Commit Graph

21014 Commits

Author SHA1 Message Date
Andrew Thompson
a6eb83193e Silence debug error by default.
PR:		usb/141212
Submitted by:	Hans Petter Selasky
2010-09-02 03:42:26 +00:00
Andrew Thompson
8d8bdb018d We need to grab a node reference count to vap->iv_bss before using it as it is
possible for the node to be replaced and freed at any time by
ieee80211_sta_join1().
2010-09-02 03:28:03 +00:00
Pyun YongHyeon
8c6cd8631f Fix stupid error in r212109 which didn't swap DMA maps. This caused
IOMMU panic on sparc64 under high TX load.
2010-09-02 00:44:05 +00:00
Andrew Thompson
910cb8feb9 Add missing MODULE_VERSION() definitions, this resolves problems around
duplicate module loads.

PR:		usb/125736
Submitted by:	danger, mm
Reviewed by:	hselasky
2010-09-01 23:47:53 +00:00
Pyun YongHyeon
7723fa2e04 Move sis_reset() to sis_initl(). This ensures driver starts with
known good state of controller.
2010-09-01 22:50:11 +00:00
Pyun YongHyeon
d199ef7e0d Avoid controller reinitialization which could be triggered by
dhclient(8) or alias addresses are added.

PR:	kern/87506
2010-09-01 22:16:25 +00:00
Pyun YongHyeon
ae9e8d4935 Do not reinitialize controller whenever promiscuous mode or
allmulti is toggled. Controller does not require reinitialization.
This removes unnecessary controller reinitialization whenever
tcpdump is used.
While I'm here remove unnecessary variable reinitialization.
2010-09-01 22:08:23 +00:00
Pyun YongHyeon
fc58ee15ff Report result of link state change to caller. Previously it always
returned success.
2010-09-01 21:44:36 +00:00
Pyun YongHyeon
d7b57e79e5 Overhaul link state change handling. Previously sis(4) blindly
configured TX/RX MACs before getting a valid link. After that, when
link state change callback is called, it called device
initialization again to reconfigure TX/RX MACs depending on
resolved link state. This hack created several bad side effects and
it required more hacks to not collide with sis_tick callback as
well as disabling switching to currently selected media in device
initialization. Also it seems sis(4) was used to be a template
driver for long time so other drivers which was modeled after
sis(4) also should be changed.

TX/RX MACs are now reconfigured after getting a valid link. Fix for
short cable error is also applied after getting a link because it's
only valid when the resolved speed is 100Mbps.

While I'm here slightly reorganize interrupt handler such that
sis(4) always read SIS_ISR register to see whether the interrupt is
ours or not. This change removes another hack and make it possible
to nuke sis_stopped variable in softc.
2010-09-01 21:42:19 +00:00
Pyun YongHyeon
91c265b83d s/u_intXX_t/uintXX_t/g 2010-09-01 19:53:15 +00:00
Pyun YongHyeon
a629f2b183 bus_dma(9) cleanup.
o Enforce TX/RX descriptor ring alignment. NS data sheet says the
   controller needs 4 bytes alignment but use 16 to cover both SiS
   and NS controllers. I don't have SiS data sheet so I'm not sure
   what is alignment restriction of SiS controller but 16 would be
   enough because it's larger than the size of a TX/RX descriptor.
   Previously sis(4) ignored the alignment restriction.
 o Enforce RX buffer alignment, 4.
   Previously sis(4) ignored RX buffer alignment restriction.
 o Limit number of TX DMA segment to be used to 16. It seems
   controller has no restriction on number of DMA segments but
   using more than 16 looks resource waste.
 o Collapse long mbuf chains with m_collapse(9) instead of calling
   expensive m_defrag(9).
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
   unnecessary callbacks.
 o Initial endianness support.
 o Prefer local alignment fixup code to m_devget(9).
 o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
   these maps in fast TX/RX path. On non-x86 architectures, this is
   very expensive operation and there is no need to do that.
 o Add missing bus_dmamap_sync(9) in TX/RX path.
 o watchdog is now unarmed only when there are no pending frames
   on controller. Previously sis(4) blindly unarmed watchdog
   without checking the number of queued frames.
 o For efficiency, loaded DMA map is reused for error frames.
 o DMA map loading failure is now gracefully handled. Previously
   sis(4) ignored any DMA map loading errors.
 o Nuke unused macros which are not appropriate for endianness
   operation.
 o Stop embedding driver maintained structures into descriptor
   rings. Because TX/RX descriptor structures are shared between
   host and controller, frequent bus_dmamap_sync(9) operations are
   required in fast path. Embedding driver structures will increase
   the size of DMA map which in turn will slow down performance.
2010-09-01 19:33:40 +00:00
Pyun YongHyeon
1d885b48c1 Nuke unnecessary return at the end of function. 2010-09-01 18:41:59 +00:00
Pyun YongHyeon
cc26c0fd68 style(9) - space after keywords. 2010-09-01 18:39:35 +00:00
Pyun YongHyeon
8eca70be71 Remove leading and trailing white spaces.
No functional changes.
2010-09-01 18:28:08 +00:00
Alexander Motin
901c71c704 Increase device reset timeout from 10 to 15 seconds, same as in ahci(4).
Some devices found need about 10-12 seconds to spinup.
2010-09-01 06:43:41 +00:00
Pyun YongHyeon
175f87424f Remove unnecessary atomic operation in bge_poll. bge(4) always
holds a driver lock in the function entry and
memory synchronization is handled by bus_dmamap_sync(9).
2010-08-31 20:56:18 +00:00
Jung-uk Kim
c74dea9cc1 Make sure the interrupt entry point is within the video ROM range. We must
not change interrupt vector if it is not pointing the ROM itself.  Actually,
we just fail shadowing altogether if that is the case because the shadowed
copy will be useless for sure and POST may not be relocatable or useful.
While I'm here, fix a debugging message under bootverbose, really.  r211829
fixed one case but broke another.  Mea Culpa.
2010-08-31 20:21:52 +00:00
Pyun YongHyeon
95a0a340f4 bge_txeof() already checks whether it has to free transmitted mbufs
or not by comparing reported TX consumer index with saved index. So
remove unnecessary check done after freeing transmitted mbufs.
While I'm here nuke unnecessary variable initializations.
2010-08-31 19:59:18 +00:00
Pyun YongHyeon
38cc61518b Handle PAE case correctly. You cannot effectively specify a 4GB
boundary in PAE case so use a 2GB boundary for PAE as suggested by
jhb.

Pointed out by:	jhb
Reviewed by:	jhb
2010-08-31 18:48:09 +00:00
Pyun YongHyeon
5b610048ec Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
tag. All controllers that are not BCM5755 or higher have 4GB
boundary DMA bug. Previously bge(4) used 32bit DMA address to
workaround the bug(r199670). However this caused the use of bounce
buffers such that it resulted in poor performance for systems which
have more than 4GB memory. Because bus_dma(9) honors boundary
restriction requirement of DMA tag for dynamic buffers, having a
separate TX/RX mbuf DMA tag will greatly reduce the possibility of
using bounce buffers. For DMA buffers allocated with
bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
requested memory region crossed the boundary or not.
With this change, only the DMA buffer that crossed the boundary
will use 32bit DMA address. Other DMA buffers are not affected as
separate DMA tag is created for each DMA buffer.
Even if 32bit DMA address space is used for a buffer, the chance to
use bounce buffer is still very low as the size of buffer is small.
This change should eliminate most usage of bounce buffers on
systems that have more than 4GB memory.

More correct fix would be teaching bus_dma(9) to honor boundary
restriction for buffers created with bus_dmamem_alloc(9) but it
seems that is not easy.

While I'm here cleanup bge_dma_map_addr() and remove unnecessary
member variables in bge_dmamap_arg structure.

Tested by:	marcel
2010-08-31 17:33:48 +00:00
Xin LI
08390ba4c9 Drain watchdog callouts before detaching. This prevents a panic while
unloading the kernel module.

Submitted by:	Tom Cough
2010-08-30 21:33:33 +00:00
Xin LI
a806ad4021 Vendor update to version 3.80.06.003 to fix a panic with ZFS when under
heavy I/O load.

Many thanks to LSI for continuing to support FreeBSD.

PR:		kern/149968
Submitted by:	LSI (Tom Couch)
Reported by:	Kai Kockro <kkockro web de>
Tested by:	Kai Kockro, jpaetzel
MFC after:	7 days
2010-08-30 19:15:04 +00:00
Alexander Motin
90400bed63 MFata(4):
Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.
2010-08-28 07:24:45 +00:00
Alexander Motin
bfc8500c34 Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.

Submitted by:	jfv@
MFC after:	1 week
2010-08-28 07:10:51 +00:00
Pyun YongHyeon
dd20cce19a Do not allocate multicast array memory in multicast filter
configuration function. For failed memory allocations, em(4)/lem(4)
called panic(9) which is not acceptable on production box.
igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which
consumed 768 bytes of stack memory which looks too big.

To address these issues, allocate multicast array memory in device
attach time and make multicast configuration success under any
conditions. This change also removes the excessive use of memory in
stack.

Reviewed by:	jfv
2010-08-28 00:34:22 +00:00
Jack F Vogel
f0d5a975b3 Add Intel Cougar Point PCH HD Audio Controller ID
MFC in a week
2010-08-28 00:23:13 +00:00
Pyun YongHyeon
880a50b513 If em(4) failed to allocate RX buffers, do not call panic(9).
Just showing some buffer allocation error is more appropriate
action for drivers. This should fix occasional panic reported on
em(4) when driver encountered resource shortage.

Reviewed by:	jfv
2010-08-28 00:16:49 +00:00
Jack F Vogel
6d23f8741b Add Intel Cougar Point PCH LPC Controller Device IDs
for watchdog support. Also add additional Intel Ibex
Peak (5 Series/3400 Series) PCH IDs.

MFC after a week
2010-08-28 00:09:46 +00:00
Pyun YongHyeon
ad1917be37 Do not call voluntary panic(9) in case of if_alloc() failure.
Reviewed by:	jfv
2010-08-28 00:09:19 +00:00
Pyun YongHyeon
5c8080f0d9 Make sure not to access unallocated stats memory.
Reviewed by:	jfv
2010-08-27 23:50:13 +00:00
Jack F Vogel
dce8a362df Add support for Intel Cougar Point SMBus controller.
MFC afer 1 week
2010-08-27 23:24:08 +00:00
Jung-uk Kim
2b13785931 Fix a debugging message under bootverbose. This address is not linear. 2010-08-25 22:48:18 +00:00
Jung-uk Kim
a73f383ee9 Add an experimental feature to shadow video BIOS. Long ago, this trick was
supported by many BIOSes to improve performance of VESA BIOS calls for real
mode OSes but it is not our intention here.  However, this may help some
platforms where the video ROMs are inaccessible after suspend, for example.
Note it may consume up to 64K bytes of contiguous memory depending on video
controller model when it is enabled.  This feature can be disabled by
setting zero to 'debug.vesa.shadow_rom' loader tunable via loader(8) or
loader.conf(5).  The default is 1 (enabled), for now.
2010-08-25 22:09:02 +00:00
Warner Losh
253953cd5b On second thought, we need to force 16-bit mode 2010-08-25 02:09:07 +00:00
Warner Losh
e94b9f21a8 Prodded by Yongari, add support for Holtek HT80232. Add the device
ID, plus the ability to force '16-bit mode' which really means NE-2000
mode.  Other open source drivers suggest that the Holtek misbehaves if
you allow the 8-bit probe.  Also, all of the PCI chips emulate
NE-2000ish cards, so always force 16-bit mode for memory transfers.

PR:		84202 (patch not used)
2010-08-25 02:03:48 +00:00
Pyun YongHyeon
3ca447da3d Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-08-24 19:41:15 +00:00
Pyun YongHyeon
6a085e6341 vr_init_locked() will stop and reset the controller. Remove
unnecessary vr_stop()/vr_reset() calls.
2010-08-24 18:44:12 +00:00
Pyun YongHyeon
9fb40e0a9b Remove unnecessary controller reinitialization.
CAM filter handling was rewritten long time ago so it should not
require controller reinitialization.

PR:	kern/87506
2010-08-24 18:40:11 +00:00
Pyun YongHyeon
7c45b43651 Add PNP id for Compex RL2000.
I'm not sure whether adding this logical id is correct or not
because Compex RL2000 is in the list of supported hardware list.
I guess the Compex RL2000 could be PCI variant while the controller
in question is ISA controller. It seems PNP compat id didn't match
or it had multiple compat ids so isa_pnp_probe() seemed to return
ENOENT.

PR:	kern/80853
2010-08-24 18:17:40 +00:00
Pyun YongHyeon
820b53e152 Fix a possible unaligned access to savebyte array.
PR:	kern/122195
2010-08-23 21:40:03 +00:00
Pyun YongHyeon
9ae11bbaa6 Implement basic WOL support. Note, not all xl(4) controllers
support WOL. Some controllers require additional 3-wire auxiliary
remote wakeup connector to draw power. More recent xl(4)
controllers may not need the wakeup connector though.
2010-08-23 19:18:50 +00:00
Pyun YongHyeon
ac68109179 Move xl_reset() to xl_init_locked(). This will make driver
initialize controller from a known good state. Previously driver
used to issue controller reset while TX/RX DMA are in progress.
I guess resetting controller in active TX/RX DMA cycle is to ensure
stopping I/Os in xl_shutdown(). I remember some buggy controllers
didn't respond with stop command if controller is under high
network load at the time of shutdown so resetting controller was
the only safe way to stop the I/Os. However, from my experiments,
controller always responded with stop command under high network
load so I think it's okay to remove the xl_reset() in
device_shutdown handler.
Resetting controller also will clear configured RX filter which
in turn will make WOL support hard because driver have to reprogram
RX filter in WOL handler as well as setting station address.
2010-08-23 18:51:31 +00:00
Pyun YongHyeon
27b031a9ad Remove unnecessary controller reinitialization by checking
IFF_DRV_RUNNING flag.
2010-08-23 00:31:55 +00:00
Pyun YongHyeon
a3835274a4 Clean up SIOCSIFCAP handler and allow RX checksum offloading could
be controlled by user.
2010-08-23 00:24:12 +00:00
Pyun YongHyeon
35f945cd62 It seems all Broadcom controllers have a bug that can generate UDP
datagrams with checksum value 0 when TX UDP checksum offloading is
enabled.  Generating UDP checksum value 0 is RFC 768 violation.
Even though the probability of generating such UDP datagrams is
low, I don't want to see FreeBSD boxes to inject such datagrams
into network so disable UDP checksum offloading by default.  Users
still override this behavior by setting a sysctl variable or loader
tunable, dev.bge.%d.forced_udpcsum.

I have no idea why this issue was not reported so far given that
bge(4) is one of the most commonly used controller on high-end
server class systems. Thanks to andre@ who passed the PR to me.

PR:	kern/104826
2010-08-22 01:39:09 +00:00
Pyun YongHyeon
7e32f79a44 Load tunable from loader.conf(5) instead of device.hints(5). 2010-08-21 23:13:16 +00:00
Jack F Vogel
1ed622958d Eliminate the ambiguous queue setting logic for
the VF, it made it possible to have 2 queues which
we don't want, the HOST is unable to handle it.
2010-08-19 17:00:33 +00:00
Rui Paulo
187278cadc For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
of the compiler command (excluding any arguments) is considered.

This allows you to use, for example, CC="/nondefault/path/clang -xxx",
and still have the various tests in bsd.*.mk identify your compiler as
clang correctly.

ICC if cases were also changed.

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-08-17 20:39:28 +00:00
Adrian Chadd
a122fea4ff Add s25sl064a, an 8mb SPI flash part. 2010-08-17 16:27:13 +00:00
John Baldwin
62508c531e Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). This
method is used by the PCI bus driver to query the power management system
to determine the proper device state to be used for a device during suspend
and resume.  For the ACPI PCI bridge drivers this calls
acpi_device_pwr_for_sleep().  This removes ACPI-specific knowledge from
the PCI and PCI-PCI bridge drivers.

Reviewed by:	jkim
2010-08-17 15:44:52 +00:00