summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:peter1999-05-091-6/+2
| | | | | | | | #define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data) .. to 2.2.x and 3.x if people think it's worth it. Driver writers can do this if it's not defined. (The reason for this is that I'm trying to progressively eliminate use of linker_sets where it hurts modularity and runtime load capability, and these DATA_SET's keep getting in the way.)
* Dynamically increase TX start threshold if TX underruns are detected.wpaul1999-05-051-4/+12
|
* Fix the media selection for the 3c900B-FL 10baseFL adapter. It actuallywpaul1999-05-041-44/+48
| | | | | | uses the AUI port with an on-board AUI to 10baseFL transceiver, not the 10baseT port like I had earlier suspected. The 3c900B-FL should be properly supported now.
* Bunch of updates:wpaul1999-04-301-95/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Try to unbreak what I broke by screwing with the tx queuing again. I'm waiting for a few more people to test out this code and report back before I move it into current. Hopefully it will be soon. Basically I reverted to the old TX queuing strategy. - Add experimental support for the 3c900B-FL (10mbps ST fiber). The card should be detected properly and the 10baseFL mode supported, but again I'm still waiting for word from a tester to see if this actually works. It shouldn't affect the other cards though; all the differences are in media selection. - Set the TX start threshold register to get better performance. - Increase the size of the RX and TX rings. UDP performance was pretty bad because the TX ring was too small. Should be substantially better now (I can saturate the link with either TCP or UDP now). - Change some of the #defines to reflect proper 3Com ASIC names (boomerang, cyclone, krakatoa, hurricane). - Simplify and reorganize interrupt handler; ack all interrupts right away and then process them. This avoids a potential race condition. (Noted by Matt Dillon.) - Reorganize the bridging code to eliminate using a goto to jump into the middle of an if() {} clause. Sorry, that just made my brain itch. - Use m_adj() in xl_rxeof(). - Make the payload alignment in xl_newbuf() the default (instead of just conditionally defined for the alpha) to improve NFS performance (avoids need for nfs_realign()).
* Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn'tpeter1999-04-241-2/+6
| | | | hurt the driver portability to 3.x too much for where drivers are shared.
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-3/+9
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* Add bridging support (tested in 3.1-RELEASE by Steven Vetzalghelmer1999-04-161-13/+41
| | | | <svetzal@icom.ca>).
* - Close PR #11136: add PCI ID for another new cyclone device: thewpaul1999-04-151-31/+57
| | | | | | | | | | | | 3c900B-TPC (twisted pair and coax). Treated similarly to the 3c900B-COMBO, except no AUI port. - Fix media selection so that it's possible to select the AUI and BNC ports on the 3c905B-COMBO. This board is now fully supported. - Change TX queueing strategy to hopefully be more efficient by avoiding register accesses in xl_start(). Should provide small performance improvement and a little better reliability.
* Add support for the 3cSOHO100-TX, which is a "hurricane" chipsetwpaul1999-04-121-2/+6
| | | | | | (cut-down version of the "cyclone" for the small office/home office "cheap bastard" market). Basically the same as a 3c905B but without Wake-on-LAN, ROM socket, etc...
* Some small updates:wpaul1999-04-111-8/+25
| | | | | | | | | | | | | | | | - Wait longer for the reset to complete in xl_attach() to try and avoid 'command never completed' warnings. - Clean up a few odds and ends in xl_attach(). - Add PCI ID for the 3c905B-COMBO (a new card). Right now this is treated as a 3c905B; I need to dig up one of these cards for testing before I can make the AUI and BNC ports work. - Add a hack to force reading the I/O address directly from the PCI registers if pci_map_port() fails. I SHOULD NOT HAVE TO DO THIS: SOMEBODY WITH MORE PCI CLUES THAN I SHOULD INVESTIGATE WHY THIS HAPPENS.
* Shorten device names so that the pci probe lines don't exceed 80 charswpaul1999-03-311-12/+15
| | | | | | | and wrap to a second line. Put 'command never completed' message inside #ifdef DIAGNOSTIC/#endif to stop people worrying about it (it's harmless).
* Make the xl and pn drivers work on FreeBSD/alpha and add them towpaul1999-03-271-4/+29
| | | | | | | | | | | | | | | sys/alpha/conf/GENERIC. Note: the PNIC ignores the lower few bits of the RX buffer DMA address, which means we have to add yet another kludge to make it happy. Since we can't offset the packet data, we copy the first few bytes of the received data into a separate mbuf with proper alignment. This puts the IP header where it needs to be to prevent unaligned accesses. Also modified the PNIC driver to use a non-interrupt driven TX strategy. This improves performance somewhat on x86/SMP systems where interrupt delivery doesn't seem to be as fast with an SMP kernel as with a UP kernel.
* Remove call to DELAY() from xl_wait(), since xl_wait() is in thewpaul1999-02-261-3/+2
| | | | | interrupt handler codepath. Having the delay there didn't really accomplish much anyway.
* Do not issue RX and TX reset commands in xl_stop() and xl_init(). On thewpaul1999-02-111-2/+6
| | | | | | | | | | | | | | 3c905B, the RX and TX reset commands also reset the cyclone chip's internal PHY, which causes it to restart its autonegotiation session. This takes a second or two to complete, which makes the interface seem to stop responding for a few seconds every time you do something that reinitializes it. Issuing the RX and TX resets on the older 3c905 boomerang adapters doesn't cause any delay because the boomerang chip requires an external PHY. This should fix the problem where people doing network installs via 3c905B cards experience a delay after the interface is first initialized, among other things.
* Remember to initialize ifp->if_snd.ifq_maxlen.wpaul1999-02-011-2/+3
|
* Fix a small bug in xl_start(): when queuing a packet onto the end ofwpaul1998-12-241-2/+3
| | | | | an existing chain, don't forget to move xl_tx_tail to point to the new tail end.
* probe function changed from returning char * to const char *.dillon1998-12-141-4/+4
|
* Silence gcc -Wall -ansi -pedantic and fix minor bug in xl_txeof().wpaul1998-12-101-9/+7
| | | | Pointed out by: Eivind
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-4/+4
| | | | and local variables, goto labels, and functions declared but not defined.
* Add sanity check to foo_start() routines: in the unlikely (thoughwpaul1998-12-051-2/+8
| | | | | | apparently possible) event that the transmit start routine is called with and empty if_snd queue, bail out instead of dereferencing unilitialized transmit list pointers and panicking.
* Fix a minor bug in xl_attach() where the list buffer region is roundedwpaul1998-11-181-3/+3
| | | | | | to a longword boundary. Noticed by: Jason Wright <jason@thought.net>
* Close PR #8409:wpaul1998-10-221-3/+3
| | | | Fix syntax errors inside #ifdef FORCE_AUTONEG_TFOUR.
* Close PR #8384:wpaul1998-10-221-21/+37
| | | | | | | | | | | | Revert the transmission packet queueing strategy changes. Clearly I missed something while debugging this, although I never encountered any problems on my test machines. Also make one other minor change: jack up the TX reclaim threshold for 3c90xB adapters in order to stave off 'transmission error: 82' errors. Document the existence of the tx reclaim register (for inspecting the current reclaim threshold) in register window 5 (if_xlreg.h).
* Modify the transmit packet queuing strategy a bit to be a little lesswpaul1998-10-191-19/+21
| | | | | | | | | | | | | | agressive. With the old code, if a descriptor chain was already on its way to the chip, xl_start() would try to splice new chains onto the end of the current chain by stopping the transmitter, modifying the tail pointer of the current chain to point to the head of the new chain, then restart the transmitter. The manual says you're allowed to do this and it works, but I'm not too keen on it anymore. The new code waits until the eixsting chain has been sent and then queues the next waiting chain in the 'transmit ok' handler. Performance still looks good one way or the other.
* Add support for yet another "cyclone" board, with PCI device id 0x905A.wpaul1998-10-091-2/+4
| | | | | | | This is a 100BaseFX board with SC fiber media connectors. I don't actually have one of these but I've been told it works with the xl driver. Submitted by: Jason Wright from the openbsd group
* Apply patch graciously provided by Jason Wright <jason@thought.net> fromwpaul1998-09-251-23/+34
| | | | | | | | | | | | | | | the OpenBSD group to fix a problem with the default ifmedia not being set properly in some cases with a 3c905B, leading to a panic in ifmedia_set(). Also apply a patch to force the transmit start routine to check the transmitter to make sure it isn't wedged if the outbound tx queue appears full. This seems to cure some problems with 'watchdog timeout' errors cropping up in some cases. I tried to do this before by checking for the IFF_OACTIVE flag on entry to xl_start(), but if the IFF_OACTIVE flag is set, ether_output() won't even call xl_start(). It should work now. Lastly, increase the size of the TX queue from 10 descriptors to 16 to hopefully make it less likely that the TX queue will fill up.
* - If the OACTIVE flag is set on entry to xl_start(), check to see if thewpaul1998-09-081-4/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | transmitter is wedged. If so, try to unwedge it, process any descriptors that might need to be free()d, then proceed. - Disable the 'background' autonegotiation performed during bootstrap. What happens currently is that the driver starts an autoneg session, the sets a timeout in the ifnet structure and returns. Later, when the timer expires, the watchdog routine calls the autoneg handler to check the results of the session. The problem with this is that the session may not complete until some point after we have started to mount NFS filesystems, which can cause the mounts to fail. This is especially troublesome if booting with an NFS rootfs: we need the interface up and running before reaching the mountroot() code. The default behavior now is to do the autoneg synchronously, i.e. wait 5 seconds for the autoneg to complete before exiting the driver attach routine. People who want the old behavior can compile the driver with XL_BACKGROUND_AUTONEG #defined. This has no effect on autoneg sessions initiated by 'ifconfig xl0 media autoselect.' This slows the probe down a little, but it's either that or botching NFS mounts at bootup. - If xl_setmode_mii() is called and there's an autoneg session in progress, cancel it, _then_ set the modes.
* Patch the transmit error handler to avoid following NULL pointers andwpaul1998-09-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | generating a trap 12 panic. The code blindly assumed that in the event of a transmit error, the packet that caused the error would still be at the head of the driver's transmit queue (sc->xl_cdata.xl_tx_head). However in the case of error 82 (which indicates that a transmit error occurred after part of the transmit FIFO memory has been reclaimed) this is not true: the TX queue has already been flushed, and the pointer to the head of the queue is NULL, so trying to dereference the pointer to find the transmit descriptor address causes a crash. The code now checks for a NULL pointer before trying to reload the chip's download pointer register. There may still be error messages printed warning of the transmit error, but no panic should occur. Note that this eror code is only generated with "cyclone" chipsets (3c900B, 3c905B, and presumeably the 3c980 server adapter). It should only appear during periods of heavy traffic, probably only on non-switched networks. Problem reported by: Darcy Buskermolen <darcy@ok-connect.com>
* Modify the xl_mediacheck() routine to also test for the case where thewpaul1998-09-041-17/+42
| | | | | | | | | | | | | | | | XCVR value read from the EEPROM is completely wrong. I've had one report of a 3c900 card that returns an xcvr value of 14, which is impossible (the manual states that all vales above 8 are reserved). If the value is out of the expe Add PCI vendor ID for the 3c980-TX server adapter card, which apparently also uses the cyclone chip. Graciously supplied Mats O Jansson <maja@cntw.com>. Also noted by Mats, the 10mpbs cyclone adapters should be named 3c900B, not 3c905B. I haven't actually encountered a 10mbps only cyclone adapter yet, nor anybody who has one, but this makes sense given the naming scheme used for the older boomerang adapters.
* "xl%d: chip is is in D%d power mode " -> "xl%d: chip is in D%d power mode "wpaul1998-09-011-3/+3
|
* Fix handling of ENOBUFS condition. During reception, the filled mbufwpaul1998-08-311-12/+27
| | | | | | | | | | | | | | | | cluster from the RX descriptor is passed up to the higher layers and replaced with an empty buffer for the next time the descriptor comes up in the RX ring. The xl_newbuf() routine returns ENOBUFS if it can't obtain a new mbuf cluster, but this return value was being ignored. Now, if buffer allocation fails, we leave the old one in place and drop the packet. This is rude, but there's not much else that can be done in this situation. Without this, the driver can cause a panic if the system runs out of MBUF clusters. Now it will complain loudly, but it shouldn't cause a panic. Also added another pair of missing newlines to some printf()s.
* Change the autonegotiation waiting period from 3 seconds to 5. Thiswpaul1998-08-301-3/+3
| | | | | | | | | delay controls how long the driver waits for autonegotiation to complete after setting the 'autoneg restart bit' in a PHY. In some cases, it seems 3 seconds is not long enough: with 3c905-TX cards (external PHY), you sometimes see 'autoneg not complete; no carrier' errors due to the timeout being too short. (3c905B adapters seem to be happy with 3 seconds though.)
* - #define mask of enabled interrupts/indications in if_xlreg.h instead ofwpaul1998-08-241-21/+32
| | | | | | constructing local copy in xl_init() - disable interrupts on entry to xl_intr(), re-enable them on exit. - fix a few typos in some comments
* Fix small printf() bogon (forgot newline, and the message was longer thatwpaul1998-08-201-4/+4
| | | | 80 cols).
* Make two changes:wpaul1998-08-191-28/+48
| | | | | | | | | | | | | | | | | | If I'm reading the manual correctly, the 3c905B actually loses its PCI configuration during the transition from D3(hot) back to D0, not during the transition from D0 to D3(hot). This means it should be possible to save the existing PCI settings, restet the power state, then restore the PCI settings afterwards. Changed xl_attach() to attempt this first thing before the normal PCI setup. I'm not certain this will work correctly, but it shouldn't hurt. If xl_init() is called while an autoneg session is in progress, the autoneg timeout and chip state will get clobbered. Try to avoid this by checking sc->xl_autoneg at the start of xl_init() and defer the initialization until later if it's set. (xl_init() is always called at the end of an autoneg session by xl_autoneg_mii().) Problem pointed out by: Larry Baird <lab@gta.com>
* Fixed printf format errors (none detected in GENERIC again).bde1998-08-171-3/+3
|
* Import the (Fast) Etherlink XL driver. I'm reasonally confident in itswpaul1998-08-161-0/+2605
stability now. ALso modify /sys/conf/files, /sys/i386/conf/GENERIC and /sys/i386/conf/LINT to add entries for the XL driver. Deactivate support for the XL adapters in the vortex driver. LAstly, add a man page. (Also added an MLINKS entry for the ThunderLAN man page which I forgot previously.)
OpenPOWER on IntegriCloud