Commit Graph

41 Commits

Author SHA1 Message Date
fvdl 7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
fvdl 370167ec16 Add newer 5704 asic revs, and add them to the table, with the
BGE_QUIRK_ONLY_PHY_1 quirk in their entry.
2003-06-01 20:26:14 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
tron ea710d8119 Don't print a kernel message like "bge0: gigabit link up" when a Gigabit
link is detected. No other ethernet driver does this and this driver
doesn't do it for other modes.
2003-03-24 12:06:05 +00:00
jonathan cd38c4da5c Commit workaround for hardware bug: 5701 chips running in PCI-X mode
require that the DMA receive buffers be aligned. The driver was
deliberately mis-aligning by 2 bytes, to force the layer-2/3
headers to 32-bit alignment.

Workaround: if chip is a 5701, and is in PCI-X mode, leave the DMA
buffers aligned.  If the host CPU requires alignment, copy the buffer
after reception to force aligment.

Tested  on an i386 in  PCI-X bus, with __NO_STRICT_ALIGNMENT forced off.

Patch and comments reworked  to minimize drift from
	FreeBSD if_bge.c rev 1.14.
2003-03-07 18:57:53 +00:00
jonathan 5214474746 Fix typo: PRODUCER_BUG quirk mask overlapped the PCIX register-bug quirk.
(Harmless, since we dont use the latter; but we will use it very soon.)
2003-03-07 18:40:18 +00:00
jonathan a9ae465f5e Commit the FreeBSD alternative of a private patch to check NIC internal
ram for using TBI, versus MII/GMII.

FreeBSD commit log and versions:
   Obtain the media type from the shared memory and only use the eeprom
   as a fallback.

   if_bge.c:	rev 1.30
   if_bgereg.h:	rev 1.13

Thanks to Paul Saab @mu.org.
2003-03-06 20:53:05 +00:00
jonathan cf38b6aae6 FreeBSD fix for problems reported (to FreeBSD) with 16-bit accesses
to 32-bit device registers. Add (untested) NetBSD fix for big-endian hosts.
From FreeBSD versions:
	if_bge.c:	1.26 and 1.27
	if_bgereg.h: 1.12

FreeBSD (MFC) comment:

MFC:  Avoid 16-bit accesses to device memory.  Use volatile where
appropriate in referencing device memory.  Parenthesize BGE_HOSTADDR
define properly.
2003-03-06 20:12:53 +00:00
tsutsui 60a7e59350 hz -> Hz 2003-02-22 04:57:48 +00:00
tron 1677386f89 Correct typo in an e-mail address. 2003-02-09 10:06:16 +00:00
thorpej 515d52e9e7 Change ext_size to a size_t, and update the signature of ext_free. 2003-01-31 05:00:24 +00:00
thorpej 2f060102ae Use aprint_*(). 2003-01-31 01:03:35 +00:00
itojun c8012d9047 correct the use of m_tag. correct indentation (:set sw=8 ts=8 please,
jonathan)
2003-01-17 08:27:35 +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
jonathan 1b7f3ca44b Grr. Fix consistent typo, to match what i actually tested before committing. 2003-01-17 00:24:29 +00:00
jonathan ad77f4e6fb Enable the 5700 DMA bug and producer-pointer fixes, by setting the
quirk on all 5700 revision B devices. (These fixes have not been
tested against NetBSD recently; committing the fix and the enable separately
gives us flexibility about which fixes get pulled into the NetBSD-1.6 branch.)
2003-01-17 00:11:00 +00:00
jonathan 1484718092 Commit accumulated bge fixes:
* Add support for 5704C dual-channel chip with integral copper PHY (tested)
   and 5704S dual-channel SERDES/TBI gbic  (untested).  Add PHY DSP patch
   for 5704.
 * Update PHY DSP-code patch for bcm5401 to match latest Linux driver.

 * Add PHY DSP-code patch for 5703 (untested).

 * Update onchip buffer tunables to recommended values from Linux drivers.

 * Disable MWI access.  This chip family cannot hanlde PCI stalls
   in the middle of an MWI burst. The driver has heuristics to detect PCI
   line size, but under load, some PCI bridges may force stalls which
   the attach-time heruistics do not catch. Some PCI bridges never
   do this, so maybe it should be a  tunable option.

*  bcm5700 rev Bx chips have a race condition, where updating the
   Tx producer pointer goes un-noticed by the chip.  Workaround is to
   write the new producer-pointer value twice.

*  bcm5700 chips rev Bx wedge up if given  DMA descriptors of
   eight bytes or less. Once hit, only reovery is a watchdog timeout/reset.
   If the offending packet is retransmitted, the chip will wedge again...
   Check for teeny fragments in a Tx request, and either fold the
   teeny chunk residue into an adjacent mbuf, or m_dup the entire buffer.
   (NB: quirk not yet enabled; in-place folding tested only on FreeBSD.)

 * Add workaround for revision Bx bcm5700: chip bugs in decoding
   of PCI register writes may leave the hardware in (partial) powersave state,
   such that  writes to "indirect" registers do not work.
   Explicitly force chip into D0 state at attach time.

 * Accessing PHY registers with the bge chip in autopoll mode, when
   link-state is the process of changing, may cause the bge chip to
   assert PCI errors.   Workaround:   when doing miibus register access,
   save autopoll state, disable around access, and restore autopoll state.
   NB: issuing PHY resets may give a window where the problem still occurs.

 * Increase Tx interrupt-coalescing thresholds, to reduce Tx-done interrupts.
2003-01-17 00:02:56 +00:00
matt 5914ae08f9 Recognize BCM5702X and BCM5703X. Add a ONLY_PHY_1 quirk and use it.
Add support for getting the macaddr for 5703 (taken from FreeBSD).
2002-12-26 20:55:30 +00:00
kristerw e367c94b9c Do not try to print uninitialized variable. 2002-10-06 23:34:56 +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
mjl 395027b4be Correct obviously switched args to memset() 2002-07-18 02:07:13 +00:00
thorpej 7ba40961d6 Add a BGE_QUIRK_CSUM_BROKEN quirk, and give it to BCM5700 B0, rather
than testing for the revision all over the driver.  If the chip has
broken checksums, then don't advertise the capability to the stack.
2002-07-13 22:48:40 +00:00
thorpej 0ff52204b9 Give BCM5700 Ax and Bx revs the BGE_QUIRK_LINK_STATE_BROKEN quirk,
and test for that, rather than checking revision where the quirk is
handled.
2002-07-13 22:31:18 +00:00
thorpej dcebb2bf0d Add a lookup table with ASIC revision, name, and any quirks. Print
ASIC revision at attach time.  Add BCM5703 revisions.
2002-07-13 22:21:20 +00:00
thorpej 7d85789f0a Move the BCM5401 DSP patch out of the bge driver and into
the brgphy driver; all users of the BCM5400 and BCM5401 need
the DSP patch and the sledgehammer-reset-at-media-set-time.

Also add a DSP patch for the BCM5411 gleaned from Apple's
GMAC driver for Darwin.

Tested with a 3Com 3c996-T (BCM5700 + BCM5401).
2002-07-13 01:23:27 +00:00
enami f216ec52a0 Match Altima AC1001. 2002-07-12 22:29:14 +00:00
thorpej 7ff40c446d Fix multicast filter programming. 2002-07-01 22:42:47 +00:00
thorpej 969b2f1817 Fix a comment. 2002-06-28 18:46:46 +00:00
thorpej 9066ce1621 When stopping the various functional blocks of the chip, clear the
bit and then read it back in a loop (with appropriate delays) waiting
for it to read back clear.

This fixes a problem where the bus would hang when bringing down
the interface or changing interface flags on a system with a
sufficiently fast CPU (e.g. 2GHz P4 Xeon).
2002-06-28 18:44:45 +00:00
fvdl 50ade28e9b Rearrange alignment code a bit. 2002-06-28 18:39:45 +00:00
thorpej 6abec8e2a2 Increase previously added delays from 2us to 10us. 2002-06-28 01:10:06 +00:00
thorpej 90bf67b885 * Only set the jumbo frame capability if we are able to allocate
jumbo frame buffers.
* Garbage-collect some stuff we don't need.
* Fix timeout detection in the firmware handshake.
2002-06-28 00:55:20 +00:00
thorpej 7778c16e7c Use a table to match BCM570x products. 2002-06-27 23:56:20 +00:00
thorpej b7af161065 Don't call m_aux_find() in the inner loop when creating the Tx
descriptor list.  Instead, call it once and remember the result,
and only call it looking for VLAN tags if VLANs are configured
on the interface.
2002-06-27 23:21:34 +00:00
thorpej 68be8ecae4 Put some delay in the loops that poll for MII transaction
completion.  Without this, reading the PHY can hang the bus
on a sufficiently fast CPU.
2002-06-27 22:31:30 +00:00
fvdl 8a454b46d0 Disable TCP/UDP checksums on the receive side again. 2002-06-27 22:10:11 +00:00
cjs 6f2291b427 Match newer NetGear GA302T cards. 2002-06-26 10:48:18 +00:00
fvdl dd96b79d02 According to the Linux driver from Broadcom, only the 5700 B0 revision had
rx checksum problems. So only disable rx checksum for that revision.
2002-06-24 01:23:11 +00:00
fvdl b04a6fd69c Driver for Broadcom 570x / Altima AC 1000 gigabit ethernet cards.
Written by Bill Paul for FreeBSD. This port started out with the
port done to OpenBSD by nate@openbsd.org, but ended up looking much
more like the port of the ti driver done by drochner@netbsd.org
(they are similar in structure).
2002-06-22 14:42:07 +00:00