History log of /freebsd-10.1-release/sys/dev/nve/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

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


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

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


243857 04-Dec-2012 glebius

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


242873 10-Nov-2012 dim

Fix all the inconsistent nve_os* function declarations and definitions
in nve(4). The OS_API structure defined in os.h expects NV_API_CALL
attributes, effectively regparm(0), on its function pointers, but all
the functions were declared and defined without this attribute.

MFC after: 1 week


241652 17-Oct-2012 glebius

Don't redefine macros defined in if.h and ethernet.h.


232874 12-Mar-2012 scottl

More conversions of drivers to use the PCI parent DMA tag.


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.


226478 17-Oct-2011 yongari

Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)


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@


213894 15-Oct-2010 marius

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


203070 27-Jan-2010 jhb

Initialize the ifnet before calling mii_phy_probe() as some phy drivers
(e.g. e1000phy(4)) expect if_dname to be valid when they are probed.

MFC after: 3 days


199560 19-Nov-2009 jhb

- Hook into the existing stat timer to drive the transmit watchdog instead
of using if_watchdog and if_timer.
- Reorder detach to call ether_ifdetach() before anything else in tl(4)
and wb(4).


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


191437 23-Apr-2009 rwatson

Two ifnet misuse fixes for if_nve:

(1) Don't manually configure if_output(), ether_ifattach() will do that
for us as part of link-layer setup.

(2) Call if_detach() before stopping nve in order to prevent calls into
the device driver after the driver has started shutting down.

Reviewed by: jhb
MFC after: 2 weeks


188175 05-Feb-2009 imp

writereg returns an int.


179458 31-May-2008 remko

Import rewritten nve device id's, which brings this more
inline with if_nfe.

PR: 110883
Submitted by: Claudel <regis at claudel dot ch>
Approved by: imp (mentor, implicit)
MFC after: 1 week


173839 22-Nov-2007 yongari

Fix function prototype for device_shutdown method.


170593 12-Jun-2007 yongari

Allow nfe(4) override nve(4).


170442 08-Jun-2007 dwhite

Don't cast the command argument to ether_ioctl() to an int since its not an
int anymore. This was causing all sorts of bad behavior when booting a system
with an nve interface present.


169338 07-May-2007 yar

Finish VLAN_MTU support in nve(4). The interface appears to be able
to handle long frames in its default mode, so setting the respective
bit in if_capenable is enough.

Tested by: yongari


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@


164915 05-Dec-2006 jhb

Fix an off by one error in struct nve_tx_desc's frags[] array as a result
of the nvenet lib upgrade (the constant went from 63 (2^n - 1) to
32 (2^n)). For reasons that are not obvious to me this fixes the driver
on at least some NICs.

MFC after: 3 days


158773 20-May-2006 mlaier

ALTQ-ify nve(4).

Submitted by: Chris Dionissopoulos
Tested by: Chris Dionissopoulos
MFC after: 4 weeks


158735 18-May-2006 jhb

- When setting up a packet for transmit, if we the tx ring is over half
full, kick the binary blob to force it to complete any pending tx
completions.
- In the watchdog routine, only reset the chip if the blob doesn't complete
any pending tx completions rather than requiring it to complete all of
the pending tx completions.

Submitted by: Nathan Whitehorn <nathanw@uchicago.edu>
MFC after: 2 weeks


158651 16-May-2006 phk

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


158123 28-Apr-2006 jhb

The nvidia binary blob sometimes defers tx completion notification to the
OS dependent layer. Thus, the watchdog timer can go off when the tx
engine is working fine but the OS dependent layer just hasn't been called
to cleanup finished tx transactions. To workaround this, when the watchdog
fires, poke the binary blob to force it to flush any pending tx
completions. If this drops the pending tx count to zero then just return
without logging a message or resetting the chip.

This reportedly fixes the 'device timeout()' errors with at least several
NF4 nve(4) parts.

Submitted by: Nathan Alexander Whitehorn <nathanw@uchicago.edu> (code)
Submitted by: dg (inspiration for comment and explanation)
MFC after: 1 week


153333 12-Dec-2005 bz

Make nve(4) work for people with nf3/nf4 who never got it
working at all and only saw "nve0: device timeout (N)" messages.

- Setup PHY before handing control to NVidia API setting
speed, duplex, enabling interrupts, etc.
- Add restriction of MAXADDR_32BIT for high address to contigmalloc
to make the driver work on machines with 4+GB of memory.

PR: kern/85583, kern/88045
Tested by: scottl, others earlier version
MFC after: 10 days


153204 07-Dec-2005 obrien

Add support for the nVidia nForce MCP12 & MCP13 Networking Adapters.


153203 07-Dec-2005 obrien

Catch up to the nvenetlib 1.0-0310 import.


153140 05-Dec-2005 jhb

Remove unused local variable misssed in previous commit.


153134 05-Dec-2005 jhb

- Don't make the driver lock recursive, it shouldn't be recursively
acquired anywhere in the driver now.
- Axe the spin mutex used for the nve_oslock*() routines. The driver lock
already provides sufficient synchronization.
- Don't mess around with IFF_UP when the link state changes. IFF_UP is
an administrative flag, not a link status indicator.

MFC after: 1 week


152669 21-Nov-2005 jhb

Overhaul nve(4) locking to make it more like other ethernet drivers in
the tree.
- Add locked variants of nve_start(), nve_init(), and nve_ifmedia_upd().
- Use callout_* to manage callouts rather than timeout(9).
- Mark interrupt handler MPSAFE (IFF_NEEDGIANT was already clear).
- Lock the driver lock in driver entry points such as the interrupt
handler, if_start, and if_init rather than locking the driver mutex
in the various work functions called by the binary blob. The spin lock
used by the binary block can probably be stubbed out now.
- Use IFQ_DRV_IS_EMPTY() macro rather than doing it by hand.
- Fix locking in detach.
- Remove some unused fields from the softc.

Tested by: cognet
MFC after: 2 weeks


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.


151733 27-Oct-2005 obrien

Clear pending_txs when not "RUNNING".

Submitted by: Q <q@onthenet.com.au>


150306 19-Sep-2005 imp

Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash. Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.


150220 16-Sep-2005 ru

Fix "struct ifnet" leak if 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 03-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


148412 25-Jul-2005 mux

Remove an erroneous m_freem() call. If m_defrag() returns a non-NULL
pointer, it has already freed the original mbuf chain, so we shouldn't
do it again.

This is an MFC candidate.


147291 11-Jun-2005 brooks

Move if_alloc() up so it's before mii_phy_probe().


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


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)


145998 08-May-2005 brueffer

Fix typo in a comment.


145556 26-Apr-2005 obrien

I missed a s/nv/nve/.

Submitted by: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>


144073 24-Mar-2005 obrien

Support MCP versions 4-11.


143442 12-Mar-2005 obrien

FreeBSD consumer bits of the nForce MCP NIC binary blob.

Demanded by: DES
Encouraged by: scottl
Obtained from: q@onthenet.com.au (partially)
KNF'ed by: obrien