History log of /freebsd-11-stable/sys/dev/bfe/if_bfe.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 271829 18-Sep-2014 glebius

Mechanically convert to if_inc_counter().


# 270856 30-Aug-2014 glebius

Use define from if_var.h to access a field inside struct if_data,
that resides in struct ifnet.

Sponsored by: Nginx, Inc.


# 267363 11-Jun-2014 jhb

Fix various NIC drivers to properly cleanup static DMA resources.
In particular, don't check the value of the bus_dma map against NULL
to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded.
Instead, assume that bus_dmamap_load() succeeeded (and thus that
bus_dmamap_unload() should be called) if the bus address for a resource
is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus
that bus_dmamem_free() should be called) if the virtual address for a
resource is not NULL.

In many cases these bugs could result in leaks when a driver was detached.

Reviewed by: yongari
MFC after: 2 weeks


# 257176 26-Oct-2013 glebius

The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# 243857 04-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.


# 229767 07-Jan-2012 kevlo

ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again

Reviewed by: yongari


# 227843 22-Nov-2011 marius

- 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.


# 221407 03-May-2011 marius

- 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@


# 213893 15-Oct-2010 marius

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
addresses; we now let mii_attach() only probe the PHY at the desired
address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
off from, partly even based on grabbing and using the softc of the
parent; we now pass these flags down from the NIC to the PHY drivers
via mii_attach(). This got us rid of all such hacks except those of
brgphy() in combination with bce(4) and bge(4), which is way beyond
what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by: jhb, yongari


# 195049 26-Jun-2009 rwatson

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


# 181994 22-Aug-2008 yongari

Add a new sysctl node 'dev.bfe.N.stats' that shows various MAC
counters for Rx/Tx statistics. Various counters in ifnet is also
updated with these hardware counters.

Tested by: kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
Ulrich Spoerlein uspoerlein at gmail dot com


# 181992 22-Aug-2008 yongari

Because bfe(4) knows interrupt mask value there is no need to read
interrupt mask register again. This saves one register access per
each interrupt.
Also don't try to process frames when driver is not running.

Tested by: kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
Ulrich Spoerlein uspoerlein at gmail dot com


# 181976 21-Aug-2008 yongari

Remove bfe_link in softc and introduce two new flags to mark
link state and detach request.
While I'm here make sure established link is IFM_10_T or
IFM_100_TX as bfe(4) just supports 10/100Mbps media.

Tested by: kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
Ulrich Spoerlein uspoerlein at gmail dot com


# 181953 21-Aug-2008 yongari

o Sort includes and add <endian.h> to support endianness.
o Removed unneeded header files.
o bus_dma(9) fix:
- created parent tag with 1GB dma address limit with no
alignment restrictions.
- set 4096 alignment limit for Tx/Rx descriptor rings.
- separate Rx buffer tag from Tx buffer tag such that Tx tag
allows up-to 16 segments while Rx buffer tag only allows
single segment.
- it seems the controller has no alignment restrictions on Tx/Rx
buffers. Remove ETHER_ALIGN alignment restriction in Tx/Rx
buffers.
- created a spare Rx dma map which would be used to cope with
failure of loading a dma map.
- make sure to load full Tx/Rx descriptor size for Tx/Rx
descriptor dma maps, previously bfe(4) used to load single
descriptor size for each descriptor rings. I have no idea how
it could be run without problems.
- don't blindly cast bus_addr_t type to 32bits in bfe_dma_map().
- created bfe_dma_free() to free allocated dma memory/tags.
- make sure to invoke bus_dmamap_sync(9) before/after processing
descriptor rings/buffers. Because the hardware has severe dma
address space limitation, bounce-buffers would be always used
on systems with more than 1GB memory during
descriptors/buffers access.
- added Tx descriptor ring initialization function,
bfe_list_tx_init().
- moved producer/consumer index initialization to
bfe_list_tx_init() and bfe_list_rx_init() from
bfe_chip_reset().
- added bfe_discard_buf() which will update loaded descriptors
without unloading/reloading the dma map to speed up error
recovery.
- implemented Tx side bus_dmamap_load_mbuf_sg(9). The number of
segments allowed was chosen to be 16 which should be enough for
non-TSO capable hardwares. Setting SOF bit of Tx descriptor is
done in the last to avoid potential race.
- don't give up sending frames in bfe_start() until the hardware
lacks free descriptors.
- added XXX comment to second kick command and possible workaround.
- implemented Rx side bus_dmamap_load_mbuf_sg(9).
- removed bfe_dma_map_desc() as it's not needed anymore after
the conversion to bus_dmamap_load_mbuf_sg(9).
- added endianness support. With this change bfe(4) should work
on any architectures that can create bounce buffers within 1GB
address range.
- add missing bus_dmamap_sync() in bfe_tx_eof()/bfe_rx_eof().
o Use PCI_BAR instead of hardcoded value to set BARs.
Simplified register access with bus_write_4(9)/bus_read_4(9) and
removed bfe_btag, bfe_bhandle, bfe_vhandle in softc as it's not
used anymore.
o Reorder device detach logic such that bfe_detach() is also used
for handling driver attach failure case.
o Remove unnecessary KASSERT in bfe_detach().
o Remove bfe_rx_cnt, bfe_up, bfe_vpd_prodname, bfe_vpd_readonly in
softc. It's not used at all.
o Remove BFE_RX_RING_SIZE/BFE_RX_RING_SIZE/BFE_LINK_DOWN.

Tested by: kib, Gleb Kurtsou gleb.kurtsou at gmail dot com
Ulrich Spoerlein uspoerlein at gmail dot com


# 181557 11-Aug-2008 yongari

Use device_set_desc() instead of device_set_desc_copy() as we don't
manipulate the verbose description of a device.


# 181556 10-Aug-2008 yongari

Partial back out r180952.
pci_get_vendor() and pci_get_device() don't do configuration space
accessses so cahcing them makes no sense.
Pointed out by: jhb, imp, des


# 180954 29-Jul-2008 yongari

style(9) - space after keywords, don't indent case.


# 180952 29-Jul-2008 yongari

Cache PCI vendor/device ids to avoid unnecessary PCI configuration
space access in device probe.
Also nuke referencing softc in device probe.


# 180950 29-Jul-2008 yongari

s/printf/device_printf/g
Don't hard code function name in device_printf() and use __func__.
While I'm here nuke bfe_unit in softc as it's not needed anymore.


# 178687 30-Apr-2008 yongari

Don't panic even if bus_dmamap_load(9) was failed. Just return
ENOBUFS so callers can reuse previous mbuf.

Submitted by: Oleg (agile.quad AT gmail DOT com)
MFC after: 1 week


# 175787 29-Jan-2008 yongari

Fix link state handling in bfe(4).
o conversion to callout(9) API.
o add a missing driver lock in bfe_ifmedia_sts().
o use our callout to drive watchdog timer.
o restart Tx routine if pending queued packets are present in
watchdog handler.
o unarm watchdog timer only if there are no queued packets.
o don't blindly reset phy and let phy driver handle link change
request in bfe_init_locked().
o return the status of mii_mediachg() to caller in
bfe_ifmedia_upd(). Previously it always returned 0 to caller.
o add check for IFF_DRV_RUNNING flag as well as IFF_DRV_OACTIVE
in bfe_start_locked().
o implement miibus_statchg method that keeps track of current
link state changes as well as negotiated speed/duplex/
flow-control configuration.
Reprogram MAC to appropriate duplex state. Flow-control
configuration was also implemented but commented out at the
moment. The flow-control configuration will be enabled again
after we have general flow-control framework in mii layer.

Reported by: Yousif Hassan < yousif () alumni ! jmu ! edu >
Tesdted by: Yousif Hassan < yousif () alumni ! jmu ! edu >


# 173839 22-Nov-2007 yongari

Fix function prototype for device_shutdown method.


# 166901 23-Feb-2007 piso

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@


# 164456 20-Nov-2006 jhb

Add suspend/resume support. Unlike many other NIC drivers,
bfe_init_locked() wasn't sufficient to bring the chip back to life, it also
required a call to bfe_chip_reset() during resume.

Tested by: Stepan Zastupov +redchrom at gmail+
MFC after: 1 week


# 159021 28-May-2006 silby

Back out the BUS_DMA_ALLOCNOW change from rev 1.39. Scottl informed me that
it's unnecessary, as the TX/RX lists are static allocations.


# 159013 28-May-2006 silby

1. Make sure that the TX and RX descriptor rings are 4096 byte aligned.
Also use BUS_DMA_ALLOCNOW to be on the safe side.

2. Look for the Descriptor Error, and Descriptor Protocol Error flags from
the card, and down the interface if we detect either.

#1 (along with fixes to busdma) makes sure that this card works in all
memory situations. Prior to this change, it was just luck that 512 count
RX/TX lists were properly aligned. Now we can use any size of RX/TX lists
and still have them properly aligned.

#2 ensures that we don't get into an endless interrupt storm if busdma fails
us. Descriptor Protocol Error would occur if we misaligned the TX/RX rings,
and Descriptor Error would occur if we tried to give the card descriptors
or rings with addresses > 1G. Trying to reinitialize the card isn't going
to fix these errors, hence we don't try.


# 158651 16-May-2006 phk

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


# 158285 04-May-2006 silby

Fix three more bugs in bfe:

- Fix bfe_encap so that it will pass the address of the mbuf back up to its
caller if/when it modifies it, as it does when doing a m_defrag on a mbuf chain.
- Make sure to unload the dmamap for ALL fragments of a packet, not just the first
- Use BUS_DMA_NOWAIT for all bus_dmamap_load calls so that the allocation of the
map is not delayed - this driver is not set up to handle such delays.
- Reduce the number of RX and TX buffers bfe uses so that it does not use more
bounce buffers than busdma is willing to allow it to use

With these changes, the driver now works properly for a user with a 2GB system,
and it also works on my system when the acceptable address range is lowered to 128MB.
Previously, both of these setups would act up after a few minutes of activity.


# 158103 28-Apr-2006 silby

Tweak the DMA limit from rev 1.33, it was off by one byte.

Submitted by: scottl


# 158102 28-Apr-2006 silby

Switch all bus_dmamap_sync calls that used PREREAD to PREWRITE and all
POSTWRITE to POSTREAD.

No guarantee that all busdma is usage is perfect, but this change (in
addition to scott's last two commits) makes if_bfe work with > 1GB of
memory in my laptop.


# 158093 27-Apr-2006 scottl

The alignment parameter to busdma must be a power of two, while the if_bfe
driver was trying to use an arbitrary rx/tx ring size of the value. Change
to using unrestricted values for alignment and boundary instead.


# 158075 27-Apr-2006 scottl

Fix problem with having more than 1GM of RAM. Also fix a nearby busdma
problem.

Submitted by: silby


# 157518 04-Apr-2006 pjd

Don't call bfe_release_resources() twice.

Found by: Coverity Prevent analysis tool
CID: 600
MFC after: 1 week


# 155671 14-Feb-2006 glebius

Do not touch ifp->if_baudrate in miibus aware drivers.


# 152315 11-Nov-2005 ru

- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.


# 151545 22-Oct-2005 imp

Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntax
(device miibus) in time for 7.0 :-)


# 150215 16-Sep-2005 ru

Fix "struct ifnet" leaks when attach() fails in the middle.


# 148887 09-Aug-2005 rwatson

Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags. Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags. This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by: pjd, bz
MFC after: 7 days


# 148654 02-Aug-2005 rwatson

Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.

Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week


# 147256 10-Jun-2005 brooks

Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
- Struct arpcom is no longer referenced in normal interface code.
Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
To enforce this ac_enaddr has been renamed to _ac_enaddr.
- The second argument to ether_ifattach is now always the mac address
from driver private storage rather than sometimes being ac_enaddr.

Reviewed by: sobomax, sam


# 147028 05-Jun-2005 imp

Powerstate stuff now done in PCI bus driver


# 146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


# 143750 17-Mar-2005 avatar

Releasing TX/RX descriptor dmamaps during device detachment instead of
doing that in bfe_stop().

This should fix a panic recently reported on -current occuring when taking
device down then up. In the original implementation, an "ifconfig bfe0 down"
triggers bfe_stop(), which also destroys all TX/RX descriptor dmamaps. Hence
the subsequent "ifconfig bfe0 up" would force the device to use those
already-released dmamap and thus panic the kernel.

PR: kern/77804
Submitted by: Frank Mayhar <frank at exit dot com>
Reviewed by: dmlb, sam (mentor)
Tested by: Phil <pcasidy at casidy dot com>, myself
MFC after: 1 week


# 143163 05-Mar-2005 imp

Use BUS_PROBE_DEFAULT for pci probe return value


# 139944 09-Jan-2005 sam

correct direction for bus_dma sync of rx buffer

Submitted by: Tai-hwa Liang


# 139749 05-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 136804 23-Oct-2004 mtm

Locking cleanups to remove the need for a recursive mutex
o Instead of locking and unlocking all over the place, use
lock assertions to make certain that the bfe lock is held
where necessary.
o Create locked and unlocked versions of bfe_init and bfe_start. These
functions can be called from outside the module and by functions
within the bfe module. The calls from outside the module don't
hold the bfe lock so the unlocked versions called by these functions
simple obtain the bfe lock and call the locked version.

- Fix a typo (scp) in the locking macros that only worked because in all the
instances in which it was called the softc pointer happened to be named 'sc'.

- Mark the interrupt MPSAFE

Tested by: matusita, Dario Freni <saturnero@gufi.org>
Silence from: -net, wpaul


# 136269 08-Oct-2004 mlaier

Fix sis, bfe and ndis in the same way dc was fixed:
Do not tell the hardware to send when there were no packets enqueued.

Found and reviewed by: green
MFC after: 1 days


# 134590 01-Sep-2004 des

Add PCI ID for the BCM4401-B0.

Submitted by: krion
MFC after: 3 days


# 133282 07-Aug-2004 des

The whitespace crusader strikes!


# 131455 02-Jul-2004 mlaier

Bring in the first chunk of altq driver modifications. This covers the
following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4),
sis(4) and xl(4)

More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take
a look and tell me if "your" driver is missing, so I can fix this.

Tested-by: many
No-objection: -current, -net


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 129709 25-May-2004 des

Set the IFCAP_VLAN_MTU bit in capenable as well.

Reminded by: ru


# 129708 25-May-2004 des

Set baudrate to 100 Mbps, and advertise our ability to handle extended
frames (802.1q).

Submitted by: Steinar Haug <sthaug@nethelp.no>


# 129616 23-May-2004 mux

We don't need to initialize if_output, ether_ifattach() does it
for us.


# 129602 23-May-2004 dmlb

Apply fix for long timeouts on driver initialisation.

PR: 64656
Submitted by: Jianqin Qu <jqu@its.brooklyn.cuny.edu>
Reviewed by: dmlb


# 127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


# 126966 14-Mar-2004 mdodd

Announce ethernet MAC addresss in ether_ifattach().


# 126473 02-Mar-2004 julian

When we get a packet error, move on, don't go into an infinite loop
looking at it.

fixes at least one cause of "hanging" due to this driver.


# 126470 01-Mar-2004 julian

Whitespace changes to match rest of file..


# 122689 14-Nov-2003 sam

Drop the driver lock around calls to if_input to avoid a LOR when
the packets are immediately returned for sending (e.g. when bridging
or packet forwarding). There are more efficient ways to do this
but for now use the least intrusive approach.

Reviewed by: imp, rwatson


# 121816 31-Oct-2003 brooks

Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)


# 119919 09-Sep-2003 wpaul

Remove unnecessary #include of brgphyreg.h, left over from when Stuart used
the bge(4) driver as a template.


# 119917 09-Sep-2003 wpaul

Add a device driver for the Broadcom BCM4401 ethernet controller,
written by Stuart Walsh and Duncan Barclay (with some kibbitzing by
me). I'm checking it in on Stuart's behalf.

The BCM4401 is built into several x86 laptop and desktop systems. For the
moment, I have only enabled it in the x86 kernel config because although
it's a PCI device, I haven't heard of any standalone NICs that use it. If
somebody knows of one, we can easily add it to the other arches.

This driver uses register/structure data gleaned from the Linux
driver released by Broadcom, but does not contain any of the code
from the Linux driver itself. It uses busdma.