Commit Graph

16125 Commits

Author SHA1 Message Date
Jack F Vogel
89290aa383 Merge in the new driver (6.5.0) of Intel. This has a new
shared code infrastructure that is family specific and
modular. There is also support for our latest gigabit
nic, the 82575 that is MSI/X and multiqueue capable.

The new shared code changes some interfaces to the core
code but testing at Intel has been going on for months,
it is fairly stable.

I have attempted to be careful in retaining any fixes that
CURRENT had and we did not, I apologize in advance if any
thing gets clobbered, I'm sure I'll hear about it :)

Approved by pdeuskar
2007-05-04 00:00:12 +00:00
John Baldwin
9310f22692 Update __FreeBSD_version check for MFC of pmap_mapbios(). 2007-05-02 18:43:51 +00:00
John Baldwin
e706f7f0c7 Revamp the MSI/MSI-X code a bit to achieve two main goals:
- Simplify the amount of work that has be done for each architecture by
  pushing more of the truly MI code down into the PCI bus driver.
- Don't bind MSI-X indicies to IRQs so that we can allow a driver to map
  multiple MSI-X messages into a single IRQ when handling a message
  shortage.

The changes include:
- Add a new pcib_if method: PCIB_MAP_MSI() which is called by the PCI bus
  to calculate the address and data values for a given MSI/MSI-X IRQ.
  The x86 nexus drivers map this into a call to a new 'msi_map()' function
  in msi.c that does the mapping.
- Retire the pcib_if method PCIB_REMAP_MSIX() and remove the 'index'
  parameter from PCIB_ALLOC_MSIX().  MD code no longer has any knowledge
  of the MSI-X index for a given MSI-X IRQ.
- The PCI bus driver now stores more MSI-X state in a child's ivars.
  Specifically, it now stores an array of IRQs (called "message vectors" in
  the code) that have associated address and data values, and a small
  virtual version of the MSI-X table that specifies the message vector
  that a given MSI-X table entry uses.  Sparse mappings are permitted in
  the virtual table.
- The PCI bus driver now configures the MSI and MSI-X address/data
  registers directly via custom bus_setup_intr() and bus_teardown_intr()
  methods.  pci_setup_intr() invokes PCIB_MAP_MSI() to determine the
  address and data values for a given message as needed.  The MD code
  no longer has to call back down into the PCI bus code to set these
  values from the nexus' bus_setup_intr() handler.
- The PCI bus code provides a callout (pci_remap_msi_irq()) that the MD
  code can call to force the PCI bus to re-invoke PCIB_MAP_MSI() to get
  new values of the address and data fields for a given IRQ.  The x86
  MSI code uses this when an MSI IRQ is moved to a different CPU, requiring
  a new value of the 'address' field.
- The x86 MSI psuedo-driver loses a lot of code, and in fact the separate
  MSI/MSI-X pseudo-PICs are collapsed down into a single MSI PIC driver
  since the only remaining diff between the two is a substring in a
  bootverbose printf.
- The PCI bus driver will now restore MSI-X state (including programming
  entries in the MSI-X table) on device resume.
- The interface for pci_remap_msix() has changed.  Instead of accepting
  indices for the allocated vectors, it accepts a mini-virtual table
  (with a new length parameter).  This table is an array of u_ints, where
  each value specifies which allocated message vector to use for the
  corresponding MSI-X message.  A vector of 0 forces a message to not
  have an associated IRQ.  The device may choose to only use some of the
  IRQs assigned, in which case the unused IRQs must be at the "end" and
  will be released back to the system.  This allows a driver to use the
  same remap table for different shortage values.  For example, if a driver
  wants 4 messages, it can use the same remap table (which only uses the
  first two messages) for the cases when it only gets 2 or 3 messages and
  in the latter case the PCI bus will release the 3rd IRQ back to the
  system.

MFC after:	1 month
2007-05-02 17:50:36 +00:00
John Baldwin
361cf3bd02 Use more specific local variable pointers to narrow some expressions.
MFC after:	1 week
2007-05-02 16:21:18 +00:00
Scott Long
ae780f57f6 MPSAFE atapi-cam 2007-05-02 15:30:24 +00:00
Scott Long
2472e51e46 Streamline locking in ciss_free() 2007-05-02 04:44:31 +00:00
Jung-uk Kim
fe09b799f1 Reflect MFC of pci_find_extcap().
MFC after:	3 days
2007-05-01 19:18:12 +00:00
Marcel Moolenaar
bd3032d144 Define the miibus ivars as a structure, instead of as a vector of
pointers. A structure is more readable and less error-prone. It
also avoids problems when a function pointer doesn't have the
same width as a void pointer.
2007-05-01 18:21:24 +00:00
Marius Strobl
5ffa507dce Fix bugs in the Sun -> AT keycode translation table which caused the
Props key to act as Again and the Paste and Copy keys to be inverted.
2007-05-01 14:14:52 +00:00
Marius Strobl
e3b78ec974 Remove invalid BUS_DMA_ALLOCNOW when creating a tag which is used for
a "static" memory allocation only.
2007-05-01 11:50:11 +00:00
Christian Brueffer
8d2896ac91 Remove pre-5.0 compat cruft.
Approved by:	rwatson (mentor)
MFC after:	1 week
2007-05-01 11:17:29 +00:00
Scott Long
975b731815 MPSAFE ciss driver 2007-05-01 05:13:15 +00:00
Pyun YongHyeon
787b3ade61 If we've got watchdog timeouts try to get more packets going after
resetting the hardware.
2007-05-01 03:40:57 +00:00
Pyun YongHyeon
7ef4ec5d34 Honor link up/down state in stge_start().
While I'm here move MAC control settings to stge_link_task, a task
queue which handles link state and duplex/flow controls.
2007-05-01 03:35:48 +00:00
Pyun YongHyeon
eb7a67da1a Use our own timer for watchdog instead of if_watchdog/if_timer
interface.
2007-05-01 03:15:04 +00:00
Marius Strobl
2f9f08b635 - Take advantage of mii_phy_add_media() for adding media and setting
sc->mii_anegticks according to whether the respective BGE chip
  supports Fast Ethernet only or also Gigabit Ethernet.
- At least the BGE chips I've tested with wedge when isolating them
  so document this as the reason for setting MIIF_NOISOLATE and
  remove the unused (and partially even #ifdef'ed out) isolation
  related code. Add code that panics if we encounter a non-zero MII
  instance as generally there's no way a PHY requiring MIIF_NOISOLATE
  can be handled gracefully in a multi-PHY configuration (it's ok for
  the internal PHY of single-PHY-only-NIC to not support isolation
  though).
- Additionally set MIIF_NOLOOP as loopback doesn't seem to work
  either and remove the #ifdef'ed out code for adding respective
  media. The MIIF_NOLOOP flag currently triggers nothing but
  hopefully will be respected by mii_phy_setmedia() later on.

Reviewed by:	jkim, yongari
MFC after:	1 month
2007-04-30 22:35:33 +00:00
Marius Strobl
08013fd336 - Add support/quirks for the on-board BGEs found in Sun Blade 1500
Blade 2500, Fire V210 and probably some other sparc64 machines.
  These chips are typically not fitted with an EEPROM which means
  that we have to obtain the MAC address via OFW and that some chip
  tests will just always fail.
  These changes are based on the respective code found in OpenBSD
  with some additional info obtained from OpenSolaris and some style
  suggestions by jkim@. They also have the desired side-effect of
  respecting the 'local-mac-address?' system configuration variable
  for the affected BGEs.
- In bge_attach() factor out calling bge_release_resources() before
  going to the fail label into the fail label as well as replace a
  magic 6 with ETHER_ADDR_LEN.

Reviewed by:	yongari (before style changes), jkim
2007-04-30 21:55:27 +00:00
Takanori Watanabe
0f23397d3f Add MELCO PC-OP-RS Universal remote ID. 2007-04-30 16:15:19 +00:00
Hidetoshi Shimokawa
0cf4488ab4 MFp4: Improve asynchronous packet receive process.
- Wake up DMA engine after adding a new receive buffer.
- Skip buffers which have unknown state after error.
- More rigid error detection.

MFC after: 1 week
2007-04-30 14:06:30 +00:00
Hidetoshi Shimokawa
2c70b09005 MFp4:
- Update state in fw_xferq_dorain() after removed from the send queue.
- Remove unnecessary 'goto err;".

MFC after: 1 week
2007-04-30 13:51:13 +00:00
Hidetoshi Shimokawa
0892f4c5ec MFp4: Fix broken userland API for async packets.
- Introduce fw_xferlist_add/remove().
- Introduce fw_read/write_async().
- Remove unused FWACT_CH.

MFC after: 1 week
2007-04-30 13:41:40 +00:00
Hidetoshi Shimokawa
5cc9512ae2 MFp4: Fix typo in recv spd.
MFC after: 1 week
2007-04-30 12:55:03 +00:00
Hidetoshi Shimokawa
6b3ecf71ea MFp4: Add a sysctl knob to disable cycle master mode and add some comments.
MFC after: 1 week
2007-04-30 12:38:50 +00:00
Hidetoshi Shimokawa
78b1168bd8 MFp4: remove unused fw_asybusy().
MFC after: 1 week
2007-04-30 12:30:21 +00:00
Hidetoshi Shimokawa
89cad4614f MFp4: Simplify tlabel handling
- Remove struct tl_label and runtime malloc() for it.
- Include tl_lable list in struct fw_xfer.
- Don't free unallocated tlabel.

MFC after: 1 week
2007-04-30 12:26:29 +00:00
Hidetoshi Shimokawa
ad9cf50615 Initialize configuration ROM before a bus reset.
MFC: after 3 days
2007-04-30 10:50:53 +00:00
Thomas Quinot
057f398585 (atapi_action, case XPT_SCSI_IO): Enable DMA only for READ and WRITE commands
as some combinations of chipset, controller and target do not behave
 correctly when DMA is enabled for other commands.

PR:		kern/103602
MFC after:	2 weeks
2007-04-30 09:33:57 +00:00
Thomas Quinot
e651554bf6 (atapi_cb): Fix test for the presence of sense data. An incorrect condition
was being tested, which would result in a system hang in some configurations.

PR:		kern/112119
Reviewed by:	scottl
MFC after:	3 days
2007-04-30 09:26:43 +00:00
Andrew Gallatin
9b03b0f3c0 -Fix an mbuf leak caused by a cut&paste bug where the small ring's mbufs
were never freed, but the big ring was freed twice.
-Don't supply rx hw csums for frames which are padded beyond the
 length specified in the ip header.  If the padding is non-zero,
 the hw csum will be incorrect for such frames.

Sponsored by: Myricom
2007-04-27 13:11:50 +00:00
Ollivier Robert
825f8b5050 Use the same timeout parameters for BIO_FLUSH as with the other commands.
This workaround the problem in Parallels/VMWare where the emulated drivers are
slower, especially with ATA_FLUSHCACHE.  The problem appears much more
frequently with ZFS which use it a lot more.

Approved:	sos, pjd
2007-04-26 12:59:20 +00:00
Kip Macy
64c43db51c Default to using a single queue as this is currently the only way to achieve
line rate
2007-04-26 08:38:00 +00:00
Kip Macy
ea5143feaf Disable mbuf chain collapsing - it is currently causing an mbuf leak 2007-04-26 08:36:59 +00:00
John Baldwin
147c0ad0a1 Use a tighter check to see if a resource allocation request is for a
specific request and thus should first try to be allocated from the
sys_resource pool.  This avoids using the sys_resource pool for wildcard
requests that have bounded ranges coming from cbb(4) and Host-PCI pcib(4)
drivers.

Tested by:	Andrea Bittau <a.bittau of cs.ucl.ac.uk fame>
Sleuthing by:	Andrea Bittau as well
2007-04-25 16:22:18 +00:00
John Baldwin
d68b1825b7 - HT 2.00b added a new flag to the MSI mapping HT capability to indicate
that the MSI mapping window is fixed at 0xfee00000 and the capability
  does not include two more dwords used to program the address.  Supporting
  this mostly results in quieting spurious warnings during boot about
  non-default MSI mapping windows.
- HT 2.00b also added a new HT capability type, so support that in pciconf.

MFC after:	3 days
Tested by:	jmg
2007-04-25 14:45:46 +00:00
Pyun YongHyeon
dd936d524b Work around GMAC hardware hang bug.
It seems that valid pause frames(Tx flow control) cause GMAC to hang
such that it resulted in watchdog timeout. As a work around don't
flush Rx MAC FIFO if we've received pause frames.

Tested by:	Harald Schmalzbauer (h DOT schmalzbauer AT omnisec DOT de)
2007-04-25 01:20:31 +00:00
Pyun YongHyeon
b2313f5861 Disable TSO support.
Under certain circumtances, if TSO is active, Yukon II generates
corrupted IP packets. All corrupted IP packets I noticed were the the
last segmented packet in a TSO request. The corrupted packet resulted
in retransmission of the damaged packet which in turn decreased network
performance dramatically.
Unfortunately it seems that there is no way to workaround this bug
as TSO is completely handled in hardware. Disable TSO until we find a
working workaround or a new silicon revision that doesn't have this
hardware bug.
2007-04-25 01:17:44 +00:00
Pyun YongHyeon
3326191f71 Fix TCP header size calculation logic which is used for setting
TSO MTU.
2007-04-25 01:13:38 +00:00
Markus Brueffer
9cf7411649 Utilize led_create_state in order to preserve the status of the ThinkLight
on driver attach.

PR:		kern/112044
Submitted by:	Henrik Brix Andersen <henrik@brixandersen.dk>
Approved by:	emax (mentor) (earlier version)
2007-04-24 23:09:37 +00:00
Hidetoshi Shimokawa
e340a7ac14 Configuration ROM length should be unsigned.
MFC: 1 week
2007-04-24 12:15:05 +00:00
Sepherosa Ziehau
3629c47471 Nuke unnecessary setting of ural(4)'s security registers. ural(4) only
supports software encrypt/decrypt.

The nuked code itself is quite problematic, as pointed out by sam@ ---
wk->wk_keyix should be replaced by the loop count.

Tested with WEP/TKIP/CCMP/no-protection.

Approved by:	sam@ (mentor)
Noticed by:	Hans Petter Selasky <hselasky@c2i.net>
2007-04-24 11:18:55 +00:00
Poul-Henning Kamp
ea60845d09 Make it possible to specify an initial state for the LED.
Requested by:	Henrik Brix Andersen <henrik@brixandersen.dk>
PR:	112008
2007-04-23 12:42:15 +00:00
Poul-Henning Kamp
98b2967900 Add VLAN capability.
Submitted by:	Slawa Olhovchenkov <slw@zxy.spb.ru>
2007-04-23 12:19:02 +00:00
Sam Leffler
b298baf298 make dev.ath.N.ledpin have an immediate effect
PR:		kern/111810
Submitted by:	Henrik Brix Andersen <henrik@brixandersen.dk>
MFC after:	1 week
2007-04-23 05:57:06 +00:00
Poul-Henning Kamp
2efc0f7f47 Remove the old software bit-banging MII interface, we started using
the Rhines shiftregisters in four years ago (1.60).
2007-04-22 15:58:56 +00:00
Poul-Henning Kamp
28a811cd5b Remove further cobwebs: Two layers of pointless substructures. 2007-04-22 15:48:29 +00:00
Poul-Henning Kamp
5d83ecf965 Initialize the physical next pointer in the tx descriptors when we
initialize instead of in the start routine.
2007-04-22 15:09:03 +00:00
Poul-Henning Kamp
27de12a9c2 Don't rename fields with #define.
Collapse two semantically identical structs.
Add missing vr_ prefix.
2007-04-22 14:57:05 +00:00
Poul-Henning Kamp
c8ea76936e Run if_vr(4) through FlexeLint and clean some of the cobwebs found. 2007-04-22 12:55:36 +00:00
Kip Macy
5f1e4ae331 Free cluster if we fail to create the dmamap.
Fixes CID 1829
Found by: Coverity
2007-04-20 05:16:42 +00:00
Kip Macy
527888d7c0 Eliminate CID 1842 by comparing against (type != EXT_MBUF) => refcnt != NULL 2007-04-20 05:12:54 +00:00