History log of /freebsd-head/sys/dev/bce/if_bce.c
Revision Date Author Comments
8e616137c474067bf3d8456f3b437b6db7f36921 01-Sep-2020 mjg <mjg@FreeBSD.org> bce: clean up empty lines in .c and .h files
aca1244ab0dffb4274033f2f9baf79507320f7bb 01-Mar-2020 imp <imp@FreeBSD.org> Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of
these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...
ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1 26-Feb-2020 kaktus <kaktus@FreeBSD.org> Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718
2c0cc8d7b9e1b82c05b4066375e3279934582b7a 21-Oct-2019 glebius <glebius@FreeBSD.org> Convert to if_foreach_llmaddr() KPI.
8efc2b3f05053bd7c6d2c0b6e0fbde9ffc58bbe5 26-Sep-2018 imp <imp@FreeBSD.org> Reapply, with minor tweaks, r338025, from the original commit:

Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);

@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);

$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)
d70d723ffc59a1cbc0c44c77ad2d3c17390ebeb2 19-Aug-2018 cem <cem@FreeBSD.org> Back out r338035 until Warner is finished churning GSoC PNP patches

I was not aware Warner was making or planning to make forward progress in
this area and have since been informed of that.

It's easy to apply/reapply when churn dies down.
3d8ae7a0f486874af060f67d597575c9ca7f9957 19-Aug-2018 cem <cem@FreeBSD.org> Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);

@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);

$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
7aeac9ef1893e0b29408213e3a320d9d1ef28357 18-May-2018 mmacy <mmacy@FreeBSD.org> ifnet: Replace if_addr_lock rwlock with epoch + mutex

Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32
4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32
4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32
4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32
4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32
4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32
4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32

After the patch

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51
5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51
5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51
5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51
5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52
5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15366
b0ccb1205b9f5dc3c34e249283a974f591b01e4d 17-Apr-2018 imp <imp@FreeBSD.org> Add PNP info to the bce driver.

Submitted by: Lakhan Shiva Kamireddy
Pull Request: https://github.com/freebsd/freebsd/pull/136
ebda8d9db801624bdae1ccc953541d8341a5ad84 20-Nov-2017 pfg <pfg@FreeBSD.org> sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
f7696c94e4b366a4d4da34b8725c1ca902d829a6 20-Feb-2017 pfg <pfg@FreeBSD.org> sys/dev: Replace zero with NULL for pointers.

Makes things easier to read, plus architectures may set NULL to something
different than zero.

Found with: devel/coccinelle
MFC after: 3 weeks
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
eed4bd22add2269ccde27996035581801316c610 03-May-2016 pfg <pfg@FreeBSD.org> sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.
729533413f4e97bb65852c22fb914805e2759b5a 21-Apr-2016 pfg <pfg@FreeBSD.org> sys: use our roundup2/rounddown2() macros when param.h is available.

rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
fe82580e96f90207d8231ebbe1c9f7fbf5f2e04b 25-Sep-2014 glebius <glebius@FreeBSD.org> - Provide bce_get_counter() to return counters that are not collected,
but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
- While here fix 3 instances of the same bug, when error counter was ++
in one place and then assigned in other place, losing the increment.
Achieve that storing soft errors counters in softc.
4248847477626776ce01157c9d7def246f17f486 03-Sep-2014 glebius <glebius@FreeBSD.org> Use CSUM_BITS instead of incorrect copy.

Sponsored by: Nginx, Inc.
35b126e324b8032aebea9ab6b4daf7c0bf8daed0 28-Jun-2014 hselasky <hselasky@FreeBSD.org> Pull in r267961 and r267973 again. Fix for issues reported will follow.
fc21f40567ac7485e9e987cf5a539bd0d11c7155 27-Jun-2014 gjb <gjb@FreeBSD.org> Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory
bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9 27-Jun-2014 hselasky <hselasky@FreeBSD.org> Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies
796b4715faa83209cd9a7cd419f62aa9faf9d2db 11-Jun-2014 jhb <jhb@FreeBSD.org> - Unmap static DMA buffers allocated via bus_dmemem_alloc() before
freeing them instead of after.
- Check the bus address of a static DMA buffer to decide if the associated
map should be unloaded.
- Don't try to destroy bus dma maps for static DMA buffers.

Reviewed by: davidcs
7a535d184518005fc2e123c2da36f15dc88c2e96 12-May-2014 davidcs <davidcs@FreeBSD.org> MFC r265703
Modify Copyright information and other strings to reflect
Qlogic Corporation's purchase of Broadcom's NetXtreme business.
Added clean option to Makefile

Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
8095e01e3e9635812d481bec6c2d39c5c75615c2 08-May-2014 davidcs <davidcs@FreeBSD.org> Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business.
Added clean option to Makefile

Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
MFC after:5 days
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
dda2180ec107d166442a8d866dc3c9724ec24a84 04-Nov-2013 yongari <yongari@FreeBSD.org> MFC r257307:
Fix regression introduced in r235816.
r235816 triggered kernel panic or hang after warm boot.
Don't blindly restore BCE_EMAC_MODE media configuration in
bce_reset(). If driver is about to shutdown it will invoke
bce_reset() which in turn results in restoring BCE_EMAC_MODE
media configuration. This operation seems to confuse controller
firmware.
Approved by: re (glebius)
70ab0619926b5574b33d3ab2f659e54db04703fd 29-Oct-2013 yongari <yongari@FreeBSD.org> Fix regression introduced in r235816.
r235816 triggered kernel panic or hang after warm boot.
Don't blindly restore BCE_EMAC_MODE media configuration in
bce_reset(). If driver is about to shutdown it will invoke
bce_reset() which in turn results in restoring BCE_EMAC_MODE
media configuration. This operation seems to confuse controller
firmware.

Reported by: Paul Herman (herman <> cleverbridge dot com)
Tested by: sbruno, Paul Herman (herman <> cleverbridge dot com)
b86044b9a978e345ee170237996f0998b5a1ece9 26-Oct-2013 glebius <glebius@FreeBSD.org> Move includes from if_bcereg.h to .c files.
ee3f3f4b852b1c526f9625d690a02180c796de0b 19-Aug-2013 andre <andre@FreeBSD.org> Remove unused and incomplete support for delayed fragment checksums
from bce(4), bxe(4), mge(4) and ti(4) drivers.
c43c218e2376600315f1fbd5f72f8db54c391e08 30-Jun-2013 yongari <yongari@FreeBSD.org> Fix triggering false watchdog timeout when controller is in PAUSE
state. Previously it used to check if controller has sent a
PAUSE frame to the remote peer.

Reported by: David Imhoff via Brad Smith <brad@OpenBSD.org>
Submitted by: davidch (initial version)
Reviewed by: davidch, David Imhoff <dimhoff_devel@xs4all.nl>
3bedef3bedc5c3327e688ac94891ec1a53a132ad 30-May-2013 marius <marius@FreeBSD.org> - Checking for spurious interrupts is only necessary when using INTx.
Actually, this may be further optimized for controller variants
supporting one-shot MSIs but I'm lacking the necessary hardware for
testing.
- Add some missing synchronization of the statistics and status DMA
maps.

MFC after: 1 week
910939ccf3182ad800172a1b9068f0b1e2fae96b 30-May-2013 marius <marius@FreeBSD.org> - Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are not
altered or actually needed there any longer.
- Honor errors passed to the DMA mapping callbacks.
- In bce_get_rx_buf(), do not reserve stack space for more DMA segments
than actually necessary.
- In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9).
- In bce_rx_intr(), remove a pointless check for an empty mbuf pointer
which can only happen in case of a severe programming error. Moreover,
recovering from that situation would require way more actions with header
splitting enabled (which it is by default).
- Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the
firmware has been told to keep it. [1]

Obtained from: OpenBSD [1]
MFC after: 1 week
c9d284c8e7c8f003864b7468cc6725ca974dec0f 30-May-2013 marius <marius@FreeBSD.org> - As a follow-up to r247565, make firmware images that do not require
patching at runtime actually const.
- Remove pointless softc members by employing the corresponding constants
directly.
- Remove pointless returns.
- Remove unnecessary inclusion of opt_device_polling.h.
- Replace an outdated and now bogus comment in bce_tick() with the
appropriate one.

MFC after: 1 week
d85a1ce450d43074c2b7a0b3598366de11994d72 01-Mar-2013 marius <marius@FreeBSD.org> Initialize count in order to appease clang.

Submitted by: delphij
8dc4f9c4f210704409703954be38a00a4cbe1951 01-Mar-2013 marius <marius@FreeBSD.org> - Make tables, device ID strings etc const.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Remove redundant/unused softc members.
- Don't allocate MSI/MSI-X as RF_SHAREABLE.
- Re-use bus accessor macros instead of duplicating them.
- In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY
address (missed in r213893).

MFC after: 1 week
a69aaa772119d359e38760dd0e931bed9afb88bf 04-Dec-2012 glebius <glebius@FreeBSD.org> Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
cd840ea089c3546a5cd705044efba4e7ec8621e7 27-Nov-2012 andre <andre@FreeBSD.org> Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability.
Checksumming the IP header of fragments is no different from doing
normal IP headers.

Discussed with: yongari
MFC after: 1 week
28b0ac4a40b8b930e6666ce82ff27e06d2cf2023 06-Aug-2012 davide <davide@FreeBSD.org> Remove a spurious bace which cause build fail in case BCE_DEBUG option
is turned on.

Reviewed by: delphij
Approved by: gnn (mentor)
Sponsored by: Google Summer of Code 2012
MFC after: 1 week
0c90b7cf737318a63627b3dc00bcdd04016d959f 23-May-2012 yongari <yongari@FreeBSD.org> Make IPMI work in the bce driver even when the interface is
configured down. Formerly, IPMI communication was lost whenever the
interface was not up. The reason was that the BCE_EMAC_MODE
register was not configured with the correct media settings. There
are two parts to the fix.

First, resetting the chip in bce_reset() causes the BCE_EMAC_MODE
register to be initialized to a default value that does not
necessarily correspond to the actual media settings. The fix
implemented here is a bit of a hack. Ideally, at the end of
bce_reset() we would poll the PHY to determine the negotiated media,
and then we would set the BCE_EMAC_MODE register accordingly. That
is difficult, since the PHY is abstracted behind the MII layer and is
not supposed to be queried directly from the MAC driver. Instead,
we read the BCE_EMAC_MODE register at the beginning of bce_reset()
and then restore its media bits to their original values before
returning. If IPMI is up and running, then the link is already
established and the BCE_EMAC_MODE register is already set appropriately
when bce_reset() is called. If IPMI is not running, no harm is
done by preserving the BCE_EMAC_MODE settings. The driver will set
the register properly once the interface is configured up and link
is established.

Second, bce_miibus_statchg() is sometimes called when the link is
down. In that case, the reported media settings are invalid.
Formerly, the driver used them anyway to setup the BCE_EMAC_MODE
register. We now avoid changing any MAC registers unless link is
active and the reported media settings are valid.

Submitted by: jdp
Tested by: jdp
MFC after: 5 days
62a24888237bd813997b2923ac098f311a35609b 09-May-2012 yongari <yongari@FreeBSD.org> Implement basic remote PHY support. Remote PHY allows the
controller to perform MDIO type accesses to a remote transceiver
using message pages defined through MRBE(multirate backplane
ethernet). It's used in blade systems(e.g Dell Blade m610) which
are connected to pass-through blades rather than traditional
switches.
This change directly manipulates firmware's mailboxes to control
remote PHY such that it does not use mii(4). Alternatively, as
David said, it could be implemented in brgphy(4) by creating a fake
PHY and let brgphy(4) do necessary mii accesses and bce(4) can
implement mailbox accesses based on the type of brgphy(4)'s mii
accesses. Personally, I think it would make brgphy(4) hard to
maintain since it would have to access many bce(4) registers in
brgphy(4). Given that there are users who are suffering from lack
of remote PHY support, it would be better to get working system
rather than waiting for complete/perfect implementation.

Tested by: Jan Winter ( jan.winter <> kantarmedia dot de )
Reviewed by: davidch (initial version)
MFC after: 2 weeks
680cd1f369fa3b1e4d1feff3c3d25c3a2a4f4b08 08-May-2012 davidch <davidch@FreeBSD.org> - Rename sysctl "loose_rx_mtu" to "strict_rx_mtu" to match code usage.

Submitted by: davidch
MFC after: 1 day
74d5826dee4ed85c5c5c6a30263eb75ed253f4c7 07-May-2012 yongari <yongari@FreeBSD.org> Restore jumbo frame configuration which was broken in r218423.

Submitted by: Andrey Zonov <andrey <> zonov dot org > (initial version)
Tested by: Andrey Zonov <andrey <> zonov dot org >
MFC after: 1 week
f3299cb2fb2e3ce259e36d9f4b84e63c1d940acb 11-Apr-2012 yongari <yongari@FreeBSD.org> Back out r228476.
r228476 fixed superfluous link UP/DOWN messages but broke IPMI
access during boot. It's not clear why r228476 breaks IPMI and
should be revisited.

Reported by: Paul Guyot <paulguyot <> ieee dot org >
MFC after: 1 week
d0b9b8460db41f0b5895f15cab33115a5e6d2480 13-Dec-2011 yongari <yongari@FreeBSD.org> Rework link state tracking and remove superfluous link UP/DOWN
messages.
o Add check for actually resolved speed in miibus_statchg callback
instead of blindly reprogramming BCE_EMAC_MODE register. The
callback may be called multiple times(e.g. link UP, link
transition, auto-negotiate complete etc) while auto-negotiation
is in progress. All unresolved link state changes are ignored
now and setting BCE_EMAC_MODE after link establishment is done
once.
o bce(4) is careful enough not to drive MII_TICK if driver got a
valid link. To detect lost link, bce(4) relied on link state
change interrupt and if driver see the interrupt, it forced to
drive MII_TICK by calling bce_tick() in interrupt handler.
Because bce(4) generates multiple link state change interrupts
while auto-negotiation is in progress, bce_tick() would be
called multiple times and this resulted in generating multiple
link UP/DOWN messages.
With this change, bce_tick() is not called in interrupt handler
anymore such that miibus_statchg callback handles link state
changes with consistent manner.

Reviewed by: davidch
17e14c6132be998c8e8d0c2fc89ff0b66d24999c 22-Nov-2011 marius <marius@FreeBSD.org> - There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.
6e9e854884e3fcfa127843dd7969c7d3015c76be 08-Nov-2011 attilio <attilio@FreeBSD.org> MFC
0c56cf839d3e773173db46a972d3792e8a36820d 07-Nov-2011 ed <ed@FreeBSD.org> Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
a4a1ec6b649211ccec5b5e059d0d278c5d62f08e 08-Oct-2011 yongari <yongari@FreeBSD.org> BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
remove explicit checks for BCM5716.
The BCM5709 and BCM5716 chips are virtually indistinguishable by
software except for the PCI device ID. The two chips differ in
that BCM5709 supports TCP/IP and iSCSI offload in Windows while
the BCM5716 doesn't.
While I'm here remove now unused definition of BCE_CHIP_NUM_5716
and BCE_CHIP_ID_5716_C0.

Reported by: sbruno
Reviewed by: davidch
Tested by: davidch
d0f32374e669176f507d67889e3a92cc6a46232a 03-May-2011 marius <marius@FreeBSD.org> - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
(reporting IFM_LOOP based on BMCR_LOOP is left in place though as
it might provide useful for debugging). For most mii(4) drivers it
was unclear whether the PHYs driven by them actually support
loopback or not. Moreover, typically loopback mode also needs to
be activated on the MAC, which none of the Ethernet drivers using
mii(4) implements. Given that loopback media has no real use (and
obviously hardly had a chance to actually work) besides for driver
development (which just loopback mode should be sufficient for
though, i.e one doesn't necessary need support for loopback media)
support for it is just dropped as both NetBSD and OpenBSD already
did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
instead of discrete function pointers, and extend this to include
a "reset" entry point. Make sure any PHY-specific reset routine is
always used, and provide one for lxtphy(4) which disables MII
interrupts (as is done for a few other PHYs we have drivers for).
This includes changing NIC drivers which previously just called the
generic mii_phy_reset() to now actually call the PHY-specific reset
routine, which might be crucial in some cases. While at it, the
redundant checks in these NIC drivers for mii->mii_instance not being
zero before calling the reset routines were removed because as soon
as one PHY driver attaches mii->mii_instance is incremented and we
hardly can end up in their media change callbacks etc if no PHY driver
has attached as mii_attach() would have failed in that case and not
attach a miibus(4) instance.
Consequently, NIC drivers now no longer should call mii_phy_reset()
directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
The purpose of that function is to perform the common steps to attach
a PHY driver instance and to hook it up to the miibus(4) instance and to
optionally also handle the probing, addition and initialization of the
supported media. So all a PHY driver without any special requirements
has to do in its bus attach method is to call mii_phy_dev_attach()
along with PHY-specific MIIF_* flags, a pointer to its PHY functions
and the add_media set to one. All PHY drivers were updated to take
advantage of mii_phy_dev_attach() as appropriate. Along with these
changes the capability mask was added to the mii_softc structure so
PHY drivers taking advantage of mii_phy_dev_attach() but still
handling media on their own do not need to fiddle with the MII attach
arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
structure. Several PHY drivers require this information also after
attaching and previously had to wrap their own softc around mii_softc.
NetBSD/OpenBSD also keep track of the model and revision on their
mii_softc structure. All PHY drivers were updated to take advantage
as appropriate.
- Convert the mebers of the MII data structure to unsigned where
appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
when mapping an OUI to the MII ID registers. All PHY drivers and
miidevs where changed as necessary. Actually this now again allows to
largely share miidevs with NetBSD, which fixed this problem already
9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
weren't explicitly converted to support flow control before. It's
unclear whether flow control actually works with these but typically
it should and their net behavior should be more correct with these
changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from: NetBSD (partially)
Reviewed by: yongari (earlier version), silence on arch@ and net@
00c3c01f4fbb02387e132c417f8a035d0366ee0d 23-Mar-2011 jhb <jhb@FreeBSD.org> Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
pci_find_cap() instead.
6bdddc88cd6b01875220fca755de698dff8aa173 10-Feb-2011 davidch <davidch@FreeBSD.org> - Added error checking to nvram read functions.
- Minor style updates.

Submitted by: gcooper@freebsd.org
MFC after: 2 weeks
93acd8b57328416a75419b8798763cecaa1bbb29 07-Feb-2011 davidch <davidch@FreeBSD.org> - Added systcls for header splitting, RX/TX buffer count, interrupt
coalescing, strict RX MTU, verbose output, and shared memory debug.
- Added additional debug counters (VLAN tags and split header frames).
- Updated debug counters to 64 bit definitions.
- Updated l2fhdr bit definitions.
- Combined RX buffer sizing into a single function.
- Added buffer size and interrupt coalescing settings to adapter info
printout.

Submitted by: davidch
MFC after: 2 weeks
8045b08e4df0219c258a95afc6a654c8ba4f3494 12-Jan-2011 mdf <mdf@FreeBSD.org> sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.

Commit the rest of the devices.
b355314642d1e24edf4e05d08b793f8b9ea76458 14-Nov-2010 dim <dim@FreeBSD.org> Sync: merge r215273 through r215318 from ^/head.
278d761d736b370c6ad85e2ff6593c0f73d10c6f 14-Nov-2010 marius <marius@FreeBSD.org> o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
support in mii(4):
- Merge generic flow control advertisement (which can be enabled by
passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
IFM_FLOW isn't implemented as a global option via the "don't care
mask" but instead as a media specific option this. This has the
following advantages:
o allows flow control advertisement with autonegotiation to be
turned on and off via ifconfig(8) with the default typically
being off (though MIIF_FORCEPAUSE has been added causing flow
control to be always advertised, allowing to easily MFC this
changes for drivers that previously used home-grown support for
flow control that behaved that way without breaking POLA)
o allows to deal with PHY drivers where flow control advertisement
with manual selection doesn't work or at least isn't implemented,
like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
by setting MIIF_NOMANPAUSE
o the available combinations of media options are readily available
from the `ifconfig -m` output
- Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
- Change IFM_ETH_MASTER from being implemented as a global option via
the "don't care mask" to a media specific one as it actually is only
applicable to IFM_1000_T to date.
- Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
actually configure manually selected slave mode (like we also do in
the PHY specific implementations).
- Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
e1000phy(4) and ip1000phy(4) to use the generic flow control support
instead of home-grown solutions via IFM_FLAGs. This includes changing
these PHY drivers and smcphy(4) to no longer unconditionally advertise
support for flow control but only if the selected media has IFM_FLOW
set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
the contents of the BMSR via mii_phy_add_media() instead of hardcoding
them. The latter approach seems to have developed historically, besides
causing unnecessary code duplication it was also undesirable because
brgphy_mii_phy_auto() already based the capability advertisement on the
contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
just BCM5701. Apparently this was a misinterpretation of a workaround
in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
this doesn't mean we can't set these as well on other PHYs for manual
media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
IFM_1000_T master mode support now is generally available with all PHY
drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
not applicable there.

Reviewed by: yongari (plus additional testing)
Obtained from: NetBSD (partially), OpenBSD (partially)
MFC after: 2 weeks
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
ac757f20ddc830f07633b578212e7bed65957067 15-Oct-2010 marius <marius@FreeBSD.org> Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these
are only straight forward conversions though.

Reviewed by: yongari
92023f4cc9e471aa4ad6bf4362c248d8f173e46a 14-Oct-2010 yongari <yongari@FreeBSD.org> Make sure to not use stale ip/tcp header pointers. The ip/tcp
header parser uses m_pullup(9) to get access to mbuf chain.
m_pullup(9) can allocate new mbuf chain and free old one if the
space left in the mbuf chain is not enough to hold requested
contiguous bytes. Previously drivers can use stale ip/tcp header
pointer if m_pullup(9) returned new mbuf chain.

Reported by: Andrew Boyer (aboyer <> averesystems dot com)
MFC after: 10 days
81421f8fc287fbb1fc113cd84cab418e9c373270 06-Oct-2010 ambrisko <ambrisko@FreeBSD.org> Add the capability to read the complete contents of the NVRAM via sysctl
dev.bce.<unit>.nvram_dump
Add the capability to write the complete contents of the NVRAM via sysctl
dev.bce.<unit>.nvram_write
These are only available if the kernel option BCE_DEBUG is enabled.
The nvram_write sysctl also requires the kernel option
BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your
own caution. Since the MAC addresses are stored in the NVRAM, if you
dump one NIC and restore it on another NIC the destination NIC's
MAC addresses will not be preserved. A tool can be made using these
sysctl's to manage the on-chip firmware.

Reviewed by: davidch, yongari
c3237393534cb9ba2cca443aa13b7a7fe3aabf1e 26-Jul-2010 jkim <jkim@FreeBSD.org> Fix an apparent typo.

Found by: clang
Reviewed by: davidch, yongari
f62d502b815b7da96ef52ef4e3e9ba073634c64a 19-Jul-2010 yongari <yongari@FreeBSD.org> Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.

Reviewed by: davidch
635930644d40205c22fb99efd6b46f15a419e0a1 19-Jul-2010 yongari <yongari@FreeBSD.org> Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()
calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to
take advantage of efficient synchronization for architectures that
support that feature.

Reviewed by: davidch
583fcb4c198241097addb794704182a5ed9ea982 19-Jul-2010 yongari <yongari@FreeBSD.org> Use bus_get_dma_tag() to get parent tag. Also use
BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
Previously it used MAXBSIZE which was wrong.

Reviewed by: davidch
8c83d23ff01634af89e336ad2bf4e84ec778b1cc 19-Jul-2010 yongari <yongari@FreeBSD.org> Add KASSERT to check number of returned DMA segments.

Reviewed by: davidch
e0c0ca83134dab5fa637e707a46195a16f964d43 19-Jul-2010 yongari <yongari@FreeBSD.org> Do not report current link state if interface is not UP.

Reviewed by: davidch
0e81d4d08522fb054cad9e4a3f63e196f0c38e54 19-Jul-2010 yongari <yongari@FreeBSD.org> Correctly check the result of media selection. Previously it always
returned success.

Reviewed by: davidch
7ded005b160abb3b56680e75ac96c4bd10c710a3 19-Jul-2010 yongari <yongari@FreeBSD.org> Don't change current media in bce_stop(). There is no need to do
this here.

Reviewed by: davidch
ca25b4a12a3cc882383341e0a4b75502ba9660b4 19-Jul-2010 yongari <yongari@FreeBSD.org> Have bce_init_ctx() return error code and make caller check the
return code. If context was not setup correctly give up
initialization. While I'm here move variable declarations to the
beginning of the function.

Reviewed by: davidch
098866995f188ced262ff7290022016d415d1f9b 19-Jul-2010 yongari <yongari@FreeBSD.org> When we didn't find a matching flash device, do not touch flash
config data. While I'm here, use return code of bce_init_nvram()
to set error instead of directly setting ENODEV.

Reviewed by: davidch
7b5a89958997969178e7eae068188b900a502f8e 07-May-2010 fabient <fabient@FreeBSD.org> Add a fastpath to allocate from packet zone when using m_getjcl.
This will add support for packet zone for at least igb and ixgbe
and will avoid to check for that in bce and mxge.

MFC after: 1 week
5724de4184a459c33f997588030ec060f43dcb52 30-Apr-2010 davidch <davidch@FreeBSD.org> - Enable flow control.
- Print device details only when verbose boot is enabled.
- Add debug output for shared memory access.
- Add debug statistics (checksum offload & VLAN frame counters).
- Modify TX path to update consumer index for each frame completed
rather than updating the consumer index only once for a group of
frames to improve small packet performance.
- Print driver/firmware pulse messages only when verbose boot
is enabled.
- Add debug sysctl to clear statistics.
- Fix more style(9) violations.

MFC after: 2 weeks
3a97c152ac99a9140341fee8f51c6870650ac760 15-Apr-2010 yongari <yongari@FreeBSD.org> MFC r206268
- Fixed 5708S 2.5G support broken in last commit.
- Added some new debug helper routines to systcl.
- Fixed many of the style(9) violations that have crept into the code
due to my use of a "smart" editor.
0ac1930cf400bedd207799d9230972c17fbdc5db 15-Apr-2010 yongari <yongari@FreeBSD.org> MFC r205300:
- Added support for 5709S/5716S PHYs.
- Update copyright to 2010.
- Add new debug code for RV2P block.
- Improve output formatting for various debug functions.

PR: kern/134658, kern/136417, kern/139761, kern/140970
d03757703dfb933bd066fdfa8840b5df66648cf6 06-Apr-2010 davidch <davidch@FreeBSD.org> - Fixed 5708S 2.5G support broken in last commit.
- Added some new debug helper routines to systcl.
- Fixed many of the style(9) violations that have crept into the code
due to my use of a "smart" editor.

MFC after: 2 weeks
7aba52d562ec4cc6dca5a6d7d5b0443262e99cff 23-Mar-2010 yongari <yongari@FreeBSD.org> MFC r204373-204374:
r204373:
Move TSO setup to new function bce_tso_setup(). Also remove VLAN
parsing code in TSO path as the controller requires VLAN hardware
tagging to make TSO work over VLANs.
While parsing the mbuf in TSO patch, always perform check for
writable mbuf as bce(4) have to reset IP length and IP checksum
field of IP header and make sure to ensure contiguous buffer before
accessing IP/TCP headers. While I'm here replace magic number 40 to
more readable sizeof(struct ip) + sizeof(struct tcphdr).

r204374:
Add TSO support on VLANs. bce(4) controllers require VLAN hardware
tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
if VLAN hardware tagging is disabled.
8becc962803ce42d4fee07087566287b40ca88a0 23-Mar-2010 yongari <yongari@FreeBSD.org> MFC r204368,204370-204372:
r204368:
Allow disabling VLAN hardware tag stripping with software work
around. Management firmware(ASF/IPMI/UMP) requires the VLAN
hardware tag stripping so don't actually disable VLAN hardware tag
stripping. If VLAN hardware tag stripping was disabled, bce(4)
manually reconstruct VLAN frame by appending stripped VLAN tag.
Also remove unnecessary IFCAP_VLAN_MTU message.

r204370:
Make sure to stop controller first before changing MTU. And if
interface is not running don't initialize controller.
While here remove unnecessary update of error variable.

r204371:
Make toggling TSO, VLAN hardware checksum offloading work. Also fix
TX/RX checksum handler to set/clear relavant assist bits which was
used to cause unexpected results.
With this change, bce(4) can be bridged with other interfaces that
lack TSO, VLAN checksum offloading.

r204372:
Prefer m_collapse(9) over m_defrag(9).
34780573a57aa4c419bc2d65287b30894660a0f7 19-Mar-2010 yongari <yongari@FreeBSD.org> MFC r202717:
- Added a workaround for NC-SI management firmware that would allow
frames to be accepted while the driver is resetting the hardware.
This failure is generally observed when broadcast frames are received
during driver load and will generate "Unable to write CTX memory"
errors.
- Small changes to driver flags display.

PR: kern/135836, kern/140684
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
50b21e387fa29ca09b1e58274ac7c0f5a6eeb5f0 18-Mar-2010 davidch <davidch@FreeBSD.org> - Added support for 5709S/5716S PHYs.
- Update copyright to 2010.
- Add new debug code for RV2P block.
- Improve output formatting for various debug functions.

MFC after: 2 weeks
34ee75fb6591aad0cd813a8aecc9be9dff5f3bbb 26-Feb-2010 yongari <yongari@FreeBSD.org> Add TSO support on VLANs. bce(4) controllers require VLAN hardware
tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
if VLAN hardware tagging is disabled.

Reviewed by: davidch
142d4bad6742190307c16cf0996ca20d233188ab 26-Feb-2010 yongari <yongari@FreeBSD.org> Move TSO setup to new function bce_tso_setup(). Also remove VLAN
parsing code in TSO path as the controller requires VLAN hardware
tagging to make TSO work over VLANs.
While parsing the mbuf in TSO patch, always perform check for
writable mbuf as bce(4) have to reset IP length and IP checksum
field of IP header and make sure to ensure contiguous buffer before
accessing IP/TCP headers. While I'm here replace magic number 40 to
more readable sizeof(struct ip) + sizeof(struct tcphdr).

Reviewed by: davidch
90740e4631e4ed0c337597c310c9984b01a8560a 26-Feb-2010 yongari <yongari@FreeBSD.org> Prefer m_collapse(9) over m_defrag(9).

Reviewed by: davidch
a4df49e099e329f7f0930f2000baf75b5e4e69bb 26-Feb-2010 yongari <yongari@FreeBSD.org> Make toggling TSO, VLAN hardware checksum offloading work. Also fix
TX/RX checksum handler to set/clear relavant assist bits which was
used to cause unexpected results.
With this change, bce(4) can be bridged with other interfaces that
lack TSO, VLAN checksum offloading.

Reviewed by: davidch
c08d71acc77a9b5828d94d12fcd7145a33c2f2ac 26-Feb-2010 yongari <yongari@FreeBSD.org> Make sure to stop controller first before changing MTU. And if
interface is not running don't initialize controller.
While here remove unnecessary update of error variable.

Reviewed by: davidch
ce9f29768bfd25b826f77bb33e2c43dee3b7ede4 26-Feb-2010 yongari <yongari@FreeBSD.org> Allow disabling VLAN hardware tag stripping with software work
around. Management firmware(ASF/IPMI/UMP) requires the VLAN
hardware tag stripping so don't actually disable VLAN hardware tag
stripping. If VLAN hardware tag stripping was disabled, bce(4)
manually reconstruct VLAN frame by appending stripped VLAN tag.
Also remove unnecessary IFCAP_VLAN_MTU message.

Reviewed by: davidch
569289cc1ef0af4007ff6b1aacec6551eacd6309 20-Jan-2010 davidch <davidch@FreeBSD.org> - Added a workaround for NC-SI management firmware that would allow
frames to be accepted while the driver is resetting the hardware.
This failure is generally observed when broadcast frames are received
during driver load and will generate "Unable to write CTX memory"
errors.
- Small changes to driver flags display.
f9a6baea98b0570a9b40904e4d83f9e6e0e28f0f 15-Nov-2009 stas <stas@FreeBSD.org> - MFC r198320:
Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
into if_bce.c anyway. It is disabled by default.
f4db0c13dfa7f13866d61e2950d9093cc648047a 21-Oct-2009 stas <stas@FreeBSD.org> - Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
splitting in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
propagated into if_bce.c anyway. It is disabled by default.

Approved by: davidch
MFC after: 3 days
52972616516a18e69bb2849c2f2e718ee644b27f 08-Sep-2009 phk <phk@FreeBSD.org> Revert previous commit and add myself to the list of people who should
know better than to commit with a cat in the area.
2314521104388ada19392a3b2cdaca4ba6f82243 08-Sep-2009 phk <phk@FreeBSD.org> Add necessary include.
be5740a255fbcb1d4053e709cb7f22bb96320eb0 26-Jun-2009 rwatson <rwatson@FreeBSD.org> Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs. This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.

For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.

Approved by: re (kib)
MFC after: 6 weeks
daf61e7b90caa82bf71529387b20f823971b0e43 23-Jun-2009 davidch <davidch@FreeBSD.org> - Added code to read bootcode firwmare version.
- Created dedicated shared memory access routines.

MFC after: One week
8dd08ce26523a86f2f91de35a2bad2d04bd3204b 18-May-2009 delphij <delphij@FreeBSD.org> DMA synchronization fixes:

- In bce_rx_intr(), use BUS_DMASYNC_POSTREAD instead of
BUS_DMASYNC_POSTWRITE, as we want to "read" from the
rx page chain pages.
- Document why we need to do PREWRITE after we have updated
the rx page chain pages.
- In bce_intr(), use BUS_DMASYNC_POSTREAD and
BUS_DMASYNC_PREREAD when before and after CPU "reading"
the status block.
- Adjust some nearby style mismatches/etc.

Pointed out by: yongari
Approved by: davidch (no objection) but bugs are mine :)
8583a840068803e7fd9e0fc2452605bca6e822d8 08-May-2009 davidch <davidch@FreeBSD.org> - Fixed incorrect packet length problem caused be earlier change to
support ZERO_COPY_SOCKETS.
- Created #define for context initialization retry count.

MFC after: 1 week
3b8bffce0869741be8850515a08b3660f97e8315 04-Mar-2009 davidch <davidch@FreeBSD.org> - Updated firmware to latest 4.6.X release.
- Added missing firmware for 5709 A1 controllers.
- Changed some debug statistic variable names to be more consistent.

Submitted by: davidch
MFC after: Two weeks
e039f0dcb5d4c4dbe5e93bbb4151c305de646d65 27-Feb-2009 davidch <davidch@FreeBSD.org> - Update copyright to 2009.
- Only enable split header operation when ZERO_COPY_SOCKETS is enabled in
the kernel.

Submitted by: davidch
MFC after: 1 week
b5317106cf105d81ddfd5c89349d1ba9ce339ece 15-Jan-2009 delphij <delphij@FreeBSD.org> Changes to match "Marketing Description" from Broadcom for HP servers.

Submitted by: davidch
MFC after: 2 months
45100d6161444776d858b80bd8c5c8b4950cb62a 13-Jan-2009 delphij <delphij@FreeBSD.org> Remove intermediate variable busaddr and have bus_* operate directly on
softc members upon initialization.

Reviewed by: davidch
MFC after: 1 month
b997fbdafd4f46352f249f61a55dc688b23dd6b3 13-Jan-2009 delphij <delphij@FreeBSD.org> Add several HP OEM parts' PCI IDs.

MFC after: 2 months
d0cece42b9e5bb36b8b2473caed8df147b13c9c5 23-Dec-2008 kmacy <kmacy@FreeBSD.org> IF_RELENG7 185850:186420

merge latest from 7 stable
7a3ee73de5b8b84eacf81efb4b3eefae05dee5d8 16-Dec-2008 delphij <delphij@FreeBSD.org> Don't count InFramesL2FilterDiscards into Ierr. This value does not represent
a real packet error but simply indicate that an unexpected unicast or multicast
error was received by the NIC, which was not counted in the past as well.

Reported by: many (on -stable@)
Reviewed by: davidch
MFC after: 3 days
fff25bc8abd42018e590c2e9b084e93902b5b1b1 16-Dec-2008 delphij <delphij@FreeBSD.org> Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL before
doing bus_dmamap_sync() since it operates on the former, not the latter.

Reviewed by: davidch
6f7ed797d320c33ec8c210b24fb80ef01c5e5f13 10-Dec-2008 kmacy <kmacy@FreeBSD.org> IF_RELENG7 184527:185849
fe1ef47ea0b7a242dcb804e8f3a6bff035879f3b 03-Dec-2008 delphij <delphij@FreeBSD.org> Don't attempt to clear status updates if we did not do a link state
change. As a side effect, this makes the excessive interrupts to
disappear which has been observed as a regression in recent stable/7.

Reported by: many (on -stable@)
Reviewed by: davidch
3b7bb201180371919ffbed7c465be32203e3cc11 23-Nov-2008 kmacy <kmacy@FreeBSD.org> IF_RELENG_7 184527:185197
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
f750559c3fe5d18392fa3f5969411eef4c84075c 19-Nov-2008 delphij <delphij@FreeBSD.org> Correct a logic error when testing BCE_PHY_SERDES_FLAG.

PR: kern/128801
Pointed out by: Adam Morrison
Ok'ed by: davidch
MFC after: 3 days
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
fecec6a1868c61aee6349432255ed8fc989a5a34 27-Aug-2008 davidch <davidch@FreeBSD.org> - Updated support for 5716.
- Added some additional code for debug builds.
- Fixed a problem printing physical memory on 64bit system during debugging.
- Modified some of the context memory and mailbox register names to more
clearly distinguish their use.
- Added memory barriers for Intel CPUs when accessing host memory data
structures which are written by hardware.

MFC after: Two weeks.
21569896cfb669ae5ec09c9a90c4a59b1023a9e2 13-Jun-2008 davidch <davidch@FreeBSD.org> - Added support for BCM5709 and BCM5716 controllers.

MFC after: 2 weeks
1a7f0803e4fbcc7296bbe6ec98d87438ca50abc4 10-Jun-2008 davidch <davidch@FreeBSD.org> - Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.
- Fixed a problem on i386 architecture when using split header/jumbo frame
firmware caused by hardware alignment requirements.
- Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/
disabled. Enabled by default.

PR: kern/123696
MFC after: 2 weeks
a6e6fbab6fee844f28f63ca80ba1714026fb33b7 30-May-2008 jhb <jhb@FreeBSD.org> Trim an extra semi-colon.
494160ee656e9d1bbcc0fb4d77980e3fd1d85da7 08-May-2008 scottl <scottl@FreeBSD.org> The BCE chips appear to have an undocumented requirement that RX frames be
aligned on an 8 byte boundary. Prior to rev 1.36 this wasn't a problem
because mbuf clusters tend be naturally aligned. The switch to using
split buffers with the first buffer being the embedded data area of the
mbuf has broken this assumption, at least on i386, causing a complete
failure of RX functionality. Fix this for now by using a full cluster for
the first RX buffer. A more sophisticated approach could be done with the
old buffer scheme to realign the m_data pointer with m_adj(), but I'm also
not clear on performance benefits of this old scheme or the performance
implications of adding an m_adj() call to every allocation.
ed5b3d4217956e072bb2e8353a32ceb66d2db84e 26-Apr-2008 marius <marius@FreeBSD.org> Remove some remnant alpha hacks.

Approved by: PCI-maintainers (imp, jhb)
0f2382be0f1c305537f916630e47d0e66eeeb1d2 11-Apr-2008 davidch <davidch@FreeBSD.org> - Fixed a problem with the send chain consumer index which would cause
TX traffic to sit in the send chain until a received packet kick
started the interrupt handler. This would cause extremely slow
performance when used with NFS over UDP.
- Removed untested polling code.
- Updated copyright year in the file header.
- Removed inadvertent ^M's created by DOS text editor.

MFC after: 2 weeks
5a4609341e06dba9cae395329a2bb0d7db7e67fb 13-Mar-2008 yongari <yongari@FreeBSD.org> MFC: Fix function prototype for device_shutdown method.
179a317c928823acb686ead063a858c69031e7c1 22-Feb-2008 davidch <davidch@FreeBSD.org> MFC after: 4 weeks

- Added loose RX MTU functionality to allow frames larger than 1500 bytes
to be accepted even though the interface MTU is set to 1500.
- Implemented new TCP header splitting/jumbo frame support which uses
two chains for receive traffic rather than the original single recevie
chain.
- Added additional debug support code.
d6d1923521f67b21a7319b500381a1e985b177ff 22-Nov-2007 yongari <yongari@FreeBSD.org> Fix function prototype for device_shutdown method.
e683c364601a5db78d6bd48f6e5b6965f05aef95 20-Aug-2007 davidch <davidch@FreeBSD.org> - Fixed a problem that would cause kernel panics and "bce0: discard frame .."
errors (especially when jumbo frames are enabled or in low memory systems)
because the RX chain was corrupted when an mbuf was mapped to an unexpected
number of buffers.
- Fixed a problem that would cause kernel panics when an excessively
fragmented TX mbuf couldn't be defragmented and was released by
bce_tx_encap().
788fd403115df43cbc47a56fc85785e8812006a2 31-Jul-2007 davidch <davidch@FreeBSD.org> - Fixed a problem that would cause kernel panics and "bce0: discard frame .."
errors (especially when jumbo frames are enabled or in low memory systems)
because the RX chain was corrupted when an mbuf was mapped to an unexpected
number of buffers.
- Fixed a problem that would cause kernel panics when an excessively
fragmented TX mbuf couldn't be defragmented and was released by
bce_tx_encap().

Approved by: re(hrs)
MFC after: 7 days
322e873bf8395207e265a234513175e28f66e413 14-Jul-2007 csjp <csjp@FreeBSD.org> commit.log
f35e9eb6831ffc54fd580daa211ec1ebb9676519 16-Jun-2007 davidch <davidch@FreeBSD.org> - Migrated IPMI fix from RELENG_6.
- Added additional debug code.
e7c59ea31703675102ef41f44fd4f4ee29b9d81a 14-Jun-2007 davidch <davidch@FreeBSD.org> - Fixed build problem with unused variable.
b06d865575470fbfb06d9ee192c88a4c1359bd79 14-Jun-2007 davidch <davidch@FreeBSD.org> - Updated firmware to latest release (v3.4.8) to fix TSO + jumbo frame lockup
- Added MSI (hw.bce.msi_enable) sysctl
- Fixed kernel panic when MSI is used and module is unloaded
- Added several new debug routines
- Removed slack space for RX/TX chains since it only covers sloppy coding
- Fixed a potential problem when programming jumbo MTU size in hardware
- Various other comment changes
- Added 2.5G support for BCM5708S
d5a0460612dc52476149f3d7a0389399c714c166 07-Jun-2007 davidch <davidch@FreeBSD.org> New Features:
- Added 2.5G support for BCM5708S.

MFC after: 4 weeks
349fe0e661c7007626c9ed89ae11328efe2d0504 05-Jun-2007 davidch <davidch@FreeBSD.org> Merged changes from HEAD, including:

- Updated copyright date to 2007.

- Tested with BCM5706 A3.

- Added ID for BCM5708 B2.

- Removed unused driver version string.

- Modified BCE_PRINTF macro to automatically fill-in the sc pointer.

- Fixed a kernel panic when the driver was loaded as a module from the
command-line because the MII bus pointer was null (i.e. the MII bus
hadn't been enumerated yet).

- Added fix proposed by Vladimir Ivanov <wawa@yandex-team.ru> to prevent
driver state corruption when releasing the lock during the ISR in
bce_rx_intr() to send packets up the stack.

- Added new TX chain and register read sysctl interfaces for debugging.

- Cleaned up formatting for various other debug routines.

- Added a new statistic maintained by firmware which tracks the number
of received packets dropped because no receive buffers are available.
0dfe831a4ec243f8d06721735a55ac5b3f667a3b 16-May-2007 davidch <davidch@FreeBSD.org> - Added TSO support
- Updated firmware to latest release (v3.4.8) to fix TSO + jumbo frame lockup
- Added MSI (hw.bce.msi_enable) and TSO (hw.bce.tso_enable) sysctls
- Fixed kernel panic when MSI is used and module is unloaded
- Added several new debug routines
- Removed slack space for RX/TX chains since it only covers sloppy coding
- Fixed a potential problem when programming jumbo MTU size in hardware
- Various other comment changes

MFC after: 4 weeks
6ab1aa7971bd4c712b1c6f75118c2dd8d2745ed6 04-May-2007 davidch <davidch@FreeBSD.org> MFC after: 2 weeks

Updated copyright date to 2007.

Tested with BCM5706 A3.

Added ID for BCM5708 B2.

Removed unused driver version string.

Modified BCE_PRINTF macro to automatically fill-in the sc pointer.

Fixed a kernel panic when the driver was loaded as a module from the
command-line because the MII bus pointer was null (i.e. the MII bus
hadn't been enumerated yet).

Added fix proposed by Vladimir Ivanov <wawa@yandex-team.ru> to prevent
driver state corruption when releasing the lock during the ISR in
bce_rx_intr() to send packets up the stack.

Added new TX chain and register read sysctl interfaces for debugging.

Cleaned up formatting for various other debug routines.

Added a new statistic maintained by firmware which tracks the number
of received packets dropped because no receive buffers are available.
c6b8fdd801667fa164182bb845b3418b4620e96e 31-Mar-2007 jhb <jhb@FreeBSD.org> MFC: Simple single-message MSI support.
17dc3a8d0b99255798645d58a5ad21868c501fb3 04-Mar-2007 csjp <csjp@FreeBSD.org> Catch up the rest of the drivers with the ether_vlan_mtap modifications.
If these drivers are setting M_VLANTAG because they are stripping the
layer 2 802.1Q headers, then they need to be re-inserting them so any
bpf(4) peers can properly decode them.

It should be noted that this is compiled tested only.

MFC after: 3 weeks
2f6d2004f4bc57e94f956c9ef12a2efb79f040e2 26-Feb-2007 jhb <jhb@FreeBSD.org> MFC: Add support for SERDES phys which are handled by gentbi(4). brgphy(4)
had to be changed to only attach to 5706C phys as the SERDES phys use the
same MII model ID.

Approved by: dwhite
6a2ffa86e5b748ba71e36d37462a936eb9101be7 23-Feb-2007 piso <piso@FreeBSD.org> o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
a5f7c166df139b784af228fe1a7d1d6f209aae71 08-Feb-2007 jhb <jhb@FreeBSD.org> MFC 1.18: Fix a typo in the device table that prevented 5708S adapters
from being probed.
fc9639c0eab20ff8cc1081d242ddab5a5f175fba 31-Jan-2007 jhb <jhb@FreeBSD.org> MFC: Fix compile with BCE_DEBUG.
6121ceb695f3bc05c543457efb668cc50779bd28 31-Jan-2007 jhb <jhb@FreeBSD.org> MFC: Add a locked variant of bce_ifmedia_upd() and add missing locking
to bce_ifmedia_upd().
b04d835340b5f0b364efb6c2ac45fa4bb5b9e239 27-Jan-2007 scottl <scottl@FreeBSD.org> MFC rev 1.26: Fix multicast.
3c7fc4d94cf691ec33107f3af812cb1d2c361f65 26-Jan-2007 dwhite <dwhite@FreeBSD.org> Add support for SERDES PHY configurations. These are commonly found in
blade systems, such as the Dell 1955 and the Intel SBXD132.

Development hardware for this work was provided by Broadcom and iXsystems.
A SBXD132 blade for testing was provided by Iron Systems.
c05aa6bb3f59fede85ec071d0c51776bd9eb0cbc 20-Jan-2007 scottl <scottl@FreeBSD.org> The multicast hash table has 8 slots in the BCE hardware, not 4 slots like
the BGE hardware. Adapt the driver for this.

Submitted by: Mike Karels
MFC After: 3 days
663437bbf2ec88d43d5b6278d6a75ef015104279 18-Jan-2007 delphij <delphij@FreeBSD.org> MFC if_bce.c (1.23-24), if_bcereg.h (1.11):

- Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bce_tick() callout.
- Instead of unconditionally resetting the controller, try to
skip the reset in case we got a pause frame, like em(4) did.
- Lock bce_tick() using callout_init_mtx().
cbd9e164046125adc3cf7eee878772255b2ab871 13-Jan-2007 jhb <jhb@FreeBSD.org> - Add a locked variant of bce_ifmedia_upd() for use within the driver and
add missing locking to bce_ifmedia_upd().
- While I'm here, unexpand an instance of LIST_FOREACH().

MFC after: 2 weeks
Reviewed by: scottl
ba8de43d95045a6fa4be2f520960071037b0c8a2 11-Jan-2007 delphij <delphij@FreeBSD.org> Space cleanup.
83499bc2d958aa69d2fa52ddaa4c7e8d3d04b929 11-Jan-2007 delphij <delphij@FreeBSD.org> - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bce_tick() callout.
- Instead of unconditionally resetting the controller, try to
skip the reset in case we got a pause frame, like em(4) did.
- Lock bce_tick() using callout_init_mtx().

Discussed with/Reviewed by: glebius, scottl, davidch
f5e17537588ec7e08c8f2f6d597c72e094eb5d14 06-Dec-2006 jhb <jhb@FreeBSD.org> Fix compile with BCE_DEBUG. The last one tripped up gcc 2.95 on 4.x even
with BCE_DEBUG turned off.
cda0da83eb2b538cf0ef15488a0e062522def40e 28-Nov-2006 scottl <scottl@FreeBSD.org> Merge rev 1.10 of if_bcereg.h and 1.20-1.21 of if_bce.c These fix VLAN tag
handling and close a race in the TX path that would lead to lost packets under
heavy load.

Approved by: re
458d936e9456dcc295c5890cad69165d4e6d171f 16-Nov-2006 scottl <scottl@FreeBSD.org> Due to an incorrect macro, it appears that this driver has always been
accidentally truncating off the VLAN tag field in the TX descriptor. Fix
this by splitting up the vlan_tag and flags fields into separate fields,
and handling them appropriately.

Sponsored by: Ironport
MFC After: 3 days
8b8b39ee6f0b7c6eb45607e9dcc17c0197580fdf 16-Nov-2006 jdp <jdp@FreeBSD.org> In bce_start_locked, check the used_tx_bd count rather than the
descriptor's mbuf pointer to see if the transmit ring is full. The
mbuf pointer is set only in the last descriptor of a
multi-descriptor packet. By relying on the mbuf pointers of the
earlier descriptors, the driver would sometimes overwrite a
descriptor belonging to a packet that wasn't completed yet. Also,
tx_chain_prod wasn't updated inside the loop, causing the wrong
descriptor to be checked after the first iteration. The upshot of
all this was the loss of some transmitted packets at medium to high
packet rates.

In bce_tx_encap, remove a couple of old statements that shuffled
around the tx_mbuf_map pointers. These now correspond 1-to-1 with
the transmit descriptors, and they are not supposed to be changed.

Correct a couple of inaccurate comments.

MFC after: 1 month
821d475e2153abcb1d2799ea78cd129f8e6bcdfa 15-Nov-2006 jhb <jhb@FreeBSD.org> Add MSI support to em(4), bce(4), and mpt(4). For now, we only support
devices that support a maximum of 1 message, and we use that 1 message
instead of the INTx rid 0 IRQ with the same interrupt handler, etc.
21803ea6f1397d03bf63a4e7bf9f4aac1f9f505d 31-Oct-2006 scottl <scottl@FreeBSD.org> Fix a typo in the device ID table that prevented 5708S chips from being
detected.

Submitted by: pyun
f0ba4fc6101c9e4248594fb4b758acd83a2f7fa2 24-Oct-2006 scottl <scottl@FreeBSD.org> Merge all changes from HEAD, except for rev 1.8 which changes the VLAN API.
This fixes a number of stability problems with the driver.

Approved by: re
Sponsored by: IronPort
077b3a2427d98693ce9a6f507645597093ce1753 21-Oct-2006 scottl <scottl@FreeBSD.org> Be more like the BGE driver. Ensure that at least 16 TX descriptors are
kept unused in the ring. This check should probably be moved up to
bce_start_locked at some point, as it'll make the loop up there slightly
more efficient, and will eliminate a costly set of busdma operations when
the ring is full. But this works for now.

This makes all of my UDP torture tests work. I'll cautiously say that
it might even work for other users now. Feedback is appreciated.
a910ffdb2ba6d23b6955f5a2d6192d4ea230c856 19-Oct-2006 scottl <scottl@FreeBSD.org> I can't find any reason why an 8 byte alignment should be enforced on rx
and tx buffers. Fix it there, and also don't have it be overridden by the
parent tag.
ac5b874a804ef9b603529b5f1c2a41c5a7c9ca52 19-Oct-2006 scottl <scottl@FreeBSD.org> Remove some spurious debugging, and use more complete error handling for
tx load and fragmentation problems.
c4037be3791d0f3c0e68b184957eb65bdfae4362 15-Oct-2006 scottl <scottl@FreeBSD.org> Overhaul the transmit and dma paths:
- Use bus_dmamap_load_mbuf_sg() to eliminate the need for the callback and
all of the extra bookkeeping associated with it.
- Eliminate the bce_dmamap_arg structure and streamline the memory allocation
routines to not need it. This does change some of the debugging messages.
- Refactor the loop that fills the buffer descriptor so that it can be done
with a single set of logic in a single loop instead of two sets of logic.
- Eliminate the need to cache and pass descriptor indexes between the start
loop and the encap function.
- Change the start loop to always check the ifnet sendq for more work.

This significantly helps the driver withstand large UDP workloads, though
it's still not perfect. I suspect the remaining work lies with handling
the OACTIVE flag, and also in possibly streamlining the interrupt handler
some. It is, however, nearly on par with the other popular gigabit drivers
in terms of stability now.
8bd9cc6205300867e480953bc80c05ad6deb634f 14-Oct-2006 scottl <scottl@FreeBSD.org> Simplify the arguments to bce_tx_encap.
2640fdfe79490398e5f0e7eb9b4a946497fad572 14-Oct-2006 scottl <scottl@FreeBSD.org> More small whitespace cleanups
5cccc781cc1b1d06014b63104ebd8c816d4382a5 14-Oct-2006 scottl <scottl@FreeBSD.org> Don't copy the bd_chain head pointers into temporary objects, they are
available globally.
aad3bc0906e5e558bd31463d023ba27eed93f630 13-Oct-2006 scottl <scottl@FreeBSD.org> Fix some whitespace
d0248e472fa247af29e5075a3f56c787b47fe780 20-Sep-2006 ambrisko <ambrisko@FreeBSD.org> Add a new 'bce_mgmt_init_locked' function to enable the minimal parts
of the chip to let ASF/IPMI firmware to respond to IPMI after attaching
and when the chip is down. David looked at it but could really say
what they right minimal config. stuff would be. It's not documented.
I figured this out via trial and error.

Reviewed by: davidch
2d9e7e4a32c8c33011a4a625f3560ff186124090 17-Sep-2006 andre <andre@FreeBSD.org> Move ethernet VLAN tags from mtags to its own mbuf packet header field
m_pkthdr.ether_vlan. The presence of the M_VLANTAG flag on the mbuf
signifies the presence and validity of its content.

Drivers that support hardware VLAN tag stripping fill in the received
VLAN tag (containing both vlan and priority information) into the
ether_vtag mbuf packet header field:

m->m_pkthdr.ether_vtag = vlan_id; /* ntohs()? */
m->m_flags |= M_VLANTAG;

to mark the packet m with the specified VLAN tag.

On output the driver should check the mbuf for the M_VLANTAG flag to
see if a VLAN tag is present and valid:

if (m->m_flags & M_VLANTAG) {
... = m->m_pkthdr.ether_vtag; /* htons()? */
... pass tag to hardware ...
}

VLAN tags are stored in host byte order. Byte swapping may be necessary.

(Note: This driver conversion was mechanic and did not add or remove any
byte swapping in the drivers.)

Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition. No more tag
memory allocation have to be done.

Reviewed by: thompsa, yar
Sponsored by: TCP/IP Optimization Fundraise 2005
2b72eebfd3e10f9adc90379ad0da053c7583d6e5 15-Aug-2006 julian <julian@FreeBSD.org> Remove extra '*/' comment close. In code not normally compiled but a bug never the less.
19ba69396e65c6269d942e2111050c8c7e061186 31-Jul-2006 jhb <jhb@FreeBSD.org> MFC: Expand locking coverage to cover if_drv_flags in a few places where
it wasn't locked.
b06ff9839e502f27f33624796b6939f9ffe9adad 20-Jul-2006 jhb <jhb@FreeBSD.org> MFC: Fix ifconfig up when the HW is down.
70fe8b72794c098354c508524bb2659d1e34b35f 20-Jul-2006 jhb <jhb@FreeBSD.org> Expand locking coverage slightly to cover if_drv_flags in a few places
where it wasn't locked.

MFC after: 3 days
Reviewed by: davidch
3af5a7c698b805f7f2c5709f568d9719ee607767 19-Jul-2006 ps <ps@FreeBSD.org> MFC: rev 1.4
- Removed updates to if_ibytes, if_obytes, if_imcasts, and if_omcasts.
These should not be handled by the driver.
- Add code to handle excessively fragmented mbufs when mapping TX frames.
d49c8aec47f9333c0b7fa3cb2790bbe28aa72e87 12-Jul-2006 ambrisko <ambrisko@FreeBSD.org> Fix ifconfig up when the HW was down. If the driver isn't running
then we need to call init otherwise just start the rx.

Interestingly dhclient seemed to work but ifconfig <IP> didn't
for me.

Reviewed by: jhb
003705e1878f14a6170f3ce7311ee8055bb53df5 08-Jun-2006 davidch <davidch@FreeBSD.org> Log:
- Removed updates to if_ibytes, if_obytes, if_imcasts, and if_omcasts.
These should not be handled by the driver.
- Add code to handle excessively fragmented mbufs when mapping TX frames.

Reviewed by: ps
Approved by: ps (mentor)
MFC after: 1 week
557bcabe67e9b11860e615e508d4ab61cf47feeb 13-Apr-2006 ps <ps@FreeBSD.org> MFC: rev 1.3, fix DEVICE_POLLING support (compile tested only)

Approved by: re
c3bf094702ba269684b1c901c22bdfb65291e2a6 13-Apr-2006 ru <ru@FreeBSD.org> Fix DEVICE_POLLING support (compile-only tested).
332c81bc908a0e984f44b616046e189b98bae388 10-Apr-2006 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'RELENG_6'.
cc2c59e66f29d7642cd4e1300fc554493c0c6928 10-Apr-2006 ps <ps@FreeBSD.org> Hook bce up to the build
c2fa353e653a723b0eafa47c1e8ae0e1ed569b44 10-Apr-2006 ps <ps@FreeBSD.org> Add a driver for the Broadcom NetXtreme II (BCM5706/BCM5708)
PCI/PCIe Gigabit Ethernet adapeter.

Submitted by: David Christensen