summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_tl.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the tl_start() routine; sometimes the tl_tx_tail pointer was notwpaul1998-12-291-3/+3
| | | | being updated correctly.
* probe function changed from returning char * to const char *.dillon1998-12-141-4/+4
|
* Silence gcc -Wall -ansi -pedantic.wpaul1998-12-101-53/+53
| | | | 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.
* Increase the size of the tx and rx rings from 10 to 20 descriptorswpaul1998-10-311-4/+4
| | | | | | | | | and increase the tx interrupt threshold to 4. This fixes performance problems on slower systems. Also fix a mind-o in the rx ring init routine: I used the TX constant instead of the RX. This isn't a problem as long as the rings are the same size, but if they aren't hijinx will ensue.
* Correctly update the tail pointer of the transmit queue in tl_start()wpaul1998-10-081-2/+3
| | | | | (one-liner). I have yet to actually encounter any problems due to this bug, but why take chances.
* Force the ThunderLAN driver to use PIO mode by default instead ofwpaul1998-10-041-2/+9
| | | | | | | memory mapped mode. There are some laptop docking stations with built-in tlan chips where memory mapped mode doesn't work correctly. Pointed out by: jmb
* Small tweak: force another reset of the adapter after probing for all thewpaul1998-09-241-3/+13
| | | | | | | | | | | | | | | | | | | PHYs in tl_attach(). This is mainly to suck away any possible stray interrupts. This prevents an intermittent problem on some systems where the adapter probes correctly but yields a device timeout (and possible subsequent adapter check) when configured. When I originally tested the driver, I ifconfig'ed the interface after the system had already been booted and didn't notice any problems, but when configuring the interface immediately at startup, it would occasionally timeout and hang, until an adapter check interrupt came along and reset things again. I'm not exactly sure if this is a general problem of just something peculiar to this hardware (there are three devices, including the tlan, all on IRQ 11) but the extra reset shouldn't hurt anything. (It works fine with my 100Mbps Olicom adapter too.) Thanks to Mark Taylor from Cybernet (mtaylor@cybernet.com) for allowing me remote access to a Compaq system for debugging purposes.
* Overhaul the ThunderLAN driver. This update includes the followingwpaul1998-09-231-801/+877
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes: - Cleaned up register access macros so that they work like the XL driver macros (you can switch from PIO to memory-mapped mode using a single #define -- default is still memory mapped mode). The old 'struct overlayed onto the memory mapped register space' cruft has been removed. - Improved multicast filter code. The ThunderLAN has four entry perfect filter table in addition to the 64-bit hash table: we need one of the perfect filter entries for the station address, but we can use the other three for multicast filtering. We arrange to put the first three multicast group addresses in the perfect filter slots so that commonly joined groups like the all hosts group and the all routers group can be filtered without using up bits in the hash table. Note: in FreeBSD 3.0, multicast groups are stored in a doubly linked list, however new entries are added at the head of the list (thereby pushing existing entries down towards the tail). We want to update the filter starting from the oldest entry to the newest since the all hosts group is always joined first. This means we really want to start from the tail of the list, not the head, but to find the tail we first have to traverse the list all the way to the end and then add entries working backwards. This is a bit of a kludge and could be inefficient if the list is long. - Cleaned up autonegotiation code: tl_autoneg() wasn't always setting modes correctly. - Cleaned up ifmedia update and status routines as well. - Added tl_hardreset() routine to initialize the internal PHY according to the ThunderLAN manual. - Did away with the kludge where PHYs were treated as separate logical interfaces. This didn't really work, especially in the case of the newer Olicom 2326 adapters which use a Micro Linear ML6692 PHY which provides only 100Mbps support, relying on the internal PHY for 10Mbps support (both PHYs share the RJ45 port, with the 6692 doing all the autonegotiation work). This kludge resulted from my misunderstanding of the operation of the Compaq Netelligent Dual Port card (the tlan manual mentions multiple channels, but in a different context; this got me a little confused). The driver has been reported to work correctly with the dual port card. - Added dio_getbit/dio_setbit/dio_read/dio_write functions which carefully set the ThunderLAN's indirectly accessed internal registers. This makes the EEPROM reading code more reliable. Hopefully I won't have to touch this again before 3.0 goes out the door. I plan to import the 2.2.x version sometime this week. Approved-by: jkh
* Fix this thing to work properly with multiple tlan adapters; incrementwpaul1998-08-041-1/+3
| | | | | | unit count correctly. Problem reported by Larry Baird <lab@gta.com>.
* Updates for the ThunderLAN driver:wpaul1998-08-031-31/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - probe for PHYs by checking the BMSR (phy status) register instead of the vendor ID register. - fix the autonegotiation routine so that it figures out the autonegotiated modes correctly. - add tweaks to support the Olicom OC-2326 now that I've actually had a chance to test one o Olicom appears to encode the ethernet address in the EEPROM in 16-bit chunks in network byte order. If we detect an Olicom card (based on the PCI vendor ID), byte-swap the station address accordingly. XXX The Linux driver does not do this. I find this odd since the README from the Linux driver indicates that patches to support the Olicom cards came from somebody at Olicom; you'd think if anyone would get that right, it'd be them. Regardless, I accepted the word of the disgnoatic program that came bundled with the card as gospel and fixed the attach routine to make the station address match what it says. o The version of the 2326 card that I got for testing is a strange beast: the card does not look like the picture on the box in which it was packed. For one thing, the picture shows what looks like an external NS 83840A PHY, but the actual card doesn't have one. The card has a TNETE100APCM chip, which appears to have not only the usual internal tlan 10Mbps PHY at MII address 32, but also a 10/100 PHY at MII address 0. Curiously, this PHY's vendor and device ID registers always return 0x0000. I suspect that this is a mutant version of the ThunderLAN chip with 100Mbps support. This combination behaves a little strangely and required the following changes: - The internal PHY has to be enabled in tl_softreset(). - The internal PHY doesn't seem to come to life after detecting the 100Mbps PHY unless it's reset twice. - If you want to use 100Mbps modes, you have to isolate the internal PHY. - If you want to use 10Mbps modes, you have to un-isolate the internal PHY. The latter two changes are handled at the end of tl_init(): if the PHY vendor ID is 0x0000 (which should not be possible if we have a real external PHY), then tl_init() forces the internal PHY's BMCR register to the proper values.
* Declare pointers to CSR register space to be volatile. This seems towpaul1998-07-131-152/+168
| | | | | | | | | | | | | | | | | | | | | | | | cure the problems I was having with interrupts not being acknowledged on time. This fixes a problem I observed where starting two ping -f processes at 10Mbps would cause an adapter check due to TX GO commands being issued before TXEOC interrupts were being acked. Also fix a small problem with tl_start(): the mechanism I was using to queue new packets onto the TX chain was bogus. Change adapter check handler so that it resets card state after tl_softreset() is stored. Moved all EEPROM-related macro definitions into if_tlreg.h. Don't allow an autoneg session to start until after the TX queue has been drained, and don't transmit anything until after the autoneg session is complete. Also add support for two more Compaq ThunderLAN-based cards, and three cards from Olicom which also use the ThunderLAN chip. The only thing different about the Olicom cards is that they store the station address at a different location within the EEPROM.
* Fixed printf format errors (only 1 left in GENERIC now).bde1998-07-131-3/+3
|
* Removed unused includes.bde1998-06-211-25/+2
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-4/+4
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Add a short delay in the read loop in tl_eeprom_getbyte(). On somewpaul1998-05-311-2/+3
| | | | | | | systems, you have to allow the delay or else you end up misreading some of the bits. Patch provided by: Yoshihiko Someya <zb9y-smy@asahi-net.or.jp>
* Don't program the antonegotiation advertisement register in tl_setmode().wpaul1998-05-291-33/+19
| | | | | | | | | I had a reason for doing this, but it violates the principle of least astonishment. (At some point I may put this back but attach it to one of the LINK flags so the behavior can be toggled on and off.) Also replace my tl_calchash() with a much less disgusting and substantially smaller one supplied by Bill Fenner.
* Ignore 'invalid' interrupts that occur while the interface is down.wpaul1998-05-261-2/+12
| | | | | | | | These are probably generated by other PCI devices sharing the TLAN's interrupt. The programmer's guide says to simply re-enable interrupts and return if one of these is detected. Prompted by bug report from: Bill Fenner
* Fix a mind-o in tl_setmulti(): when setting a bit in the upperwpaul1998-05-241-3/+3
| | | | | | | 32 bits of the 64-bit hash table, we have to use a 32-bit shift, not 31. Pointed out by: Bill Fenner
* Remove 2.2.x compatibility code and #ifdefs. Once the shakedown periodwpaul1998-05-221-68/+4
| | | | | | | | | | | in -current is over, I'll put a 2.2.x specific version in the RELENG_2_2 branch. If somebody wants a 2.2 version of this driver now, they can check out the previous version from CVS or ask me via e-mail. Gee people, I didn't mean to stir up such a controversy. I just wanted to make sure I could get this thing to work with both kernel versions and didn't want to have to maintain two separate copies. All ya hadda do was ask. :)
* Yeargh! After all that, I forgot to remove the #include.jkh1998-05-211-4/+2
|
* Don't use __FreeBSD_version explicitly - none of the otherjkh1998-05-211-11/+11
| | | | | | drivers here do and it also blows up in building GENERIC during a release build if you try and include <osreldate.h> (which shot my SNAP dead - argh!). Use __FreeBSD__ instead.
* Add Texas Instruments TNET100 'ThunderLAN' PCI NIC driver to the tree.wpaul1998-05-211-0/+2707
This driver supports the following cards/integrated ethernet controllers: Compaq Netelligent 10, Compaq Netelligent 10/100, Compaq Netelligent 10/100, Compaq Netelligent 10/100 Proliant, Compaq Netelligent 10/100 Dual Port, Compaq NetFlex-3/P Integrated, Compaq NetFlex-3/P Integrated, Compaq NetFlex 3/P w/ BNC, Compaq Deskpro 4000 5233MMX. It should also support Texas Instruments NICs that use the ThunderLAN chip, though I don't have any to test. If you've got a card that uses the ThunderLAN chip but isn't listed in the PCI vendor/product list in if_tl.c, try adding it and see what happens. The driver supports any MII compliant PHY at 10 or 100Mbps speeds in full or half duplex. (Those I've personally tested are the National Semiconductor DP83840A (Prosignia server), the Level 1 LXT970 (Deskpro desktop), and the ThunderLAN's internal 10baseT PHY.) Autonegotiation, hardware multicast filtering, BPF and ifmedia support are included. This chip is pretty fast; Prosignia servers with NCR SCSI, ThunderLAN ethernet and FreeBSD make for a nice combination.
OpenPOWER on IntegriCloud