summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_dc.c
Commit message (Collapse)AuthorAgeFilesLines
* Do not call mii_pollstat() from within device tick routines; the statusjlemon2001-09-291-8/+5
| | | | | | information is updated by mii_tick(). Pointed out by: wpaul (a while back)
* Add support for Conexant LANfinity miniPCI controllers. People who havewpaul2001-09-041-3/+27
| | | | | | | | | | laptops with this chip should test this and report back as I don't have access to this hardware myself. People with -stable systems should try the patch at: http://www.freebsd.org/~wpaul/conexant.patch.gz Submitted by: Phil Kernick <Phil@Kernick.org>
* Deal with the condition where we lose link in the middle of transmittingwpaul2001-07-121-1/+1
| | | | | | | | | | | | | | | a bunch of frames. In this case, the dc_link flag is cleared, and dc_start() stops draining the if_snd send queue, which results in lots of 'no buffers available' errors being reported to applications. The whole idea behind not draining the send queue until the link comes up was to avoid having the gratuitous ARP being lost while we're waiting for autoneg to complete after the interface is first brought up. As an optimization, change the test in dc_start() so that we only bail if dc_link is not set _and_ there are less than 10 packets in the send queue. If the queue has many frames in it, we need to drain them. If the queue has a small number of frames in it, we can hold off on sending them until the link comes up. MFC after: 1 week
* Apply patch supplied by Jonathan Chen: use the correct arguments towpaul2001-07-091-2/+2
| | | | | pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.
* Change m_devget()'s outdated and unused `offset' argument to actually meanbmilekic2001-06-201-3/+2
| | | | | | | | | | | | | | | | | | | | something: offset into the first mbuf of the target chain before copying the source data over. Make drivers using m_devget() with a first argument "data - ETHER_ALIGN" to use the offset argument to pass ETHER_ALIGN in. The way it was previously done is potentially dangerous if the source data was at the top of a page and the offset caused the previous page to be copied (if the previous page has not yet been appropriately mapped). The old `offset' argument in m_devget() is not used anywhere (it's always 0) and dates back to ~1995 (and earlier?) when support for ethernet trailers existed. With that support gone, it was merely collecting dust. Tested on alpha by: jlemon Partially submitted by: jlemon Reviewed by: jlemon MFC after: 3 weeks
* Apply patch to allow TX underrun handling without issuing a completewpaul2001-02-221-26/+58
| | | | | | chip reset. Just temporarily turn off the transmitter instead. Submitted by: Stephen McKay <mckay@freebsd.org>
* Big round of minor updates:wpaul2001-02-211-3/+3
| | | | | | | | | | | | | | - Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers that need them so we don't have to fiddle with the PCI power management registers directly. - Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and PIO/memory mapped accesses. - Add support to the RealTek driver for the D-Link DFE-530TX+ which has a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright) - Have the SiS 900/National DP83815 driver be sure to disable PME mode in sis_reset(). This apparently fixes a problem on some motherboards where the DP83815 chip fails to receive packets. (Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)
* Take luigi's suggestion and move the check for nothing to do to before theimp2001-02-201-5/+4
| | | | lock so we don't have lots of null lock/release pairs.
* Add DC_UNLOCK before first return. This caused returns when dc was onimp2001-02-201-1/+3
| | | | | | a shared interrupt. Pointed out by tegge.
* Add a check in the interrupt service routine to return quickly inluigi2001-02-181-1/+4
| | | | | | | | | | | case there is nothing to do. This happens normally when the card shares the interrupt line with other devices. This code saves a couple of microseconds per interrupt even on a fast CPU. You normally would not care, except under heavy tinygram traffic where you can have some 50-100.000 interrupts per second... On passing, correct a spelling error.
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-4/+4
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead ofphk2001-02-031-8/+4
| | | | | | | <sys/queue.h> implementation details. Created with: /usr/sbin/sed Reviewed with: /sbin/md5
* Silence compiler warnings.wpaul2001-01-201-2/+2
|
* Bug fixes that I've put together while working on a project in the office:wpaul2001-01-191-6/+12
| | | | | | | | | | | | | | if_vr: handle the case where vr_encap() returns failure: bust out of the packet sending loop instead of panicking. Also add some missing newlines to some printf()s. if_dc: The miibus_read and miibus_write methods keep swapping in and out of MII mode by fiddling with CSR6 for cards with MII PHYs. This is a hack to support the original Macronix 98713 card which has built-in NWAY that uses an MII-like management interface even though it uses serial transceivers. Conditionalize this so that we only do this on 98713 chips, since it does bad things to genuine tulip chips (and maybe other clones).
* Implement MTX_RECURSE flag for mtx_init().bmilekic2001-01-191-1/+1
| | | | | | | | | | | | | | | | | | | All calls to mtx_init() for mutexes that recurse must now include the MTX_RECURSE bit in the flag argument variable. This change is in preparation for an upcoming (further) mutex API cleanup. The witness code will call panic() if a lock is found to recurse but the MTX_RECURSE bit was not set during the lock's initialization. The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to MTX_RECURSED, which is more appropriate given its meaning. The following locks have been made "recursive," thus far: eventhandler, Giant, callout, sched_lock, possibly some others declared in the architecture-specific code, all of the network card driver locks in pci/, as well as some other locks in dev/ stuff that I've found to be recursive. Reviewed by: jhb
* Use pci_get_powerstate()/pci_set_powerstate() which now exists in thewpaul2000-12-181-24/+16
| | | | | | | | PCI code. This saves each driver from having to grovel around looking for the right registers to twiddle. I should eventually convert the other PCI drivers to do this; for now, these three are ones which I know need power state handling.
* Initialize/grab the mutex earlier in the attach phase, so thatwpaul2000-12-041-2/+3
| | | | | bailing out to the fail: label where we release/destroy the mutex will work without exploding.
* Change the driver to allocate its own callout structure, and modifyjlemon2000-11-251-7/+11
| | | | | | the interface to use callout_* instead of timeout(). Also add an IS_MPSAFE #define (currently off) which will mark the driver as mpsafe to the upper layers.
* Add support for the Accton EN2242 MiniPCI adapter. This is just anwpaul2000-11-141-0/+3
| | | | | | ADMtek Centaur chip, so all we need is the PCI ID. Submitted by: Scott Lang <scottl@FreeBSD.org>
* Grrrr. Remember to bzero() the mediainfo structures after we allocatewpaul2000-11-031-0/+3
| | | | | | | them. If we leave garbage in them, the dc_apply_fixup() routine may try to follow bogus pointers when applying the reset fixup. Noticed by: Andrew Gallatin
* Call dc_apply_fixup() in dc_setcfg() for the MII case.wpaul2000-10-311-0/+4
|
* Grrr. The 'reg' variable in dc_apply_fixup() needs to be a u_int32_t, notwpaul2000-10-301-1/+1
| | | | | a u_int8_t. Pass the conical hat. This should fix certain cardbus 21143 cards that require SROM h0h0magic in order to enable their transceivers.
* Fix typo s/DE_DEVICEID_FE2500/DC_DEVICEID_FE2500/peter2000-10-281-1/+1
|
* Add PCI IDs for some additional cardbus cards. Yes, there really iswpaul2000-10-281-2/+8
| | | | | | | a RealTek 8139 cardbus device. Unfortunately it doesn't quite work yet because the CIS parser barfs on it. Submitted by msmith, with some small tweaks by me.
* Yet another bug fix/optimization for the Davicom DM9100/9102: increasewpaul2000-10-271-0/+5
| | | | | | | | | the PCI latency timer value to 0x80. Davicom's Linux driver does this, and it drastically reduces the number of TX underruns in my tests. (Note: this is done only for the Davicom chips. I'm not sure it's a good idea to do it for all of them.) Again, still waiting on confirmation before merging to stable.
* Set the DC_TX_INTR_ALWAYS and DC_TX_STORENFWD flags for the Davicomwpaul2000-10-251-2/+2
| | | | | | | | | | | | | | | | | | | DM9100/DM9102 chips. Do not set DC_TX_ONE. The DC_TX_USE_TX_INTR flag causes dc_encap() to set the 'interrupt on TX completion' bit only once every 64 packets. This is an attempt to reduce the number of interrupts generated by the chip. You're supposed to get a 'no more TX buffers left' interrupt once you hit the last packet whether you ask for one or not, however it seems the Davicom chip doesn't generate this interrupt, or at least it doesn't generate it under the same circumstances. The result is that if you transmit n packets, where n is less than 64, and then wait 5 seconds, you'll get a watchdog timeout whether you want one or not. The DC_TX_INTR_ALWAYS causes dc_encap() to request an interrupt for every frame. I'm still waiting on confirmation from a couple of users to see if this fixes their problems with the Davicom DM9102 before I merge this into -stable, but this fixed the problem for me in my own testing so I'm willing to make the change to -current right away.
* Remove unnecessary machine/mutex.h include.jhb2000-10-201-1/+0
|
* NEWCARD/Cardbus -jon2000-10-191-9/+174
| | | | | | | | | This commit adds support for Xircom X3201 based cardbus cards. Support for the TDK 78Q2120 MII is also added. IBM Etherjet, Intel and Xircom cards uses these chips. Note that as a result of this commit, some Intel/DEC 21143 based cardbus cards will also attach, but not get link. That is being looked at.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Clean up a few things in dc_setcfg() pointed out to be me bywpaul2000-10-141-4/+9
| | | | aaron@openbsd.com on IRC earlier today.
* Use device_get_nameunit(dev) as the mutex string when callingwpaul2000-10-131-1/+1
| | | | | mtx_init() instead of hard-coded string constant. Also remember to do the mutex changes to the ste driver, which I forgot in the first commit.
* First round of converting network drivers from spls to mutexes. Thiswpaul2000-10-131-31/+49
| | | | | | | | takes care of all the 10/100 and gigE PCI drivers that I've done. Next will be the wireless drivers, then the USB ones. I may pick up some stragglers along the way. I'm sort of playing this by ear: if anyone spots any places where I've screwed up horribly, please let me know.
* Add support for parsing the media blocks from the SROM on 21143wpaul2000-10-051-56/+222
| | | | | | | | | | adapters. This is necessary in order to make this driver work with the built-in ethernet on the alpha Miata machines. These systems have a 21143-PC chip on-board and optional daughtercards with either a 10/100 MII transceiver or a 10baseT/10base2 transceiver. In both cases, you need to twiddle the GPIO bits on the controller in order to turn the transceivers on, and you have to read the media info from the SROM in order to find out what bits to twiddle.
* If this is a Davicom DM9102A and we're enabling the homePNA link, forcewpaul2000-09-201-4/+9
| | | | | dc_link to 1 and don't activate the tick routine. Without this, dc_start() always thinks the link is down and never transmits in homePNA mode.
* Special-case the LED twiddling code so that it doesn't do anythingwpaul2000-09-071-2/+11
| | | | | | | on the NEC VersaPro NoteBook PC. This 21143 implementation has no LEDs, and flipping the LED control bits somehow stops it from establishing a link. We check the subsystem ID and don't flip the LED control bits for the NEC NIC.
* Make the blinkylights on non-MII 21143 cards work. We need to enablewpaul2000-09-011-0/+11
| | | | | | | the link and activity LED control bits in CSR15 in order for the controller to drive the LEDs correctly. This was largely done for the ZNYX multiport cards, but should also work with the DEC DE500-BA and other non-MII cards.
* Close PR 20438. Make fix for preserving LED settings conditional onwpaul2000-08-071-3/+7
| | | | presence Intel 21143 chip.
* Apply patch supplied by John Hood <jhood@sitaranetworks.com> to fix problemswpaul2000-08-011-2/+13
| | | | | | | with LEDs on some cards being stomped on when clearing the "jabber disable" bit. Using DC_SETBIT() has an unwanted side effect of setting a write enable bit in the watchdog timer register which we really want to be cleared when we do a write.
* Add the PCI IDs for the Macronix 98727 and 98732 parts. These arewpaul2000-07-171-1/+8
| | | | | | 3.3volt PCI/cardbus chipsets similar to the 98715 (and they have 512-bit hash tables). Also update the man page to mention the 98727/98732 and the SOHOware SFA110A Rev B4 card with the 98715AEC-C chip.
* Apply patch to the dc driver to handle Macronix MX98715AEC-C/D/E chips,wpaul2000-07-151-7/+30
| | | | | | | | which differ slightly from the Macronix MX98715AEC chip on the sample adapter that I have in that the multicast hash table is only 128 bits wide instead of 512. New adapters are popping up with this chip, and due to improper handling of the smaller hash table, broadcast packets were not being received correctly.
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-6/+3
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Add support for the Accton EN1217.asmodai2000-06-111-0/+4
| | | | | PR: 18735 Submitted by: Adoal Xu <adoal@iname.com>
* When I tweaked if_dc.c to alter the polling interval for non-MIIwpaul2000-06-071-7/+12
| | | | | | | | | 21143 chips, I accidentally removed the DC_MII_REDUCED_POLL flag for all 21143 cards. This caused problems with timer-instigated TCP retransmits, which happened to occur at the same time as an MII poll tick on MII-based cards (e.g. D-Link DFE-570TX). Fixed this, plus made some other cleanups. The autoneg fixes for the non-MII cards still work. Also tested the PNIC II now that I have one again.
* Rework the support for the internal autonegotiation on the 21143 andwpaul2000-05-311-15/+35
| | | | | | | | | | | | | | | | | | workalike chips (Macronix 98713A/98715 and PNIC II). Timing is somewhat critical: you need to bring the link as soon as possible after NWAY is done, and the old one second polling interval was too long. Now we poll every 10th of a second until NWAY completes (at which point we return to the 1 second interval again to keep an eye on the link state). I tested all the other cards I had on hand to make sure I didn't bust any of them and they seem to work (including the MII-based 21143 card). This should fix some autoneg problems with DE500-BA cards and the built-in 10/100 ethernet on some alpha systems. (Now before anyone asks why I never noticed this before, the old code worked just find with the Intel swich I used for testing back in NY. Apparently not all switches are as picky about the timing.)
* Use the correct register names. s/PCI_COMMAND_STATUS_REG/PCIR_COMMAND/peter2000-05-281-3/+3
|
* Move code to handle BPF and bridging for incoming Ethernet packets outarchie2000-05-141-40/+0
| | | | | | | | | | | | | | | of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code. The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers. The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists. Reviewed by: freebsd-net
* Depend on miibus.peter2000-04-291-0/+2
| | | | | | | | Note that if_aue doesn't strictly depend on usb because it uses the method interface for calls rather than using internal symbols, and because it's a child driver of usb and therefore will not try and do anything unless the parent usb code is loaded at some point. if_aue does strictly depend on miibus as it will fail to link if it is missing.
* Teach the 'dc' driver how to pick up settings left over by themsmith2000-03-111-0/+40
| | | | | | | | SRM on alpha systems. This is an expedient if not entirely elegant solution to the problem. Submitted by: gallatin Approved by: jkh
* Introduce ethernet bridge support for if_dcrwatson2000-03-091-4/+25
| | | | Approved by: jkh
* Add support for DM9102A boards with Davicom DM9801 HomePNA PHYs.wpaul2000-01-241-7/+77
|
OpenPOWER on IntegriCloud