aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sf
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-2/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Fix style(9) issues with __P removal.Warner Losh2005-02-241-37/+35
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=142407
* Return BUS_PROBE_DEFAULT instead of 0.Warner Losh2005-02-241-6/+6
| | | | Notes: svn path=/head/; revision=142398
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-072-2/+2
| | | | Notes: svn path=/head/; revision=139825
* Correct URL of the programming manual.Christian Brueffer2004-11-171-1/+1
| | | | Notes: svn path=/head/; revision=137835
* Add missing /* DEVICE_POLLING */Christian Brueffer2004-11-171-1/+1
| | | | Notes: svn path=/head/; revision=137834
* Add altq support.Christian Brueffer2004-11-121-7/+9
| | | | | | | | | | Patch by mlaier. Approved by: mlaier MFC after: 2 weeks Notes: svn path=/head/; revision=137620
* Add device polling supportChristian Brueffer2004-11-102-0/+109
| | | | | | | | | | | Original patch by me, improvements by ru Happy birthday to: BSDforen.de! Approved by: ru MFC after: 2 weeks Notes: svn path=/head/; revision=137557
* Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until theyRobert Watson2004-08-281-1/+2
| | | | | | | are either locked down or demonstrated MPSAFE. Notes: svn path=/head/; revision=134442
* Whitespace nitBruce M Simpson2004-07-051-1/+1
| | | | Notes: svn path=/head/; revision=131657
* Eliminate redundant return keywords.Bruce M Simpson2004-07-051-29/+0
| | | | Notes: svn path=/head/; revision=131656
* Remove burn bridges code that saved/restored the pci config registersWarner Losh2004-06-281-24/+0
| | | | | | | | that are now handled in the pci bus layer. They are no longer necessary. Notes: svn path=/head/; revision=131253
* Replace handrolled CRC calculation with ether_crc32_[lb]e().Christian Weisgerber2004-06-091-27/+2
| | | | Notes: svn path=/head/; revision=130270
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129878
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-3/+2
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Announce ethernet MAC addresss in ether_ifattach().Matthew N. Dodd2004-03-141-6/+0
| | | | Notes: svn path=/head/; revision=126966
* Stop setting ifp->if_output to ether_output() since ether_ifattach()Maxime Henrion2004-03-111-1/+0
| | | | | | | does it for us already. Notes: svn path=/head/; revision=126847
* Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.David E. O'Brien2003-12-081-5/+5
| | | | | | | Requested by: bde,imp Notes: svn path=/head/; revision=123289
* Drop the driver lock around calls to if_input to avoid a LOR whenSam Leffler2003-11-142-0/+5
| | | | | | | | | | | the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach. Reviewed by: imp, rwatson Notes: svn path=/head/; revision=122689
* Remove duplicate FBSDID's, move others to their right place.David E. O'Brien2003-11-141-4/+3
| | | | Notes: svn path=/head/; revision=122678
* Try to create some sort of consistency in how the routings to find theDavid E. O'Brien2003-11-131-12/+10
| | | | | | | | | | 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). Notes: svn path=/head/; revision=122625
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-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) Notes: svn path=/head/; revision=121816
* Prefer new location of pci include files (which have only been in theWarner Losh2003-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. Notes: svn path=/head/; revision=119288
* Due to extreme bogusness in the pci bus layer, these drivers wereWarner Losh2003-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. Notes: svn path=/head/; revision=117208
* Remove break after returnPoul-Henning Kamp2003-05-311-5/+0
| | | | | | | Found by: FlexeLint Notes: svn path=/head/; revision=115529
* Use newly minted device_is_attached rather than device_is_alive to seeWarner Losh2003-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 Notes: svn path=/head/; revision=113812
* Revise attach/detach resource cleanupNate Lawson2003-04-171-4/+14
| | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=113609
* - Don't call pci_enable_io() in drivers (unless needed for resume).Matthew N. Dodd2003-04-161-18/+0
| | | | | | | | - Don't test memory/port status and emit an error message; the PCI bus code will do this now. Notes: svn path=/head/; revision=113545
* - Express hard dependencies on bus (pci, isa, pccard) andMatthew N. Dodd2003-04-151-1/+3
| | | | | | | | | | | 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.) Notes: svn path=/head/; revision=113506
* Use __FBSDID rather than rcsid[].David E. O'Brien2003-04-031-7/+3
| | | | Notes: svn path=/head/; revision=113038
* Add missing ()'s so that these drivers all compile again.John Baldwin2003-03-311-1/+1
| | | | | | | | Noticed by: jake Tested on: i386 (compile) Notes: svn path=/head/; revision=112880
* Clean up locking and resource management for pci/if_*Nate Lawson2003-03-311-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=112872
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-4/+4
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-4/+4
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* o track either_ifattach/ether_ifdetach API changesSam Leffler2002-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 Notes: svn path=/head/; revision=106936
* Be consistent about functions being static.Poul-Henning Kamp2002-10-161-2/+2
| | | | | | | | | Properly put macro args in (). Spotted by: FlexeLint. Notes: svn path=/head/; revision=105221
* add missing \n to printfBernd Walter2002-09-091-2/+2
| | | | | | | Approved by: gallatin (mentor) Notes: svn path=/head/; revision=103139
* style:Alfred Perlstein2002-08-231-32/+64
| | | | | | | | put return values on a line by themselves. fix some paste issues where whitespace was used instead of tabs. Notes: svn path=/head/; revision=102335
* Change callers of mtx_init() to pass in an appropriate lock type name. InJohn Baldwin2002-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 Notes: svn path=/head/; revision=93818
* Remove __P.Alfred Perlstein2002-03-201-34/+34
| | | | Notes: svn path=/head/; revision=92739
* Remove printf's on mbuf/cluster allocation failures. There are nowLuigi Rizzo2001-12-141-6/+1
| | | | | | | | | | equivalent and less dangerous (rate limited) messages in the mbuf allocation code. MFC after: 3 days Notes: svn path=/head/; revision=87846
* Do not call mii_pollstat() from within device tick routines; the statusJonathan Lemon2001-09-291-7/+6
| | | | | | | | | information is updated by mii_tick(). Pointed out by: wpaul (a while back) Notes: svn path=/head/; revision=84147
* After one more day of testing, make what I hope are the final tweaks toBill Paul2001-08-161-3/+5
| | | | | | | | | | | | | | prevent/workaround TX lockups in this driver. The secret seems to be to not let the TX DMA queue become too full. If we have too many packets in the queue, we should wait for them to drain a bit before trying to queue more. This should prevent the lockup from occurring, and if it does occur, there is special code in sf_start() to kick the NIC in the head and get it going again. Special thanks to Glen Neff for helping me test this fix. Notes: svn path=/head/; revision=81798
* Still more changes to try to prevent TX lockups. Will wait for one moreBill Paul2001-08-162-7/+48
| | | | | | | | | | | | night of testing before merging to -stable. Also added to code to detect TX underruns and automatically increase the TX threshold to avoid them. Carefully placed diagnostig printf() about this under #ifdef DIAGNOSTIC to avoid getting any panicky e-mails from confused users, like I always do with the xl and dc drivers. Notes: svn path=/head/; revision=81737
* Tweak the interrupt handler so that we call the txeof handler more often,Bill Paul2001-08-151-2/+5
| | | | | | | | to hopefully prevent the TX DMA queue from filling up and never getting flushed. Notes: svn path=/head/; revision=81714
* Apply patch supplied by Jonathan Chen: use the correct arguments toBill Paul2001-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. Notes: svn path=/head/; revision=79472
* Change m_devget()'s outdated and unused `offset' argument to actually meanBosko Milekic2001-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 Notes: svn path=/head/; revision=78508
* Big round of minor updates:Bill Paul2001-02-211-26/+21
| | | | | | | | | | | | | | | | | - 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>) Notes: svn path=/head/; revision=72813
* Change and clean the mutex lock interface.Bosko Milekic2001-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order) Notes: svn path=/head/; revision=72200
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedPoul-Henning Kamp2001-02-061-8/+1
| | | | | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh Notes: svn path=/head/; revision=72084