Commit Graph

15817 Commits

Author SHA1 Message Date
Lukas Ertl
92fb2d84f5 Add support for another 3G card and update man page accordingly.
The patch from the PR was a little outdated w/regards to the
Vodafone vendor string.

PR:            kern/106033
Submitted by:  Volker Werth <volker_AT_vwsoft.com>
MFC in:        3 days
2007-02-04 22:14:18 +00:00
Jean-Sébastien Pédron
5a10830e1a Synaptics TouchPad seems to go back to Relative Mode after the call
to set_controller_command_byte() call; by issueing a Read Mode Byte
command, the touchpad is in Absolute Mode again.

This problem occursed at least on Asus V6V laptops.
2007-02-04 12:47:52 +00:00
Joel Dahl
5bcbb3c5e8 Orion originally wrote and added these files in 2002/2003, so with his
approval, change the copyright statement to point at him instead of
"FreeBSD, Inc".

Encouraged by:	rwatson
Reviewed by:	imp
Discussed with and approved by:	orion
2007-02-04 06:52:33 +00:00
Florent Thoumie
2b5fb13e20 Fix build (sc->dev => sc->sc_dev). 2007-02-03 21:11:11 +00:00
Rink Springer
cece26a63a Add support for the NetCell NC3000/5000 series SATA RAID cards.
Reviewed by:	sos
Approved by:	imp (mentor)
MFC after:	1 week
2007-02-03 20:12:00 +00:00
Warner Losh
df96f93d49 It turns out we were mallocing too early, so move the allocation so we
don't leak.
2007-02-03 19:11:09 +00:00
Warner Losh
5f1413947b Fix memory leak of devinfop
PR: 108719
Submitted by: Antoine Brodin
2007-02-03 16:41:55 +00:00
Warner Losh
f254d5b0d1 Fix possible memory leaks of devinfo.
PR: 108719
Submitted by: Antoine Brodin
2007-02-03 16:38:32 +00:00
Warner Losh
881c241ce3 Fix non-use, but not memory leak, of devinfop. Set the device's
description here.  The fix in the PR isn't necessary at all for memory
leaks, but we weren't setting the device description.

While I'm here, remove some of the obfuscating macros in attach.

PR: 108719
2007-02-03 16:33:47 +00:00
Warner Losh
9b4f44b31e Fix memory leak of devinfo. The leak itself was documented in
PR/108719, but there's a simpler fix: free it after it is used, and
then get rid of the redundant frees this causes.  Other leaks in this
PR not yet fixed.

While I'm here, remove NetBSD/OpenBSD code and some of the portability
#defines that were getting in the way of understanding this code.  The
devinfo bug was harder to spot because one needed to know that
device_set_desc_copy() was used inside of one of them (one that didn't
take an argument!).

Prefer device_printf(sc->sc_dev, "...") to printf("%s:...",
device_get_nameunit(sc->sc_dev)).  This saves almost 300 bytes.

PR: 108719
Submitted by: Antoine Brodin
2007-02-03 16:19:28 +00:00
Max Laier
fe46dc7031 Add ALTQ support for aue(4).
Tested by:	Greg Hennessy, Volker
MFC after:	1 week
2007-02-03 13:53:22 +00:00
Warner Losh
8ccfb0607f We need to free the ivars for the child that we just deleted. 2007-02-03 07:09:36 +00:00
John Baldwin
f50589d755 Add constants for the PCIY_VENDOR (vendor-specific), PCIY_DEBUG (EHCI
debug port), and PCIY_EXPRESS (PCI-express) capabilities.
2007-02-02 19:48:25 +00:00
Joel Dahl
155414e2e4 Remove dead email address.
Requested by:	luigi
2007-02-02 13:44:09 +00:00
Joel Dahl
a0afd24d9c Clean up the BSD license to match the preferred license in
/usr/share/examples/etc/bsd-style-copyright.  I've fixed a
few minor wording and formatting differences.

Approved by:	luigi, Hannu Savolainen <hannu@opensound.com>
2007-02-02 13:39:20 +00:00
Joel Dahl
262e034444 Add a standard BSD license to these files.
Discussed with:	rwatson
Approved by:	luigi
2007-02-02 13:33:35 +00:00
Kevin Lo
b0ea96df61 Use bus_get_dma_tag() so iwi(4) works on platforms requiring it.
Approved by: cognet
2007-02-02 05:17:18 +00:00
Ariff Abdullah
9e4c8259a3 Fix huge memory leak within sound buffer (during channel destruction,
buffer resizing, etc.) that was here since eon. Free all (unmanaged)
allocated buffer through sndbuf_destroy() in case we forgot to call
sndbuf_free(). For a managed buffer (mostly hw specific managed buffer),
either provide CHANNEL_FREE() method with appropriate return value to
invoke semi-automatic sndbuf_free() or simply do it on their own. If
everything is failed, sndbuf_destroy() will come to the rescue as a
final measure.

MFC after:	3 days
2007-02-01 09:46:03 +00:00
Ariff Abdullah
e444a20971 Fix apparent memory leak (during vchan destruction) that was here
since eon.
2007-02-01 09:30:01 +00:00
Andrew Gallatin
dce01b9b27 - Add 99% of a callout based watchdog. The remaining 1% is waiting
for pci_cfg_restore() to be exported.  It was tested using a
  hackily accessed pci_cfg_restore().

- Add ifmedia_removeall() to mxge_detach() in order to stop leaking
  an ifaddr

- Fix a small acounting bug introduced by the locking code shuffle
  which could cause spurious watchdog resets now that we have a
  watchdog.

Sponsored by: Myricom
2007-01-31 19:53:36 +00:00
Andrew Gallatin
c265717682 destroy busdma maps even if they are NULL, so as to avoid leaking
busdma tags.
2007-01-31 15:47:44 +00:00
Andrew Gallatin
a98d6cd71c Abandon using sleepable locks in favor of mutexes for mxge's if_ioctl
locking in preparation for adding a watchdog handler (callouts must
not use sleepable locks).  This required shuffling memory and
interrupt allocation to the attach routine rather than if_ioctl so as
to avoid potential sleeps while bringing up the interface.
2007-01-31 15:29:31 +00:00
Joel Dahl
fcacf52ec7 Put #ifndef... after the license.
Approved by:	ariff
2007-01-31 12:10:48 +00:00
Joel Dahl
22821dadfc s/WHETHERIN/WHETHER IN/ & s/THEPOSSIBILITY/THE POSSIBILITY/ in the
license text.

Approved by:	imp
2007-01-31 08:53:45 +00:00
Andrew Gallatin
a82c2581b5 Minor updates:
- initialize ifq_drv_maxlen correctly
- mark the interface as jumbo capable
- keep stats on the number of times the hw transmit queue filled and
  was restarted.
2007-01-30 08:39:44 +00:00
Joel Dahl
48351eaf73 Clean up the BSD license to match the preferred license in
/usr/share/examples/etc/bsd-style-copyright.  I've fixed a
few minor wording and formatting differences.

Approved by:	matk, Hannu Savolainen <hannu@opensound.com>
Reviewed by:	imp
2007-01-28 20:38:07 +00:00
Takanori Watanabe
c5286e1196 Add support for serial communication with Windows CE based Handheld Computer.
Obtained from:	NetBSD
2007-01-28 11:56:14 +00:00
Takanori Watanabe
224b9013e8 Add some vendor IDs mainly from NetBSD. 2007-01-28 10:46:32 +00:00
Ariff Abdullah
5430d30e44 Add speaker control for HP xw4300. This hardware doesn't respond to
unsolicited pin sense event and need manual control to turn off speaker
volume while attaching headphone.

Tested by:		Ingeborg Hellemo <Ingeborg.Hellemo@cc.uit.no>

Disable global Acer + ALC883 headphone automute settings since there are
few models that does not respect this and causing broken behaviour.

Reported/Tested by:	Pavel Argentov <argentoff@rtelekom.ru>
2007-01-28 03:16:54 +00:00
Remko Lodder
7fd6875fc5 Add the SMART command to the ATA instruction set.
When the disk has an error, it will now print SMART
instead of 'Unknown CMD'.

PR:		kern/93368
Submitted by:	Garry Belka <garry at NetworkPhysics dot COM>
Approved by:	sos
2007-01-27 21:15:59 +00:00
Ariff Abdullah
d130d86519 Rearrange locking order to avoid LOR (cat /dev/midistat).
Reported by:	rodrigc
2007-01-27 15:55:59 +00:00
Ariff Abdullah
b9ba7b9e78 Massive inlining cleanups/removal to make it survive on WARNS=2. 2007-01-27 13:30:19 +00:00
Ariff Abdullah
a12b5a0728 Reduce maximum DMA segments from 128 to 64. We don't need more than that. 2007-01-27 07:35:05 +00:00
Ariff Abdullah
f39ee7ef2e Total DMA segments should include total number of record channel(s). 2007-01-26 23:53:56 +00:00
Ariff Abdullah
b1d922169b Fix forever broken ua_chan_setblocksize() uninitialized return value
which causing divide by zero panic in other places (notably chn_sync()).
2007-01-26 19:14:41 +00:00
Ariff Abdullah
3ad47bdd54 Sync uaudio_sndstat_prepare_pcm() output with sndstat_prepare_pcm() to get
simmilar (debugging) output.
2007-01-26 19:06:17 +00:00
Doug White
e30d3a0c79 Add missing MIIBUS_MEDIAINIT() call. 2007-01-26 17:06:02 +00:00
Doug White
3c3d8e1e45 Collapse 5706C and 5708C PHYs into one entry. ID 0x15 is actually used for
the SERDES PHY on these chips and we want gentbi to pick this up, not brgphy.
2007-01-26 17:05:24 +00:00
Doug White
4a5cd040cb Add support for SERDES PHY configurations. These are commonly found in
blade systems, such as the Dell 1955 and the Intel SBXD132.

Development hardware for this work was provided by Broadcom and iXsystems.
A SBXD132 blade for testing was provided by Iron Systems.
2007-01-26 17:03:51 +00:00
Matt Jacob
325bba15cc Whoops- #ifdef problem caused uninitialized transport. Not horribly
a problem, but caused annoying messages.
2007-01-25 18:02:23 +00:00
Bill Paul
e2bcb489ef The TCP checksum offload handling in the 8111B/8168B and 8101E PCIe can
apparently be confused by short TCP segments that have been manually
padded to the minimum ethernet frame size. The driver does short frame
padding in software as a workaround for a bug in the 8169 PCI devices
that causes short IP fragments to be corrupted due to an apparent
conflict between the hardware autopadding and hardware IP checksumming.

To fix this, we avoid software padding for short TCP segments, since
the hardware seems to autopad and checksum these correctly (even the
older 8169 NICs get these right). Short UDP packets appear to be
handled correctly in all cases. This should work around the IP header
checksum bug in the 8169 while not tripping the TCP checksum bug in
the 8111B/8168B and 8101E.
2007-01-25 17:30:30 +00:00
Nate Lawson
7826bf983c Add missing function trace for debug prints. 2007-01-23 07:20:44 +00:00
Scott Long
95a8bcd854 Remove a PCI ID entry that conflicts with the AMR driver. 2007-01-23 02:47:33 +00:00
Pyun YongHyeon
d01fac16ac It seems that enabling Tx and Rx before setting descriptor DMA
addresses shall access invalid descriptor DMA addresses on PCIe
hardwares and then panicked the system.
To fix it set descriptor DMA addresses before enabling Tx and Rx
such that hardware can see valid descriptor DMA addresses. Also
set RL_EARLY_TX_THRESH before starting Tx and Rx.

Reported by:	steve.tell AT crashmail DOT de
Tested by:	steve.tell AT crashmail DOT de
Obtained from:	NetBSD
MFC after:	1 week
2007-01-23 00:44:12 +00:00
Matt Jacob
f9734398e3 Clean up some of the various platform and release specific dma tag
stuff so it is centralized in isp_freebsd.h.

Take out PCI posting flushed in qla2100/2200 register reads except for
2100s.
2007-01-23 00:02:29 +00:00
John Baldwin
5fe82bca57 Expand the MSI/MSI-X API to address some deficiencies in the MSI-X support.
- First off, device drivers really do need to know if they are allocating
  MSI or MSI-X messages.  MSI requires allocating powerof2() messages for
  example where MSI-X does not.  To address this, split out the MSI-X
  support from pci_msi_count() and pci_alloc_msi() into new driver-visible
  functions pci_msix_count() and pci_alloc_msix().  As a result,
  pci_msi_count() now just returns a count of the max supported MSI
  messages for the device, and pci_alloc_msi() only tries to allocate MSI
  messages.  To get a count of the max supported MSI-X messages, use
  pci_msix_count().  To allocate MSI-X messages, use pci_alloc_msix().
  pci_release_msi() still handles both MSI and MSI-X messages, however.
  As a result of this change, drivers using the existing API will only
  use MSI messages and will no longer try to use MSI-X messages.
- Because MSI-X allows for each message to have its own data and address
  values (and thus does not require all of the messages to have their
  MD vectors allocated as a group), some devices allow for "sparse" use
  of MSI-X message slots.  For example, if a device supports 8 messages
  but the OS is only able to allocate 2 messages, the device may make the
  best use of 2 IRQs if it enables the messages at slots 1 and 4 rather
  than default of using the first N slots (or indicies) at 1 and 2.  To
  support this, add a new pci_remap_msix() function that a driver may call
  after a successful pci_alloc_msix() (but before allocating any of the
  SYS_RES_IRQ resources) to allow the allocated IRQ resources to be
  assigned to different message indices.  For example, from the earlier
  example, after pci_alloc_msix() returned a value of 2, the driver would
  call pci_remap_msix() passing in array of integers { 1, 4 } as the
  new message indices to use.  The rid's for the SYS_RES_IRQ resources
  will always match the message indices.  Thus, after the call to
  pci_remap_msix() the driver would be able to access the first message
  in slot 1 at SYS_RES_IRQ rid 1, and the second message at slot 4 at
  SYS_RES_IRQ rid 4.  Note that the message slots/indices are 1-based
  rather than 0-based so that they will always correspond to the rid
  values (SYS_RES_IRQ rid 0 is reserved for the legacy INTx interrupt).
  To support this API, a new PCIB_REMAP_MSIX() method was added to the
  pcib interface to change the message index for a single IRQ.

Tested by:	scottl
2007-01-22 21:48:44 +00:00
Marius Strobl
c2175ff5ca Change the remainder of the drivers for DMA'ing devices enabled in the
sparc64 GENERIC and the sound device drivers known working on sparc64
to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid
of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4),
stge(4) and ti(4) these changes are runtime tested (unless I booted up
the wrong kernels again...).
2007-01-21 19:32:51 +00:00
Marius Strobl
e54f674652 Correct a logic bug in the previous change. 2007-01-21 19:28:00 +00:00
Scott Long
089292ab0b The multicast hash table has 8 slots in the BCE hardware, not 4 slots like
the BGE hardware.  Adapt the driver for this.

Submitted by: Mike Karels
MFC After: 3 days
2007-01-20 17:05:12 +00:00
Marius Strobl
8dbf0223f3 Add macros for the individual divisor bits as some MC146818A-compatible
chips also use them for different purposes.
2007-01-20 14:57:51 +00:00
Marius Strobl
0c7d35d0b9 Remove BUS_DMA_WAITOK from bus_dma_tag_create() invocations as it's
no valid flag there.
2007-01-20 14:19:29 +00:00
Marius Strobl
0222c13479 Add front-ends for the 'lebuffer' variants found on some SBus cards.
These are shared-memory variants based on Am79C90-compatible chips
that apart from the missing DMA engine are similar to the 'ledma'
variant including using a (pseudo-)bus/device for the buffer that
the actual LANCE device hangs off from. The performance of these is
close to that of the 'ledma' one, like expected at a few times the
CPU load though.
2007-01-20 12:53:30 +00:00
Marius Strobl
17792f45fb For setting the port PCnet chips must be powered down or stopped and
unlike documented may not take effect without an initialization. So
don't invoke (*sc_mediachange) directly in lance_mediachange() but
go through lance_init_locked(). It's suboptimal to impose this for
all chips but given that besides the affected PCI bus front-end the
only other front-end which supports media selection is and likely
ever will be the 'ledma' front-end I see not enough reason to break
the in-driver API for this (though one could argue both ways here).
2007-01-20 10:47:16 +00:00
Marius Strobl
d2255d0286 Use bus_get_dma_tag() to obtain the parent DMA tag so le(4) works on
platforms requiring this.
2007-01-20 09:57:09 +00:00
Matt Jacob
8ada63303e Grumble- let a linux-ism slip in and had an llx which
then choked on a 64 bit platforms. Oops.
2007-01-20 07:38:31 +00:00
Matt Jacob
6c81a0aecb MFP4: Move default setting to the end of isp_reset instead of the
front of isp_init so we can read NVRAM even if we're role ISP_NONE.
Prepare for reintroduction of channels (for FC) for N-Port
Virtualization.

Fix a botch in handle assignment that caused us to nuke one device
when a new one arrives and end up with two devices with the same
identity in the virtual target mapping table.
2007-01-20 04:00:21 +00:00
Marius Strobl
9bcdfcae43 - In miibus_attach() remove IFM_IMASK from the dontcare_mask of the
ifmedia_init() invocation. IFM_IMASK makes only sense here when all of
  the maxium of 32 PHYs on each one MII bus support disjoint sets of media,
  which generally isn't the case (though it would be nice if we had a way
  to let NIC drivers indicate that for the few card models where the PHY
  configuration is known/fixed and IFM_IMASK actually makes sense).
- Add and use a miibus_print_child() for the bus_print_child method which
  additionally prints the PHY number (which actually is the PHY address)
  so one can figure out the media instance <-> PHY number mapping from the
  PHY driver attach output. This is intented to be usefull in situations
  where the addresses of the PHYs on the bus are known (f.e. of internal/
  integrated PHYs) so one can feed the appropriate media instance number
  to ifconfig(8) (with the upcoming change for ifconfig(8)).
  This is more or less inspired by the NetBSD mii_print().
2007-01-20 00:55:03 +00:00
Marius Strobl
b8a5d0481a - Don't set MIIF_NOISOLATE so ukphy(4) can be used in configurations with
multiple PHYs. In case some PHYs currently driven by ukphy(4) exhibit
  problems when isolating due to incomplete implementations or silicon bugs
  we'll need to add specific drivers for these. Looking at NetBSD and
  OpenBSD I don't expect problems here though (quite the contrary; we still
  seem to set MIIF_NOISOLATE without good reason in a bunch of PHY drivers).
- Fix a style(9) whitespace nit.
2007-01-20 00:52:29 +00:00
John Baldwin
6eb7ebfe25 - Change the PCI-X registers constants to be relative to the PCI-X PCI
capability rather than hardcoded offsets for a particular card.  While
  I'm here, expand the constants some.
- Change the ahd(4) driver to use pci_find_extcap() to locate the PCI-X
  capability to keep up with the first change.

Reviewed by:	scottl, gibbs (earlier version)
2007-01-19 22:37:52 +00:00
Warner Losh
7e2ff8bbff Cope gracefully with device_get_children returning an error.
Obtained from: Hans Petter Selasky
P4: http://perforce.freebsd.org/chv.cgi?CH=112957
2007-01-19 08:49:28 +00:00
Marius Strobl
97202af2dc - Add a uart_rxready() and corresponding device-specific implementations
that can be used to check whether receive data is ready, i.e. whether
  the subsequent call of uart_poll() should return a char, and unlike
  uart_poll() doesn't actually receive data.
- Remove the device-specific implementations of uart_poll() and implement
  uart_poll() in terms of uart_getc() and the newly added uart_rxready()
  in order to minimize code duplication.
- In sunkbd(4) take advantage of uart_rxready() and use it to implement
  the polled mode part of sunkbd_check() so we don't need to buffer a
  potentially read char in the softc.
- Fix some mis-indentation in sunkbd_read_char().

Discussed with:	marcel
2007-01-18 22:01:19 +00:00
Marius Strobl
3284c150d2 - Probe the CS4231 in USIII machines.
- Remove unused variables. [1]

Reported by:	Coverity Prevent (CID 700, 701) [1]
2007-01-18 19:19:19 +00:00
Marius Strobl
420a38dd4b Wrap the EISA-specific parts of the dpt(4) and si(4) back-ends in
the newly added DEV_EISA. This is done so that these back-ends can
be compiled on platforms not providing in{b,w,l}()/out{b,w,l}() and
friends (but may wish to use them together with bus front-ends other
than the EISA one).
2007-01-18 13:33:36 +00:00
Marius Strobl
2f11f3372a On sparc64 also use the fillw() this header provides for ia64 so
the sparc64 MD code doesn't need to provide a memsetw() along with
the ISA compat cruft.
2007-01-18 13:08:08 +00:00
Markus Brueffer
740ae2a34c Fix a buffer overflow iff USB_DEBUG is set, hw.usb.ums.debug is > 5 and the
total size of all input reports is < 6.

PR:		usb/106435
Submitted by:	Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Approved by:	emax (mentor)
MFC after:	3 days
2007-01-17 03:50:45 +00:00
Scott Long
875d25860a Add PCI Id's for upcoming controllers.
Obtained from: LSI Corp.
MFC After: 3 days
2007-01-17 02:58:41 +00:00
Marius Strobl
d3fc12aff9 - Merge sys/sparc64/creator/creator_upa.c into sys/dev/fb/creator.c.
The separate bus front-end was inherited from the OpenBSD creator(4),
  which at that time had a mainbus(4) (for USI/II machines, which use
  an UPA interconnection bus as the nexus) and an upa(4) (for USIII
  machines, which use a subordinate/slave UPA bus hanging off from the
  Fireplane/Safari interconnection bus) front-end. With FreeBSD and
  newbus there is/will be no need to have two separate bus front-ends
  for these busses, so we can easily coallapse the shared front-end
  and the back-end into a single source file (note that the FreeBSD
  creator_upa.c was misnomer anyway; based on what it actually attached
  to that should have been creator_nexus.c), actually OpenBSD meanwhile
  also has moved to a shared front-end and a single source file. Due
  to the low-level console support creator.c also wasn't free from bus
  related things before.
  While at it, also split sys/sparc64/creator/creator.h into a
  sys/dev/fb/creatorreg.h that only contains register macros and move
  the structures to the top of sys/dev/fb/creator.c as suggested by
  style(9) so creator(4) is no longer scattered over two directories.
- Use OF_decode_addr()/sparc64_fake_bustag() to obtain the bus tags and
  handles for the low-level console support instead of hardcoding
  support for AFB/FFB hanging off from nexus(4) only. This is part 2/4
  of allowing creator(4) to work in USIII machines (which have a UPA
  bus hanging off from the Fireplane/Safari bus reflected by the nexus),
  which already makes it work as the low-level console there.
- Allocate resources in the bus attach routine regardless of whether
  creator(4) is used as for the low-level console and thus the required
  bus tags and handles have been already obtained or not so the resources
  are marked as taken in the respective RMAN.
- For both obtaining the bus tags and handles for the low-level console
  support as well as allocating the corresponding resources in the
  regular bus attach routine don't bother to get all for the maximum of
  24 register banks but only (for) the two tag/handle pairs required for
  providing the video interface for syscons(4) support. If we can't
  allocate the rest of them just limit the memory range accessible via
  creator_fb_mmap() accordingly.
- Sanity check the memory range spanned by the first and last resources
  and the resources in between as far as possible, as the XFree86/Xorg
  sunffb(4) expects to be able to access the whole region, even though
  the backing resources are actually non-continuous. Limit and check
  the memory range accessible via creator_fb_mmap() accordingly.
- Reduce the size of buffers for OFW properties to what they actually
  need to hold.
- Rename some tables to creator_<foo> for consistency.
- Also for the sizes in the creator_fb_mmap() mapping table entries use
  macros for consistency, add macros for the remaining register banks
  for completeness.
2007-01-16 21:08:22 +00:00
Marius Strobl
b4b958792b o In re_newbuf() and re_encap() if re_dma_map_desc() aborts the mapping
operation as it ran out of free descriptors or if there are too many
  segments in the first place, call bus_dmamap_unload() in order to
  unload the already loaded segments.
  For trying to map the defragmented mbuf (chain) in re_encap() this
  introduces re_dma_map_desc() setting arg.rl_maxsegs to 0 as a new
  failure mode. Previously we just ignored this case, corrupting our
  view of the TX ring.
o In re_txeof():
  - Don't clear IFF_DRV_OACTIVE unless there are at least 4 free TX
    descriptors. Further down the road re_encap() will bail if there
    aren't at least 4 free TX descriptors, causing re_start() to
    abort and prepend the dequeued mbuf again so it makes no sense
    to pretend we could process mbufs again when in fact we won't.
    While at it replace this magic 4 with a macro RL_TX_DESC_THLD
    throughout this driver.
  - Don't cancel the watchdog timeout as soon as there's at least one
    free TX descriptor but instead only if all descriptors have been
    handled. It's perfectly normal, especially in the DEVICE_POLLING
    case, that re_txeof() is called when only a part of the enqueued
    TX descriptors have been handled, causing the watchdog to be
    disarmed prematurely.
o In re_encap():
  - If m_defrag() fails just drop the packet like other NIC drivers
    do. This should only happen when there's a mbuf shortage, in which
    case it was possible to end up with an IFQ full of packets which
    couldn't be processed as they couldn't be defragmented as they
    were taking up all the mbufs themselves. This includes adjusting
    re_start() to not trying to prepend the mbuf (chain) if re_encap()
    has freed it.
  - Remove dupe initialization of members of struct rl_dmaload_arg to
    values that didn't change since trying to process the fragmented
    mbuf chain.
    While at it remove an unused member from struct rl_dmaload_arg.
o In re_start() remove a abandoned, banal comment. The corresponding
  code was moved to re_attach() some time ago.

With these changes re(4) now survives one day (until stopped) of
hammering out packets here.

Reviewed by:	yongari
MFC after:	2 weeks
2007-01-16 20:35:23 +00:00
John Baldwin
abc007f085 Disable MSI for the Intel 845 and 865 chipsets and update comment for
E7210 to note it is the same devid as the 875 chipset.
2007-01-16 19:44:45 +00:00
Jung-uk Kim
b2430c5000 Correct driver_t brgphy_driver, which was forgotten from the last commit. 2007-01-16 17:48:57 +00:00
John Baldwin
8bbeb21223 Fix the subvendor ID for PCI-PCI bridges.
- Retire the PCI_SUB*_1 constants and don't try to read a subvendor ID out
  of them.  There isn't a standard subvendor ID field for PCI-PCI bridges.
  Instead, the dword at offset 0x34 is actually mostly reserved except for
  the LSB which is the capabilities pointer.
- Add support for the PCI-PCI bridge subvendor ID capability (13) and use
  it to set the subvendor ID for PCI-PCI bridges.

MFC after:	 1 month
2007-01-16 17:04:42 +00:00
Joel Dahl
5c92405025 Fix typo in a comment. 2007-01-16 12:27:13 +00:00
Jung-uk Kim
900e97a881 Move MII model and revision into softc. 2007-01-16 00:52:26 +00:00
Jung-uk Kim
d69e0bb92e - Move Ethernet@WireSpeed and jumbo frame configurations to separate
functions.  The idea is taken from OpenBSD.
- Set/clear jumbo frame configurations for bge(4).
- Re-add BCM5750 PHY workaround for bce(4), which was mistakenly removed
from the previous commit.
2007-01-15 22:21:44 +00:00
Jung-uk Kim
5ee49a3a58 - Fix BCM5754 support found in Dell PowerEdge SC440.
- Move some PHY bug detections from brgphy.c to if_bge.c.
- Do not penalize working PHYs.
- Re-arrange bge_flags roughly by their categories.
- Fix minor style(9) nits.

PR:		kern/107257
Obtained from:	OpenBSD
Tested by:	Mike Hibler <mike at flux dot utah dot edu>
2007-01-15 21:43:43 +00:00
Nate Lawson
bd82680347 Clean up some debug prints from last commit and move one under boot -v.
Reminded by:	bruno
2007-01-15 18:17:36 +00:00
Scott Long
df8ed58dc5 Add a missing mutex unlock to an error path.
Submitted by: Yuxiang Luo
PR: 107943
2007-01-15 16:22:20 +00:00
Sam Leffler
c5bebabde1 add compat shim for ath_hal_isgsmsku until the new hal gets committed 2007-01-15 04:26:19 +00:00
Sam Leffler
517eabc6fa save changes for handling 5416/5418 parts 2007-01-15 01:17:44 +00:00
Sam Leffler
724c193aed Add initial support for 900MHz cards like the Ubiquiti SR9:
o eliminate assumptions that half/quarter rate channels on exist in 11a
o handle frequency mapping between hal and net80211; hal gives us freq's
  in the range 2422..2437 that we remap

MFC after:	1 month
2007-01-15 01:15:57 +00:00
Bruce Evans
2e34ccc7fe Fixed a panic in the probe. The memory resource was accessed after
releasing it.  This seems to have worked until a few days ago, but
now the memory is unmapped.
2007-01-13 11:00:56 +00:00
John Baldwin
22bf1c7fb0 - Add a new flag to the PCI-PCI driver to disable MSI on devices behind the
bridge if it doesn't pass MSI messages up correctly.  We set the flag
  in pcib_attach() if the device ID is disabled via a PCI quirk.
- Disable MSI for devices behind the AMD 8131 HT-PCIX bridge.  Linux has
  the same quirk.

Tested by:	no one despite repeated calls for testers
2007-01-13 04:57:37 +00:00
John Baldwin
53a8becd31 - Add a locked variant of bce_ifmedia_upd() for use within the driver and
add missing locking to bce_ifmedia_upd().
- While I'm here, unexpand an instance of LIST_FOREACH().

MFC after:	2 weeks
Reviewed by:	scottl
2007-01-13 04:35:15 +00:00
Ariff Abdullah
95af1064dc Fix headphone/speaker automute for [1] Acer Aspire 5050 and [2] MSI MS-1034
laptops.

Tested by:	[1] Lion G. <liontanker@hotmail.com>
          	[2] Pietro Cerutti <pietro.cerutti@gmail.com>

Specialized mixer initialization for STAC9221, much like STAC9220.

Tested by:	Devon H. O'Dell
2007-01-13 00:24:44 +00:00
Marius Strobl
2e0b466321 After another thought there is another nail for the mii_phy_dev_probe()-
hammer.
2007-01-13 00:17:39 +00:00
Marius Strobl
2bf52b991f Remove mii_media_from_bmcr(); all previous users have been converted to
use mii_phy_add_media()/mii_phy_setmedia().
2007-01-13 00:14:45 +00:00
Marius Strobl
75b1a030f1 - Take advantage of mii_phy_dev_probe() and mii_phy_setmedia().
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
  flag currently triggers nothing but hopefully will be respected by
  mii_phy_setmedia() later on.
- Use MII_ANEGTICKS instead of 5.
- Remove an unused macro.
- Fix some whitespace nits.

MFC after:	1 week
2007-01-13 00:06:41 +00:00
Marius Strobl
d1b9b18869 - Take advantage of mii_phy_dev_probe().
- In exphy_service() for the MII_TICK case don't bother to check whether
  the currently selected media is of type IFM_AUTO as auto-negotiation
  doesn't need to be kicked anyway.
- Remove #if 0'ed unapplicable code.
- Fix some whitespace nits.

MFC after:	1 week
2007-01-12 23:17:43 +00:00
Marius Strobl
a9ddce9830 Set MIIF_HAVE_FIBER and add IFM_100_FX media when the AC_MCTL_FX_SEL
and thus the FX_DIS pin indicates fibre media. This is part 1/2 of
adding support for the 100baseFX interface/port of AT-2700 series
adaptors.

Idea from:	NetBSD
MFC after:	1 week
2007-01-12 22:59:38 +00:00
Marius Strobl
0fd495e21f - Correct the AC_MCTL_BYP_PCS constant.
- Correct whitespace nits (use #define<tab>, remove trailing whitespace).
2007-01-12 22:58:04 +00:00
Marius Strobl
3d7c219de9 Use mii_phy_add_media()/mii_phy_setmedia()-compatible media table
indices when manually adding media. Some of these I've missed while
converting drivers to take advantage of said fuctions recently,
others where longstanding bugs.
2007-01-12 22:27:46 +00:00
John Baldwin
77312b5673 Disable MSI for two ServerWorks chipsets. The first is based on a user
report.  The second is blacklisted in Linux.
2007-01-12 21:37:51 +00:00
John Baldwin
854923ae86 Blacklist a few more Intel chipsets re: MSI based on user reports:
E7500 and 855.
2007-01-12 21:30:25 +00:00
John Baldwin
af07bd5661 - Condense the comment for Intel chipset MSI blacklist entries.
- Blacklist the E7210.

PR:		kern/105768 (2)
Reported by:	marcus (2)
2007-01-12 13:33:56 +00:00
John Baldwin
234093730d Add a device ID for the 631xESB/6321ESB SMBus controller.
Submitted by:	Reed A. Cartwright <reed scit.us>
2007-01-11 21:13:27 +00:00
Bill Paul
bb7dfefb45 Fix re_setmulti() so that it works correctly for PCIe chips where
the multicast hash table are in reverse order compared to older
devices.
2007-01-11 20:31:35 +00:00
John Baldwin
85064e683c Various updates to most of the smbus(4) drivers:
- Use printf() and device_printf() instead of log() in ichsmb(4).
- Create the mutex sooner during ichsmb(4) attach.
- Attach the interrupt handler later during ichsmb(4) attach to avoid
  races.
- Don't try to set PCIM_CMD_PORTEN in ichsmb(4) attach as the PCI bus
  driver does this already.
- Add locking to alpm(4), amdpm(4), amdsmb(4), intsmb(4), nfsmb(4), and
  viapm(4).
- Axe ALPM_SMBIO_BASE_ADDR, it's not really safe to write arbitrary values
  into BARs, and the PCI bus layer will allocate resources now if needed.
- Merge intpm(4) and intsmb(4) into just intsmb(4).  Previously, intpm(4)
  attached to the PCI device and created an intsmb(4) child.  Now,
  intsmb(4) just attaches to PCI directly.
- Change several intsmb functions to take a softc instead of a device_t
  to make things simpler.
2007-01-11 19:56:24 +00:00
Xin LI
f662c0c840 Space cleanup. 2007-01-11 03:18:31 +00:00
Xin LI
5411f54447 - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bce_tick() callout.
 - Instead of unconditionally resetting the controller, try to
   skip the reset in case we got a pause frame, like em(4) did.
 - Lock bce_tick() using callout_init_mtx().

Discussed with/Reviewed by:	glebius, scottl, davidch
2007-01-11 03:17:28 +00:00
John Polstra
0fb18ca82e Correct the comment describing the BGE_PCISTATE_PCI_BUSSPEED bit.
It had the sense of the bit reversed.
2007-01-11 01:43:24 +00:00