aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/mii
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* mii: include missing sources in loadable moduleMilan Obuch2022-04-031-5/+11
| | | | | | | | | | | | | | | | | | As of today, using 'kldload miibus' is not equivalent to using 'device miibus' in a kernel config. Newly introduced PHY drivers (DP83822, DP83867, VSCPHY) and source files/PHY driver for FDT-enabled kernels are missing. Without including them, kernel modules using any function from dev/mii/mii_fdt.c refuse to load. Additionally, miivar.h directly includes opt_platform.h. Add the missing sources to the module build, with the FDT-only files gated behind an OPT_FDT check. Maintain the alphabetical listing of SRCS, but move the required header files to a separate line to improve readability. Reviewed by: mhorne, mindal@semihalf.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34256
* Fix some modules to export more used symbolsKonstantin Belousov2021-11-181-7/+1
| | | | | | | | | and remove non-present symbols that are now reported by kmod_syms.awk. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32878
* mlphy(4)/tlphy(4): Remove obsolete driversMarius Strobl2020-12-261-2/+2
| | | | | | | | | | | | | | These drivers should have been removed along with tl(4) as part of 7c897ca91fe1cdb785531d2f5aa0d441c1d73142 and r347918 respectively as these fromer made sure to only ever attach to the latter, e. g.: <...> static int tlphy_probe(device_t dev) { if (!mii_dev_mac_match(dev, "tl")) return (ENXIO); <...>
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-041-1/+1
| | | | | | | | | | | This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
* Merging of projects/armv6, part 5Oleksandr Tymoshenko2012-08-151-1/+2
| | | | | | | | | | - Driver for SMSC LAN95XX and LAN8710A ethernet controllers - Driver for LAN8710A PHY Submitted by: Ben Gray, Damjan Marion, Tim Kientzle Notes: svn path=/head/; revision=239275
* Connect smcphy(4) to mii module build.Pyun YongHyeon2012-02-231-1/+1
| | | | Notes: svn path=/head/; revision=232016
* - Import the common MII bitbang'ing code from NetBSD and convert drivers toMarius Strobl2011-11-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | take advantage of it instead of duplicating it. This reduces the size of the i386 GENERIC kernel by about 4k. The only potential in-tree user left unconverted is xe(4), which generally should be changed to use miibus(4) instead of implementing PHY handling on its own, as otherwise it makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just for the MII bitbang'ing code. The common MII bitbang'ing code also is useful in the embedded space for using GPIO pins to implement MII access. - Based on lessons learnt with dc(4) (see r185750), add bus barriers to the MII bitbang read and write functions of the other drivers converted in order to ensure the intended ordering. Given that register access via an index register as well as register bank/window switching is subject to the same problem, also add bus barriers to the respective functions of smc(4), tl(4) and xl(4). - Sprinkle some const. Thanks to the following testers: Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4)) Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4). Reviewed by: yongari (subset of drivers) Obtained from: NetBSD (partially) Notes: svn path=/head/; revision=226995
* - Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHYMarius Strobl2011-10-081-2/+2
| | | | | | | | | | | | | | | | | drivers that only ever attach to a particular MAC driver, i.e. inphy(4), ruephy(4) and xlphy(4), to the directory where the respective MAC driver lives and only compile it into the kernel when the latter is also there, also removing it from miibus.ko and moving it into the module of the respective MAC driver. - While at it, rename exphy.c, which comes from NetBSD where the MAC driver it corresponds to also is named ex(4) instead of xl(4) but that in FreeBSD actually identifies itself as xlphy(4), and its function names accordingly for consistency. - Additionally while at it, fix some minor style issues like whitespace in the register headers and add multi-inclusion protection to inphyreg.h. Notes: svn path=/head/; revision=226154
* - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOPMarius Strobl2011-05-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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@ Notes: svn path=/head/; revision=221407
* Add RDC Semiconductor R6040 10/100 PHY driver.Pyun YongHyeon2010-12-301-2/+2
| | | | Notes: svn path=/head/; revision=216828
* Now that all previous users of mii_phy_probe() have been convertedMarius Strobl2010-10-151-1/+0
| | | | | | | | | | in r213893 and r213894 to use mii_attach() instead remove the former and along with it the "EVIL HACK". MFC after: never Notes: svn path=/head/; revision=213900
* Add a NetBSD-compatible mii_attach(), which is intended to eventuallyMarius Strobl2010-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replace mii_phy_probe() altogether. Compared to the latter the advantages of mii_attach() are: - intended to be called multiple times in order to attach PHYs in multiple passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1 range) - being able to pass along the capability mask from the NIC to the PHY drivers - being able to specify at which address (phyloc) to probe for a PHY (instead of always probing at all addresses from 0 to MII_NPHY - 1) - being able to specify which PHY instance (offloc) to attach - being able to pass along MIIF_* flags from the NIC to the PHY drivers (f.e. as required to indicated to the PHY drivers that flow control is supported by the NIC driver, which actually is the motivation for this change). While at it, I used the opportunity to get rid of some hacks in mii(4) like miibus_probe() generally doing work besides sheer probing and the "EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by passing the struct ifnet pointer via an argument of mii_attach() as well as to fix some resource leaks in mii(4) in case something fails. Commits which will update the PHY drivers to honor the MII flags passed down from the NIC drivers and take advantage of mii_attach() to get rid of certain types of hacks in NIC and PHY drivers as well as a conversion of the remaining uses of mii_phy_probe() will follow shortly. Reviewed by: jhb, yongari Obtained from: NetBSD (partially) Notes: svn path=/head/; revision=213878
* New PHY driver for the internal PHY found in the AX88790. There's aWarner Losh2009-03-301-1/+2
| | | | | | | | number of quirks for this device, and this implements just the basics. The 2.5s powerdown recommended in the datasheet will be next... Notes: svn path=/head/; revision=190558
* Add et(4), a port of DragonFly's Agere ET1310 10/100/GigabitXin LI2008-06-201-1/+2
| | | | | | | | | | | Ethernet device driver, written by sephe@ Obtained from: DragonFly Sponsored by: iXsystems MFC after: 2 weeks Notes: svn path=/head/; revision=179895
* Connect jmphy(4) to the build.Pyun YongHyeon2008-05-271-1/+1
| | | | Notes: svn path=/head/; revision=179336
* Connect atphy(4) to the build.Pyun YongHyeon2008-05-191-1/+1
| | | | Notes: svn path=/head/; revision=179099
* Add a driver for the National Semiconductor DP83815, DP83843 andMarius Strobl2008-01-271-1/+1
| | | | | | | | | | | | | DP83847 PHYs. The main reason for using a specific driver for these PHYs are reset quirks similar to the nsphy(4) driven DP83840A. PR: 112654 Obtained from: NetBSD MFC after: 2 weeks Thanks to: mlaier for testing w/ DP83815 Notes: svn path=/head/; revision=175702
* Sort values according to style.Makefile(5).Marius Strobl2008-01-271-8/+9
| | | | Notes: svn path=/head/; revision=175701
* Connect icsphy(4) to the build.Pyun YongHyeon2007-06-111-1/+1
| | | | Notes: svn path=/head/; revision=170526
* Connect gentbi, ip1000phy to the build.Pyun YongHyeon2006-07-251-1/+1
| | | | Notes: svn path=/head/; revision=160639
* Don't build dc-only pseudo phy devices with mii.ko anymoreWarner Losh2005-10-181-1/+1
| | | | Notes: svn path=/head/; revision=151441
* ciphy wasn't included here.Warner Losh2005-09-301-1/+1
| | | | Notes: svn path=/head/; revision=150757
* Add a PHY driver to support the built-in gigE PHY in the 8169S/8110SBill Paul2003-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | ethernet chips. This driver is pretty simple, however it contains special DSP initialization code which is needed in order to get the chip to negotiate a gigE link. (This special initialization may not be needed in subsequent chip revs.) Also: - Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS) - Deal with shared interrupts in re_intr(): if interface isn't up, return. - Fix another bug in re_gmii_writereg() (properly apply data field mask) - Allow PHY driver to read the RL_GMEDIASTAT register via the re_gmii_readreg() register (this is register needed to determine real time link/media status). Notes: svn path=/head/; revision=119976
* tdkphy.c is missing from this module's Makefile. Add it.Bill Paul2003-07-101-1/+1
| | | | Notes: svn path=/head/; revision=117374
* Add RealTek RTL8150 USB to fast Ethernet controller driver.Shunsuke Akiyama2003-05-031-0/+1
| | | | | | | | | | | This driver now supports the Melco LUA-KTX and the GREEN HOUSE GH-USB100B. Reviewed by: imp MFC after: 2 weeks Notes: svn path=/head/; revision=114577
* Remove miidevs.h and generate it from miidevs at compile time.David E. O'Brien2003-01-191-1/+1
| | | | | | | The devlist2h.awk tool to do this has been repocopied to sys/tools/. Notes: svn path=/head/; revision=109514
* Connect bmtphy to the mii module build.Benno Rice2002-08-061-1/+1
| | | | | | | Forgotten a long time ago by: benno Notes: svn path=/head/; revision=101410
* Export symbols that constitute APIs defined by theseMike Smith2002-01-111-0/+6
| | | | | | | | | | | modules. Note that in the case of 'mii' the API is not clearly defined, and the symbols exported represent a subset defined by current usage. Notes: svn path=/head/; revision=89244
* Add support for gigabit ethernet cards based on the NatSemi DP83820Bill Paul2001-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000 copper PHY. There are a whole bunch of very low cost cards available with this chipset selling for $150USD or less. This includes the SMC9462TX, D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards from Addtron. This chip supports TCP/IP checksum offload, VLAN tagging/insertion. 2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs. I have not done serious performance testing with this driver. I know it works, and I want it under CVS control so I can keep tabs on it. Note that there's no serious mutex stuff in here yet either: I need to talk more with jhb to figure out the right way to do this. That said, I don't think there will be any problems. This driver should also work on the alpha. It's not turned on in GENERIC. Notes: svn path=/head/; revision=76479
* add MARVELL to the list of phys to go into miibusMatt Jacob2001-04-211-1/+1
| | | | Notes: svn path=/head/; revision=75813
* Add Intel 82553, 82555 PHY driver.Jonathan Lemon2001-03-121-1/+1
| | | | Notes: svn path=/head/; revision=74133
* Add QS6612, AC101 and LXT970 personal drivers and register definitions.Semen Ustimenko2001-02-071-1/+1
| | | | | | | Obtained from: NetBSD/OpenBSD Notes: svn path=/head/; revision=72132
* Use a consistent style and one much closer to the rest of /usr/srcDavid E. O'Brien2001-01-061-6/+7
| | | | Notes: svn path=/head/; revision=70711
* Add a homePNA PHY driver. This is really only a stub: MII-based homePNABill Paul2000-09-201-1/+1
| | | | | | | | PHYs tend to look like 10mbps PHYs with no autonegotiation. This allows us to display the proper media type and link status however. Notes: svn path=/head/; revision=66129
* Use .include <bsd.kmod.mk> to get to ../../*/conf/kmod.mk instead ofPeter Wemm2000-05-271-1/+1
| | | | | | | encoding the relative path. Notes: svn path=/head/; revision=60966
* Pull in sys/conf/kmod.mk, rather than /usr/share/mk/bsd.kmod.mk.Peter Wemm2000-05-041-1/+1
| | | | | | | | | | This means that the kernel can be totally self contained now and is not dependent on the last buildworld to update /usr/share/mk. This might also make it easier to build 5.x kernels on 4.0 boxes etc, assuming gensetdefs and config(8) are updated. Notes: svn path=/head/; revision=59951
* Reoganize/update the SysKonnect driver:Bill Paul2000-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | - Break out the support for the XMAC II's PHY into an miibus driver. - Reorganize the probe/attach stuff using newbus. Each XMAC is now attached to the parent GEnesis controller using newbus. This is necessary since each XMAC must also have an attached miibus, and the miibus read/write register routines need to be able to get at the softc struct for each XMAC, not the one for the parent controller. This allows me to get rid of the grotty code I added for selecting the unit numbers for the ifnet interfaces: the unit numbers are now derived from the newbus-assigned unit numbers, which should track with the ifnet interface numbers. I think. At the very least, there should never be any collisions. - Add support for the SK-9821 and SK-9822 1000baseTX adapters. Special thanks to SysKonnect for loaning me two adapters for testing. Notes: svn path=/head/; revision=59478
* Add ${DEBUG_FLAGS} to CFLAGS in bsd.kmod.mk, not in scattered moduleBruce Evans2000-01-281-1/+0
| | | | | | | | makefiles. Bad examples in fxp/Makefile keep getting copied to new makefiles. Notes: svn path=/head/; revision=56735
* Add pci_if.h to SRCS so that dcphy will build.Bill Paul1999-12-051-1/+1
| | | | Notes: svn path=/head/; revision=54140
* Add the if_dc driver and remove all of the al, ax, dm, pn and mx driversBill Paul1999-12-041-1/+1
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=54134
* Removed special rules for building and cleaning device interface filesBruce Evans1999-11-281-15/+1
| | | | | | | | and empty options files. The rules are now generated automatically in bsd.kmod.mk. Cleaned up related things ($S and ${CLEANFILES}). Notes: svn path=/head/; revision=53846
* Convert the mx driver to miibus.Bill Paul1999-10-161-1/+1
| | | | | | | | | | | | | | | | | In order to make this work, I created a pseudo-PHY driver to deal with Macronix chips that use the built-in NWAY support and symbol mode port. This is actually all of them, with the exception of the original MX98713 which presents its NWAY support via the MII serial interface. The mxphy driver actually manipulates the controller registers directly rather than using the miibus_readreg()/miibus_writereg() bus interface since there are no MII registers to read. The mx driver itself pretends that the NWAY interface is a PHY locayed at MII address 31 for the sole purpose of allowing the mxphy_probe() routine to know when it needs to attach to a host controller. Notes: svn path=/head/; revision=52282
* Change the name of the installed KLM to contain a leading "if_".David E. O'Brien1999-09-201-1/+1
| | | | | | | | | Except for miibus which is now installed as miibus.ko. Discussed by: msmith, peter, and wpaul Notes: svn path=/head/; revision=51443
* Add a driver for the AMD AM79c873 10/100 PHY. By some strange coincidence,Bill Paul1999-09-061-1/+1
| | | | | | | | | | | this PHY and the Davicom DM9101 have exactly the same register definitions. One of them is probably a clone of the other. I'm not sure which. This is needed for the Davicom DM9102 10/100 PCI ethernet driver which will be committed shortly. Notes: svn path=/head/; revision=50983
* Add a driver for the internal PHY in the RealTek 8139.Bill Paul1999-08-311-1/+1
| | | | Notes: svn path=/head/; revision=50702
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Update these Makefiles; add mlphy and tlphy to the mii module, addBill Paul1999-08-271-1/+2
| | | | | | | miibus_if.h to tl module's dependencies. Notes: svn path=/head/; revision=50464
* This commit adds support for the NetBSD MII abstraction layer andBill Paul1999-08-211-0/+23
MII-compliant PHY drivers. Many 10/100 ethernet NICs available today either use an MII transceiver or have built-in transceivers that can be programmed using an MII interface. It makes sense then to separate this support out into common code instead of duplicating it in all of the NIC drivers. The mii code also handles all of the media detection, selection and reporting via the ifmedia interface. This is basically the same code from NetBSD's /sys/dev/mii, except it's been adapted to FreeBSD's bus architecture. The advantage to this is that it automatically allows everything to be turned into a loadable module. There are some common functions for use in drivers once an miibus has been attached (mii_mediachg(), mii_pollstat(), mii_tick()) as well as individual PHY drivers. There is also a generic driver for all PHYs that aren't handled by a specific driver. It's possible to do this because all 10/100 PHYs implement the same general register set in addition to their vendor-specific register sets, so for the most part you can use one driver for pretty much any PHY. There are a couple of oddball exceptions though, hence the need to have specific drivers. There are two layers: the generic "miibus" layer and the PHY driver layer. The drivers are child devices of "miibus" and the "miibus" is a child of a given NIC driver. The "miibus" code and the PHY drivers can actually be compiled and kldoaded as completely separate modules or compiled together into one module. For the moment I'm using the latter approach since the code is relatively small. Currently there are only three PHY drivers here: the generic driver, the built-in 3Com XL driver and the NS DP83840 driver. I'll be adding others later as I convert various NIC drivers to use this code. I realize that I'm cvs adding this stuff instead of importing it onto a separate vendor branch, but in my opinion the import approach doesn't really offer any significant advantage: I'm going to be maintaining this stuff and writing my own PHY drivers one way or the other. Notes: svn path=/head/; revision=50120