summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
Commit message (Collapse)AuthorAgeFilesLines
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-12/+11
| | | | | | | multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
* s/driver/device/ for config file lineimp2003-11-061-1/+1
|
* Change config file syntax to be less FreeBSD 3.ximp2003-11-051-1/+1
|
* Remove explicit cardbus attachments from drivers where this is identicaldfr2003-11-031-1/+0
| | | | | | | to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices. Reviewed by: imp
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Add a tiny bit more delay in the xl_mii_sync function; this is necessarysilby2003-09-291-0/+2
| | | | | | for proper intialization in certain 905B + old system combinations. Tested by: Jakub Miziolek <jxm@obta.uw.edu.pl>
* - Avoid calling pci_get_device() more than once in a single function.mdodd2003-09-141-22/+39
| | | | | - Provide a mechanism to prevent the use of MMIO. - Prevent the use of MMIO for all 3c575 cardbus cards.
* Report media status for bitrate PHYs.mdodd2003-08-231-0/+8
|
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Use the BUS_DMA_ZERO flag instead of bzero()'ing DMA memory.mux2003-07-271-5/+2
|
* Support for large frames for VLANs was added by tweaking the packet sizewpaul2003-07-101-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | register, present only on 3c90xB and later NICs. This meant that you could not use a 1500 byte MTU with VLANs on original 3c905/3c900 cards (boomerang chipset). The boomerang chip does support large frames though, just not in the same way: you can set the 'allow large frames' bit in the MAC control register to receive frames up to 4K in size. Changes: - Set the 'allow large frames' bit for boomerang chips and increase the packet size register for cyclone and later chips. This allows us to use IFCAP_VLAN_MTU on all supported xl(4) NICs. - Actually set the IFCAP_VLAN_MTU flag in the capabilities word in xl_attach(). - Change the method used to detect older boomerang chips. My 3c575C cardbus NIC was being incorrectly identified as 3c90x chip instead of 3c90xB because the capabilities word in its EEPROM reports a bizzare value. In addition to checking for the supportsNoTxLength bit, also check for the absence of the supportsLargePackets bit. Both of these cases denote a 3c90xB chip. - Make RX and TX checksums configurable via the SIOCSIFCAP ioctl. - Avoid an unecessary le32toh() in xl_rxeof(): we already have the received frame size in the lower 16 bits of rxstat, no need to read it again. Tested with 3c905-TX, 3c900-TPO, 3c980C and 3c575C NICs.
* - Ensure that the busdma API won't do deferred loads by using themux2003-07-041-9/+9
| | | | | | BUS_DMA_NOWAIT flag, since the code can't handle this. - Use NULL, NULL for the lockfunc and lockfuncarg parameters of bus_dma_tag_create() since deferred loads can't happen now.
* Due to extreme bogusness in the pci bus layer, these drivers wereimp2003-07-031-2/+2
| | | | | | | | | forced to do slightly bogus power state manipulation. However, this is one of those features that is preventing further progress, so mark them as BURN_BIRDGES like I did for the drivers in sys/dev/... This, like the other change, are a no-op unless you have BURN_BRIDGES in your kernel.
* Mega busdma API commit.scottl2003-07-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Modify the xl_reset() routine slightly so that, if we're using memorywpaul2003-06-291-0/+10
| | | | | | | | | | | | | | | | | | mapped I/O mode, we pause for .1 seconds after issuing the reset command before trying to poll the 'command busy' bit in the status register. With my 3c575C cardbus NIC, my Sony Picturebook locks up when it tries to read the status register immediately after the reset. This appears to be a problem only with certain NICs on certain hardware, but the added delay should not hurt cards that already work. This bug seems to have been brought to light by the fact that the xl driver now defaults to memory mapped I/O mode instead of programmed I/O mode like it used to. With PIO mode, the delay isn't needed and everything works (which is why this NIC worked with 5.0-RELEASE but not 5.1). I suspect that what's happening is that when the chip is reset, it takes a little while for the memory-mapped decoding logic to recover. Trying to access the chip's registers during this period causes an error condition of some kind that wedges the system.
* Use __FBSDID().obrien2003-06-111-1/+0
|
* 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
OpenPOWER on IntegriCloud