Commit Graph

65 Commits

Author SHA1 Message Date
tsutsui 6353b12d1a Fix hardware cksum problem on big endian machines.
Tested on macppc by HATANO Hiromichi.

Note I guess this bug could be fixed only adding one htole32(),
but I'd rather clean up endianness handling:
- Use htole32() only to accesses against DMA descriptors.
- Don't use uint32_t union member  with htole32()/le32toh()
  to access uint8_t/uint16_t descriptors.
- Add le32toh() in some DPRINTF.
  (XXX: strictly speaking, bus_dmamap_sync() is needed for these DPRINTF)
2004-01-14 14:29:48 +00:00
thorpej c0ddd8220b Bump the Tx DMA segment count to 40. Apparently, it's common to have
DMA segment counts in this ballpark when using jumbo frames (so says
the "ti" driver).
2003-12-04 06:57:37 +00:00
thorpej f6c3c3450e Add a missing i82541 ID to the table. 2003-11-22 08:32:12 +00:00
thorpej 32ddb3f486 Fix brain'o in PCIX speed detection. kern/23375 (John R. Shannon). 2003-11-07 06:03:52 +00:00
thorpej 73fea8467b Enable i82541 and i82547 chips - it works well enough to get broader
testing.  Update the TODO list.
2003-11-04 19:09:39 +00:00
ichiro 8b115395c7 Fix uninitialized variable warnings 2003-11-03 03:05:25 +00:00
christos 125ccd91b1 Fix uninitialized variable warnings 2003-10-25 18:29:12 +00:00
ragge c4690aa593 Set snd queue size to max(WM_IFQUEUELEN, IFQ_MAXLEN), instead of hard to
WM_IFQUEUELEN.
2003-10-23 12:53:02 +00:00
thorpej 0f781c4abb Add support for the SPI EEPROM found on the newer i82541 and i82547
chips.  Add the i82541 and i82547 product IDs to the table, #if 0'd
out, for now (there are still more changes to come for these new chips
to work properly).
2003-10-22 15:50:39 +00:00
thorpej 3e560e2b48 Add a TODO list item. 2003-10-21 16:52:08 +00:00
thorpej c50f2ac573 - Move the i82540EM (LOM) along with the other i82540 product IDs.
- Match the i82545GM (1000BASE-T and 1000BASE-X) and i82546GB
  (1000BASE-T and 1000BASE-X) product IDs.
2003-10-21 16:51:17 +00:00
thorpej a866babe44 If we're on PCI-X, look up the PCI-X capability. Verify that the
max memory read byte count in the command register is <= the max designed
memory read byte count in the status register.  If not, reset it to the
status register's value.  This is necessary because some BIOSes configure
the wrong value, and the wrong value confused some versions of the PCI-X
capable chips.
2003-10-21 16:41:51 +00:00
thorpej abc7f80ca5 - Map I/O space on chips that support it. While it is not used for
normal operation, it is required to implement a bug work-around on
  some chips.
- When issuing a reset on the i82544, i82540, i82545, i82546,
  and i82541, use I/O space, if available, to work around a problem
  with the memory write cycle (problem only occurs when issuing
  a reset).
2003-10-21 05:45:11 +00:00
thorpej 2cadb9ce85 Record characteristics of the bus connection at attach time. 2003-10-21 04:35:01 +00:00
thorpej e2d086d69d - Do better error checking on EEPROM access.
- Let the EEPROM wire-protocol handler perform the loop.
2003-10-20 22:52:19 +00:00
thorpej 12c5273afa Move all the code that handles the MicroWire EEPROM protocol into
a separate function.
2003-10-20 16:28:23 +00:00
thorpej fedb07bc8d Fix a typo in the "failed to acquire eeprom" case. 2003-10-20 15:34:25 +00:00
thorpej 0ebc93fe43 Move the code that reads a series of bits from the EEPROM into a
separate function.
2003-10-20 15:33:48 +00:00
thorpej 17aaa92402 Make all of the functions in this file static. 2003-10-20 06:00:26 +00:00
thorpej 10926a6056 Factor out the code that sends bits to the EEPROM into a separate function. 2003-10-20 05:56:17 +00:00
thorpej f5fc41219d Move the code that handle the EEPROM handshake into separate functions. 2003-10-20 05:40:03 +00:00
thorpej b0bced8029 Store the number of EEPROM address bits in the softc. 2003-10-17 21:12:48 +00:00
thorpej 2d858d3912 Add internal representation for i82545 rev 3, i82546 rev3, i82541,
i82541 rev 2, i82547, and i82547 rev 2.
2003-10-17 20:57:32 +00:00
thorpej e3ca7c2c73 Make the "align tweak" factor per-interface (since the MTU is per-interface). 2003-10-17 20:41:21 +00:00
tls ab54d7e94f Add support for jumbo (9K) frames. Add support for larger receive
descriptor sizes if larger mbuf clusters are in use -- currently
commented out because, for some reason, transmit doesn't work at
all with large mbuf cluster sizes.

Note that using actual 9K frames is a _lot_ less efficient than
using frames that are a little smaller than 8K so that they fit
in one or two pages (instead of two or three) and avoid the extra
chained descriptor with only 1K of data in it, too.  TCP will
segment things just fine for an 8K total packet size, just as it
does for 1500-byte packets.

On my system, using "mtu 8000" with ifconfig, I get an almost 50%
performance boost for TCP (930Mbit/sec instead of 660Mbit/sec) over
1500-byte frames.  "mtu 9000" yields only 770Mbit/sec.
2003-09-10 04:02:17 +00:00
thorpej 2f2b9c7cb0 GMII works on the i82543 now. 2003-09-04 19:32:19 +00:00
thorpej 058f44ae26 Add support for the Intel PRO/1000 MT Quad Port server adapter; this
is just 2 i82546EB chips behind an IBM 133 PCI-X bridge.
2003-07-29 19:49:50 +00:00
lukem 365cbd9428 add missing __KERNEL_RCSID() 2003-07-14 15:47:00 +00:00
thorpej b43b1645a2 Use aprint*(). 2003-04-29 01:07:30 +00:00
tron 78a6a01cac Pullup short mbuf in wm_tx_cksum() instead of dropping it which fixes
PR kern/21190 by myself. Jason R. Thorpe code reviewed the changes.
2003-04-15 22:52:40 +00:00
thorpej b2beaa1fbd wm_tx_cksum(): Set the initial offset correctly for packets using
802.1Q encap.
2003-04-15 21:12:24 +00:00
kent d49a3d652c Support for 82540EP and 82540EP (LOM).
Not tested.
2003-04-05 13:23:17 +00:00
kent e7a590c1f1 Support for i82450EP. 2003-04-04 06:45:12 +00:00
thorpej b6fa4ee6ba Use bus_dmamap_load_mbuf() in wm_add_rxbuf(). 2003-02-04 17:40:31 +00:00
itojun aa8971e35f m_tag transition mistake (within #if 0) 2003-01-21 05:43:26 +00:00
itojun 40606ab8f2 switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson
2003-01-17 08:11:49 +00:00
tsutsui 238efe4697 Replace magic numbers for power management control with PCI_PMCSR* macros.
XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?
2002-12-23 02:58:36 +00:00
kristerw 2ce6431736 wm_copy_small in not used anywhere. Remove. 2002-12-21 16:12:15 +00:00
christos ab944659c0 change the macro params to longer names 2002-10-23 01:34:58 +00:00
fair 2104199dc3 Change the "dontcare bits" argument to ifmedia_init() to IFM_IMASK
so that it is possible select PHY instances other than the first
one (instance zero), if there is more than one PHY attached.
2002-10-21 23:38:10 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
itojun a8b4aa9a72 #if 0 out call to rnd_add_uint32() in interrupt logic until thorpej
measures performance differences.
2002-08-23 16:30:10 +00:00
itojun e68a39d27b attach random number source. 2002-08-23 07:45:39 +00:00
thorpej 3e3fdc01e9 * After testing for DD on a descriptor, and finding it clear,
sync that descriptor with PREREAD to make sure that it is evicted
  from the data cache.  From Allen Briggs.
* With the above bug fixed, stop using BUS_DMA_COHERENT, resulting in
  a fairly decent performance improvement on systems where BUS_DMA_COHERENT
  causes descriptors to be accessed uncached (most painful in wm_start()).
2002-08-17 20:58:04 +00:00
thorpej 00a0212e10 Update a comment; TCP/IP checksum offloading is fixed! 2002-08-15 18:35:25 +00:00
briggs 8d5eb3e93d On transmit, zero the upper 32 bits of the address in the tx descriptor.
The descriptor may have been used as as context descriptor in the past,
in which case this field will be non-zero.  h/w checksum offload works now.
2002-08-15 18:29:02 +00:00
thorpej 2b615e62c4 Add support for the new i82540, i82545, and i82546 Gig-E chips. The
i82546 chip has 2 Gig-E interfaces in a single chip.

The main difference is these chips have a special handshaking protocol
for accessing the EEPROM (due to the shared nature on the i82546).
2002-08-08 00:12:08 +00:00
simonb d436dc19f3 Fix a typo in a comment. 2002-08-07 04:53:18 +00:00