#
685dc743 |
|
16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
64450e3a |
|
19-Apr-2022 |
John Baldwin <jhb@FreeBSD.org> |
dc: Remove unused devclass arguments to DRIVER_MODULE.
|
#
df57947f |
|
18-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
spdx: initial adoption of licensing ID tags. 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. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133
|
#
62d76917 |
|
02-Jun-2014 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Introduce a procedural interface to the ifnet structure. The new interface allows the ifnet structure to be defined as an opaque type in NIC drivers. This then allows the ifnet structure to be changed without a need to change or recompile NIC drivers. Put differently, NIC drivers can be written and compiled once and be used with different network stack implementations, provided of course that those network stack implementations have an API and ABI compatible interface. This commit introduces the 'if_t' type to replace 'struct ifnet *' as the type of a network interface. The 'if_t' type is defined as 'void *' to enable the compiler to perform type conversion to 'struct ifnet *' and vice versa where needed and without warnings. The functions that implement the API are the only functions that need to have an explicit cast. The MII code has been converted to use the driver API to avoid unnecessary code churn. Code churn comes from having to work with both converted and unconverted drivers in correlation with having callback functions that take an interface. By converting the MII code first, the callback functions can be defined so that the compiler will perform the typecasts automatically. As soon as all drivers have been converted, the if_t type can be redefined as needed and the API functions can be fix to not need an explicit cast. The immediate benefactors of this change are: 1. Juniper Networks - The network stack implementation in Junos is entirely different from FreeBSD's one and this change allows Juniper to build "stock" NIC drivers that can be used in combination with both the FreeBSD and Junos stacks. 2. FreeBSD - This change opens the door towards changing ifnet and implementing new features and optimizations in the network stack without it requiring a change in the many NIC drivers FreeBSD has. Submitted by: Anuranjan Shukla <anshukla@juniper.net> Reviewed by: glebius@ Obtained from: Juniper Networks, Inc.
|
#
76039bc8 |
|
26-Oct-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
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.
|
#
604f5f1f |
|
23-Nov-2011 |
Marius Strobl <marius@FreeBSD.org> |
Use DEVMETHOD_END.
|
#
ee6eac62 |
|
28-Jun-2011 |
Kevin Lo <kevlo@FreeBSD.org> |
Remove duplicate header includes
|
#
3fcb7a53 |
|
03-May-2011 |
Marius Strobl <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@
|
#
c6397d3f |
|
14-Jan-2011 |
Marius Strobl <marius@FreeBSD.org> |
- Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Just let the default case handle all unsupported media types. - In pnphy_status() don't unnecessarily read a register twice. - Remove unnused macros. MFC after: 1 week
|
#
a7d5f7eb |
|
19-Oct-2010 |
Jamie Gritton <jamie@FreeBSD.org> |
A new jail(8) with a configuration file, to replace the work currently done by /etc/rc.d/jail.
|
#
8e5d93db |
|
15-Oct-2010 |
Marius Strobl <marius@FreeBSD.org> |
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
|
#
d7a9ad56 |
|
03-Oct-2010 |
Marius Strobl <marius@FreeBSD.org> |
Consistently always explicitly set IFM_HDX for half-duplex. Obtained from: OpenBSD (mostly)
|
#
de1add1e |
|
02-Oct-2010 |
Marius Strobl <marius@FreeBSD.org> |
- In the spirit of previous simplifications factor out the checks for a different PHY instance being selected and isolation out into the wrappers around the service methods rather than duplicating them over and over again (besides, a PHY driver shouldn't need to care about which instance it actually is). - Centralize the check for the need to isolate a non-zero PHY instance not supporting isolation in mii_mediachg() and just ignore it rather than panicing, which should sufficient given that a) things are likely to just work anyway if one doesn't plug in more than one port at a time and b) refusing to attach in this case just leaves us in a unknown but most likely also not exactly correct configuration (besides several drivers setting MIIF_NOISOLATE didn't care about these anyway, probably due to setting this flag for no real reason). - Minor fixes like removing unnecessary setting of sc->mii_anegticks, using sc->mii_anegticks instead of hardcoded values etc.
|
#
7b9a15f7 |
|
27-Sep-2010 |
Marius Strobl <marius@FreeBSD.org> |
Use the mii_data provided via mii_attach_args and mii_pdata respectively instead of reaching out for the softc of the parent.
|
#
b54282f6 |
|
19-Mar-2009 |
Marius Strobl <marius@FreeBSD.org> |
- Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers nothing but hopefully will be respected by mii_phy_setmedia() later on. - Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired.
|
#
d7f03759 |
|
19-Oct-2008 |
Ulf Lilleengen <lulf@FreeBSD.org> |
- Import the HEAD csup code which is the basis for the cvsmode work.
|
#
36bef328 |
|
30-Sep-2008 |
Marius Strobl <marius@FreeBSD.org> |
cosmetic changes and style fixes
|
#
07c4a8df |
|
01-Aug-2006 |
Pyun YongHyeon <yongari@FreeBSD.org> |
Replace hard-coded magic constants to system defined constants (BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). These pseudo PHY drivers were forgotten from the conversion due to the repo copy to dc driver location.
|
#
6a3033a8 |
|
18-Oct-2005 |
Warner Losh <imp@FreeBSD.org> |
Make dc compile after repo-copy.
|
#
7d830ac9 |
|
30-Sep-2005 |
Warner Losh <imp@FreeBSD.org> |
Use ansi function definitions in preference to K&R to reduce diffs with NetBSD (and cause it looks cooler).
|
#
d4fcf3cb |
|
28-May-2005 |
Yoshihiro Takahashi <nyan@FreeBSD.org> |
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)
|
#
50aa1061 |
|
29-May-2004 |
Marius Strobl <marius@FreeBSD.org> |
Remove double __FBSDID and move the remaining one into a common place after the license(s) and before the driver comment (the latter only in drivers not having __FBSDID at that location).
|
#
aad970f1 |
|
24-Aug-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Use __FBSDID(). Also some minor style cleanups.
|
#
19ca5847 |
|
31-May-2003 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove unnecessary breaks. Remove unused variables. Add XXX comment where a break may be missing. [lxtphy.c] Found by: FlexeLint
|
#
8368cf8f |
|
03-Apr-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Use __FBSDID rather than rcsid[].
|
#
2d3ce713 |
|
18-Jan-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Remove miidevs.h and generate it from miidevs at compile time. The devlist2h.awk tool to do this has been repocopied to sys/tools/.
|
#
9c1c2e99 |
|
14-Oct-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Put function return types on a line by themselves. Cleanup my earlier de-__P sweep and remove whitespace between function names and paramters.
|
#
279fe8d1 |
|
29-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Make one generic mii_phy_detach() to replace 19 slightly different ones. Rename mii_phy_auto_stop() mii_phy_down(). Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did.
|
#
07dd9383 |
|
28-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Don't pass three args when one will do just fine, and even prevent mistakes like the one brgphy.c (now corrected).
|
#
83549c66 |
|
28-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Improve an API by about 4 lines per driver.
|
#
e51a25f8 |
|
19-Mar-2002 |
Alfred Perlstein <alfred@FreeBSD.org> |
Remove __P.
|
#
d9730b8b |
|
29-Sep-2001 |
Jonathan Lemon <jlemon@FreeBSD.org> |
Cleanup pass for mii drivers. . Make internal service routines static. . Use a consistent ordering of checks in MII_TICK. Do the work in the mii_phy_tick() subroutine if appropriate. . Call mii_phy_update() to trigger the callbacks.
|
#
f34fa851 |
|
28-Mar-2001 |
John Baldwin <jhb@FreeBSD.org> |
Catch up to header include changes: - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
|
#
35e0e5b3 |
|
20-Oct-2000 |
John Baldwin <jhb@FreeBSD.org> |
Catch up to moving headers: - machine/ipl.h -> sys/ipl.h - machine/mutex.h -> sys/mutex.h
|
#
db7e3af1 |
|
15-Oct-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove unneeded #include <machine/clock.h>
|
#
d308faac |
|
13-Oct-2000 |
Bill Paul <wpaul@FreeBSD.org> |
Add #include <machine/mutex.h> since these files need it and don't include anything else that includes mutex.h. Needed to resolve struct mtx from struct dc_softc.
|
#
3389ae93 |
|
19-Apr-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove ~25 unneeded #include <sys/conf.h> Remove ~60 unneeded #include <sys/malloc.h>
|
#
96f2e892 |
|
04-Dec-1999 |
Bill Paul <wpaul@FreeBSD.org> |
Add the if_dc driver and remove all of the al, ax, dm, pn and mx drivers which it replaces. The new driver supports all of the chips supported by the ones it replaces, as well as many DEC/Intel 21143 10/100 cards. This also completes my quest to convert things to miibus and add Alpha support.
|