History log of /freebsd-head/sys/dev/bce/if_bcereg.h
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...
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.
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.
a9edaae369b07cec99714368baba56d0c0dfe739 26-Mar-2015 yongari <yongari@FreeBSD.org> MFC r279223:
Correct a typo.
11397750d9f6c941f9d39544909634817c8fae42 24-Feb-2015 yongari <yongari@FreeBSD.org> Correct a typo.

Reported by: jmg
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.
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
fa731335a20543877153a2aabbf27e200ec99974 14-Apr-2014 yongari <yongari@FreeBSD.org> MFC r263957:
Increase the number of TX DMA segments from 32 to 35. It turned
out 32 is not enough to support a full sized TSO packet.
While I'm here fix a long standing bug introduced in r169632 in
bce(4) where it didn't include L2 header length of TSO packet in
the maximum DMA segment size calculation.
e1b5ce307a401cee03e8762e864442953d82c590 31-Mar-2014 yongari <yongari@FreeBSD.org> Increase the number of TX DMA segments from 32 to 35. It turned
out 32 is not enough to support a full sized TSO packet.
While I'm here fix a long standing bug introduced in r169632 in
bce(4) where it didn't include L2 header length of TSO packet in
the maximum DMA segment size calculation.

In collaboration with: rmacklem
MFC after: 2 weeks
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
b86044b9a978e345ee170237996f0998b5a1ece9 26-Oct-2013 glebius <glebius@FreeBSD.org> Move includes from if_bcereg.h to .c files.
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>
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
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
a93bdbb610d296583acb7082db92d7aa5891d0ff 30-Oct-2012 zont <zont@FreeBSD.org> - Remove BCE_JUMBO_HDRSPLIT kernel option which was forgotten in r218423.

Approved by: davidch
Approved by: kib (mentor)
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
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
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
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
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.
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
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
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
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
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
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
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
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.
9d3bb599b193495af5419ee85be4afe9a18b6091 22-Nov-2008 kmacy <kmacy@FreeBSD.org> - bump __FreeBSD version to reflect added buf_ring, memory barriers,
and ifnet functions

- add memory barriers to <machine/atomic.h>
- update drivers to only conditionally define their own

- add lockless producer / consumer ring buffer
- remove ring buffer implementation from cxgb and update its callers

- add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to
allow drivers to efficiently manage multiple hardware queues
(i.e. not serialize all packets through one ifq)
- expose if_qflush to allow drivers to flush any driver managed queues

This work was supported by Bitgravity Inc. and Chelsio Inc.
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
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
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.
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
f35e9eb6831ffc54fd580daa211ec1ebb9676519 16-Jun-2007 davidch <davidch@FreeBSD.org> - Migrated IPMI fix from RELENG_6.
- Added additional debug code.
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.
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().
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
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
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
dbd998a427edb992f0bdd7022b4811e5317c70d3 24-Oct-2006 scottl <scottl@FreeBSD.org> Refine the checksum hack a little. It appears that the chip can handle UDP
and TCP checksum offloading fine, it only has a problem with IP checksums on
IP fragments.. Barring a fix or workaround available from the hardware, the
real solution would be to have finer grained control in the stack over what
can and cannot be assisted in hardware.
4aba6782237384502b0e6133979939b3fdea22c8 21-Oct-2006 scottl <scottl@FreeBSD.org> There seems to be a problem with txcsum and UDP. Turn it off until it is
understood better. This fixes timeout problems with NFS.
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.
5cccc781cc1b1d06014b63104ebd8c816d4382a5 14-Oct-2006 scottl <scottl@FreeBSD.org> Don't copy the bd_chain head pointers into temporary objects, they are
available globally.
ef310efff89c7c9b24e149c33a698707417d8367 16-May-2006 phk <phk@FreeBSD.org> Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
4df119d9553138cb2c8b113dc3f8c2fa6f443c94 04-May-2006 scottl <scottl@FreeBSD.org> MFC rev 1.2-1.4.

Approved by: re
98b1689816cf3bac8a0fb552789583b84a3057dc 04-May-2006 mjacob <mjacob@FreeBSD.org> Gratuitous tag alignment. It bugged me.
4a65e282e55d9f004b816c9e301ac17047c63d9a 26-Apr-2006 ps <ps@FreeBSD.org> Only use the low address for stats collection.
82b42c364a16257aa590195fc40a970e6b58e68a 25-Apr-2006 jhb <jhb@FreeBSD.org> Fix half of the current i386 tinderbox failure. max_bus_addr should be a
bus_addr_t rather than a bus_size_t.
332c81bc908a0e984f44b616046e189b98bae388 10-Apr-2006 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'RELENG_6'.
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