Commit Graph

8102 Commits

Author SHA1 Message Date
Justin T. Gibbs
887fa2a22c Sync perforce Ids. 2002-08-31 06:53:06 +00:00
Justin T. Gibbs
1a1fbd0bda Identify new controllers and the aic7901A.
Move interrupt enable to the OSM.

Remove some debugging messages.

Remove chip bug workarounds for non-production asics.
2002-08-31 06:52:27 +00:00
Justin T. Gibbs
42eac0a945 Hook up the endian macros.
Correct some comments.
2002-08-31 06:51:51 +00:00
Justin T. Gibbs
c1463ef7c0 Enable card interrupts in our OSM rather than in the core.
This ensures that we don't enter our interrupt handler until
all OSM components it might reference have been fully initialized
during attach.

Remove vestiges of untagged queue handling.

Add hints to ahd_get_scb() so it knows what type of SCB collision
management to perform for each new transaction.

Properly disable/enable IU_REQ with changes in tagged queuing and
disconnection settings passed in by CAM.
2002-08-31 06:51:15 +00:00
Justin T. Gibbs
adcf242ea9 Correct lun representation during packetized operation.
Uninline some routines that are just too big to be inlined.

Add some helper macros for SCB ID collision management.

Use a hardware SCB rather than a full SCB for the "next
SCB to queue" sentinal.

Update for new "high SCBID bit" qoutfifo delivery scheme.

If interrupts are disabled on the card, don't bother running
our interrupt handler.  Our handler was called due to a shared
interrupt, and the card's interrupts are explicitly disabled
to prevent entry into our interrupt handler.
2002-08-31 06:50:39 +00:00
Justin T. Gibbs
8fdc126111 Add a prefix to be used for assembler generated tables and
functions for register pretty-printing.

Implement "top bit of SCBID is valid bit" qoutfifo delivery scheme.

"the the" -> "the".

Remove old and never used tag collision chain handling in the
sequencer.  Tag collisions are never allowed to get as far as
on the controller.

Simplify busy target table handling routines.

Update comments to reflect reality.

Add support for catching more protocol violations.

Correct a bug in data fifo handling in mixed packetized and
non-packetized environments.  SG_STATE must be cleared even
if an SG fetch is not in progress at the time of FIFO shutdown
or we may confuse the non-packetized transaction idle-loop.
2002-08-31 06:49:55 +00:00
Justin T. Gibbs
3ebc100928 Convert to new assembler field syntax.
Add preliminary Rev B definitions.

Add QOUTFIFO_ENTRY_VALID_TAG for new qoufifo scheme.

Reserve SCB space for large luns.
2002-08-31 06:49:11 +00:00
Justin T. Gibbs
544c53b8be Updates for new non-packetized SCB-ID collision avoidance,
busy target table addressing changes, our qoufifo scheme,
and long lun support.

Drop bus reset hold delay to 25us.

Remove chip workarounds for revisions that never went to
production.

Add aic7901A identification information.

Remove untagged queue logic.
2002-08-31 06:48:42 +00:00
Justin T. Gibbs
3f293aaf2c Identify the AIC7901A as such instead of an AIC7902.
Push protocol violation handler to its own routine.  We now
properly detect and recovery from the following target induced
protocol violations:
	o Unexpected or invalid non-packetized Relesection
	o Command complete with no status message
	o Good Status after incomplete cdb transfer

Add an SCB collision avoidance algorithm that allows us to
use all 512 SCBs for non-packetized operations.  There is
still the possibility of running out of SCBs with non-colliding
tag identifiers, but the algorithm ensures that the stall will
be rare and short lived.

Convert to a read-only algorithm for validing entries in the
qoufifo.  The sequencer now toggles the high bit of the SCB
identifier on each wrap around of the qinfifo.  If the high
bit doesn't match the expected value for this pass of the
qoufifo, the entry is not valid.  This has the benefit of
working on machines that have large granularity cache write
back semantics without requiring any additional memory.

Remove lots of code related to untagged SCB queues.  Since
these controllers can keep a fully busy target table, we
will never have untagged SCB queues.

Lots of improvements to diagnostic logging.

Clarify some comments.

Don't clear BUSFREE interrupt enable in SIMODE1 in the SELTO
handler.  Just clearing the interrupt status is sufficient and
this avoids the chance of disabling busfree detection in connection
that occurs while we are handling the busfree interrupt.

Clear all possible interrupt sources when handling a busfree
interrupt.  The hardware clears some but not all of them.

Don't panic if we get into the default SCSIINT handler.
Dump the card state and clear all interrupt sources in the
hope that we can continue.

LASTPHASE != PREVPHASE.  Use the correct PREVPHASE for testing
against values in the PERRDIAG register.

According to SPI4, the bus free that is required after certain
PPR negotiations will only occur at the end of all message phases.
Handle the bus free if it occurs after a transaction in either
the message-in or message-out phases.  The busfree can also occur
if the status of IU_REQ changes due to a WDTR or SDTR message.
We now set the expect busfree flag in ahd_set_syncrate so that
it works regardless of message type.

Correct a problem with missing certain busfree events.  The
chip supports single-stepping even if a SCSIINT is pending.
This obviates the need to clear all of the SCSI interrupt enables
prior to single stepping.  Since ENBUSFREE can only be disabled
manually and not re-enabled, avoiding touching this bit in the
single-step case yields reliable bus free detection.

Enhance ahd_clear_intstat to clear all SCSIINT sources.

Only use ahd_update_pending_scbs() if we are active on the
bus.  We cannot modify the "MK_MESSAGE" bits on SCBs in the
execution queue if a selection might be in process since
the sequencer uses this bit to detect PPR negotiation to
a target with an outstanding IU_REQ agreement.

Allocate the SCB delivery mechansim's sentinal SCB specially
so we don't waste a valid SCB for this task.

Move tranceive state settle logic to ahd_chip_init() since
this needs to occur after every chip reset, not just the
chip reset that happens during primary driver initialization.

Correct a bug with transmitting lun information in packetized
connections.

Restrict busy target table operations to the range of luns
that can be used for non-packetized connections.  Larger luns
can only be accessed in packetized mode.

Correct a busy target table addressing bug.

Be more careful about how we shutdown the DMA engines during
bus reset events.

Only freeze the SIMQ once regardless of the number of bus
reset events that occur while we are polling for the resets
to stop.

Don't rely on the sequencer remaining paused() during our
reset poll.  It is safe for the sequencer to run during this
time, and many callers to the bus reset code would need to
be modified to make this assumption universally true.

Even if we are not going to clobber SCB state when an auto-request
sense SCB has a check condition, we must still unfreeze the queue.
Re-arrange the BAD STATUS handler to handle this case appropriately.

Modify the SCB download size depending on whether long luns are
being stored in the SCB.

Add ahd_print_register() for pretty printing register diagnostics.

Don't trust that the flexport logic to detect the presence of
a seeprom is available.  It may not be on some motherboard
implementations.

"the the" -> "the"
2002-08-31 06:48:14 +00:00
Justin T. Gibbs
d10a3e08c6 If interrupts are disabled on the card, don't bother running
our interrupt handler.  Our handler was called due to a shared
interrupt, and the card's interrupts are explicitly disabled
to prevent entry into our interrupt handler.
2002-08-31 06:46:37 +00:00
Justin T. Gibbs
6c746b27b7 Update Perforce Ids. 2002-08-31 06:45:28 +00:00
Justin T. Gibbs
274c41275c Move interrupt enable into the OSM.
Set the AHC_LSCBS_ENABLED softc flag appropriately.

Convert to using softc storage for our seeprom data.

Break seeprom parsing out into a separate routine.

Change our policy in regards to AHC_SPIOCAP so that we
will allow auto-termination to take place on some aic7855
based cards.

Remove initialized but never really used variables.
2002-08-31 06:44:56 +00:00
Justin T. Gibbs
4c4797e6b4 Cleanup endian macros.
Honor the AHC_REG_PRETTY_PRINT option.

Add lock placeholders for new locks used by the core.  These
are not currently needed for FreeBSD.
2002-08-31 06:44:20 +00:00
Justin T. Gibbs
226aa6ea7a Enable card interrupts from the OSM.
Use "offset == 0" not "period == 0" to denote async trasnfers.

Implement TARG_IMMEDIATE_SCB non-disconnected target mode
SCB delivery scheme.

In our timeout handler, don't rely on the phase already being
set to denote an active connection.  IDENTIFY_SEEN is more
than sufficient.

Verify that the softc passed in ahc_detach is still known
to the driver before blindly using it.
2002-08-31 06:43:55 +00:00
Justin T. Gibbs
62cdfa05f2 Add a prefix to be used for assembler generated tables and
functions for register pretty-printing.

Only clear SELDO once we've recorded enough information for
the host to understand that the connection is valid.  The
host uses the SELDO status as a handshake to close this
race window.

Correct a bug in target mode handling of non-disconnected
transactions.  The host would indicate the correct SCB to
DMA by setting the SCB id in the currently selected hardware
SCB.  Unfortunately, we would then immediated allocate a
hardware SCB which, depending on the access patern might not
be the same hardware SCB that the host setup for us.  Avoid
this by having the host put the SCBID into scratch ram.
2002-08-31 06:43:15 +00:00
Justin T. Gibbs
264fafe657 Convert to new assembler field syntax.
Document the SXFRCTL2 register found on U2 and U160 controllers.

Overload the MWI_RESIDUAL field for use as the SCB to be downloaded
for "immediate" (or those without the disconnect privledge)
transactions.

Add scratch ram locations for the 274X that give us a bit more
information including whether to enable extended translation.
2002-08-31 06:42:38 +00:00
Justin T. Gibbs
3b06611aa7 Drop the bus reset hold delay back down to 25us. The 250us
value slipped in from a debugging session.

Add AHC_LSCBS_ENABLED and AHC_SCB_CONFIG_USED ahc_flags which
allow for some code to move to the core.

Remove extern for ahc_syncrates[].  The OSMs no longer need
direct access to this array.

Add serial eeprom field to the ahc softc.

Prototype ahc_search_untagged_queues() and ahc_print_register().

Convert to AHC_SHOW_XXX debug option format.
2002-08-31 06:42:10 +00:00
Justin T. Gibbs
31b6c79691 Add ahc_print_devinfo() to simplify some diagnostic output.
Switch to using the same AHC_SHOW_XXX format as the ahd driver.

Always give the target a MSG_INITIATOR_DET_ERR for unexpected
DT or ST phase errors.

Add AHC_SHOW_SELTO diagnostics.

Force renegotiation whenever an unexpected bus free occurs
to rule out a negotiation mismatch as the cause for the error.

Use "offset != 0" as an intenal indicator of "async" rather than
using a period of 0.

In ahc_fetch_devinfo(), correct a bug in getting "our id" as
target.  We weren't looking at all the SEQ_FLAGS that indicate
that we are still in a selected rather than reselected state.

Add support for the AHC_SHOW_MESSAGES debugging option.

If ahc_parse_msg() tells us to terminate the message loop,
do so without acking the message.  The message may be one
that the sequencer needs to handle on its own.

In ahc_parse_msg() return MSGLOOP_TERMINATED for all messages
the sequencer handles.

Allocate storage for, and track, seeprom contents in our softc.

Touch all SCB bytes to avoid parity errors should one of our
debugging routines read an otherwise uninitiatlized byte.

S/G lists must be 8 byte aligned.  Reflect this in our DMA tag.

"the the" -> "the" in a comment

When pausing the card to perform error recovery, ensure that we
are not in the process of being selected or have just been selected
but have not yet handled that selection.  This leaves only one other
race window, in the command complete handler, that needs to be fixed
to make recovery 100% bullet proof.

Convert a few straglers from bsd u_intX_t to inttypes uintX_t.

Remove unused variables.

Split out searching of the untagged holding queues to its own
routine.  In certain recovery scenarios, we want to just
remove entries in the untagged queue without touching related
transactions that are in the QINFIFO or WAITING queues that are
searched by ahc_search_qinfifo().

Add an implementation of the ahc_print_register() routine which
"pretty prints" registers.  The extra bloat in the form of string
tables for this feature is controlled by the AHC_REG_PRETTY_PRINT
option.

Fix a few bugs in ahc_enable_lun() that could prevent controllers
lacking the multiple-target-id feature from changing "our id" on
the fly.  Add a large comment to this section while I'm here
describing the restrictions on "id switching".
2002-08-31 06:41:37 +00:00
Justin T. Gibbs
b73b70cca7 Pass unparsed serial eeprom information into the driver core.
Honor the extended translation setting for EISA cards now that
I've determined where this information is kept.

Defer card interrupt enabling to the OSM since it may have
some initialization to perform that must occur before interrupts
can be enabled.
2002-08-31 06:40:32 +00:00
Justin T. Gibbs
63183d8c4e Update assembler syntax and assembler to allow generation of register
description tables used for diagnostic "pretty printing".
2002-08-31 06:39:41 +00:00
Justin T. Gibbs
621c0e6c92 Tell the user about a failed IRQ mapping rather than fail silently. 2002-08-31 03:04:08 +00:00
Justin T. Gibbs
e211c13e86 Add IDs for upcoming LSI U320 products that use the MegaRAID interface.
Adjust format of one comment so it doesn't wrap at 80 columns.
Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 18:28:00 +00:00
Maxim Sobolev
d8afaeb24b Whitespace-only: don't mix tabs and spaces for doing identation. 2002-08-30 14:21:01 +00:00
Mitsuru IWASAKI
6c40705212 s/hint.acpi.0.disable/hint.acpi.0.disabled/
Fix device hints entry for disabling acpi(4).
This also should fix the arbitration with apm(4) when both drivers
are enabled.

Note that your /boot/device.hints needs to be updated if you want to
stop auto-loading acpi.ko or disable acpi(4).
2002-08-30 11:11:07 +00:00
Scott Long
eb3025b3ed The aac driver needs 256K of contiguous physical memory in order to
attach.  If it can't get that (highly likely if loaded as a module on
a system that's been up for a while), give a more descriptive error
message.
Also clean up some nearby style nits.

MFC after:	2 days
2002-08-30 05:02:07 +00:00
Matt Jacob
d3ecac6617 Sigh. Ken Merry convinced me that my attempts to DTRT were wrong.
Replace dual copyright with a plain BSD style copyright assigned
to LSI Logic. This is still within the intents of express consent
from LSI.

MFC after:	2 days
2002-08-30 03:36:50 +00:00
Matt Jacob
eae4a35f9f Add 909A PCI id.
MFC after:	2 days
2002-08-30 02:35:31 +00:00
Matt Jacob
8d4ee0ece1 Add an additional copyright (with the express consent of LSI Logic) that
specifically allows for (via 'BSD Style' licensing) source && binary
redistribution.

Pointy hat to: Matt, for not getting this done ahead of time.

MFC after: 2 days
2002-08-30 02:34:19 +00:00
Scott Long
c02a39a15d Fix a silly off my one error that caused crashes on resume in certain
circumstances.  The problem was only reported with -stable, but it's
obviously wrong in -current also.  MFC is forthcoming.

Submitted by:	doconnor@dsoft.com.au
2002-08-29 15:06:26 +00:00
Mitsuru IWASAKI
d62ab2f4a1 Resolve conflicts arising from the ACPI CA 20020815 import. 2002-08-29 01:52:27 +00:00
Poul-Henning Kamp
de7ac779e9 Only try to flush the FIFO of 500 characters, return EIO if that fails.
This at least prevents the total hang of the machine when I open a
PCCARD sio device on -current, but it does not solve the problem.
2002-08-28 22:25:41 +00:00
Josef Karthauser
9f1c775798 Add a device description for Intel 82801CA/CAM (ICH3) USB controller
USB-C.

PR:	kern/41963
2002-08-28 20:24:49 +00:00
Mitsuru IWASAKI
f3a6cbb651 Change default value of hw.acpi.sleep_delay to 0.
This caused problems (reset or lock up) at wakeup.
2002-08-28 18:46:09 +00:00
Orion Hodson
47d5a0f3e5 Marginally simplify dsp_open error handling by adding an early test to
determine liklihood of opening device in requested directions.  Makes for
simpler error handling and change should close kern/35004.

PR: kern/35004.
2002-08-28 15:19:30 +00:00
Guido van Rooij
7251aa2022 Add a new command: show pciregs, equivalent to pciconf -l
Reviewed by:	Doug Rabson (quite some time ago)
MFC after:	1 week
2002-08-28 10:02:59 +00:00
Nate Lawson
4927b7b149 printf -> CAM_DEBUG so debugging prints are tunable.
MFC after:	1 week
2002-08-28 07:03:44 +00:00
Nate Lawson
42f821c717 Use csio pointer instead of dereferencing hcb.
MFC after:	1 week
2002-08-28 07:00:58 +00:00
Bruce Evans
7e9e7dc4ed Include <sys/lockmgr.h> for old lock interfaces instead of depending on
namespace pollution in <sys/lock.h>.
2002-08-27 11:51:55 +00:00
Mitsuru IWASAKI
cfd820d382 Fix a bug about the cooling system controlling in acpi_thermal driver.
Recent version of ACPI CA returns the package object which contains
object reference elements if the elements are named objects.
We need to be careful when you use acpi_ForeachPackageObject() in new
code...
2002-08-27 07:53:55 +00:00
Prafulla Deuskar
90fd36aac8 Back out TX/RX descriptor/buffer management changes from earier commit.
We are having panics with the driver under stress with jumbo frames.
Unfortunately we didnot catch it during our regular test cycle.
I am going to MFC the backout immediately.
2002-08-26 18:59:16 +00:00
John Baldwin
2ccfc93222 Overhaul the ACPI PCI bridge driver a bit:
- Add an ACPI PCI-PCI bridge driver (the previous driver just handled
  Host-PCI bridges) that is a PCI driver that is a subclass of the generic
  PCI-PCI bridge driver.  It overrides probe, attach, read_ivar, and
  pci_route_interrupt.
  - The probe routine only succeeds if our parent is an ACPI PCI bus which
    we test for by seeing if we can read our ACPI_HANDLE as an ivar.
  - The attach routine saves a copy of our handle and calls the new
    acpi_pcib_attach_common() function described below.
  - The read_ivar routine handles normal PCI-PCI bridge ivars and adds an
    ivar to return the ACPI_HANDLE of the bus this bridge represents.
  - The route_interrupt routine fetches the _PRT (PCI Interrupt Routing
    Table) from the bridge device's softc and passes it off to
    acpi_pcib_route_interrupt() to route the interrupt.
- Split the old ACPI Host-PCI bridge driver into two pieces.  Part of
  the attach routine and most of the route_interrupt routine remain in
  acpi_pcib.c and are shared by both ACPI PCI bridge drivers.
  - The attach routine verifies the PCI bridge is present, reads in
    the _PRT for the bridge, and attaches the child PCI bus.
  - The route_interrupt routine uses the passed in _PRT to route a PCI
    interrupt.
  The rest of the driver is the ACPI Host-PCI bridge specific bits that
  live in acpi_pcib_acpi.c.
  - We no longer duplicate pcib_maxslots but use it directly.
  - The driver now uses the pcib devclass instead of its own devclass.
    This means that PCI busses are now only children of pcib devices.
  - Allow the ACPI_HANDLE for the child PCI bus to be read as an ivar
    of the child bus.
  - Fetch the _PRT for routing PCI interrupts directly from our softc
    instead of walking the devclass to find ourself and then fetch our
    own softc.

With this change and the new ACPI PCI bus driver, ACPI can now properly
route interrupts for devices behind PCI-PCI bridges.  That is, the
Itanium2 with like 10 PCI busses can now boot ok and route all the PCI
interrupts.  Hopefully this will also fix problems people are having with
CardBus bridges behind PCI-PCI bridges not properly routing interrupts
when ACPI is used.

Tested on:	i386, ia64
2002-08-26 18:30:27 +00:00
John Baldwin
28bf1fad05 Add an ACPI PCI bus driver that is a subclass of the generic PCI bus
driver.  This driver overrides the probe, attach, and read_ivar methods.

If the parent bridge is an ACPI PCI bridge, then the probe routine will
match, otherwise it will fail.  It tests this by seeing if it can get
the ACPI_HANDLE ivar from the bridge device.

In the attach routine, it uses pci_add_children() to add all the child
devices (but with a slightly larger ivar so it can store ACPI_HANDLE's
for child devices) and then walks through the ACPI namespace below the
bus device to cache ACPI_HANDLE's for all child devices present in the
namespace.  It does this by comparing the pci slot and function to the
address encoded in _ADR of the devices in the ACPI namespace.

The read_ivar routine passes most requests off to pci_read_ivar()
and adds a new request so that the ACPI_HANDLE for a child device can
be read.

To add proper power support the power methods can be overridden as well,
but that is not currently implemented.  Also, there are cases where a
device may show in the ACPI namespace as a PCI device that the PCI probe
does not find.  Currently such devices are ignored.

Tested on:	i386, ia64
2002-08-26 17:55:42 +00:00
John Baldwin
6f0d58848f Export a few symbols as globals to allow subclassing of this driver. In
OOP speak, you would mark these as 'protected' members.  Specifically:
- Make the pcib_softc struct public so it can be used by subclasses.
- Make pcib_{read,write}_ivar(), pcib_alloc_resource(), pcib_maxslots(),
  and pcib_{read,write}_config() globals that can be used by subclasses.
- Make the pcib devclass a global variable.
- Move most of the pcib_attach() function into a global
  pcib_attach_common() function that can be called by the attach routines
  of subclasses.

Tested on:	i386, alpha, sparc64, ia64
2002-08-26 15:57:08 +00:00
John Baldwin
42dbeaee02 Various changes to make it easier to subclass the PCI bus device.
- Make the pci devclass a global variable.
- Add child devices in pci_attach() instead of pci_probe().  Change
  pci_probe() to just check for a valid bus number from the associated
  bridge and return -1000 if successful.  This allows subclasses of the
  PCI bus driver to override the generic driver.
- Move the code to load the vendor data into its own public function.
  Really though, doing this at attach is just plain wrong.  This should
  really be done in the module load routine instead.  As a side effect,
  the 'busno' variable in pci_attach() is now no longer static (minor
  bug that was harmless so far.)
- Change pci_add_children() to take an extra argument that is the size of
  the device info structure passed to pci_read_device() and make it public
  so subclasses of the PCI bus can call it in their attach routines.
- Move the bits to attach a probed PCI child to a PCI bus into a global
  pci_add_child() function.  This will allow subclasses that can detect
  a PCI device not found in the normal PCI probe to add those devices in
  their own attach routine.  (I have seen this in the ACPI tree on my
  laptop for example.)  As a side effect, change the static function
  pci_add_resources() to get the busno, slot, and func from the passed
  in dinfo structure instead of requiring them as function arguments.

Tested on:	i386, alpha, ia64, sparc64
2002-08-26 15:23:52 +00:00
John Baldwin
473f1ca90d In acpi_pcib_route_interrupt(), the code claims to check to see if a PCI
LNK device (interrupt source provider sort of) is present before using it,
but the code actually tested the status (_STA) of the PCI bridge device
doing the routing, not the actual LNK device.  Fix it to check the status
of the LNK device.
2002-08-26 15:12:47 +00:00
Philippe Charnier
93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
Mitsuru IWASAKI
ff01efb50d Add new sysctl MIB (hw.acpi.sleep_delay) to specify the delay (in
seconds) before ACPI sleep.  Some machines might need this to sleep
by Hot-key.
2002-08-25 06:13:53 +00:00
Orion Hodson
933ce6fa4b Add suspend and resume support.
Contributed by:	Takanori Watanabe <takawata@FreeBSD.org>
PR:		kern/41809
2002-08-25 02:00:49 +00:00
Bruce Evans
760e2cb04a Fixed editing errors in rev.1.4 which manifested as printf format errors
at compile time and probably as panics at runtime.
2002-08-25 01:32:22 +00:00
Alan Cox
fff6062ab6 o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since
pmap_zero_page() and pmap_zero_page_area() were modified to accept
   a struct vm_page * instead of a physical address, vm_page_zero_fill()
   and vm_page_zero_fill_area() have served no purpose.
2002-08-25 00:22:31 +00:00
Nick Sayer
47172de8a2 Be sure to unregister from sndstat on unregister. Gets rid of phantom
sndstat output after removing uaudio.
2002-08-24 19:13:11 +00:00
Marc Fonvieille
1739cac24b Fix typos: s/O2Mirco/O2Micro/
Approved by:	imp
2002-08-24 07:46:08 +00:00
Alfred Perlstein
8e708563c7 style: put return types on a line by themselves. 2002-08-24 00:02:03 +00:00
Alfred Perlstein
e3d2833a26 style:
put return values on a line by themselves.
 fix some paste issues where whitespace was used instead of tabs.
2002-08-23 23:49:02 +00:00
Orion Hodson
4408eb15b0 Make sure channel buffer start is associated with channel, otherwise
getptr is broken.  Noise reported by Thomas Draney <tmdraney@yahoo.com> who
also tested the patch.
2002-08-23 20:54:32 +00:00
Matt Jacob
90f62fd23f Do some minor cleanups found during backport to RELENG_4. 2002-08-23 06:56:31 +00:00
Matt Jacob
019717e053 Pick a cleaner method (and put in a separate function) for finding
the peer device on a dual board.
2002-08-23 06:56:08 +00:00
Orion Hodson
108082c42e s/AC97_MIX_PHONES/AC97_MIX_AUXOUT/ to match ac97r2.{2,3}.
Attempt to determine what function of AUX_OUT is: "True line level
out", "Headphone out", or "4-Channel out" and frig OSS mixer label
accordingly.

Addresses problem raised by Randy Bush on -multimedia of not being
able to hear audio on ich2 m/b which was eventually found to be
because the mixer monitor value was 0.  On this h/w the label
"monitor" should now be presented as the marginally more intuitive
"ogain".
2002-08-23 06:19:28 +00:00
Archie Cobbs
4a6a94d8d8 Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
Peter Wemm
b87a69181e Use machine/limits.h rather than userland limits.h (which may come from
the userland source tree, or even worse: /usr/include)
2002-08-22 20:44:17 +00:00
Matt Jacob
a11af9c915 Define ISP_DMA_ADDR_T to be a bus_addr_t, not a u_int32_t.
This is in preparation to completing A64 PCI support.
2002-08-22 16:14:19 +00:00
Matt Jacob
fecafa5c9f unused variable removal (pointed out by bde) 2002-08-22 16:13:31 +00:00
John Hay
799e9b2414 Add an entry for Avlab's low profile 4 serial port card.
PR:		41146
Submitted by:	Shinsuke Matsui <smatsui@internet-inc.co.jp>
Obtained from:	NetBSD
2002-08-22 10:40:00 +00:00
John Hay
76353f6823 Add an entry for VScom PCI-200L 2 port serial card.
PR:		41142
Submitted by:	Shinsuke Matsui <smatsui@internet-inc.co.jp>
Obtained from:	OpenBSD
2002-08-22 10:37:55 +00:00
Prafulla Deuskar
a237f70d50 TX/RX descriptor/buffer management changes.
Use array based scheme instead of queueing macros.

Submitted by:	Luigi Rizzo (rizzo@icir.org)
MFC after:	3 days
2002-08-21 23:44:15 +00:00
Archie Cobbs
55f7c614fd Don't use "NULL" when "0" is really meant. 2002-08-21 23:39:52 +00:00
John Baldwin
11dfccde73 Use the _STA method of a battery control method to see if a battery is
present or not.  My laptop now properly notices when a battery is removed.

Reviewed by:	iwasaki
2002-08-21 15:01:53 +00:00
Warner Losh
34c947d8b6 When setting the WI_RID_ENCRYPTION mode, we have to conditionally
set EXCLUDE_UNENCRYPTED if we're not in OPEN mode (or if we are a
symbol card).

Obtained from: OpenBSD (looks like a millert@ special)
2002-08-21 05:57:37 +00:00
Warner Losh
87c397af5c comment about the magic number -149 2002-08-21 05:35:51 +00:00
Warner Losh
abc38e4485 Treat IBSS the same as ADHOC in wi_get_cur_ssid. This makes ifconfig
work better, but might not make ibss actually work on the prism2 cards
that I have (this is the first time I've tried ibss in a long time).
2002-08-21 05:31:04 +00:00
Matt Jacob
7104aeef01 A chunk of cleanup, both stylistic and substantive.
We now also read configuration information for the SCSI cards- this allows
us to try and say what the speed settings now are.

Start, but not yet complete, the process of reorgs && #defines so that we
can backport to RELENG_4 pretty soon.
2002-08-20 23:04:08 +00:00
Maxime Henrion
6527574b75 - Use the __BUS_ACCESSOR macro for EISA_ACCESSOR instead
of reimplementing it.
- #undef EISA_ACCESSOR after use like we do for other accessors.

Reviewed by:	tmm
2002-08-20 12:32:06 +00:00
Orion Hodson
2296709020 Back out last commit. Needs slightly more subtle handling. 2002-08-20 08:02:56 +00:00
Peter Wemm
2943ed8c5d de-count atkbdc. I have more extensive patches to make properly dynamic,
but since pc hardware only allows one AT-style keyboard controller, this
doesn't seem particularly urgent.  (I do not know what the old sunriver
remote keyboard/mouse/vga cards do, that might be an exception).
2002-08-19 23:58:37 +00:00
Peter Wemm
f457830b8e de-count schistory.c. The handling of NSC was rather bogus here and was
little more than a place holder, because nothing actually counted the
number of 'sc' units to compare it against NSC.  A bit more work here
is needed so that the scaling of SC_MAX_HISTORY_SIZE and extra_history_size
goes up when more sc units are added.  But, it does not appear that we can
have more than one console yet, so it does not seem particularly urgent.
2002-08-19 23:56:01 +00:00
Maxime Henrion
258682384f style(9) nit. 2002-08-19 22:51:23 +00:00
Maxime Henrion
e9cf2ddb50 Use the __BUS_ACCESSOR macro for PCIB_ACCESSOR instead of
reimplementing it.

Reviewed by:	tmm
2002-08-19 22:50:08 +00:00
Semen Ustimenko
c5844e091c Stop trying to align malloc()ed memory. Rely on malloc() instead, just like
others.
2002-08-19 20:36:08 +00:00
Semen Ustimenko
714087a2ac Do not reset card in epic_freebsd_attach() as reset is done in
epic_common_attach().
2002-08-19 20:24:13 +00:00
Søren Schmidt
8ba0fd9c32 Fix buffer length.
PR: 41063
2002-08-19 18:52:23 +00:00
Søren Schmidt
f6137a0df1 Fix typo. 2002-08-19 18:47:51 +00:00
Maxim Sobolev
41a2a5c1c6 1. Allow information about current history size be retrieved using ioctl(2);
2. modify screen dumpung routine, so that in addition to visible area, it
   allows to grab any portion of history buffer as well.
2002-08-19 16:32:09 +00:00
Orion Hodson
14213e7d3e Cater for ich4 quirks.
Reported by: Jacob Rhoden
Tested by: Jacob Rhoden, mp
2002-08-19 16:03:56 +00:00
Orion Hodson
42e67fd3e7 Apply reference counting patch. Fixes problem of two applications
opening the device, eg one read only and one write only, and the
reference count being non-zero when both exit rendering device
permanently busy.

PR:		kern/35004
Submitted by:	Bill Wells
MFC after:	3 days
2002-08-18 14:17:06 +00:00
Søren Schmidt
1652b7bde4 Fix args for contigmalloc, cosmetics. 2002-08-18 12:20:33 +00:00
Josef Karthauser
24177c6cb0 Use uhci_pci_match to return the device description and rework the
vendor description code.
2002-08-18 11:52:47 +00:00
Josef Karthauser
f992fafdd7 Add a comment to remind that uhci_pci_match will never return NULL.
Don't display the "New UHCI DeviceId" message unless booting verbosely.
Use a switch statement for the vendor match code.
2002-08-18 11:42:11 +00:00
Maxim Sobolev
62f7648682 Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid
breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in
SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.

Reviewed by:	-hackers, -net
2002-08-18 07:05:00 +00:00
Orion Hodson
b383a8478c Fix VRA configuration.
Reported and fixed by: Grzybowski Rafal <grzybek@inferno.mikrus.pw.edu.pl>
2002-08-18 00:29:08 +00:00
Josef Karthauser
8f5fc1b728 Consolidate the device recognition code. 2002-08-18 00:24:03 +00:00
Matt Jacob
fecfd395b0 If we're using ancient (pre 1.17.0) 2100 f/w (for the cards that cannot
load f/w images > 0x7fff words), set ISP_FW_ATTR_SCCLUN. We explicitly
don't believe we can find attributes if f/w is < 1.17.0, so we have to
set SCCLUN for the 1.15.37 f/w we're using manually- otherwise every
target will replicate itself across all 16 supported luns for non-SCCLUN
f/w.

Correctly set things up for 23XX and either fast posting or ZIO. The
23XX, it turns out, does not support RIO. If you put a non-zero value
in xfwoptions, this will disable fast posting. If you put ICBXOPT_ZIO
in xfwoptions, then the 23XX will do interrupt delays but post to the
response queue- apparently QLogic *now* believes that reading multiple
handles from registers is less of a win than writing (and delaying)
multiple 64 byte responses to the response queue.

At the end of taking a a good f/w crash dump, send the ISPASYNC_FW_DUMPED
event to the outer layers (who can then do things like wake a user
daemon to *fetch* the crash image, etc.).
2002-08-17 17:29:15 +00:00
Matt Jacob
8a5f89b96d We only do isp_reinit from isp_async if ISP_FW_CRASH_DUMP is defined-
otherwise the core code does this.
2002-08-17 17:23:15 +00:00
Matt Jacob
fc3bbaaa8b Fix the incorrect parsing of the Risc2Host isr. For RIO_16,
fast posting command completion, and fast post CTIO completion,
the upper half of Risc2Host is a copy of mailbox #1- *not*
mailbox #0.

MFC after:	1 day
2002-08-17 17:21:54 +00:00
Matt Jacob
bd3f1cd53b Add ICBXOPT_ZIO definition. 2002-08-17 17:19:29 +00:00
Matt Jacob
e347e2c9b4 Add ISPASYNC_FW_DUMPED async event.
add ISP_FW_NEWER_THAN macro- makes the code easier to read.
2002-08-17 17:19:09 +00:00
Orion Hodson
ae83180158 Support for VIA VT8233 audio controller. 2002-08-17 16:23:44 +00:00
Orion Hodson
67a97e1522 Remove support for the vt8233. Specs for chipset changed mid-revision
so this code was not working for the newer VIA chipsets.
2002-08-17 16:13:29 +00:00
Robert Watson
d49fa1ca6e In continuation of early fileop credential changes, modify fo_ioctl() to
accept an 'active_cred' argument reflecting the credential of the thread
initiating the ioctl operation.

- Change fo_ioctl() to accept active_cred; change consumers of the
  fo_ioctl() interface to generally pass active_cred from td->td_ucred.
- In fifofs, initialize filetmp.f_cred to ap->a_cred so that the
  invocations of soo_ioctl() are provided access to the calling f_cred.
  Pass ap->a_td->td_ucred as the active_cred, but note that this is
  required because we don't yet distinguish file_cred and active_cred
  in invoking VOP's.
- Update kqueue_ioctl() for its new argument.
- Update pipe_ioctl() for its new argument, pass active_cred rather
  than td_ucred to MAC for authorization.
- Update soo_ioctl() for its new argument.
- Update vn_ioctl() for its new argument, use active_cred rather than
  td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-17 02:36:16 +00:00
Doug Ambrisko
74495bcdab Revert change to detect multiply PHYs in mii code. There might be cases
when this is needed.  Work around bogus second PHY in the DFE-580 card
via a change in the if_ste.c driver.

Suggested by:	jdp
Reviewed by:	jdp
MFC after:	3 days
2002-08-16 23:19:16 +00:00
Josef Karthauser
1e03ff6cf0 MFNetBSD: 1.51
Move a quirk tests so the message printed about directionality is
right.
2002-08-16 12:16:07 +00:00
Josef Karthauser
a6103a945a MFNetBSD: (1.50) Get rid of trailing white space. 2002-08-16 12:13:26 +00:00
Josef Karthauser
3a89188b79 MFNetBSD:
revision 1.127
	date: 2002/08/07 20:03:19;  author: augustss;  lines: +4 -8
	Fix some braindead calls to free memory (only encountered
	under low memory conditions).  From OpenBSD.
2002-08-16 09:10:43 +00:00
Josef Karthauser
c5849647cc UHCI_DEBUG -> USB_DEBUG. 2002-08-15 22:41:20 +00:00
Warner Losh
6c596e8d0b pccbb -> cbb 2002-08-15 08:02:23 +00:00
Warner Losh
b35cf6719f Rename the pccbb device to cbb. 2002-08-15 08:01:24 +00:00
Warner Losh
6f6efa5165 Move the symbol firmware loading routines into if_wi.
Define some basic firmware downloading commands.
2002-08-15 07:13:17 +00:00
Mike Silbersack
f3b2d59e18 Improve handling of TX errors. Early reports indicate that this
elimiates the driver lockup problem reported by many.

Concepts used were taken from Via's if_fet driver.  Verification
and implementation were done by Thomas Nystrom.

Submitted by:	Thomas Nystrom <thn@saeab.se>
MFC after:	3 days
2002-08-15 04:04:53 +00:00
Joerg Wunsch
d718f8d486 Implement the DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls, and rename
the DIOCGDINFO ioctl into DIOCGDVIRGIN.  This allows the newfs(8) to
work on vinum volumes without the now removed -v option.

Approved by:	grog
2002-08-14 09:28:19 +00:00
Warner Losh
2ab060eebb don't include redunant \n in panic message 2002-08-12 22:36:18 +00:00
Warner Losh
db64ac4457 Don't redundantly include \n in panic messages 2002-08-12 22:34:12 +00:00
Søren Schmidt
242d59f390 Shut up warning in debug code. 2002-08-12 20:08:00 +00:00
Mark Peek
99c027ed09 Add PCI ID for ICH4 SMBus controller. 2002-08-12 16:22:12 +00:00
Mark Peek
eabc182e02 Add PCI ID for the ICH4 AC97 controller. 2002-08-12 15:45:12 +00:00
Matt Jacob
9b63136347 Add support for the LSI-Logic Fusion/MP architecture.
This is an architecture that present a thing message passing interface
to the OS. You can query as to how many ports and what kind are attached
and enable them and so on.

A less grand view is that this is just another way to package SCSI (SPI or
FC) and FC-IP into a one-driver interface set.

This driver support the following hardware:

LSI FC909:	Single channel, 1Gbps, Fibre Channel (FC-SCSI only)
LSI FC929:	Dual Channel, 1-2Gbps, Fibre Channel (FC-SCSI only)
LSI 53c1020:	Single Channel, Ultra4 (320M) (Untested)
LSI 53c1030:	Dual Channel, Ultra4 (320M)

Currently it's in fair shape, but expect a lot of changes over the
next few weeks as it stabilizes.

Credits:

The driver is mostly from some folks from Jeff Roberson's company- I've
been slowly migrating it to broader support that I it came to me as.

The hardware used in developing support came from:

	FC909: LSI-Logic, Advansys (now Connetix)
	FC929: LSI-Logic
	53c1030: Antares Microsystems (they make a very fine board!)

MFC after:	3 weeks
2002-08-11 23:34:20 +00:00
Josef Karthauser
31f48889ad Add the uftdi ucom driver which supports the following adapters:
Inland UAS111
	QVS USC-1000
	HP USB-Serial adapter shipped with some HP laptops

Submitted by:	takawata
MFC After:	7 days
2002-08-11 23:32:33 +00:00
Josef Karthauser
0d7655be61 Regen 2002-08-11 21:19:18 +00:00
Josef Karthauser
4910ddcf3f Add Palm M515.
Submitted by:	Luiz Eduardo Roncato Cordeiro <cordeiro@nic.br>
2002-08-11 21:11:14 +00:00
Warner Losh
6854d13abc Follow NetBSD's lead and use WI_PORTTYPE_HOSTAP instead of _AP, since
_AP might be used in the future for cards with firmware that does AP in
firmware.
2002-08-11 08:51:08 +00:00
Scott Long
2f4bfb29bb Fix GET_TRAN_SETTINGS to be more correct.
Don't allow SCSI resets on the 5400S card, it seems to cause problems with
certain backplanes.

Submitted by:	lnb@freebsdsystems.com
MFC after:	3 days
2002-08-10 19:55:00 +00:00
Scott Long
5fd988a2d7 Fix the GET_TRAN_SETTINGS and SET_TRAN_SETTINGS ops to be more correct. 2002-08-10 19:48:27 +00:00
Alan Cox
fab965bf7e o Use the VM_ALLOC_WIRED flag instead of calling vm_page_wire(). 2002-08-10 18:42:13 +00:00
Søren Schmidt
9da322c8aa Minor corrections.
Suggested by: scottl <Scott Long>
2002-08-10 11:56:03 +00:00
Warner Losh
673cffefc7 When we allocate our bus address via the kludge that we have in the
code to do it when the bios doesn't do it for us, flag it.  Then, when
we dealloc, do an equal kludge to get rid of the address.  This should
address the can't get IRQ and panic bug in a more graceful way.

# really should write a dealloc routine and just call it instead, since
# this might not fix things in the kldunload case.
2002-08-10 06:37:32 +00:00
Warner Losh
44d0da39f0 confirmed OZ6912 and 6972 share same pci ID 2002-08-10 06:35:03 +00:00
Søren Schmidt
fd4b4ecc73 Add the ability to use ATAPI devices via CAM.
The CAM<>ATAPI layer was submitted by "Thomas Quinot <thomas@cuivre.fr.eu.org>"
changes form the version on the net by me (formatting, ability to be used
alone without the ATAPI native device driver, proper speed reporting...)

See /sys/conf/NOTES for usage.

Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-08-09 20:54:06 +00:00
Mitsuru IWASAKI
27c7af4d02 Fix wrong member variable ordering of struct acpi_bif. 2002-08-09 07:08:53 +00:00
Luigi Rizzo
fd9430fea6 use the new interface to ether_input(), with eh = NULL and
the MAC header in the mbuf.

MFC after: 3 days
2002-08-09 01:48:28 +00:00
Doug Ambrisko
1f5488043d Add support for SX cards using TBI such as Netgear GA621.
Sponsored by:	Vernier Networks.
MFC after:	1 week
2002-08-08 18:33:28 +00:00
Warner Losh
fd78f7e0f3 Don't bogusly depend on pcic. pccard should be enough.
Noticed by: jhay
Forgotten  about for two years by: imp
2002-08-08 15:52:55 +00:00
Josef Karthauser
3b7efc56d0 Use the hw.usb sysctl tree instead of debug.usb.
Requested by:	imp
2002-08-08 12:05:51 +00:00
Søren Schmidt
b2e73852e5 Add DVD+RW support to the ATA driver and burncd. This also closes
PR40430 by "Peter Haight <peterh@sapros.com>" that has semilar patches
included and which I merged with my own work.

HW sponsored by: FreeBSD Foundation & FreeBSD Mall Inc

Enjoy!
2002-08-08 07:59:24 +00:00
Doug Ambrisko
130be1f120 Only attach one PHY device to a controller. NetBSD has similar code.
The D-Link DFE-580 card will otherwise show 2 miibuses for each controller
and therefore 2 ukphy's.

Sponsored by:	Vernier Networks
MFC after:	1 week
2002-08-07 22:18:33 +00:00
Max Khon
ae9e184e5e printf() formats fixes 2002-08-06 17:00:02 +00:00
Max Khon
0d13f401f4 Make driver portable:
- bus_space'ify
- generate fake ethernet address using read_random() instead of reading
from timer i/o ports

Other minor fixes:
- remove "hack" in connect_to_master()
- use M_ZERO
- remove unused variable in sbni_ioctl()
- properly release irq in sbni_attach_isa() on attach errors
2002-08-05 18:14:16 +00:00
Max Khon
2fb48d6c87 back out one change that crept in (will be committed later) 2002-08-05 17:32:16 +00:00
Max Khon
cc99b6cf41 style fixes 2002-08-05 17:20:17 +00:00
Mike Silbersack
aff8da7074 Make sure to set the DMA transfer length register, plus one
small style fix.

Submitted by:	Thomas Nystrom <thn@saeab.se>
2002-08-05 13:24:06 +00:00
Warner Losh
6edfb9d7cb Fix minor typo in ID number in last commit 2002-08-05 07:48:31 +00:00
Warner Losh
cb642e2945 A definition of regulatory domains that matches the docs. 2002-08-05 07:45:57 +00:00
Warner Losh
b04a43c87c Differentiate between AT45DB011 compatible large serial flash parts
and the AT24C08 small serial flash parts.  We still report these as
the same part (since we group things already), but now we recognize
the small serial versions as well.
2002-08-05 07:24:02 +00:00
Warner Losh
ae06c30e2b Add a comment that says it looks like lucent cards have a primary
firmware revision as well (not sure which firmware versions are needed
for this, but the 6.x and 8.x 'software' versions that I have seem to
support it).

Add dBm comm quality RID.  This is like the normal comm quality rid,
except the signal and noise numbers are normalized to dBm.  Some
revisions of the prism firmware, however, don't support this RID, and
some that do support it return 0 for quality and/or noise.  Your
milage may vary.
2002-08-05 07:19:27 +00:00
Luigi Rizzo
9e2518582d Use m_getcl() to allocate buffers for the receive ring.
MFC after: 3 days
2002-08-05 00:21:24 +00:00
Luigi Rizzo
2b5989e943 Fix handling of Receiver Not Ready errors when doing polling.
Also take this chance to cleanup the code in fxp_intr_body.

Add a missing block of code to disable interrupts when
reinitializing the interface while doing polling (the RELENG_4
version was correct).

MFC after: 3 days
2002-08-04 22:33:28 +00:00
Jake Burkholder
d5e6ffe8d2 Ported to FreeBSD. 2002-08-04 18:41:27 +00:00
Jake Burkholder
47029a19ea Add Jason L. Wright's driver for the SAB82532 serial chip, found in many
sun ultras.

Obtained from:	OpenBSD
2002-08-04 18:36:36 +00:00
Jake Burkholder
ab9d7ec432 Remove this abortive attempt. 2002-08-04 18:24:09 +00:00
Warner Losh
073eef8ca2 Add code that will download firmware to a Symbol LA4100-series of CF
cards.  Since the firmware is hard coded into the kernel, I've made it
a kernel option (WI_SYMBOL_FIRMWARE).

Note: This only downloads into the RAM of these cards.  It doesn't
download into FLASH, and is somewhat limited.  There needs to be a
better way to deal, but this works for now.  My Symbol LA4132 CF card
works now.

Obtained from: NetBSD
2002-08-03 00:19:58 +00:00
Warner Losh
b8182b24d7 While PCI interrupts are shareable, this should not have been committed just
yet.
2002-08-02 22:26:03 +00:00
Mark Murray
052c7c89c2 Modernise the cdevsw WRT to (unused) kqueue. 2002-08-02 11:24:43 +00:00
Warner Losh
3d976872ed Don't set the IFF_PROMISC bit when in hostap mode like the previous
commit bogusly did.  Instead, don't set PROMSIC in the hardware if
we're in hostap mode.  This matches more closely what openbsd did as
well.
2002-08-01 07:37:52 +00:00
Scott Long
0d74300cae Allow the ahc and ahd drivers to be built as modules. This also
breaks the ahc driver into a core back-end and pci and eisa
front-ends.
2002-08-01 01:36:39 +00:00
Mike Silbersack
16afddabdc Make sure to set both sets of registers which control the RX and TX buffer
sizes.  Previously, the end result was at the mercy of the card's default
setting.  This change will reduce the number of buffer underruns for
some users.

PR:		kern/37929
Submitted by:	Thomas Nystrom <thn@saeab.se>
MFC after:	7 days
2002-07-31 19:58:36 +00:00
Søren Schmidt
c4d86885af Byteswap the serial # 2002-07-31 18:29:34 +00:00
Søren Schmidt
27da7e6f24 Finally first shot at a driver for the Promise SuperTrak SX6000 ATA RAID
controller. Some testing has already been done, but its still greenish.
RAID's has to be setup via the BIOS on the SuperTrak, but all RAID
types are supported by the driver. The SuperTrak rebuilds failed arrays
on the fly and supports spare disks etc etc...

Add "device	pst" to your config file to use.

As usual bugsreports, suggestions etc are welcome...

Development sponsored by:	Advanis
Hardware donated by:		Promise Inc.
2002-07-31 18:26:30 +00:00
Josef Karthauser
528d1a7fbc Replace the FOO_DEBUG definitions with USB_DEBUG, and switch the
debugging levels to off by default.  Now that debug levels can be
tweaked by sysctl we don't need to go through hoops to get the
different usb parts to produce debug data.
2002-07-31 14:34:36 +00:00
Josef Karthauser
6ada40b009 Make this compile with the debugging options switched on. 2002-07-31 14:27:40 +00:00
Josef Karthauser
163ddd953b Wake up Joe! It would help if I included sys/sysctl.h. 2002-07-31 14:20:07 +00:00
Josef Karthauser
140d7e756f Add a sysctl (debug.usb.uhub) for tweaking the uhub debug levels. 2002-07-31 13:58:15 +00:00
Josef Karthauser
0e6b196686 Get bored with hard coded debug level variables and introduce a debug.usb
sysctl tree for tweaking them real-time.

Reviewed by:	iedowse
2002-07-31 13:33:55 +00:00
Josef Karthauser
5e33115f05 It should be "ucom", not "usio". 2002-07-31 10:52:46 +00:00
Josef Karthauser
39db6f7ae0 Regen 2002-07-31 10:05:58 +00:00
Josef Karthauser
0919ca4bc4 MFNetBSD: uvisor.c (1.14, 1.15)
Add support for Palm (M500, M505, M125) and Sony devices (Clie 4.0 and 4.1).
2002-07-31 10:05:26 +00:00
Josef Karthauser
34b549fdf3 Remove trailing white spaces
Obtained from: NetBSD (1.16)
2002-07-31 09:24:41 +00:00
Josef Karthauser
f8d314e7c6 Regen 2002-07-31 09:09:50 +00:00
Josef Karthauser
1dc3ed04a2 Add the HP ScanJet 2200C. 2002-07-31 09:07:56 +00:00
Josef Karthauser
7ab45e978a Enable the HP 2200C and Visioneer Scanport 3000 scanners, and remove
some trailing spaces whilst I'm here.

Obtained from:	NetBSD.
2002-07-31 09:05:52 +00:00
Josef Karthauser
b2dd67bba5 Add the Primax (Visioneer) 6200 scanner.
Obtained from:	OpenBSD (via NetBSD)
2002-07-31 08:51:32 +00:00
Josef Karthauser
7ebe6f9e2f Regen 2002-07-30 23:30:56 +00:00
Josef Karthauser
3fc6710b56 Add support for a couple of network adapters; the 3Com 3C460B and
the Belkin USB2LAN.

Obtained from:	NetBSD
2002-07-30 23:30:15 +00:00
Ian Dowse
b4dc6ff9bc Remove some strange code that allocates memory and then immediately
frees it again. The idea was to perform M_WAITOK allocations in a
process context to reduce the risk of later interrupt-context
M_NOWAIT allocations failing, but in fact this code can be called
from contexts where it is not desirable to sleep (e.g. if_start
routines), so it causes lots of witness "could sleep" warnings.
2002-07-30 23:26:22 +00:00
Bill Fenner
e34c1b84b7 Call bpf_mtap() on output, to catch outgoing packets for e.g. tcpdump . 2002-07-30 21:47:14 +00:00
Mitsuru IWASAKI
b69ed3f4c6 Resolve conflicts arising from the ACPI CA 20020725 import. 2002-07-30 19:35:32 +00:00
Josef Karthauser
ca095220db Commit a version of the uvisor driver for connecting Handspring
Visors via USB.

Submitted by:	Chia-liang Kao <clkao@clkao.org>
2002-07-30 17:44:28 +00:00
Maxim Sobolev
47c7de587b Add support for controlling line1 mixer device, which on some cards represents
onboard FM tuner.

MFC after:	2 weeks
2002-07-30 16:24:00 +00:00
Maxim Sobolev
3c7d68acc8 Regen after usbdevs rev.1.95. 2002-07-30 11:03:50 +00:00
Maxim Sobolev
b8d95a688e Add ID for Luwen EasyDisk USB flash memory drive.
PR:		41081
Submitted by:	demon
MFC after:	5 days
2002-07-30 11:02:35 +00:00
Maxim Sobolev
b047aa218b Add a quick check that device actually has sound capabilities. The problem
is that some cards built around fm801 chip have the same device ID, only
have radio tuner onboard, but no sound capabilities. Therefore, with such
card inserted and `device pcm' in kernel the user has a big problem, as
the fm801 driver effectively hangs the machine when trying to initialise
nonexistent ac97 codecs (it does 500 retries with 1 second interval!).
It would be better if MediaForte's engeneers were smart enough to put
different device ID into such cards, but it isn't an option.

MFC after:	2 weeks
2002-07-30 10:54:19 +00:00
Warner Losh
08c0f3d917 If we are in hostap mode, do not go into promisc mode. This causes
problems with the firmware and will result in a) poor performance and
b) the inability to associate certain types of cards (most notibly
cisco).

Idea obtained from OpenBSD, but I implemented it by clearing the
IFF_PROMISC flag rather than the refusing to honor it downstream.
2002-07-29 15:36:22 +00:00
Mike Silbersack
e2102ae475 Revert rev 1.131.
1.131 is slightly broken, and I would commit the fix to that here, but it
has been reported that any deviation from the original code is causing
problems with some 82557 chips, causing them to lock hard.

Until those issues have been figured out, going back to the original
code is the best plan.

Frustrated:	Silby
2002-07-29 04:32:35 +00:00
Luigi Rizzo
e823d3404b whitespace commit: fix indentation in fxp_intr_body.
This is also done in preparation of a subsequent fix
for the handling of RNR conditions in polling mode.
2002-07-29 02:48:09 +00:00
Søren Schmidt
b3d86d9ca2 OK, dont rely on the upper layers handling iosize_max correctly,
instead rely on ATAPI devices ability to do the work instead.

MFC material.
2002-07-28 23:59:00 +00:00
Bill Fenner
11ae409d07 Fix location and name of if_an_pci.c in comment. 2002-07-27 21:28:40 +00:00
Søren Schmidt
23a5f1b91a Properly change the block_size on different CD media, and use that
to calculate the max amount of data in one IO request.

Correct the max size on atapi floppies/tapes as well.
2002-07-27 12:22:39 +00:00
Peter Wemm
4c4a48ec03 Do not try and probe random PNP devices, This Is Bad.
Display reasons why probe/attach fails.
2002-07-27 08:46:28 +00:00
Peter Wemm
4682cd8f5e Make si_debug tunable. 2002-07-27 08:17:29 +00:00
Warner Losh
ffd283ae15 Send a disassoc packet for a STA that we don't know about that claims to
be associated with us.  From millert@openbsd.org

Obtained from: OpenBSD (I think)
2002-07-26 22:56:04 +00:00
Warner Losh
bec60c0fd8 Only INTERSIL 0.8.3 and newer firmware is supported with hostap mode.
While earlier versions can be made to work, they require various work
arounds not in the driver right now.
2002-07-26 22:54:30 +00:00
Warner Losh
3722c8ed3d No doubt about it, I gotta get a better hat:
Add the definition for sockbase that I accidentally removed two
revisions ago and didn't notice until some kind soul pointed it out to
me.
2002-07-26 20:28:58 +00:00
Søren Schmidt
aafa7ea069 Fix the max transfer size for ATAPI devices. The spec says to
transfer at most 65534 bytes, thats 126 times DEV_BSIZE not 252 :(

Pointed out by: Ian Dowse <iedowse@maths.tcd.ie>
2002-07-26 19:13:05 +00:00
Warner Losh
8948a4fd3d Looks like a last second change wasn't completely backed out. 2002-07-26 17:50:01 +00:00
Takanori Watanabe
7850154fdd Add ALLIED TELESIS,K.K. LA-ISA V2 ISA PnP ID.
Submitted by:	nork
MFC after: 3 days
2002-07-26 17:33:58 +00:00
Warner Losh
e4188e915d MFp4:
o Rename the insanely long PCIC bridge ids.
	o Add my copyright to pccbb.c
	o Add support for the TI-1510, TI-1520 and TI-4510 series of upcoming
	  bridges.
	o Init MFUNC if it is zero and the TI part has a MFUNC register
	  at offset 0x8c (1030, 1130 and 1131 don't have anything there, the
	  1250,1251,1251B and 1450 have a different thing there.  The rest
	  have it.  TI is likely to only do MFUNC from now on.  The IRQMUX
	  in the 1250 series of chips needs no tweaks.
	o Adjust to new exca interface.
	o Add comments about TI chips that I learned in talking to an
	  engineer at TI.
	o Add register definitions for MFUNC.
	o Create CB_TI125X chipset type.
2002-07-26 08:05:25 +00:00
Warner Losh
6dfd31d460 MFp4:
o Protect .h against multiple includes.
	o eliminate the pointers to the read/write routines.  The
	  bus_space_read routines can cope since we have the offset
	  field.
	o Print a warning if the requested map address is > 16M and
	  your chipset doesn't support the extended ExCA registers.
2002-07-26 08:01:08 +00:00
Warner Losh
a850203de0 Make PCI_ENABLE_IO_MODES a sysctl hw.pci.enable_io_modes. It can also
be set at boot time.  It defaults to 1 now since it can be set in the
boot loader.  If this proves unwise, we can reset it to defaulting to 0.
2002-07-26 07:58:16 +00:00
John Polstra
470bd96a07 Recognize the Altima AC9100 chip, which is used in current versions
of the Netgear GA302-T.  I changed the symbolic names in the
submitter's patch to reflect the part number of the chip instead
of the board.

PR:		kern/38988
Submitted by:	Brad Chapman <chapmanb@arches.uga.edu>
MFC after:	2 days
2002-07-26 03:47:08 +00:00
Matt Jacob
e277218592 Frequency default should be '25' for 25MHz, not 25000000.
Through the PITA of endiannness, clock has to be MHz freq << 8.

Don't trust NVRAM on SBus cards.

Set a default initiator ID sensibly.

SBus/ISP now working, what with the change to sbus.c earlier today.
2002-07-25 20:49:30 +00:00
Matt Jacob
43722a425a Don't test against default_iid being zero as a test for whether we
set something- iid 0 is valid.
2002-07-25 20:47:40 +00:00
Matt Jacob
72429e49f5 Make sure that if are in fact using 'full SMP', make the interrupt
flags include INTR_MPSAFE. Put the flags in a common place so that
both isp_sbus && isp_pci DTRT.

In isp_mbxdma setup, drop any locks prior to calling things like
bus_dmatag_create. This gets rid of these obnoxious WITNESS messages
about 'sleeping with locks held' blah blah blah blah blah.
2002-07-25 16:02:09 +00:00
Matt Jacob
4eb494274f Put MODULE_VERSION back here so that ispfw is happy. 2002-07-25 16:00:24 +00:00
Takanori Watanabe
2e673adddb Regen. 2002-07-25 14:16:47 +00:00
Takanori Watanabe
86b3064d09 MFNetBSD: FTDI USB-serial converter chips description. 2002-07-25 14:15:49 +00:00
Brian Feldman
ca33ae2367 Fix some of the places where sound(4) can sleep with a lock held. (Help
courtesy of fenner).
2002-07-25 04:49:45 +00:00
Doug Ambrisko
fed38951fd Fake a resume method for this chip via calling detach/attach. This lets
ThinkPads using this chip to have sound after a suspend/resume sequence
without resorting to kldunload/kldload.

MFC after:	1 week
2002-07-24 21:27:22 +00:00
Jake Burkholder
11e3f06011 Fix warning. 2002-07-24 01:09:38 +00:00
Alexander Kabaev
61698e0ca1 Fix the sound driver vchan support to work when hw.snd.maxautovchans
has been specified through /boot/loader.conf as opposed to setting it
in /etc/sysctl.conf. Only PCMDIR_PLAY channel can be used as a parent
of virtual channel. Do not initialize a new vchan for a given physical
channel if other physical channel already has one created.

PR:	31597
Approved by:	obrien (mentor)
2002-07-23 14:50:51 +00:00
Peter Wemm
65c4663d5f Minimal tweak to not depend on NPCI, but still maintain portability
to 4.x which still does need it (since pci_if.h isn't generated without
pci being present)
2002-07-23 06:31:45 +00:00
Mitsuru IWASAKI
3c24196d00 Add NULL check for the output buffer from AcpiEvaluateObject().
Submitted by:	jon
2002-07-23 00:47:13 +00:00
Warner Losh
11b0ee113b integrate from p4 repo:
o Honor NE2000DVF_{AX88190,DL10019} flags by setting the ED_FLAGS_xxxx
  flag.
o Mark linksys combo_ecard as ax88190
o Set the type_str to AX88190 for the ax88190 cards.

This fixes ax88190 based cards, for the most part, but doesn't seem to fix
the mii based dl10019 cards (aka linksys cards).
2002-07-22 21:28:46 +00:00
Warner Losh
64b17388de Three minor changes:
1) Add support for compaq cpq 10/100 card (a rebadged ce3)
2) Minor protection for failure on vendor lookup
3) Minor style(9) nits.
2002-07-22 21:24:12 +00:00
Søren Schmidt
ba41a3d37e Fix the transfer size calculation. 2002-07-22 18:37:33 +00:00
Søren Schmidt
5c0d1ab990 Sync with the spl changes in -stable.
Add start of support for DVD+RW.
2002-07-22 18:36:14 +00:00
Søren Schmidt
2dadf47412 Update the tags handling a bit, which makes support for the
older IBM DTTA series of drives possible.
Update error handling a bit now we are here.
2002-07-22 18:35:01 +00:00
Robert Drehmel
b0e28044ba - Remove unnecessary break statement.
- Move a label to a syntactically correct place to keep
   gcc from warning.
2002-07-22 15:01:04 +00:00
Mitsuru IWASAKI
a1fccb4765 Add device(power/sleep button and lid) wake function from sleeping state.
This is required for some Thinkpad (and maybe VAIO) machines to wake
the system up from sleep.

Currently partially implemented, more complete implementation will come later.
2002-07-22 12:52:54 +00:00
Orion Hodson
7cf0e77a00 Move lock in pcm_chn_add() to after malloc.
PR:             kern/40157
Submitted by:   Dan Lukes <dan@obluda.cz>
2002-07-22 02:38:20 +00:00
Peter Wemm
7c65416558 Make this compile.
uaudio.c:1822: warning: `uaudio_ctl_get' defined but not used
2002-07-22 00:11:35 +00:00
Peter Wemm
b5d0be8951 Remove dependency on NPCI. Use 'options ATA_NOPCI' to compile without
pci support.  This really needs to be fixed properly some day, but judging
by the fact that the nopci case hasn't compiled for quite a while, there
does not seem to be much urgency.

Reviewed by:	sos
2002-07-21 21:37:09 +00:00
Nick Sayer
d807a231a2 Add uaudio -- a USB audio device driver.
This driver actually works slightly better on -stable than on -current
(the system locks on detach on -current), so it should be MFC'd somewhat
sooner.

This driver currently points out a difficulty in the sound device framework.
The PCM unregister routine is allowed to refuse the detach if the device is
in use. In the case of a USB device, however, this unregistration is much more
mandatory in nature, since the device is *actually* gone when this call is
made. The sound subsystem really should not refuse an unregistration and
should take its own steps to reject further I/O. As a result, if you detach
a USB sound device while it is in use, you can expect a panic shortly
thereafter.

This device cannot currently record audio. Some routines are unwritten as
of yet in uaudio.c to support recording.

This device hangs my -current box on detach. I don't know why. This does
not happen on my -stable machine.

Obtained from:	Hiroyuki Aizu
MFC after:	2 weeks
2002-07-21 17:28:50 +00:00
Peter Wemm
05e5542d97 Remove abuse of NBKTR - this was always a NOP on freebsd. We never
compiled this stuff if NBKTR was zero.
2002-07-21 05:19:03 +00:00
Peter Wemm
42eab1f8d9 Remove #if 0'ed abuse of NPCI 2002-07-21 05:16:56 +00:00
Peter Wemm
9fe486ad0f Remove #include <pci.h> - there is no abuse of NPCI here 2002-07-21 05:16:14 +00:00
Warner Losh
ba9b43207d The CNW_801 and CNW_802 are wireless cards that the cnw driver supports. 2002-07-21 04:27:44 +00:00
Warner Losh
05335a0e90 Don't abuse __FreeBSD__ as version number. Since it was >= 3, remove
the ifdef completely.
2002-07-21 04:25:30 +00:00
Warner Losh
5c673b5765 Minor whitespace nits. remove #if 1 and #endif pair, but not code between. 2002-07-21 04:24:30 +00:00
Warner Losh
4e64e27753 cardbus attachment. 2002-07-21 04:23:40 +00:00
Warner Losh
9e1b56e284 Reset the 16-bit bus and turn off power. More work in this area may
be needed, but this seems sane on my laptop.
2002-07-21 04:23:11 +00:00
Warner Losh
df9c943ac9 Remove __FreeBSD__ version abuse, also de-orbit support for FreeBSD 2
and FreeBSD 3.
2002-07-21 04:18:20 +00:00
Alan Cox
5ec699cdac o If the page returned by vm_page_grab(VM_ALLOC_ZERO) isn't prezeroed,
zero it.

Reviewed by:	dfr, peter
2002-07-21 04:07:26 +00:00
John Baldwin
d6ac80d12f Add PCI IDs for the A, B, and C UHCI controllers in the ICH4.
Sponsored by:	The Weather Channel
2002-07-19 22:17:02 +00:00
John Baldwin
c584bd8f63 Add PCI ID for the ICH4 ATA100 controller.
Sponsored by:	The Weather Channel
2002-07-19 22:14:54 +00:00
Warner Losh
c1bb793bbb Eliminate the need for pccard_common.c by moving the function inline
in the .h file.  Make it static __inline to make sure that it doesn't
wind up defined in any files.

Also, fix a typo that said null_do_attach instead of null_do_probe.
2002-07-17 05:20:43 +00:00
Warner Losh
fc7b12d6fc Add support for Elsa XI325, Netgear MA401RA, and Nokia C110. From OpenBSD
by various people there.
2002-07-17 04:07:07 +00:00
Warner Losh
bdcb2d73e4 regen from pccarddevs 1.33 2002-07-17 04:02:52 +00:00
Warner Losh
8f414056fa MFOpenBSD:
1.93; henning; MA401RA wi card
1.92; millert; elsa XI-325 wi card
1.91; fgsch; gemplus cpr400 smartcard reader
1.90; mickey; Nokia c110/c111 is prism2 card
1.89-1.86 (similar to what we do already)
2002-07-17 04:01:57 +00:00
John Baldwin
8034890757 - Use more correct values to initialize the AGP controller during setup.
The value we use is still questionable for 440BX chipsets.
- When flushing the TLB just toggle the bit in question instead of writing
  a magic value that could trash other unrelated bits.
2002-07-17 02:52:01 +00:00
Prafulla Deuskar
802baa70eb - Use IO mode to reset the controller (82544 and beyond)
- Read the Mac address only once during attach.
  (This fixes the failover issue observed using the bonding driver)

MFC after:	3 days
2002-07-16 16:55:03 +00:00
Thomas Moestl
60a6cf4eff Add missing quotes around ID string in __FBSDID().
Pointy hat to:	obrien
2002-07-16 16:20:44 +00:00
Ian Dowse
417d8f25fc Re-fetch the interface handle after setting the config number,
because the previous interface handle gets freed when the config
number is set. This fixes a problem where memory could be accessed
after it was freed when the interface was ifconfig'd up.

Reviewed by:	n_hibma
2002-07-15 14:37:36 +00:00
Mark Murray
bbf09ad887 Upgrade the random device to use a "real" hash instead of building
one out of a block cipher. This has 2 advantages:
1) The code is _much_ simpler
2) We aren't committing our security to one algorithm (much as we
   may think we trust AES).

While I'm here, make an explicit reseed do a slow reseed instead
of a fast; this is in line with what the original paper suggested.
2002-07-15 13:58:35 +00:00
Mark Murray
64d85ef750 Use semicolons at the end of function-like macros for the sake of
consistency, style and future cleanliness.
2002-07-15 13:03:10 +00:00
Hajimu UMEMOTO
767f578267 Correct module name of my previous commit. 2002-07-15 11:22:37 +00:00
Max Khon
937033e904 fix driver name in DRIVER_MODULE
MFC after:	3 days
2002-07-15 05:05:50 +00:00
Alan Cox
613f5495ed o Lock page queue accesses by vm_page_wire(). 2002-07-14 20:40:32 +00:00
Thomas Moestl
9f6388ba93 Miscellaneous fixes:
- always reinitialize the rx descriptors, even if the mbuf is kept.
  This should fix the hangs on ifconfig that were observed
- on an rx overflow, reinitialize the descriptor so that the interface
  will not hang
- correct some bus_dmamap_sync() calls
- correct some debug messages
- some minor nits
2002-07-14 12:09:48 +00:00
Alan Cox
1f54526952 o Complete the locking of page queue accesses by vm_page_unwire().
o Assert that the page queues lock is held in vm_page_unwire().
 o Make vm_page_lock_queues() and vm_page_unlock_queues() visible
   to kernel loadable modules.
2002-07-13 20:55:21 +00:00
Hajimu UMEMOTO
ad85ae6de1 When usb is kld, ucom and uplcom were failed to load because of
usbd_abort_pipe undefined.
2002-07-13 10:41:35 +00:00
Matt Jacob
dbf6d71cba Remove a couple of debugging lines. 2002-07-11 03:27:30 +00:00
Matt Jacob
73030e03ce 'Support' for ISP SBus cards.
This code does not imply that SBus cards work yet. They hang for me.
But I can't netboot the latest snapshot on my ultra1e, and things
hang at bus_setup_intr time.

Since I'm offline for a while, I thought I'd toss this in in case somebody
else who has a bit better luck wants to fart around with it. Please try
and wait until I get back to check things in.
2002-07-11 03:25:04 +00:00
Matt Jacob
74496412c4 Add SBus firmware (compiled in only for sparc systems). 2002-07-11 01:55:15 +00:00
Maxim Sobolev
8c6d67ef99 Add PCI ID and configuration hint for Netmos Nm9845 PCI 6-ports serial
card.

Submitted by:	Oleg Antoshin <oleh@at2000.kiev.ua>
MFC after:	3 days
2002-07-10 17:26:11 +00:00