summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate unneeded return keywords.bms2004-07-061-34/+1
|
* Whitespace passbms2004-07-061-54/+54
|
* Remove code to slam the config space on transition to d0.imp2004-06-281-56/+0
|
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-29/+2
|
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* Wrap the code to save/restore PCI config registers on suspend/resume injhb2004-05-241-0/+8
| | | | | | #ifndef BURN_BRIDGES. Noticed by: phk
* A handler for ioctl(SIOCSIFCAP) should not alter a bit inyar2004-05-231-1/+3
| | | | | | | if_capenable unless the interface driver is actually able to toggle the respective capability on and off. Reviewed by: ru
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* Implemented per-interface polling(4) control.ru2004-04-111-1/+9
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-5/+5
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Announce ethernet MAC addresss in ether_ifattach().mdodd2004-03-141-5/+0
|
* Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.obrien2003-12-081-6/+6
| | | | Requested by: bde,imp
* Sometimes cardbus attachments don't attach, so while we track downimp2003-11-281-0/+1
| | | | | | | | this problem put these lines back in. While they should be unnecessary, they appear to be sometimes necessary. Reviewed in concept: dfr Approved by: re (scottl@)
* Drop the driver lock around calls to if_input to avoid a LOR whensam2003-11-141-0/+4
| | | | | | | | the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach. Reviewed by: imp, rwatson
* Remove duplicate FBSDID's, move others to their right place.obrien2003-11-141-3/+3
|
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-13/+11
| | | | | | | multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
* Remove explicit cardbus attachments from drivers where this is identicaldfr2003-11-031-1/+0
| | | | | | | to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices. Reviewed by: imp
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | 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)
* Remove the dual-address cycle stuff. DAC is used to allow a bus masterwpaul2003-09-201-4/+2
| | | | | | | | | | | | | | | device to access 64-bit addresses from a 32-bit PCI bus. While the RealTek manual says you can set this bit and the chip will perform DAC only if you give it a DMA address with any of the upper 32 bits set, this appears not to be the case. If I turn on the DAC bit, the chip sets the 'system error' bit in the status register when I to do a DMA on my Athlon test box with 32-bit PCI bus (VIA chipset) even though I only have 128MB of physical memory, and thus can never give the chip a 64-bit address. Obviously, I can't just set it and forget it, so until I figure out the right rule for when it's safe/necessary to enable it, keep it turned off.
* Remove jumbo buffer #defines that I ended up not needing.wpaul2003-09-191-1/+1
|
* In re_diag(), there's no need for us to call re_start() ourselves:wpaul2003-09-181-4/+8
| | | | | | | | | | | IF_HANDOFF() does it for us behind the scenes. Remove the extra call to re_start() otherwise we try to transmit twice. In re_encap(), fix the code that guards against consuming too many descriptors in the TX ring so that it actually works. With the new 8169S chip, I was able to hit a corner case that drained the free descriptor count all the way to 0. This is not supposed to be possible.
* Teach the re(4) driver about the CFG2 register, which tells us whetherwpaul2003-09-131-7/+14
| | | | | | | | | we're on a 32-bit/64-bit bus or not. Use this to decide if we should set the PCI dual-address cycle enable bit in the C+ command register. (Enabling DAC on a 32-bit bus seems to do bad things.) Also, initialize the C+ command register early in the re_init() routine. The documentation says this register should be configured first.
* Toggle the interface on and off before starting the diag test. Thiswpaul2003-09-111-0/+3
| | | | | | | | seems to be necessary for the 8139C+ under certain circumstances, and doesn't appear to hurt the other chips. (In the failure case, the packet would be sent through the TX DMA ring but not get echoed back. I suspect this has something to do with the link state changing unexpectedly.)
* - For the 8169 chips, read the station address by forcing an EEPROMwpaul2003-09-111-27/+59
| | | | | | | | | | | | | | | | | | | | | autoload and then copying the contends of the station address registers. For some reason, reading the EEPROM on the 8169S doesn't work right. This gets around the problem, and allows us to read the station address correctly on the 8169S. - Insert a delay after initiating packet transmition in re_diag() to allow lots of time for the frame to echo back to the host, and wait for both the 'RX complete' and 'timeout expired' bits in the ISR register to be set. - Deal more intelligently with the fact that the frame length field in the RX descriptor is a different width on the 8139C+ than it is on the 8169/8169S/8110S - For the 8169, you have to set bit 17 in the TX config register to enter digital loopback mode, but for the 8139C+, you have to set both bits 17 and 18. Take this into account so that re_diag() works properly for both types of chips.
* Add a PHY driver to support the built-in gigE PHY in the 8169S/8110Swpaul2003-09-111-1/+16
| | | | | | | | | | | | | | | | | | 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).
* Fix bug in re_gmii_writewreg(): we don't need to be screening out certainwpaul2003-09-101-3/+0
| | | | PHY addresses here. (The chip will only let you talk to one PHY anyway.)
* Update hardware revision table. 0x04000000 appears to be the revisionwpaul2003-09-101-3/+6
| | | | | | | | for the 8169S, according to my sample board. The RealTek Linux driver mentions 0x00800000. I'm assigning this to the 8110S until I get more info on it. (The (preliminary) RealTek docs only say that 8169S/8110S chips will have some combination of those two bits set, but doesn't say exactly what bit combination goes with which chip variant.)
* Take the support for the 8139C+/8169/8169S/8110S chips out of thewpaul2003-09-081-0/+2430
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).
OpenPOWER on IntegriCloud