summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_ste.c
Commit message (Collapse)AuthorAgeFilesLines
* Move the ste driver from sys/pci to sys/dev/ste.imp2008-08-141-1752/+0
|
* Fix function prototype for device_shutdown method.yongari2007-11-221-3/+3
|
* The mac address must be written a word length at a time, it was having no ↵thompsa2007-06-151-2/+4
| | | | | | effect before. MFC after: 1 week
* Add new ST201 PCI id.yongari2007-03-101-1/+2
| | | | PR: kern/108150
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Consistently use if_printf() only in interface methods: if_start,glebius2006-09-151-7/+9
| | | | | | | | | | if_ioctl, if_watchdog, etc, or in functions that are used by these methods only. In all other cases use device_printf(). This also fixes several panics, when if_printf() is called before softc->ifp was initialized. Submitted by: Alex Lyashkov <umka sevcity.net>
* Do not touch ifp->if_baudrate in miibus aware drivers.glebius2006-02-141-1/+0
|
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-1/+1
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntaximp2005-10-221-1/+1
| | | | (device miibus) in time for 7.0 :-)
* In detach method, move if_free() after bus_teardown_intr().ru2005-10-131-2/+3
|
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceglebius2005-10-051-0/+4
| | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde
* Big polling(4) cleanup.glebius2005-10-011-32/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb
* Fix "struct ifnet" leaks when attach() fails in the middle, e.g.ru2005-09-161-2/+2
| | | | | | when mii_phy_probe() or bus_setup_intr() fails. For drivers that call their detach() in this case, call if_free() there to cover this case too.
* Various locking fixes and mark MPSAFE:jhb2005-08-301-59/+94
| | | | | | | | | | | - Add locked variants of start(), init(), ifmedia_upd(), and poll() and stop recursing on the driver lock. - Add locking to ifmedia_upd() and ifmedia_sts(). - Use callout_*() instead of timeout/untimeout. - Fix locking in ioctl(). Tested by: Bob Bishop rb at gid dot co dot uk MFC after: 3 days
* Use device_printf() and if_printf() and remove ste_unit from the softc.jhb2005-08-171-23/+19
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-11/+11
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Modify device drivers supporting multicast addresses to lock if_addr_mtxrwatson2005-08-031-0/+2
| | | | | | | | over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week
* ALTQify ste(4).mlaier2005-07-081-6/+8
| | | | | Requested and tested by: <nike_d at cytexbg dot com> Approved by: re (scottl)
* Move if_alloc() up so it's before mii_phy_probe().brooks2005-06-111-6/+7
|
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-13/+22
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-2/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Fix style(9) issues with __P removal.imp2005-02-241-38/+36
| | | | Noticed by: bde
* Return BUS_PROBE_DEFAULT instead of 0.imp2005-02-241-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until theyrwatson2004-08-281-1/+2
| | | | are either locked down or demonstrated MPSAFE.
* Remove burn bridges code that saved/restored the pci config registersimp2004-06-281-24/+0
| | | | | that are now handled in the pci bus layer. They are no longer necessary.
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-29/+2
|
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* A handler for ioctl(SIOCSIFCAP) should not alter a bit inyar2004-05-231-1/+2
| | | | | | | if_capenable unless the interface driver is actually able to toggle the respective capability on and off. Reviewed by: ru
* Implemented per-interface polling(4) control.ru2004-04-111-1/+13
|
* Actually fix the TX performance with polling(4) enabledru2004-04-061-1/+1
| | | | | | | by increasing the TX list size from 64 to 128, which is adequate for HZ=1000. Submitted by: Vsevolod Lobko
* - Improved the TX performance with polling(4) by only checking theru2004-04-061-15/+11
| | | | | | | | | | | | | status registers for error conditions and updating statistics when there are cycles left (inspired by the nge(4) driver). - Removed the TX list counter and the producer/consumer gap; it's enough to just ensure we don't reuse the last (free) descriptor, as the chip may not have read its next pointer yet. If we reuse it, the TX may stall under a heavy TX load with polling enabled. - Dropped code to recharge the watchdog timer, it's pointless; the watchdog routine will re-init the chip and both RX and TX lists.
* Recharge the watchdog timer if there's still some TX work left.ru2004-04-031-0/+2
|
* Performance tuning.ru2004-04-021-38/+44
| | | | | | | | | | | | | | | | | | | | | | Moved the RX ring resyncing code to ste_rxeoc(), and only run it if we were asked to POLL_AND_CHECK_STATUS, under DEVICE_POLLING. (This significantly reduces the CPU load.) Improved the RX ring resyncing code by re-checking if the head is still empty before doing resyncing. This mostly affects the DEVICE_POLLING mode, where we run this code periodically. We could start checking with an empty head (well, an empty ring even), and after doing a few iterations, the chip might write a few entries, including the head, and we would bogusly consider this case as requiring resyncing. On a test box, this reduced the number of resyncs done by a factor of 10. In ste_txeof(sc), only reset the watchdog timer to zero when the TX list is completely empty. Converted ste_tx_prev_idx to a pointer -- faster. Removed some bitrot.
* Moved the statistical counter under hw.ste.rxsyncs.ru2004-04-011-1/+3
| | | | Suggested by: njl
* Under a heavy RX load, at least with D-Link DFE-550TX adapters,ru2004-03-311-1/+18
| | | | | | | | | | | | | | | | | | | the driver's RX ring head may fall behind the chip, causing the stuck traffic, disordered packets, etc. Work around this by adopting the technique of resyncing RX head used in dc(4) and xl(4) drivers, but do it in a slightly different place to reduce the number of resyncs needed. Also, set the NIC's RX polling period to a more meaningful value, to stop overloading the PCI bus (this also reduces the number of resyncs by a factor of 3 or more in a long run; the actual number is very dependent on a nature of the traffic). Maintain the statistics counter as the hw.ste_rxsyncs sysctl. In cooperation with: Vsevolod Lobko OK'ed by: ambrisko MFC after: 5 days
* Added polling(4) support for ste(4).ru2004-03-311-3/+77
| | | | MFC after: 5 days
* Switch ste_encap() over to using m_defrag().ru2004-03-301-14/+2
| | | | | | | | No functional change, the previous ste_encap() was correct WRT long mbuf chains; this just reduces code duplication. MFC after: 3 days Prodded by: ambrisko
* Properly reprogram the hardware when IFF_ALLMULTI flag is set.ru2004-03-241-0/+3
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-3/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Announce ethernet MAC addresss in ether_ifattach().mdodd2004-03-141-6/+0
|
* Stop setting ifp->if_output to ether_output() since ether_ifattach()mux2004-03-111-1/+0
| | | | does it for us already.
* Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.obrien2003-12-081-11/+13
| | | | Requested by: bde,imp
* Drop the driver lock around calls to if_input to avoid a LOR whensam2003-11-141-0/+4
| | | | | | | | 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
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-13/+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).
* 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)
* 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.
* 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.
* Remove unused variables.phk2003-05-311-4/+0
| | | | Found by: FlexeLint
* 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
OpenPOWER on IntegriCloud