Commit Graph

102 Commits

Author SHA1 Message Date
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
skrll 6a270f002d Typo in comment. 2005-12-19 12:35:19 +00:00
jonathan e66e62e9be Fix silly cut-and-paste typo (CSR_READ(sc, BGE_MARBMODE_ENABLE),
should obviously have been CSR_READ(sc, BGE_MARB_MODE) incurred during
my backport of 5714/5715 support from my netbsd-3 development branch,
back into -current.
2005-12-12 19:58:11 +00:00
jonathan cc474061e1 Add support for bcm5714 and (possibly incorrect) support for the
bcm5715 PCI-Express dual-port NICs. Taken from the Broadcom-supplied
Linux driver, bcm-8.3.13a.

Add nascent support for the bcm5780, but (since I have no bcm5780 to
test), don't yet add an entry which allows us to match or attach to a
5780.

Change 5752 support: Follow the lead of the Broadcom-supplied Linux
driver (bcm) and the Linux tg3 driver, and treat the 5752 like a 5750.
2005-12-12 00:40:44 +00:00
jonathan cf16a10aad Add PCI device-ids to sys/dev/pci/pcidevs for newer Broadcom gigabit
ethernet devices: bcm5714, bcm5752 (previously the 5789, but fvdl
committed that whilst I was musing).

Add definitions to sys/dev/pci/if_bgereg.h for the Broadcom 57xx-family
ASIC revisions on these newer chips.

Add entries to the PCI-device-version and bge-internal-asic-revision
tables in sys/dev/pci/if_bge.c to use these new devices. Pending
further information, follow the lead of FreeBSD's if_bge.c driver and,
pending further info, treat these new chips as we do the 5750.
2005-12-07 04:43:05 +00:00
fvdl a085182504 Match the 5789. 2005-12-06 20:56:42 +00:00
martin 328b263349 Use %zd for size_t. Noticed by Kurt Schreiner on current-users. 2005-11-24 13:47:46 +00:00
jonathan 43255e3f4e Add TSO support to bge(4) for PCI-Express bge devices, which are
shipped from the factory with TSO-capable firmware.  The TSO support
here may also work on 5705 chips, but that is (so far) untested.

TSO support written after careful reading of the Linux tg3 driver,
and (after attempting to deconstruct the cut-and-paste mess therein)
very close reading of the Broadcom-supplied Linux driver, particularly
the building of Tx-DMA buffer descriptors (bds). The TSO code herein was
then rewritten from scratch, circa 4am local time, October 27 2005.
(In other words: this is 4am software; caveat emptor.)

Other magic register settings in this patch are required; without
them, attepmting to use TSO locks up the chip. The required register
settings were extracted from the cited Linux drivers.

Note that TSO-capable firmware for the 5703/5704 is distributed in
non-GPL form with the aforementioned Linux drivers. Once the 5705 case
is debugged, (particularly the pseudo-header checksum precalculation
flagged with an XXX) downloading that TSO-capable firmware to the
5703/5704 should, in principle, enable TSO support on all but the
original bcm5700 (I forget if the 5701 can support TSO, or not).

Note also that the ``hard case '' of IP/TCP headers spanning more than
one mbuf is not handled; I haven't been able to trigger it.  In any
case, since TSO applies only to packets generated by the local TCP,
and our TCP always leaves space for TCP headers and a normal IP
header, TSO on an IP/TCP header spanning multiple headers can only
arise due to insertion of IP options. I beleive that we are clearly
better off outlawing that case, and requiring ip_insertoptions()
to  pull-up TCP headers on any packets with M_CSUM_TSOv4 set.

As far as I know, bge hardwar does not support TSO for IPv6.
2005-11-24 03:27:59 +00:00
jonathan de85711ee1 Correct a performance bug from Bill Paul's original FreeBSD bge(4) driver:
Each call to the FreeBSD bge_start() routine the transmit producer
pointer index from the chip mailbox register BGE_MBX_TX_HOST_PROD0_LO.
The local copy of that value is then updated by bge_encap() as
bge_encap() encapsulates packets in the Tx ring. If bge_encap()
succeds in encpuslating one or more packets, bge_start() tells the
chip to start sending the newly-encinitiates writes the new value back
to the chip mailbox register.

However, comparison of the Linux drivers (Broadcom-supplied and
open-source tg3.c) and to the OpenSolaris driver confirms that
register BGE_MBX_TX_HOST_PROD0_LO is write-only to software.
Thus, we can just keep a copy in the softc, and eliminate the
(expensive) PCI register write on each call to bge_start().

``Make it so''.
2005-11-15 06:05:44 +00:00
tsarna da085b10b3 Allow reception of VLAN sized frames. From FreeBSD.
Reviewed by cube.
2005-09-06 15:42:21 +00:00
gavan 84c672e259 Add quirk for BGE_CHIPID_BCM5751_A1. From Kurt Schreiner <ks at ub.uni-mainz
dot de> via PR kern/31028.
2005-08-22 18:18:25 +00:00
gavan 0216bccfb3 Recognise Broadcom 5751M Gigabit Ethernet, as found on ThinkPad T43p. 2005-08-21 21:32:26 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
christos 7cdea212c0 No 0x in front of %p... 2005-05-22 15:54:45 +00:00
yamt 330cc0a11e split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx. 2005-05-02 15:34:31 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
thorpej 2f8e8079d1 Define M_CSUM_DATA_IPv4_IPHL() and M_CSUM_DATA_IPv4_OFFSET() macros
to extract data from csum_data, rather than just open-coding it.
2005-02-21 02:12:48 +00:00
jdolecek dc8941eb32 use VLAN_* macros for VLAN tag extraction/addition
also restructure and simplify input VLAN ID code handling somewhat, to not use
local have_vlan/vlan_tag variables, and use the appropriate cur_rx condition
on the one place where it's needed
2005-02-20 15:48:35 +00:00
heas d6e174eefd Adjust csum_data usage; mask off the high 16 bits. 2005-02-18 01:10:44 +00:00
jmcneill 6a3e1ea6a4 Missed a break in the powerhook (shouldn't matter functionally, but
fix anyway for correctness).
2005-01-26 22:15:26 +00:00
jmcneill 0c537484ca Add powerhook to bge(4) 2005-01-26 21:52:47 +00:00
matt 027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
fredb 99ad984e37 Recognize the Broadcom 5721 Gigabit Ethernet, as found on SuperMicro P8SCi
motherboards.
2005-01-08 16:00:03 +00:00
jmmv dcfa2c4905 Fix typo in previous commit that was breaking the build (hi, tacha@!). 2004-11-19 17:59:09 +00:00
tacha f2ffe49e42 Add support for Broadcom BCM5705K. 2004-11-19 10:17:17 +00:00
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
cube cce3c2a9eb Add support for the BCM575x variants. They're close to the 5705 one, with
some special cases for the PCI-Express versions.  As there is no
documentation available, all of this is inspired from Linux or taken from
FreeBSD (itself inspired from Linux).  There are a lot of magic numbers.

Tested on two BCM5751 devices as found in newer Dell computers.
2004-10-28 07:36:05 +00:00
yamt 81378f8ab8 - mbuf external storage is of (caddr_t), not (caddr_t *).
- remove a needless cast.
2004-09-29 11:22:03 +00:00
yamt 52f0c217f7 introduce M_EXT_RW to allow mbuf external storage R/W.
discussed on tech-net@.
2004-09-21 21:57:30 +00:00
atatat 16122fe06c Remaining sysctl descriptions under hw subtree (ath and bge) 2004-05-25 04:38:36 +00:00
thorpej b7d5c113dd Add PAUSE-related event counters. Slightly modified from patch supplied by
HITOSHI Osada.
2004-05-15 22:19:27 +00:00
thorpej 34b8c2c481 Patches from HITOSHI Osada:
* Set buffer management high water marks for MTU > 1514.
* Set BGE_MAX_RX_FRAME_LOWAT (from Linux driver).
2004-05-15 21:58:40 +00:00
tron 71c703ffaa Add support for Broadcom BCM5788 GbE. Patches supplied by FUKAUMI Naoki
in PR kern/25166.
2004-05-12 07:07:34 +00:00
thorpej 4c019a313e Add 802.3x flow control support. From HITOSHI Osada. 2004-04-10 19:23:49 +00:00
keihan fef14e4cd8 s/netbsd.org/NetBSD.org/g 2004-04-06 08:48:55 +00:00
jonathan e05bba34d6 Fix mistaken arguments to bge_set_thresh(); the prior revision would
pass the bge_softc * to a function expecting the struct ifnet*,
triggering a panic every time the Rx-mitigation value is changed via sysctl.
(Testing via kernel debugger before Andrew's recent sysctl(9) changes
was done with the exact same mistaken argument.)
2004-04-04 00:43:25 +00:00
atatat b233127eb3 GC ath_node_root as well, but modify to work around the single
(tightly scoped) reason for recording the node address by recording
the assigned number.  Dink pci/if_bge.c to match, since ic/ath.c was
used as the archetype.
2004-03-27 04:37:59 +00:00
atatat de94728620 GC bge_node_root, since it's not needed and probably wrong. 2004-03-27 04:25:12 +00:00
jonathan c13c949dac Update yesterday's if_bge sysctl hooks for hw.bge.* (based on
yesterday's sys/dev/ic/ath.c) to match today's ath.c driver.
Commit now in the hope that Andrew Brown will pick up this file for
any more pending changes.
2004-03-27 01:17:49 +00:00
jonathan b9aa680ef2 Add a table of Rx interrupt-threshold register values for mitigating
Rx interrupts, functions to post a request for new table entries, and
code to apply pending Rx-interrupt control values at the next hardware
interrupt.

As used in a third-party proprietary tree since at least March 2003.
As discussed on tech-kern/tech-net in January 2004 (in the context of
NetBSD for packet capture, bpf, and FreeBSD-sylte IFF_POLL), and as
posted to tech-net for comments in mid-March 2004.

Still missing sysctl or other knobs to acutally change the config-time
values, due to my ignorance of any accepted per-device sysctl namespace.
2004-03-20 02:04:07 +00:00
jonathan 73e79089ee Possibloe fix for some bge chip revisions taking a long time to reset
(e.g., polling for a half-second or more at splnet(), blocking most
interrupts, durin an ifconfig down/ifconfig up).

Appears to help for a 5704C rev A3, which is the only chip I've
ever seen that had even a mild version of the reported problem.
2004-03-20 01:58:51 +00:00
jonathan 426b3e3a08 Check for BGE_PCI_PCISTATE register failing to revert on reset.
if it occurs, print a message indicating why the reset took so long.
2004-03-20 01:42:21 +00:00
drochner 529666a2a8 use "=" instead of "|=" on first assignment to mbuf.csum_flags
(probably unnecessary because zero-initialized on mget, but
cheaper anyway)
2004-03-10 18:46:10 +00:00
martin bddc2b94bb Set BGE_JUMBO_RXRING_VALID in bge_flags when allocating jumbo ring buffers,
so it can be freed later. From HITOSHI Osada in PR kern/24686.
2004-03-06 17:42:43 +00:00
jonathan ca71058195 Add hooks to dynamically change the bge Rx interrupt thresholds. I
found empiricaly that (at least on bcm5700s) the Rx coalesce and bd
counts cannot be updated on-the-fly; attempting to do so (even at
splhigh()) causes weird behaviour.

Instead, add a softc flag to record that the desired softc values for
Rx-interrupt thresholds have changed; check that boolean in the interrupt
routine. If set, apply the new values there and clear the flag.
2004-01-22 02:29:46 +00:00
jonathan c4e9405150 Do 5704-specific setup of DMA control register for all 5704 variants,
including chips that matched only the asic-revision  fallback table.

When dong DMA setup for 5703 and 5704, use the new BGE_ASICREV() macro
to extract the ASIC revision.
2003-12-14 03:08:12 +00:00
pooka 34f5b5e378 The highest 16 bits of chipid identify the ASIC, so print only them. 2003-12-09 15:19:33 +00:00
pooka 3c0925818d Match 5703 ASIC A3.
Also, when printing the ASIC ID, print the revision in hex in all
cases to avoid extra confusion if only the "superclass" of the ASIC
is recognized.
2003-12-08 17:09:39 +00:00
fvdl 9d4e217e09 From FreeBSD:
* erratum: disable the nocrc RX bit, as it may cause problems on the 570{1-4}.
  adjust the length of the incoming packet accordingly to trim it.
* the 5704 has a smaller MBUF_POOL, so set a smaller value

Local change:
* Pass the autoneg force flag to mii_attach. Some PHYs need to be kicked
  out of their falsely autoneged 10baseT state with this.
2003-11-11 22:28:58 +00:00
simonb b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00