Commit Graph

11476 Commits

Author SHA1 Message Date
Ian Dowse
eadf519a78 Replace the static "qdat" structure with a per-instance softc field
in all USB ethernet drivers. The qdat structure contains a pointer
to the interface's struct ifnet and is used to process incoming
packets, so simultaneous use of two similar devices caused crashes
and confusion.

The if_udav driver appeared in the tree since Daan's PR, so I made
similar changes to that driver too.

PR:		kern/59290
Submitted by:	Daan Vreeken <Danovitsch@Vitsch.net>
2004-05-23 12:35:25 +00:00
Lukas Ertl
5ac85402da Diff reduction to NetBSD.
MFNetBSD 1.177; author: toshii
   Use the correct wValue to get hub desriptors.
   Also, make wValue checks of root hub codes less strict.

MFNetBSD 1.178: author: martin
   Interrupt descriptors might become invalid while being processed in
   uhci_check_intr - so remember their next pointer before calling it.
   Patch provided by Matthew Orgass in PR kern/24542.

Obtained from:   NetBSD
2004-05-23 11:43:34 +00:00
Maxime Henrion
e0026a65f9 Use __FBSDID. 2004-05-23 10:57:11 +00:00
Duncan Barclay
62a9464c76 Apply fix for long timeouts on driver initialisation.
PR:		64656
Submitted by:	Jianqin Qu <jqu@its.brooklyn.cuny.edu>
Reviewed by:	dmlb
2004-05-23 08:35:07 +00:00
Maxime Henrion
eb3259747a In agp_generic_bind_memory(), grab the needed pages before acquiring
the agp mutex.  We do this because vm_page_grab() called with the
VM_ALLOC_RETRY flag can sleep.

Pointed out by:	alc
2004-05-23 00:00:10 +00:00
Nate Lawson
12957d4991 Revert the previous commit. The bus accessor macros do not check the
return value for BUS_READ_IVAR and thus don't generate the proper NULL
in cases where a device (i.e. on PCI) does not have a handle.

Found by:	peadar, tjr
2004-05-22 17:19:59 +00:00
Marius Strobl
a32a374caf - Rearrange a comment to fit in 80 chars per line, like the rest of this
file.
- Remove a superfluous ';'.
2004-05-22 16:45:19 +00:00
Marius Strobl
073e8552f8 - Move OFW_NAME_MAX, used as a limit for OFW property names and device
identifiers, to openfirmio.h as OFIOCMAXNAME, so programs can use it
  for buffer sizes etc.
  Note: Although this is only a rough upper limit to make the code more
  robust and to prevent the allocation of ridiculous amounts of memory,
  the current limit of one page (8191 + '\0' in openfirm_getstr()) still
  appears a bit high. The maximum length of OFW property names is 31.
  I didn't find a maximum length for the device identifiers in the OFW
  documentation but it certainly is much smaller than 8191, too.
- Enable the OFIOCSET ioctl, i.e. move it out from under #if 0.
- Don't use openfirm_getstr() for the property value in OFIOCSET, there
  are also properties whose values aren't strings and it makes sense to
  use a different maximum length for property values than OFW_NAME_MAX/
  OFIOCMAXNAME. The maximum accepted property value is defined in
  openfirmio.h as OFIOCMAXVALUE (currently the maximum size of the value
  of the nvramrc property).
- Make OFIOCSET not return EINVAL when OF_setprop() returns a different
  length for the written value than it was told to write, this is normal
  for the text string values of the properties in the OFW /options node.
  Instead, only return EINVAL if OF_setprop() returned -1 (value could
  not be written or property could not be created). Add a comment about
  the specialty of the OFW /options node.
- Make OFIOCSET return the length of the written value returned by
  OF_setprop(), just like OF_getprop() does. Quite useful, at least for
  debugging.

Reviewed by:	tmm
2004-05-22 16:43:42 +00:00
Doug Rabson
03161bbcf6 Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's to
uint32_t where appropriate.
2004-05-22 16:14:17 +00:00
Lukas Ertl
d0834d4dc8 Add Intel PCI vendor ID. 2004-05-22 14:18:05 +00:00
Yaroslav Tykhiy
2d8c4e44b2 Don't forget to reset if_hwassist back to 0 when hardware checksumming
is being turned off, or else TCP/IP will keep assigning the job to us.

Drivers themselves should consult if_capenable, not if_hwassist--the
latter is for the TCP/IP stack.
2004-05-22 13:59:17 +00:00
Maxime Henrion
d8a821e8cf Get rid of a lockmgr consumer by making agp(4) use a standard mutex,
since it's always acquiring the lock exclusively.  This was tested
with X on an SMP box, with and without WITNESS.
2004-05-22 13:06:38 +00:00
Lukas Ertl
b2d36e0f30 Fix typos in comments.
Submitted by:   Gerhard Gonter <gonter@falbala.wu-wien.ac.at>
2004-05-22 09:29:52 +00:00
Marius Strobl
55fe3a872f Spelling and style fixes.
Obtained from:	NetBSD
2004-05-22 01:56:18 +00:00
Maxime Henrion
27d8bee2a7 Plug three lock leaks. 2004-05-22 00:44:08 +00:00
Yaroslav Tykhiy
5fe9116b72 Cosmetic:
Set capability bits in a consistent way.
Add a comment on why the VLAN_MTU stuff comes after ether_ifattach().
2004-05-21 20:34:04 +00:00
Warner Losh
c5b82061f4 Fix cutNpasto in last commit. 2004-05-21 19:47:55 +00:00
Yaroslav Tykhiy
21ce2bf290 The driver fxp(4) has reception of large frames enabled hardcodedly,
so let VLAN_MTU be marked in if_capenable from the beginning.
2004-05-21 18:11:38 +00:00
Yaroslav Tykhiy
7560265c18 Mark the capability of this driver to receive VLAN frames >1500 bytes
as initially active in if_capenable since it is always on.

Reviewed by:	simokawa
2004-05-21 17:11:34 +00:00
Warner Losh
d776e1167f ifdef writing to registers that the base pci standard says are
read-only on D3->D0 power state transition.  Add a define to enable
them, but include a comment to contact me if there's a problem.
2004-05-21 14:41:02 +00:00
Doug Rabson
95a2495411 Fix spelling. 2004-05-21 09:12:07 +00:00
Warner Losh
17249aab6e Compeletely rewrite the description of hw.pci.do_powerstate to sound
better.
2004-05-21 07:06:54 +00:00
Warner Losh
4c04937d5b Improve the English somewhat.
Prodded by: ru@
2004-05-21 07:03:07 +00:00
Warner Losh
cd677980a1 Ooops, forgot to commit the updated definition for hw.pci.do_powerstate
when I committed code that changed its meaning.
2004-05-21 06:43:46 +00:00
Warner Losh
b17653cf41 MFp4:
Split the baby.  For idepci devices, now both legacy mode bits need
not be set.  We can run an idepci in a split mode.  However, it only
works better than before, not works.  It works better in that when one
device is legacy and the other isn't and disabled, we now operate
correctly.

sos submitted a version of this patch.
2004-05-21 06:41:15 +00:00
Warner Losh
ae8b157fbf Move pci_do_powerstate up a level. Now it just means 'do not turn devices
off into d3 state when there's no driver for the device'.  This should
help suspend/resume in the default case.
2004-05-21 06:39:09 +00:00
Warner Losh
e5af1ba884 MFp4: o save/restore subvendor, subdevice, vendor, device, baseclass,
subclass, progif and revid.  While these are typically read
	only fields, they aren't always read-only.  progif is writable
	for ata devices, for example.  It does no harm when they are
	read only, and helps when they aren't.
2004-05-21 06:36:36 +00:00
Warner Losh
2a6c850c09 When attaching pccard and cardbus children, there's no need to set the
device == NULL on failure.  A warning should suffice.

# I wrote this back before I understood the unattached but loosely bound
# newbus concept...
2004-05-21 06:11:47 +00:00
Warner Losh
2a829b00f4 Now that we have the resource allocation code in current, the kludge
to try to allocate things on my parent can be taken out.  It duplicates code.

Also, add comment about why the power state stuff is here (type 2
devices don't participate in the power state save/restore due to
larger Bx issues).
2004-05-21 06:10:13 +00:00
Warner Losh
d53b25544c make the pci power state and resource code a lot less chatty. The
chattiness was left in for debugging, but now that nearly all of the
problems relating to the changes have been fixed, it is only annoying.  It
is still available via bootverbose.

Prodded by: jhb
2004-05-21 06:03:26 +00:00
MIHIRA Sanpei Yoshiro
c970d559f1 Sync to 1.178 of usbdevs 2004-05-21 01:39:38 +00:00
MIHIRA Sanpei Yoshiro
3ee4bca213 add support Kyocera AH-K3001V (cellular phone in Japan)
PR:		kern/66779
Submitted by:	Togawa Satoshi <toga@puyo.org>
MFC after:	1 week
2004-05-21 01:36:48 +00:00
Dag-Erling Smørgrav
76b108abfe Whitespace cleanup. 2004-05-20 14:49:12 +00:00
Yaroslav Tykhiy
1df1a82541 Stylistic changes around the previous commit:
- since the number of supported capabilities is growing,
  set bits in if_cap* in a consistent way;

- unexpand(1) leading SPACE characters.
2004-05-20 11:04:09 +00:00
Yaroslav Tykhiy
388305aceb Set the VLAN bits in if_capenable as well as in if_capabilities
because VLAN hardware features are enabled in em(4) by default.

Note: Currently vlan(4) has a bug that it consults
if_capabilities, not if_capenable.  This will be fixed
after all the network drivers set VLAN bits in
if_capenable properly.
2004-05-20 10:57:33 +00:00
Scott Long
7cb88a352e Update from vendor. This also adds support for newer management tools.
Submitted by:	Achim Leubner
2004-05-19 17:46:34 +00:00
Eric Anholt
f4078c527f Add explicit list of SiS AGP chipsets based on Linux kernel's list.
Prompted by:	i386/59503
2004-05-19 05:25:31 +00:00
Warner Losh
092d0b6b38 Replace the lame big endian crc with wpaul's standard big endian crc
algorithm, supplied by wpaul himself.  The lame one has an origin
that's been called into question, so rather than argue about that (one
could make an excellent fair use argument), replace it with better
code since that's what FreeBSD is about.

Submitted by: wpaul[1], Klaus Klein

[1] Bill called this a silly bikeshed.  Maybe his is not incorrect.
2004-05-19 02:16:46 +00:00
Nate Lawson
14e2b11f18 Use the simpler __BUS_ACCESSOR macros for ivars instead of defining them
ourselves.
2004-05-18 16:53:29 +00:00
Pawel Jakub Dawidek
6a40892929 Fix panic which occurs when given sector size for memory-backed device
is less than DEV_BSIZE (512) bytes.

Reported by:	Mike Bristow <mike@urgle.com>
Approved by:	phk
2004-05-18 07:30:04 +00:00
Joerg Wunsch
b3dd2b7bfc Fix various style(9) bugs. This includes the removal of wrong
reimplementations of enodev() (for the smbread() and smbwrite()
functions), as well as fixing various errno values to conform to
errno(3).

Bruce also points out that a number of the pointer == NULL tests
are probably nonsense because the respective checks are already
done at upper layers.

(Mostly) submitted by:	bde
2004-05-17 18:55:45 +00:00
Søren Schmidt
263b4cdea3 Rip out the too verbose "spurious interrupt" printf's, they dont serve
a purpose any longer.
2004-05-17 17:53:12 +00:00
Paul Saab
a891a3bf7c Turn SCSI pre-fetch ON. This is mainly for 64XX and 64X based
controllers and allows the controller to prefetch 1-2k on certain
PCI memory reads to the host.  The spec says this should only be
used for IA32 based systems.

Informed of feature by:	John Cagle <first.last@hp.com>
2004-05-17 17:27:38 +00:00
Vinod Kashyap
5bc4169411 Undid scottl's recent changes. 2004-05-17 17:16:58 +00:00
Roman Kurakin
b25d0ae0cb Add description of Cronyx Omega2-PCI (8x port serial adapter). 2004-05-17 12:57:30 +00:00
Warner Losh
734e3cc5fd Update to reflect new location in the tree. This has been repo copied
from sys/isa/fd.c in preparation for specialization of attachments for
different busses.
2004-05-17 05:42:04 +00:00
Peter Wemm
dbfcb6b2db Remove "register_t eflags; eflags = read_eflags();" because 1) it wasn't
subsequently used in the code, and 2) it doesn't compile on !i386.
2004-05-16 21:22:45 +00:00
Joerg Wunsch
69271da461 Another candidate that didn't use copyin/copyout for user<->kernel
transfers.

MFC after:	1 month
2004-05-16 21:19:59 +00:00
Joerg Wunsch
add37e1e86 You wouldn't believe a driver could survive doing userland IO without
properly using copyin/copyout for more than 5 years?  This one did. :-)

Properly encapsulate all user<->kernel data transfers using copy{in,out}.

MFC after:	1 month
2004-05-16 21:18:45 +00:00
Joerg Wunsch
c2d85eaa93 After successfully attaching an iicbus instance, instead of using a
NULL name in device_add_child(), explicitly name all of our known
child drivers in order to give them a chance to attach to us.
Otherwise, only the first one present would be probed and attached.

Reviewed by:	nsouch
MFC after:	1 month
2004-05-16 21:11:46 +00:00
Yoshihiro Takahashi
d385ba7313 - Initialize uart_bus_space_io and uart_bus_space_mem.
- Fix wrong comment.
2004-05-16 14:12:05 +00:00
Doug Rabson
c59285296e Don't use the node id as an index into the topology map. This breaks
if a node on the bus has more than three ports (like my cheapo six
port hub).
2004-05-16 11:26:39 +00:00
Scott Long
f3a537ca3f Remove twa_intrhook prototype.
Submitted by:	cperciva
2004-05-15 15:41:59 +00:00
Scott Long
e25b7fccd4 Set the cpi.hba_inquiry field to something useful. 2004-05-15 05:18:05 +00:00
Scott Long
bd4c922777 Remove the config_intrhook as it is not needed. 2004-05-15 05:17:42 +00:00
Dag-Erling Smørgrav
0f126ea09f Remove some debugging printf()s and a pointless device_set_desc() call. 2004-05-15 00:07:23 +00:00
MIHIRA Sanpei Yoshiro
e68f2db9a3 MFNetBSD (umodem.c 1.46):
URL updates
2004-05-14 15:16:09 +00:00
Nate Lawson
0025fb0f4f Add support for GPE being a package of { reference, gpe bit }.
Rework the ECDT probe to pass all the parameters in a temporary struct.
Note why we are mostly ok evaluating _GLK so early.
2004-05-14 04:17:56 +00:00
John Baldwin
92cb9c9b67 Different VIA host bridges use different offsets to their AGP config
registers, so add a register offset array to the softc.  We key off the
device ID to determine which set of register offsets.  Currently the 8385
host bridge used on amd64 is the only bridge to use the AGP3_VIA_*
register offsets and all other bridges use the AGP_VIA_* offsets.  It is
currently unclear if the AGP3_VIA_* offsets are for VIA bridges that
implement AGP 3.0 bridges or just for amd64 bridges.

Submitted by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-13 20:05:42 +00:00
Dag-Erling Smørgrav
7cec30e791 Unbreak the build. 2004-05-13 19:15:21 +00:00
Scott Long
d7f2f66e08 Enable INTR_ENTROPY if the interrupt is not set to INTR_FAST. Remove the
testing and setting of the INTR_ENTROPY macro as it is not needed in
FreeBSD 5.x.

Submitted by:	Alex Vasylenko
2004-05-13 16:02:18 +00:00
Don Lewis
63625ec31e Remove extraneous spaces. 2004-05-13 11:33:44 +00:00
Don Lewis
9d2820eaac Implement sbc_lockassert() and sb_lockassert() functions to allow
proper locking to be checked at runtime.

Remove sb_lock() and sb_unlock() calls from sb_reset_dsp() because the
latter is called from sb_setup() with the lock already held.  Add a
call to sb_lockassert().

Surround the call to sb_reset_dsp() in sb16_attach() with sb_lock()
and sb_unlock() calls.

Tested by:	Bartek Marcinkiewicz <junior AT p233.if.pwr.wroc.pl>
2004-05-13 11:32:54 +00:00
Nate Lawson
c868ac7d12 Add support for retrieving _GLK in the ECDT probe. Now we no longer always
use the global lock at the beginning of the ECDT probe.  Instead, we use
the handle from the ECDT to call _GLK.  Also, unify the device description.
2004-05-13 03:17:08 +00:00
Warner Losh
4cec015da7 Sync to pccarddevs 1.84 2004-05-13 01:24:48 +00:00
Warner Losh
4fa82af570 Add Intel EtherExpress PRO/100 LAN Modem. This will eventually be
added to xe once the pccard issues are resolved...
2004-05-13 01:24:26 +00:00
Bill Paul
dc9d837079 Restore source code compatibility with 5.2-RELEASE. 2004-05-12 15:58:42 +00:00
Joerg Wunsch
0233123076 Convert the #if 0 magic to #if SCAN_IICBUS, and make it actually compile
again.  While it's not generally recommended anymore, it might still prove
useful for debugging purposes.
2004-05-12 13:43:41 +00:00
Vinod Kashyap
088113ed0b 1. Fixed potential problem that would cause out-of-order requests in twe_startio.
2. Changed version.

Submitted by: scottl
Reviewed by: vkashyap
Approved by: re
2004-05-12 04:10:37 +00:00
Justin T. Gibbs
22dbd4c64c aic79xx.c:
Allow 500us between pauses in ahd_pause_and_flushwork().
	The maximum we will wait is now 500ms.

	In the same routine, remove any attempt to clear ENSELO.
	Let the firmware do it once the current selection has
	completed.  This avoids some race conditions having to
	do with non-packetized completions and the auto-clearing
	of ENSELO on packetized completions.

	Also avoid attempts to clear critical sections when
	interrups are pending.  We are going to loop again
	anyway, so clearing critical sections is a waste of
	time.  It also may not be possible to clear a critical
	section if the source of the interrupt was a SEQINT.

aic79xx_pci.c:
	Use the Generic 9005 mask when looking for generic 7901B
	parts.  This allows the driver to attach to 7901B parts
	on motherboards using a non-Adaptec subvendor ID.

aic79xx_inline.h:
	Test for the SCBRAM_RD_BUG against the bugs
	field, not the flags field in the softc.

aic79xx.c:
	Cancel pending transactions on devices that
	respond with a selection timeout.  This decreases
	the duration of timeout recovery when a device
	disappears.

aic79xx.c:
	Don't bother forcing renegotiation on a selection
	timeout now that we use the device reset handler
	to abort any pending commands on the target.
	The device reset handler already takes us down
	to async narrow and forces a renegotiation.

	In the device reset handlers, only send a
	BDR sent async event if the status is not
	CAM_SEL_TIMEOUT.  This avoids sending this
	event in the selection timeout case

aic79xx.c:
	Modify the Core timeout handler to verify that another
	command has the potential to timeout before passing off
	a command timeout as due to some other command.  This
	safety measure is added in response to a timeout recovery
	failure on H2B where it appears that incoming reselection
	status was lost during a drive pull test.  In that case,
	the recovery handler continued to wait for the command
	that was active on the bus indefinetly.  While the root
	cause of the above issue is still being determined seems
	a prudent safeguard.

aic79xx_pci.c:
	Add a specific probe entry for the Dell OEM 39320(B).

aic79xx.c:
aic79xx.h:
aic79xx.reg:
aic79xx.seq:
	Modify the aic79xx firmware to never cross a cacheline or
	ADB boundary when DMA'ing completion entries to the host.
	In PCI mode, at least in 32/33 configurations, the SCB
	DMA engine may lose its place in the data-stream should
	the target force a retry on something other than an
	8byte aligned boundary. In PCI-X mode, we do this to
	avoid split transactions since many chipsets seem to be
	unable to format proper split completions to continue
	the data transfer.

	The above change allows us to drop our completion entries
	from 8 bytes to 4.  We were using 8 byte entries to ensure
	that PCI retries could only occur on an 8byte aligned
	boundary.  Now that the sequencer guarantees this by splitting
	up completions, we can safely drop the size to 4 bytes (2
	byte tag, one byte SG_RESID, one byte pad).

	Both the split-completion and PCI retry problems only show
	up under high tag load when interrupt coalescing is being
	especially effective.  The switch from a 2byte completion
	entry to an 8 byte entry to solve the PCI problem increased
	the chance of incurring a split in PCI-X mode when multiple
	transactions were completed at once.  Dropping the completion
	size to 4 bytes also means that we can complete more commands
	in a single DMA (128byte FIFO -> 32 commands instead of 16).

aic79xx.c:
	Modify the SCSIINT handler to defer clearing
	sequencer critical sections to the individual
	interrupt handlers.  This allows us to
	immediately disable any outgoing selections in
	the case of an unexpected busfree so we don't
	inadvertantly clear ENSELO *after* a new selection
	has started.  Doing so may cause the sequencer
	to miss a successful selection.

	In ahd_update_pending_scbs(), only clear ENSELO if
	the bus is currently busy and a selection is not
	already in progress or the sequencer has yet to
	handle a pending selection.  While we want to ensure
	that the selection for the SCB at the head of the
	selection queue is restarted so that any change in
	negotiation request can take effect, we can't clobber
	pending selection state without confusing the sequencer
	into missing a selection.
2004-05-11 20:46:05 +00:00
Justin T. Gibbs
f49574218d o When restarting the sequencer, clear any pending
sequencer interrupt codes.  These codes are only
  relevant to the code that was last being executed
  and that context is cleared when we reset the
  program counter.  This addresses a race condition
  between a sequencer interrupt and any SCSI event
  that causes us to restart the sequencer.

o When running the untagged-Q, we must start the
  timer for any transaction we queue.

o Give the firmware half a millisecond between
  pauses to flush work out.  This should give us
  around half a second of total delay before flagging
  an issue with pausing and flushing controller work.

  Only attempt to clear critical sections if there
  are no pending interrupts in the pause and flush
  loop.  If the sequencer has issued an INTSTAT, we
  may not be able to step out of the critical section.

o Cancel pending transactions on devices that
  respond with a selection timeout.  This decreases
  the duration of timeout recovery when a device
  disappears.

  Don't bother forcing renegotiation on a selection
  timeout now that we use the device reset handler
  to abort any pending commands on the target.
  The device reset handler already takes us down
  to async narrow and forces a renegotiation.

o In the device reset handlers, only send a
  BDR sent async event if the status is not
  CAM_SEL_TIMEOUT.  This avoids sending this
  event in the selection timeout case.

o Modify the Core timeout handler to verify that another
  command has the potential to timeout before passing off
  a command timeout as due to some other command.
2004-05-11 20:39:46 +00:00
Justin T. Gibbs
9fe88a385d Add aic_scb_timer_start() which will be used in the aic7xxx driver to
start the timer on SCBs queued in the untagged SCB queue.

The core treats timeouts in usecs to satisfy Linux requirements.  Multiply
accordingly.
2004-05-11 20:33:42 +00:00
John Baldwin
d3b3af7599 Remove unused WL_IRQS macro. 2004-05-11 20:06:12 +00:00
Dag-Erling Smørgrav
cae8da6164 Add a driver for the watchdog timer function present on the LPC interface
bridge in Intel ICH-series chipsets.

The original implementation was by W. Daryl Hawkins of Texas A&M, but I
have made substantial modifications.
2004-05-11 18:21:38 +00:00
Søren Schmidt
45bf968a10 Fix Sii3114 support. 2004-05-10 20:23:25 +00:00
John Baldwin
fb0ac5433b If an ACPI PCI-PCI bridge doesn't have a _PRT object, fall back to using
the swizzle method for routing PCI interrupts across the bridge.  This
fixes problems with motherboards (typically laptops) whose BIOS doesn't
provide a PRT for the AGP bridge even though there is a device entry for
the bridge in the ACPI namespace.

Tested by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-10 18:26:22 +00:00
Maxime Henrion
c5c09c282b - Remove the __FBSDID and put the $FreeBSD$ tag in the comment above,
so that including this file more than once works.
- Fix some style bugs while I'm here.
2004-05-10 11:50:21 +00:00
Maksim Yevmenkin
92f4dabf30 Resync 2004-05-10 02:26:49 +00:00
Maksim Yevmenkin
73a4a9a759 Mode few Bluetooth defines into system include files
Reviewed by:	imp
2004-05-10 02:24:56 +00:00
Warner Losh
62e40b13fe This file has never been used, nor will it ever be used in FreeBSD, so
remove it.
2004-05-09 07:09:30 +00:00
Warner Losh
c7a0a4c076 We don't need the dependency on the pccard module here. 2004-05-08 06:06:13 +00:00
Warner Losh
fbfb97942e It turns out that the module dependency on pccard is in error. Since
there's not dependencies on pccard symboles, such a dependency is not
necessary.  This means that drivers that have multiple attachments can
not drag bogus devices into the kernel at load time.

We can't (yet) do this with pci and isa.  Drivers written for them
actually do seem to have symbols that depend on these busses'
implementation code.

ndis not touched until other things can be tested.
2004-05-08 06:04:06 +00:00
MIHIRA Sanpei Yoshiro
e5728f83a0 Add support CS4294
PR:		kern/66280
Submitted by:	Christian Brueffer <chris@unixpages.org>
2004-05-08 03:41:40 +00:00
Roman Kurakin
8ad3557f05 Use better way of closing fr support before current sppp get it. 2004-05-07 11:59:54 +00:00
Roman Kurakin
e97da3ff02 Sync with RELENG_4 2004-05-07 11:56:07 +00:00
Roman Kurakin
ff05239c88 Use better way of closing fr support before current sppp doesn't have it. 2004-05-07 11:45:25 +00:00
Roman Kurakin
3030578038 Sync with RELENG_4. 2004-05-07 11:11:13 +00:00
Roman Kurakin
2a4aba97c4 Delete unused cx_slow_ih.
Pointed by:	jhb
2004-05-07 11:06:25 +00:00
Nate Lawson
ccc09458fa Change hw.acpi.cpu.cx_lowest to accept values in the form of C1,
C2, ...  Update power_profile to use the new format.  Update the
man page to reflect this and give more info on Cx states.
2004-05-07 05:22:38 +00:00
Nate Lawson
b0e2b625f2 Rename acpi_cpu to cpu. Change the probe routine to early on reject
devices it cannot attach to.  This gets rid of extraneous but harmless
device_probe_and_attach() errors.  While I'm here, make the device
description more useful.  The !acpi case for cpu is handled by legacy0.
2004-05-06 17:25:23 +00:00
Joerg Wunsch
66764b4ce9 The Sun hme hardware supposedly supports Tx frames up to 65535 octets,
and Rx frames up to 8191 octets, so it is perfectly capable of supporting
vlan(4)-style VLAN natively.

Thus, make it support VLAN `oversize' frames.

Reviewed by:	tmm
2004-05-06 13:38:19 +00:00
MIHIRA Sanpei Yoshiro
c6b0444f5f fix SONY_CLIE_41 (as PEG-SJ33/U)
PR:		kern/64968
Submitted by:	John Merryweather Cooper <coop9211@uidaho.edu>
MFC after:	1 week
2004-05-06 13:33:59 +00:00
Andre Oppermann
c8d5cfbd81 Link state change notification of ethernet media to the routing socket.
o The ndis_ticktask() function updates the ifi_link_state field and
  calls rt_ifmsg() to notify listeners on the routing socket.

Approved by:	wpaul
2004-05-06 13:17:02 +00:00
Mike Silbersack
f71ae83f34 Remove "Scheduling overrun" interrupts from the set of normal interrupts
that the OHCI driver uses.  Broken OHCI devices (like the controller
in my laptop, apparently) like to set this bit at times.  Research
through google shows that this problem has shown up on other systems
as well.

As the scheduling overrun handler doesn't actually do anything, and
the only effect is console spamming, disabling the interrupt seems
to be the right thing to do.  (And it is also what linux 2.6 does.)
2004-05-06 09:21:05 +00:00
Nate Lawson
ea27c63ec6 Select the highest valid (i.e., S3) sleep state for the default for the
sleep button.  Change the default for the lid switch to NONE.  This can
be overridden in /etc/sysctl.conf as desired.
2004-05-06 08:04:34 +00:00
Nate Lawson
2fb3498126 Add back sys/reboot.h which is needed. 2004-05-06 02:57:24 +00:00
Nate Lawson
869ec176fc Make unnecessary globals static and remove unused includes.
Pointed out by:	cscout
2004-05-06 02:18:58 +00:00
Nate Lawson
7e639165c2 Fix setting debug strings via sysctl. Also, clean up the way we print
debug strings.
2004-05-06 02:05:45 +00:00
Nate Lawson
c8dd768173 Remove extra parentheses. 2004-05-05 20:07:52 +00:00
Nate Lawson
65a7c90189 Add an MI implementation of the ACPI global lock routines and retire the
individual asm versions.  The global lock is shared between the BIOS and
OS and thus cannot use our mutexes.  It is defined in section 5.2.9.1 of
the ACPI specification.

Reviewed by:	marcel, bde, jhb
2004-05-05 20:04:14 +00:00
Josef Karthauser
3e69419a37 Regen 2004-05-05 19:40:03 +00:00
Josef Karthauser
81bf999d56 Add support for the new Zire 31 device.
Submitted by:	Adriaan de Groot <adridg@cs.kun.nl>
2004-05-05 19:39:24 +00:00
Roman Kurakin
5020aeb346 Add support for Cronyx Tau-PCI adapters.
Note: cpddk.c is in obfuscated form (discussed with core@).

As always, driver will be connected to the build a bit
later after some extra testings.
2004-05-05 16:11:45 +00:00
Scott Long
c043a33795 Update the version history in the driver to note everything that has happened
over the last three weeks.
2004-05-05 14:19:43 +00:00
Scott Long
1e5532d487 Roto-till the ioctl code. Remove all the groping around in the x86 BIOS
segment, remove the groping around in the Option ROM segments, remove the
bogus tests for bcopy vs. copyout.  There really is no reason for a
management app to know these things other than to create l33t info tables
for the user.
2004-05-05 05:29:19 +00:00
Scott Long
60c3d7b627 Convert the asr driver to use the bus_space API. This does not represent
a significant functional change, but it further cleans up the code and
brings it closer to being portable.  Thanks to Don Bowman for helping to
test this.
2004-05-05 03:42:33 +00:00
MIHIRA Sanpei Yoshiro
e3433c8b27 Sync to 1.176 of usbdevs 2004-05-04 11:37:26 +00:00
MIHIRA Sanpei Yoshiro
9ea2290de0 fix typo (adapte -> adapter)
Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch@Vitsch.net>
2004-05-04 11:36:54 +00:00
MIHIRA Sanpei Yoshiro
39b7f9fc17 Sync to 1.175 of usbdevs 2004-05-04 11:23:45 +00:00
MIHIRA Sanpei Yoshiro
5151db7f71 Fix device ID for Linksys USB 2.0 10/100 ethernet controller
(use LINKSYS2)

Submitted by:	takawata-san
2004-05-04 11:22:09 +00:00
MIHIRA Sanpei Yoshiro
10aee7e1c4 Sync to 1.174 of usbdevs 2004-05-04 09:41:08 +00:00
MIHIRA Sanpei Yoshiro
6183ba9d09 Add some device ID for atuwi USB wlan driver
(Atmel at76c503a http://vitsch.net/bsd/atuwi)

Fix ATMEL DWL-120 Wireless adapter product ID.
(I checked http://www.linux-usb.org/usb.ids)

PR:		kern/66227
Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch@Vitsch.net>
2004-05-04 09:39:44 +00:00
Marcel Moolenaar
eced428604 Fix hangs caused by z8530_bus_ipend() returning UART_IPEND_TXIDLE
not as a pending interrupt status, but as a matter of status quo.
Consequently, when there's no data to be transmitted the condition
is not cleared and uart_intr() is stuck in an infinite loop trying
to clear the UART_IPEND_TXIDLE status.
The z8530_bus_ipend() function is changed to return idle only once
after having sent any data.

The root cause for this problem is that we cannot use the interrupt
status bits of the SCC itself. The register that holds the interrupt
status can only be accessed by channel A and holds the status for
both channels. Using the interrupt status register would complicate
the driver because we need to synchronize access to the SCC between
the channels.

Elementary testing: marius
2004-05-04 06:58:10 +00:00
Marcel Moolenaar
5918c72d28 When the interrupt cannot be INTR_FAST, it still is INTR_MPSAFE.
Mark it as such.
2004-05-04 05:54:02 +00:00
Scott Long
01a157ea66 Fix a typo from rev 1.56 that somehow escaped my testing. 2004-05-04 03:16:22 +00:00
Warner Losh
923332f7c5 Need to mark the interrupt from cbb as being MP safe on resume too. 2004-05-04 02:25:00 +00:00
Doug Ambrisko
a00d3e6140 Remove new options and my prevention of system freeze when the sio probe
returns okay when HW probe fails.  This happens when comconsole flag is
set but VGA console is used instead.

Back out requested by:  bde (He will be looking at other solutions from scratch)
2004-05-03 22:35:28 +00:00
Andre Oppermann
127d7b2d2d Link state change notification of ethernet media to the routing socket.
o Extend the if_data structure with an ifi_link_state field and
  provide the corresponding defines for the valid states.

o The mii_linkchg() callback updates the ifi_link_state field
  and calls rt_ifmsg() to notify listeners on the routing socket
  in addition to the kqueue KNOTE.

o If vlans are configured on a physical interface notify and update
  all vlan pseudo devices as well with the vlan_link_state() callback.

No objections by:	sam, wpaul, ru, bms
Brucification by:	bde
2004-05-03 13:48:35 +00:00
Andre Oppermann
9a54cbb95d Correct the phy_service() routine case MII_TICK to correctly track
the falling edge of a media state change.

This is in preparation for media state change notification to the
routing socket.

No objections by:	sam, wpaul, ru, bms
Brucification by:	bde
2004-05-03 13:01:34 +00:00
Poul-Henning Kamp
675d58e870 Fix off by one error. 2004-05-03 11:41:25 +00:00
MIHIRA Sanpei Yoshiro
d6f89a0596 Sync to 1.173 of usbdevs 2004-05-02 13:23:25 +00:00
MIHIRA Sanpei Yoshiro
a62da76023 Add support SUNTAC U-Cable type A4 (AS144L4)
http://www.sun-denshi.co.jp/scc/products/mobile/as144l4/as144l4.htm (in Japanese)

PR:		kern/66144
Submitted by:	KURASHINA Hideyuki <rushani@FreeBSD.org>
2004-05-02 13:21:28 +00:00
Scott Long
eb095afb05 Remove the static reservation of the asr major number 2004-05-02 03:51:53 +00:00
Scott Long
9823f1a2c9 Remove the defAlignLong and getAlignLong macros. I guess that the original
intent was to make sure that message structs allocated off of the stack were
4-byte aligned.  However, the macros as defined did absolutely nothing.
And since I2O forces you to manually copy messages down to the hardware, there
really is no point of enforced alignment anyways.
2004-05-02 03:33:18 +00:00
Scott Long
c371b99774 Remove the bogus printing of the asr control device major number. Also
rename the control device from rasr%d to asr%d.  This starts us down the
path of divorcing ourselves from a very bogus design in the management
apps.  Since the apps are open source now, they will likely be updated
and fixed before 5.3.
2004-05-02 00:27:54 +00:00
Bruce Evans
ee1f208e50 Reduce differences with cy_isa.c: fixed an unsorted include.
Remove unused includes.
2004-05-01 18:43:00 +00:00
Bruce Evans
e336e1d48a Reduce differences with cy_pci.c: add a description of this file, and
don't use too many tabs in declarations.

Attempt to complete KNFization of this file (1 more indentation fix).
2004-05-01 18:42:14 +00:00
Bruce Evans
60792a34e9 Adjust pathnames for the move from i386/isa to dev/cy.
Adjust staticness and a variable name for the split of cy.c into cy.c and
cy_isa.c.  Use the new header required for the split to avoid repeating
declarations in cy_pci.c.
2004-05-01 18:09:16 +00:00
Bruce Evans
8d40686c71 New header for exporting declarations of things not closely related to
hardware.  A couple of the declarations were misplaced in cy_pci.c, and
cy_isa.c needs a couple more.  The exported interfaces should be cleaner.
2004-05-01 17:44:03 +00:00
Bruce Evans
fa87af7f75 Removed bits related to isa configuration. These have been moved to
cy_isa.c via a repo-copy of this file (except for some static declarations
which will become non-static in a new header).
2004-05-01 17:21:07 +00:00
Bruce Evans
89d1707fe2 Remove bits not related to isa configuration. This file was repo-copied
from cy.c.
2004-05-01 17:10:23 +00:00
Scott Long
f5a923258b Correctly test *Reply_Ptr in ASR_resetIOP(). Thanks to dhartmei for pointing
this out.
2004-05-01 06:32:01 +00:00
Scott Long
6021732ae8 Re-indent some silly sub-blocks in asr_attach(). 2004-05-01 06:12:58 +00:00
Scott Long
6f4409dd10 Remove ASR_get_sc() and reference the softc in the dev_t. For some nefarious
reason, the I2O protocol requires knowledge of all I2O devices in the system,
so we can't get rid of the evil linked-list of softc's yet.
2004-05-01 05:56:57 +00:00
Scott Long
68cf1a90b4 Remove the DOMINO and MODE0 device attachments. They never did anything.
Remove a bunch of obfuscating macros.
2004-05-01 05:19:39 +00:00
Scott Long
ec0b2af03f More whitespace style cleanups, also remove unneeded (void *) casts for bzero(). 2004-05-01 03:06:54 +00:00
Scott Long
6f2cb1c2f2 Many more style cleanups. Switch complex macros to being inline functions.
Put @includes in a better spot.  Fix many cases of 2 space indents and spaces
between a function name and the parens.  Use KASSERT instead of a home-rolled
ASSERT.  Remove some undeeded caddr casts.
2004-05-01 02:27:06 +00:00
Scott Long
cff5a08d74 Get rid of a bunch of useless macros. STATIC becomes static, INLINE becomes
__inline where appropriate and gets nuked elsewhere, IN/OUT/INOUT go away.
Reformat code affected by this.
2004-05-01 01:25:05 +00:00
Doug Ambrisko
33c5911242 Some enhancements and bug fix.
-  Define option FORCECONSPEED to force the serial console to
        be CONSPEED.  I've run into a lot of boards in which
        the detect for prior speed doesn't work and ends up with
        broken console since it is at the wrong speed.
     -  If a serial port is marked as a console, but console=vidconsole
        and if the serial ports doesn't exist it will be probed and
        attached at a 8250 chip.  Then writes to that will freeze the
        system.
     -  Add an option flags 0x400000 to mark this as a potential
        comconsole in-case the one flaged with 0x10 does not exist
        in the system.

This makes it easier to deploy on systems with one or two serial ports.

Obtained from:	IronPort
2004-04-30 21:16:52 +00:00
Bill Paul
a1788fb41e Small timer cleanups:
- Use the dh_inserted member of the dispatch header in the Windows
  timer structure to indicate that the timer has been "inserted into
  the timer queue" (i.e. armed via timeout()). Use this as the value
  to return to the caller in KeCancelTimer(). Previously, I was using
  callout_pending(), but you can't use that with timeout()/untimeout()
  without creating a potential race condition.

- Make ntoskrnl_init_timer() just a wrapper around ntoskrnl_init_timer_ex()
  (reduces some code duplication).

- Drop Giant when entering if_ndis.c:ndis_tick() and
  subr_ntorkrnl.c:ntoskrnl_timercall(). At the moment, I'm forced to
  use system callwheel via timeout()/untimeout() to handle timers rather
  than the callout API (struct callout is too big to fit inside the
  Windows struct KTIMER, so I'm kind of hosed). Unfortunately, all
  the callouts in the callwhere are not marked as MPSAFE, so when
  one of them fires, it implicitly acquires Giant before invoking the
  callback routine (and releases it when it returns). I don't need to
  hold Giant, but there's no way to stop the callout code from acquiring
  it as long as I'm using timeout()/untimeout(), so for now we cheat
  by just dropping Giant right away (and re-acquiring it right before
  the routine returns so keep the callout code happy). At some point,
  I will need to solve this better, but for now this should be a suitable
  workaround.
2004-04-30 20:51:55 +00:00
Søren Schmidt
6230b63c5a Do at better job at unit numbering. 2004-04-30 18:49:03 +00:00
Thomas Moestl
e501d96926 Remove the sio EBus attachment, which never worked with an unpatched
driver because sio(4) uses ISA-specific functions. uart(4) has full
support for the respective hardware and should be used instead.
2004-04-30 17:25:47 +00:00
Søren Schmidt
ad452ba45c Spring cleanup of macros 2004-04-30 16:21:34 +00:00
Brian Feldman
35ce92de2d Don't do malloc(M_WAITOK) for sound buffers while locks are held. 2004-04-29 02:51:59 +00:00
Bill Paul
0584cf1978 Remove code that fiddles with Giant in ndis_ticktask() that snuck in
during previous commit.
2004-04-28 17:06:18 +00:00
Thomas Moestl
fe2c61013d Remove the EBus stopgap of r1.248; a proper fix is in place now. 2004-04-28 13:43:11 +00:00
Søren Schmidt
1e311c1849 Reduce the time spent looking for devices on channels that return
what looks like garbage.
2004-04-27 15:52:08 +00:00
MIHIRA Sanpei Yoshiro
3fa30d6c9a Sync to 1.172 of usbdevs 2004-04-27 13:56:39 +00:00
MIHIRA Sanpei Yoshiro
2137eb2fa7 Add support DELL BC02 Bluetooth USB Adapter(TrueMobile 300)
PR:		kern/65777
Submitted by:	Patrick Hurrelmann <outi@bytephobia.de>
2004-04-27 13:55:26 +00:00
Poul-Henning Kamp
71f3747e71 Add the ability to avoid repetition of s.... sequences with a '.' 2004-04-27 13:09:21 +00:00