summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rl.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up locking and resource management for pci/if_*njl2003-03-311-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer. Reviewed by: imp, mdodd
* Switch rl_encap over to using m_defrag.silby2003-03-301-11/+1
| | | | | | | No functional change, the previous rl_encap was correct wrt long mbuf chains; this just reduces code duplication. MFC after: 2 weeks
* Add support for Planex FNW-3800-TX(CardBus 100M/10M).sanpei2003-03-181-1/+4
| | | | | Submitted by: Kunihiro Arai <araik@attglobal.net> Obtained from: [bsd-nomads:16625]
* Add support for Peppercon ROL-F Card.dan2003-02-231-0/+2
| | | | | Submitted by: Sascha Holzeiter <sascha@root-login.org> PR: 48559
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Clean up exit path from rl_attach() to remove multiple returnsnjl2003-02-091-3/+3
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* FBSDIDize and clean up whitespace nits.des2003-01-111-30/+25
|
* Read sanpei's mind, and unbreak the build.des2003-01-111-2/+3
|
* Add support for Corega FEtherII CB-TXD (CardBus 100M/10M).sanpei2003-01-111-2/+5
| | | | Fix typo (Coreaga->Corega)
* When reading PHY regs over the i2c bus, the turnaround ACK bitmbr2003-01-101-1/+1
| | | | | | | | | | is read one clock edge too late. This bit is driven low by slave (as any other input data bits from slave) when the clock is LOW. The current code did read the bit after the clock was driven high again. Reviewed by: luoqi MFC after: 2 weeks
* Tweaks to make if_rl work on sparc64.jake2003-01-051-4/+10
| | | | | Mostly submitted by: tmm Tested on: i386, sparc64
* o track either_ifattach/ether_ifdetach API changessam2002-11-141-16/+5
| | | | | | | | | | | o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re
* Don't take out the rl_mtx lock in the attach routine. The only wayimp2002-10-291-19/+15
| | | | | we'd need it is if we're interrupted. So, register the interrupt last in the attach routine.
* Be consistent about functions being static.phk2002-10-161-2/+2
| | | | | | Properly put macro args in (). Spotted by: FlexeLint.
* Fix two misindents.phk2002-10-011-1/+1
| | | | Spotted by: FlexeLint
* Add support for Corega FEther CB-TXD (CardBus 100M/10M).iwasaki2002-09-061-1/+3
|
* style:alfred2002-08-231-32/+64
| | | | | put return values on a line by themselves. fix some paste issues where whitespace was used instead of tabs.
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-08-181-3/+3
| | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net
* If we get 0xffff back when reading the status register, assume the cardjhb2002-07-301-0/+5
| | | | | | | has gone away instead of spinning in the interrupt handler. This stops my machine from hanging when I eject a rl(4)-based cardbus card. Reviewed by: imp
* Fix if_timer logic to make sure that there is always a timeoutluigi2002-06-301-3/+3
| | | | | | | | pending if there are packets queued for transmission. Several drivers still have the same problem. MFC after: 3 days
* Add support for the D-Link DFE-690TXD Cardbus card which has a RealTek 8139jhb2002-05-061-1/+4
| | | | with its own PCI ID.
* Add DEVICE_POLLING support to the "rl" driver.luigi2002-04-161-6/+70
| | | | | | The diffs are very similar to the ones for the "sis" driver. MFC After: 5 days
* Nortel Networks sells a RealTek 8139-based NIC that's basicallywpaul2002-04-111-0/+2
| | | | | | the same thing as the SMC 1211, but with their own vendor ID. Update the device list to support this NIC. (Discovered these cards lying around the lab at work.)
* Teach the rlphy driver how to do parallel link detection. If the link partnerwpaul2002-04-071-0/+11
| | | | | | | | | | | | | | | doesn't support NWAY, the RealTek PHY (both the integrated ones on 8139 chips and the RTL8201L 10/100 PHY) will not report the link speed via the ANLPAR or BMSR registers. For the 8201L, we need to look in magic vendor-specific PHY register 0x19. For the 8139 MAC+PHY combo, we have to be able to test the RL_MEDIASTAT register. The changes to rlphy.c are based largely on the patch from PR 30836, however I tried to eliminate some magic numbers by creating an entry for the 8201 PHY in miidevs. Also updated if_rl.c to allow the rlphy driver to read the RL_MEDIASTAT register via the rl_miibus_readreg() routine.
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-201-43/+40
|
* Remove mbuf exhaustion warning messages; these are handled by thesilby2002-02-111-4/+0
| | | | | | mbuf system in a rate-limited fashion now. MFC after: 3 days
* Remove printf's on mbuf/cluster allocation failures. There are nowluigi2001-12-141-5/+1
| | | | | | | equivalent and less dangerous (rate limited) messages in the mbuf allocation code. MFC after: 3 days
* Add suspend/resume code mostly merged from fxp driver.iwasaki2001-11-231-0/+72
|
* Convert the if_sis and if_rl drivers to use the bus_dma API instead ofwpaul2001-08-151-9/+98
| | | | | | | | | | calling vtophys() and contigmalloc()/contigfree() directly. Hopefully, I have shaken out all of the problems with busdma on the alpha now. (Everything seems to work as expected.) Also, change the max RX DMA limit to 1024 bytes instead of "unlimited," as the latter seems not to work correctly on the alpha that I tested. (At 100Mbps, all attempts to receive frames yield RX errors.)
* 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-20/+7
| | | | | | | | | | | | | | | | | | | | 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
* Big round of minor updates:wpaul2001-02-211-4/+6
| | | | | | | | | | | | | | - 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>)
* Preceed/preceeding are not english words. Use precede and preceding.asmodai2001-02-181-1/+1
|
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-1/+1
| | | | | | 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-2/+1
| | | | | | | <sys/queue.h> implementation details. Created with: /usr/sbin/sed Reviewed with: /sbin/md5
* 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-23/+19
| | | | | | | | 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-3/+3
| | | | | bailing out to the fail: label where we release/destroy the mutex will work without exploding.
* Print a warning when we detect a Realtek 8139B chiproger2000-11-241-0/+10
| | | | | | | | | | | | | | | (identified by the IO map being 256 bytes long instead of 128) This chip works very unreliably on my Lanner embedded PC with the rl driver. Lots of watchdog timeouts or poor performance. Forcing the media type to 10 Meg (ifconfig rl0 media 10baseT/UTP) is a good workaround. This looks very similar to the problem reported in PR kern/18790 It is interesting to note that the linux driver has lots of special case code for this chip.
* Fix 8-bit EEPROM breakage: compare against 0x8129, not 8129.wpaul2000-11-011-6/+6
|
* Fix support for cardbus cards:wpaul2000-10-301-1/+6
| | | | | | | | | | - Add DRIVER_MODULE() declaration to make this driver a child of cardbus - Handle different width EEPROMs The CIS parser still barfs when scanning this card, but it seems to probe/attach correctly anyway. I can't do a traffic test just yet since I don't have a proper crossover cable handy.
* Add PCI IDs for some additional cardbus cards. Yes, there really iswpaul2000-10-281-1/+4
| | | | | | | 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.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* 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/+48
| | | | | | | | 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.
* 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
* Use the correct register name. 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-17/+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
OpenPOWER on IntegriCloud