summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
Commit message (Collapse)AuthorAgeFilesLines
* On second though, print the OUI, model and revision. This is the sameimp2005-02-161-1/+3
| | | | | information that's in the id1 and id2 fields we were using, but is in a form that the drivers will be using in their matching routines.
* Add location and PNP info to the mii busimp2005-02-161-0/+24
|
* Use ANSI function definitions, in preference to the K&R definitions.imp2005-02-152-34/+15
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-0631-32/+31
|
* Cleanup link state change notification:sam2004-12-081-28/+11
| | | | | o add new if_link_state_change routine that deals with link state changes o change mii to use if_link_state_change
* With mii.h rev 1.4 changes to BMSR_MEDIAMASK merged in frombz2004-11-261-2/+2
| | | | | | | | | | | | | | | | | NetBSD got activated. NetBSD has an additional change in their mii.c rev 1.26 which got missed with that merger: : When probing for a PHY, look at the EXTSTAT bit in the BMSR, as well, : not just the media mask. This prevents PHYs/TBIs that only support : Gigabit media from slipping through the cracks. With this GE only ones like from the SK-9844 are detected again. PR: i386/63313, i386/71733, kern/73725 Tested by: matt baker <matt at sevenone dot com>, Jin Guojun <jin at george dot lbl dot gov> Approved by: rwatson (mentor) Obtained from: NetBSD mii.c rev 1.26 MFC after: 1 week
* Add support for the BCM5750/5751. Unfortunately the documentationps2004-09-242-0/+34
| | | | | | | | I have from Broadcom does not give much information on these devices, so the Broadcom Linux driver was used for clues to what these chips support. It turns out they are similar to the 5705 with the 5751 being the PCI-Express version and needing special work-arounds and settings.
* Add device driver support for the VIA Networking Technologieswpaul2004-09-103-0/+790
| | | | | | | | | | | | VT6122 gigabit ethernet chip and integrated 10/100/1000 copper PHY. The vge driver has been added to GENERIC for i386, pc98 and amd64, but not to sparc or ia64 since I don't have the ability to test it there. The vge(4) driver supports VLANs, checksum offload and jumbo frames. Also added the lge(4) and nge(4) drivers to GENERIC for i386 and pc98 since I was in the neighborhood. There's no reason to leave them out anymore.
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-151-1/+1
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* Add some missing <sys/module.h> includes which are masked by thephk2004-05-3010-0/+10
| | | | one on death-row in <sys/kernel.h>
* DP83840A on hme(4) don't advertise their media capabilities themselvesmarius2004-05-291-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | properly. This causes the autonegotiation to e.g. never establish a 100baseTX full-duplex link. The solution to this problem is to manually write the capabilities from the BMSR to the ANAR every time a media change occurs, even when already in autonegotiation mode. The NetBSD way of doing this is to set their MIIF_FORCEANEG flag in the NIC driver. This causes mii_phy_setmedia() to call mii_phy_auto() (which will set the ANAR according to the BMSR) even when the PHY alread is in autonegotiation mode. However, while doing the same on FreeBSD (which involves porting the MIIF_FORCEANEG flag and converting nsphy.c to use mii_phy_setmedia()) fixes autonegotiation, using mii_phy_setmedia() causes this driver to no longer work properly in the other modes. Another drawback of that approach is that this will also force writing the ANAR on other PHYs whose drivers use mii_phy_setmedia() and which are used with a NIC whose driver sets MIIF_FORCEANEG (e.g. hme(4) is known to be used together with 3 different PHYs while only the DP83840A require this workaround). So instead of moving to MIIF_FORCEANEG, just call mii_phy_auto() in nsphy_service() unconditionally when hanging off of a hme(4) and serving a media change This is part 1/2 of fixing autonegotiation on hme(4) using DP83840A PHYs.
* Spelling fix in a comment.marius2004-05-291-1/+1
|
* Remove double __FBSDID and move the remaining one into a common place aftermarius2004-05-2921-84/+27
| | | | | the license(s) and before the driver comment (the latter only in drivers not having __FBSDID at that location).
* Move __FBSDID out from under a comment.marius2004-05-291-3/+3
|
* Spelling fix in a comment.marius2004-05-291-1/+1
|
* Link state change notification of ethernet media to the routing socket.andre2004-05-031-4/+18
| | | | | | | | | | | | | | | o Extend the if_data structure with an ifi_link_state field and provide the corresponding defines for the valid states. o The mii_linkchg() callback updates the ifi_link_state field and calls rt_ifmsg() to notify listeners on the routing socket in addition to the kqueue KNOTE. o If vlans are configured on a physical interface notify and update all vlan pseudo devices as well with the vlan_link_state() callback. No objections by: sam, wpaul, ru, bms Brucification by: bde
* Correct the phy_service() routine case MII_TICK to correctly trackandre2004-05-039-19/+21
| | | | | | | | | | the falling edge of a media state change. This is in preparation for media state change notification to the routing socket. No objections by: sam, wpaul, ru, bms Brucification by: bde
* Make sure set the media type in the phy, we cannot trust it to have chosenphk2004-01-171-0/+1
| | | | | | | the type we happen to want. Bug triggered by net-booting soekris hardware which comes up in 10/hdx mode by default.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+2
| | | | | | | | | | | | | 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)
* Typo when setting wirespeed. || != |ps2003-09-281-1/+1
| | | | Found by: jake
* Add support for SK-9521 V2.0 and 3COM 3C940.wilko2003-09-203-50/+114
| | | | | | | | | | Tested at 100Mbit only, using Asus P4P800 onboard 3C940. The -stable version of this patch I have in use for ~2 weeks now, and works just fine for me. Based on: Nathan L. Binkert's patch for OpenBSD Patch submitted by and thanks to: Jung-uk Kim <jkim@niksun.com> MFC after: 2 weeks
* Clean up dead code.wpaul2003-09-111-15/+8
|
* Add a PHY driver to support the built-in gigE PHY in the 8169S/8110Swpaul2003-09-113-0/+628
| | | | | | | | | | | | | | | | | | 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).
* Add a device driver for the Broadcom BCM4401 ethernet controller,wpaul2003-09-092-0/+4
| | | | | | | | | | | | | | 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.
* Take the support for the 8139C+/8169/8169S/8110S chips out of thewpaul2003-09-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rl(4) driver and put it in a new re(4) driver. The re(4) driver shares the if_rlreg.h file with rl(4) but is a separate module. (Ultimately I may change this. For now, it's convenient.) rl(4) has been modified so that it will never attach to an 8139C+ chip, leaving it to re(4) instead. Only re(4) has the PCI IDs to match the 8169/8169S/8110S gigE chips. if_re.c contains the same basic code that was originally bolted onto if_rl.c, with the following updates: - Added support for jumbo frames. Currently, there seems to be a limit of approximately 6200 bytes for jumbo frames on transmit. (This was determined via experimentation.) The 8169S/8110S chips apparently are limited to 7.5K frames on transmit. This may require some more work, though the framework to handle jumbo frames on RX is in place: the re_rxeof() routine will gather up frames than span multiple 2K clusters into a single mbuf list. - Fixed bug in re_txeof(): if we reap some of the TX buffers, but there are still some pending, re-arm the timer before exiting re_txeof() so that another timeout interrupt will be generated, just in case re_start() doesn't do it for us. - Handle the 'link state changed' interrupt - Fix a detach bug. If re(4) is loaded as a module, and you do tcpdump -i re0, then you do 'kldunload if_re,' the system will panic after a few seconds. This happens because ether_ifdetach() ends up calling the BPF detach code, which notices the interface is in promiscuous mode and tries to switch promisc mode off while detaching the BPF listner. This ultimately results in a call to re_ioctl() (due to SIOCSIFFLAGS), which in turn calls re_init() to handle the IFF_PROMISC flag change. Unfortunately, calling re_init() here turns the chip back on and restarts the 1-second timeout loop that drives re_tick(). By the time the timeout fires, if_re.ko has been unloaded, which results in a call to invalid code and blows up the system. To fix this, I cleared the IFF_UP flag before calling ether_ifdetach(), which stops the ioctl routine from trying to reset the chip. - Modified comments in re_rxeof() relating to the difference in RX descriptor status bit layout between the 8139C+ and the gigE chips. The layout is different because the frame length field was expanded from 12 bits to 13, and they got rid of one of the status bits to make room. - Add diagnostic code (re_diag()) to test for the case where a user has installed a broken 32-bit 8169 PCI NIC in a 64-bit slot. Some NICs have the REQ64# and ACK64# lines connected even though the board is 32-bit only (in this case, they should be pulled high). This fools the chip into doing 64-bit DMA transfers even though there is no 64-bit data path. To detect this, re_diag() puts the chip into digital loopback mode and sets the receiver to promiscuous mode, then initiates a single 64-byte packet transmission. The frame is echoed back to the host, and if the frame contents are intact, we know DMA is working correctly, otherwise we complain loudly on the console and abort the device attach. (At the moment, I don't know of any way to work around the problem other than physically modifying the board, so until/unless I can think of a software workaround, this will have do to.) - Created re(4) man page - Modified rlphy.c to allow re(4) to attach as well as rl(4). Note that this code works for the sample 8169/Marvell 88E1000 NIC that I have, but probably won't work for the 8169S/8110S chips. RealTek has sent me some sample NICs, but they haven't arrived yet. I will probably need to add an rlgphy driver to handle the on-board PHY in the 8169S/8110S (it needs special DSP initialization).
* Use __FBSDID().obrien2003-08-2424-5/+72
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-222-3/+3
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* On Dell boxes such as the PE2650 we need to disable 3 led mode for theambrisko2003-08-201-0/+7
| | | | | | | link LED to work. Reviewed by: wpaul Obtained from: Linux driver
* Add support for the Broadcom BCM5901 and BCM5901 rev A2 chips.wpaul2003-08-121-5/+25
| | | | | | | | These are 10/100 only NICs found on the IBM Thinkpad R40E and G40. These seem to be based on the BCM5705 MAC but with a PHY that doesn't support 1000Mbps modes. Submitted by: Igor Sviridov <sia@nest.org>
* Add support for the BCM5705 and its ilk. Changes:wpaul2003-07-162-0/+27
| | | | | | | | | | | | | | | | | | | - 5705 doesn't support jumbo frames - Statistics must be read from registers - RX return ring must be capped at 512 entries - Omit initialization of certain device blocks - Acknowledge link change interrupts by setting the 'link changed' bit in the status register (used to have no effect) - Remember to toggle the MI completion bit too - Set the mbuf low watermark differently (on-chip memory buffers, not BSD mbufs) - Don't enable Ethernet@WireSpeed feature for certain 5705 chip revs - Add additional PCI IDs for 5705 and 5782 parts - Add a forgotten 5704 PCI ID Most changes ripped kicking and screaming from the Broadcom linux driver. Thanks to Paul Saab for sanity testing. (My lack of sanity has been confirmed.)
* Fix bge at 10Mbit. The defines for 10-Half and 10-Full were swapped.ps2003-06-171-2/+2
| | | | Shamed into fixing by: John Cagle <john.cagle@hp.com>
* Remove unnecessary breaks.phk2003-05-317-14/+1
| | | | | | | Remove unused variables. Add XXX comment where a break may be missing. [lxtphy.c] Found by: FlexeLint
* Something I missed in my tree.ps2003-05-041-2/+18
| | | | | | If the media changes, poke the DSP on the 5401/5411 Broadcom PHY's. Obtained from: NetBSD
* - Move bge_phy_hack into the phy code and implement the various DSPps2003-05-031-20/+161
| | | | | | | | | | | | | | | | | | | | | | | | | patch workarounds for each phy revision. Obtained from: NetBSD & Broadcom Linux driver - Disable AUTOPOLL when accessing the PHY as it may cause PCI errors. Obtained from: NetBSD - Check the UPDATED bit in the status block so the driver knows that the status block as indeed changed since the last access. Broadcom documentation states drivers should unset the UPDATED/CHANGED bits after reading them. - When changing media types, first loop the phy then set the media. Broadcom documentation and Linux drivers do this and I observed much better handling of link after this change. - Broadcom documentation states that for 1000BaseT operation, autonegotiation must be enabled. Fix hard coding of media so that the driver only advertises 1000BaseT as the supported media type and enable autonegotition. - Only set Master/Slave on the 5701. Obtained from Broadcom Linux driver.
* Add RealTek RTL8150 USB to fast Ethernet controller driver.akiyama2003-05-032-0/+335
| | | | | | | | This driver now supports the Melco LUA-KTX and the GREEN HOUSE GH-USB100B. Reviewed by: imp MFC after: 2 weeks
* Add untested support for the Broadcom 5704.ps2003-05-022-0/+7
| | | | Obtained from: NetBSD
* Use __FBSDID rather than rcsid[].obrien2003-04-0319-110/+59
|
* Remove unused variable and code.peter2003-02-191-2/+0
|
* Remove miidevs.h and generate it from miidevs at compile time.obrien2003-01-1921-388/+18
| | | | The devlist2h.awk tool to do this has been repocopied to sys/tools/.
* Regenerateobrien2003-01-131-1/+3
|
* Partial support for the nVidia nForce2 chipset's on-board Broadcom/Altima PHYobrien2003-01-122-0/+4
| | | | | | | and 3com MAC. Specifications for the Altima PHY are available at: http://www.altimacom.com/products/ac101L.html Submitted by: Mikko S. Hyvarinen <morphy@morphy.iki.fi>
* Remove unnecessary <sys/malloc.h> include.semenu2002-10-298-8/+0
| | | | | Submitted by: marius@alchemy.franken.de MFC after: 1 week
* Put function return types on a line by themselves.alfred2002-10-1418-75/+111
| | | | | Cleanup my earlier de-__P sweep and remove whitespace between function names and paramters.
* Be consistent about "static" functions: if the function is markedphk2002-09-282-2/+2
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Add support for the BCM5703x chips. I do not have one of thesejdp2002-09-083-0/+9
| | | | | | | | cards to test; however the submitter reports that this patch works with the on-board interface on the IBM x235 server. Submitted by: Jung-uk Kim <jkim@niksun.com> MFC after: 1 month
* Revert change to detect multiply PHYs in mii code. There might be casesambrisko2002-08-161-5/+2
| | | | | | | | | when this is needed. Work around bogus second PHY in the DFE-580 card via a change in the if_ste.c driver. Suggested by: jdp Reviewed by: jdp MFC after: 3 days
* Only attach one PHY device to a controller. NetBSD has similar code.ambrisko2002-08-071-2/+5
| | | | | | | | The D-Link DFE-580 card will otherwise show 2 miibuses for each controller and therefore 2 ukphy's. Sponsored by: Vernier Networks MFC after: 1 week
* regeneratebenno2002-07-051-3/+9
|
* Add a driver for the Broadcom BCM52xx "mini-theta" PHY. This includes thebenno2002-07-053-0/+483
| | | | | | | | | | | | | internal PHY on the 3COM 3C905B and 3C905C parts, however I've rigged it so that xlphy (aka exphy) takes precedence for the time being. If people try this with their xl cards and decide that it's a better choice, we can switch this later. This is the PHY used in various iMacs and possibly other GMAC-equipped Macintoshes with 10/100 PHYs (the ones with 10/100/1000 appear to use brgphy). Obtained from: NetBSD
* Use 3C905C instead of 3c905Cphy as the identifier for the Broadcom PHY usedbenno2002-07-052-3/+3
| | | | | | in the 3C905C. This is mainly cosmetic. I'm doing this mainly so we share the same identifier as NetBSD.
OpenPOWER on IntegriCloud