summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
Commit message (Collapse)AuthorAgeFilesLines
* Use newly minted device_is_attached rather than device_is_alive to seeimp2003-04-211-1/+1
| | | | | | | | | if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine. Symptoms of problem reported by: martin blapp
* Revise attach/detach resource cleanupnjl2003-04-171-10/+17
| | | | | | | | | | | | | | | - Unconditionally call *_stop() if device is in the tree. This is to prevent callouts from happening after the device is gone. Checks for bus_child_present() should be added in the future to keep from touching potentially non-existent hardware in *_detach(). Found by iedowse@. - Always check for and free miibus children, even if the device is not in the tree since some failure cases could have gotten here. - Call ether_ifdetach() in the irq setup failure case - ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so that ifmedia_removeall() can be unconditionally called on detach. There is no way to detect whether ifmedia has been initialized without using a separate variable (as tl(4) does). - Add comments to indicate assumptions of code path
* - Don't call pci_enable_io() in drivers (unless needed for resume).mdodd2003-04-161-10/+0
| | | | | - Don't test memory/port status and emit an error message; the PCI bus code will do this now.
* - Express hard dependencies on bus (pci, isa, pccard) andmdodd2003-04-151-2/+4
| | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
* Correct maxsize/maxsegsz parameters to bus_dma_tag_create().mux2003-04-091-6/+4
|
* Fix up callers of xl_encap so that they handle a failure responsesilby2003-04-081-3/+10
| | | | | | | | | | | properly (likely due to mbuf exhaustion.) Previously, the driver got somewhat wedged. Also, remove the annoying messages printed every time xl_encap couldn't allocate a mbuf; they served no useful purpose, and just made an mbuf exhaustion situation more annoying. MFC after: 1 week
* Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() for themux2003-04-051-2/+21
| | | | | | | | RX part of this driver too. It's better since the code wasn't dealing with bus_dmamap_load() returning EINPROGRESS, and this can't happen with bus_dmamap_load_mbuf(). Submitted by: jake
* Add missing ()'s so that these drivers all compile again.jhb2003-03-311-1/+1
| | | | | Noticed by: jake Tested on: i386 (compile)
* Clean up locking and resource management for pci/if_*njl2003-03-311-113/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Fix up the long mbuf chain recovery code to use m_defrag; the oldsilby2003-03-291-19/+8
| | | | | | | code messed up on B & C chipsets because it lost the packet header and therefore the flag indicating the need for hardware checksums. MFC after: 2 weeks
* Make sure to free the correct resources when the card fails to attachsilby2003-03-191-0/+8
| | | | | | properly. (Broken in the previous commit.) Noticed by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
* Instead of relying on a compile time define to determine whether the xlsilby2003-03-181-37/+33
| | | | | | | | | driver should use port or memory based IO, determine it dynamically at runtime, preferring MMIO where possible. This helps us support newer arches which dislike port based access better. Tested on i386 & sparc64, with 3c900, 905, 905b, and 905C cards. (in varying combinations by both jake and myself)
* Fix bug introduced in 1.130. For the < MHLEN case, we shouldbmilekic2003-03-041-1/+1
| | | | | | | be doing a m_gethdr(), not an m_get(). Pointed out by: Hiten Pandya <hiten@unixdaemons.com> Pointy hat to: Me
* Make xl use m_getcl() to allocate an mbuf and a cluster in one shot,bmilekic2003-02-221-19/+5
| | | | | | | | | | | | as opposed to one after the other. This is faster in both -CURRENT and -STABLE. Additionally, there is less code duplication for error-checking. One thing to note is that this code seems to return(1) when no buffers are available; perhaps ENOBUFS should be the correct return value? Partially submitted & tested by: Hiten Pandya <hiten@unixdaemons.com> MFC after: 1 week
* Fix panic on sparc64 introduced in my last commit. I reallymux2003-02-191-5/+6
| | | | | | | | | | | wish the busdma APIs were more consistent accross architectures. We should probably move all the other DMA map creations in xl_attach() where we can really handle them failing, since xl_init() is void and shouldn't fail. Pointy hat to: mux Tested by: Anders Andersson <anders@hack.org>
* Back out M_* changes, per decision of the TRB.imp2003-02-191-5/+5
| | | | Approved by: trb
* - Fix mbuf leak when we successfully allocate a new mbuf but fail tomux2003-02-181-6/+17
| | | | | | | | | bus_dmamap_load() it. - Make it so reusing mbufs when we can't allocate (or map) new ones actually works. We were previously trying to reuse a mbuf which was already bus_dmamap_unload()'ed. Reviewed by: silby
* Remove the now unused sys/malloc.h header.mux2003-01-241-1/+0
|
* Correctly identify the 3C920B chipset; although it may ship with some Nforce2silby2003-01-221-4/+4
| | | | | | boards, it's definitely not an Nvidia chip. Info from: Nvidia's Linux Network driver & pciids.sourceforge.net
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-5/+5
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Complete the support of the on-board xl(4) on nVidia nForce2 mobo's.obrien2003-01-191-0/+3
| | | | Submitted by: Mikko S. Hyvarinen <morphy@morphy.iki.fi>
* Make the xl driver work on sparc64:tmm2003-01-191-67/+99
| | | | | | | | | | | | | | | | - Add conversions to/from little endian for fields that the NIC accesses by DMA as required. - Add some bus_dmamap_sync() calls, and correct some existing ones. - Read the receiver information from the EEPROM in an endian-neutral manner. - Load all RX and TX descriptors in a single DMA map up front, and get the bus addresses of individual descriptors by address arithmetic; this fixes multiple use of the descriptor tags, which would have undesired effects. It seems that xl still does not work on e250 boxen, for reasons which are not clear yet. Reviewed by: mux
* Partial support for the nVidia nForce2 chipset's on-board Broadcom/Altima PHYobrien2003-01-121-0/+2
| | | | | | | and 3com MAC. Specifications for the Altima PHY are available at: http://www.altimacom.com/products/ac101L.html Submitted by: Mikko S. Hyvarinen <morphy@morphy.iki.fi>
* 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
* o Only try to recopy the mbuf into an mbuf cluster ifmux2003-01-071-13/+22
| | | | | | | | bus_dmamap_load_mbuf() returned EFBIG. o Fix mbuf leaks in an error (rare) code path. o Reuse the TX descriptor if xl_encap() failed instead of just picking the next one. o Better error messages.
* Ooops, use the full name of XL_FLAG_EEPROM_OFFSET_30silby2003-01-061-1/+1
| | | | Noticed by: Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
* Add support for the 3c555 miniPCI chipset.silby2003-01-061-1/+8
| | | | | | Submitted by: johannes <johannes@paradise.net.nz> PR: 46603 MFC after: 3 days
* Add two MII_SETs to provide a bit more time between operations insilby2003-01-061-0/+2
| | | | | | xl_sync; this appears to be necessary with certain systems. Requested by: Michael Class <michael_class@gmx.net>
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Leave only one of the two $FreeBSD$ tag, and use __FBSDID().mux2002-12-301-6/+3
|
* Fix bug with 3c90xB cards and newer. We weren't trying tomux2002-12-181-39/+14
| | | | | | copy the mbuf chain into an mbuf cluster when there is more than 63 mbufs in the chain. We were trying with older cards though.
* Convert the xl(4) driver to the busdma API. This should makemux2002-12-171-139/+279
| | | | | | | it possible to use this driver under ia64, sparc64 (though there may be endianness issues with this one) and other archs. Tested on: i386, alpha (gallatin)
* o track either_ifattach/ether_ifdetach API changessam2002-11-141-18/+7
| | | | | | | | | | | 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
* Add some magic bits necessary to turn the transmitter on for somesilby2002-10-221-0/+7
| | | | | | | | | (newer) 556B chips. Requested & tested by: Dinesh Nambisan <dinesh@nambisan.net> Magic bits found by: Dave Dribin & Donald Becker MFC After: 3 days
* 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
* Remove all DELAY(1) calls around MII operations in the XL driver.silby2002-09-221-17/+0
| | | | | | | | | | | According to the MII specification, the delay produced by our reads alone are sufficient for correct operation. This reduces the time mii_tick takes from 10ms to ~1ms here. That's still a lot, but much better than before. Submitted by: Harti Brandt <brandt@fokus.gmd.de> MFC after: 3 weeks
* add missing \n to printfticso2002-09-091-3/+3
| | | | Approved by: gallatin (mentor)
* style: put return types on a line by themselves.alfred2002-08-241-42/+84
|
* 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-56/+54
|
* Fix a problem where stats overflow interrupts would causesilby2001-12-171-1/+1
| | | | | | | | | | a major slowdown, and re-enable stats overflow interrupts. For future reference, the bug was in our code, and not some bug in the 3com chips. Reviewed by: wpaul MFC after: 2 days
* Remove printf's on mbuf/cluster allocation failures. There are nowluigi2001-12-141-6/+1
| | | | | | | equivalent and less dangerous (rate limited) messages in the mbuf allocation code. MFC after: 3 days
* Add suspend/resume hooks to this driver; necessary to overcomeguido2001-12-051-0/+38
| | | | | | problems on HP Omnibook 500. MFC after: 1 week
* Implement TCP/IP checksum off-loading on send for the 3c905B and lateralc2001-10-221-1/+12
| | | | generation cards.
* Implement TCP/IP checksum off-loading on receive. Announcealc2001-09-231-3/+21
| | | | | | rxcsum capabilities. Reviewed by: wpaul
* Add support for the 3c656B cardbus adapter. This is one half of awpaul2001-08-281-5/+20
| | | | | | | | | | | dual function card. It needs pretty much the same flags as the 656C, except that it seems to need both the INVERT_MII_PWR and INVERT_LED_PWR flags set. Tested with cardbus in -current as of today. Also added support for the 3c656, which looks to be the same as the 656B, except it doesn't need the EEPROM_8BIT flag. I think. This one is untested, but the added support should not break any of the other cards.
* Pacify users who get all bent out of shape when they see the "xl%d: commandwpaul2001-07-271-2/+7
| | | | | | | | | | | never completed" message. The RX reset takes longer complete than it used to, a lot longer in fact than xl_wait() is prepared to wait. When we do the RX reset in xl_reset(), this cases xl_wait() to time out and whine. We wait a little extra time now after the RX reset, which should silence the warning. Thanks to obrien for finally getting me a box with a NIC that causes this problem for me to tinker with.
* 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.
* Grrr. Fix PR 27742 correctly this time. (At least I got -stable right.)wpaul2001-06-011-11/+2
|
OpenPOWER on IntegriCloud