summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Increase gigE negotiation timeout to 17 seconds.phk2002-05-041-5/+5
| | | | | 10 seconds is not enough to negotiate a gigE link with a cisco switch which holds carrier off for several seconds between tries.
* Clean up mii/phy drivers: Remove the MIIF_DOINGAUTO which doesn't reallyphk2002-05-0416-331/+115
| | | | | do anything at the end of the day except bloat the drivers which has copy&pasted it.
* MII_TICK handlers need not restart aneg on these PHYs, they behave prettysemenu2002-05-012-109/+55
| | | | | | | | | | | | well as is, so - just fetch current status upon MII_TICK. Also do IFM_INST verification at the top of *_service() then doing it separately for every case in switch. acphy: do not read MII_ACPHY_DIAG twice, there is nothing latching. qsphy: always fetch actual link status from MII_QSPHY_PCTL. MFC after: 1 week
* Introduce NetBSD's mii_phy_match() API and use it in the nsgphy tophk2002-04-293-10/+45
| | | | get a description printed.
* Convert exphy and ukphy over to the new code.phk2002-04-293-61/+10
| | | | exphy is done flying blind, ukphy is tested on one card.
* Make one generic mii_phy_detach() to replace 19 slightly different ones.phk2002-04-2922-339/+61
| | | | | | | 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.
* Move a lot closer to NetBSDs MII support for GigE.phk2002-04-296-289/+244
| | | | Move fxp and nge drivers over to use the new stuff.
* Moving closer to being able to use NetBSD's generic mii_set_media()phk2002-04-293-20/+141
| | | | function.
* Edging ever closer to NetBSD...phk2002-04-293-12/+11
|
* Move us yet closer to IFM_* definitions in NetBSD.phk2002-04-291-2/+2
|
* Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/phk2002-04-283-16/+16
|
* Don't pass three args when one will do just fine, and even preventphk2002-04-2817-22/+27
| | | | mistakes like the one brgphy.c (now corrected).
* Improve an API by about 4 lines per driver.phk2002-04-2815-59/+19
|
* Use generic MII #defines instead of private ones when the registersphk2002-04-282-169/+67
| | | | | | are IEEE defined. Object file comes out the same.
* Merge in rev 1.9 from NetBSD.phk2002-04-281-3/+81
|
* Work around an Intel 21143 chip bug.mckay2002-04-181-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rev 1.56 of if_dc.c removed calls to mii_pollstat() from the dc_tick() routine. dc_tick() is called regularly to detect link up and link down status, especially when autonegotiating. The expectation was that mii_tick() (which is still called from dc_tick()) would update status information automatically in all cases where it would be sensible to do so. Unfortunately, with authentic 21143 chips this is not the case, and the driver never successfully autonegotiates. This is because (despite what it says in the 21143 manual) the chip always claims that link is not present while the autonegotiation enable bit is set. Autonegotation takes place and succeeds, but the driver tests the link bits before it switches off the autonegotiation enable bit, and success is not recognised. The simplest solution is to call dcphy_status() more often for MII_TICK calls by dropping out of the switch statement instead of exiting when we are autonegotiating and link appears to not be present. When autonegotiation succeeds, dcphy_status() will note the speed and fdx/hdx state and turn off the autonegotiation enable bit. The next call to dcphy_status() will notice that link is present, and the dc driver code will be notified. Macronix chips also use this code, but implement link detection as described in the manual, and hence don't need this patch. However, tests on a Macronix 98715AEC-C show that it does not adversely affect them. This could be done better but is the minimal effective change, and most closely mimics what was happening prior to rev 1.56 of if_dc.c. (Actually I also deleted a small amount of unnecessary code while I was in the area.) Reviewed by: wpaul
* Regenerate.wpaul2002-04-071-1/+6
|
OpenPOWER on IntegriCloud