summaryrefslogtreecommitdiffstats
path: root/sys/dev/xl
Commit message (Collapse)AuthorAgeFilesLines
* Use DEVMETHOD_END.marius2011-11-231-1/+1
|
* - There's no need to overwrite the default device method with the defaultmarius2011-11-221-5/+1
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* - Import the common MII bitbang'ing code from NetBSD and convert drivers tomarius2011-11-012-179/+58
| | | | | | | | | | | | | | | | | | | | | | | | take advantage of it instead of duplicating it. This reduces the size of the i386 GENERIC kernel by about 4k. The only potential in-tree user left unconverted is xe(4), which generally should be changed to use miibus(4) instead of implementing PHY handling on its own, as otherwise it makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just for the MII bitbang'ing code. The common MII bitbang'ing code also is useful in the embedded space for using GPIO pins to implement MII access. - Based on lessons learnt with dc(4) (see r185750), add bus barriers to the MII bitbang read and write functions of the other drivers converted in order to ensure the intended ordering. Given that register access via an index register as well as register bank/window switching is subject to the same problem, also add bus barriers to the respective functions of smc(4), tl(4) and xl(4). - Sprinkle some const. Thanks to the following testers: Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4)) Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4). Reviewed by: yongari (subset of drivers) Obtained from: NetBSD (partially)
* - Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHYmarius2011-10-081-0/+197
| | | | | | | | | | | | | | drivers that only ever attach to a particular MAC driver, i.e. inphy(4), ruephy(4) and xlphy(4), to the directory where the respective MAC driver lives and only compile it into the kernel when the latter is also there, also removing it from miibus.ko and moving it into the module of the respective MAC driver. - While at it, rename exphy.c, which comes from NetBSD where the MAC driver it corresponds to also is named ex(4) instead of xl(4) but that in FreeBSD actually identifies itself as xlphy(4), and its function names accordingly for consistency. - Additionally while at it, fix some minor style issues like whitespace in the register headers and add multi-inclusion protection to inphyreg.h.
* Really spell suppress the right wayimp2011-06-211-1/+1
|
* My broken 'u' key scks!imp2011-06-211-1/+1
|
* Supress warning that command didn't complete when the parent busimp2011-06-211-2/+2
| | | | thinks the card is gone.
* Fix build.yongari2011-05-071-1/+1
|
* Remove unneeded use of variable status. This should have been doneyongari2011-05-071-2/+0
| | | | in r221557.
* XL_DMACTL is 32bit register, use 32bit write macro.yongari2011-05-072-1/+6
| | | | While I'm here add more bits for the register.
* Rearm watchdog timer if driver kick controller to recover from TXyongari2011-05-071-2/+5
| | | | | | underrun error. While here, prepend 0x to status code to show TX status is hex number.
* Rename xl_stats_update() callout handler to xl_tick() and move MIIyongari2011-05-072-37/+21
| | | | | | | tick driving logic to xl_tick(). Now xl_tick() handles MII tick as well as periodic updating of statistics. This change removes a hack used in interrupt handler where it wanted to update statistics without driving MII tick.
* Reuse the TX descriptor(DPD) if xl_encap() failed instead of justyongari2011-05-061-2/+8
| | | | | | | | picking the next available one. This may explain why xl(4) sees TX underrun error with no queued frame. I hope this addresses a long standing xl(4) watchdog timeout issue as well. Obtained from: OpenBSD
* Change xl_rxeof() a bit to return the number of processed frames inyongari2011-05-061-7/+3
| | | | | | | | | | | | RX descriptor ring. Previously it returned the number of frames that were successfully passed to upper stack which in turn means it ignored frames that were discarded due to errors. The number of processed frames in RX descriptor ring is used to detect whether driver is out of sync with controller's current descriptor pointer. Returning number of processed frames reduces unnecessary (probably wrong) re-synchronization. While here, remove unnecessary local variable initialization.
* Terminate interrupt handler if driver detect it's not running.yongari2011-05-061-3/+9
| | | | | Also add check for driver running state before trying to send frames. While I'm here, use for loop.
* Updating status word should be the last operation of UPD structureyongari2011-05-062-3/+3
| | | | | renewal. Disable instruction reordering by adding volatile to xl_list_onefrag structure.
* Call bus_dmamap_sync() only after TX DPD update.yongari2011-05-061-4/+4
|
* Set status word once instead of twice. For 3C90xB/3C90xC, frameyongari2011-05-061-5/+5
| | | | | length of status word is ignored. While here move bus_dmamap_sync() up where DMA map is loaded.
* Remove unnecessary htole32/le32toh dance.yongari2011-05-061-8/+5
|
* Rewrite RX filter logic and provide controller specific filteryongari2011-05-061-120/+102
| | | | | | | handler for 3C90x and 3C90xB/C respectively. This simplifies ioctl handler as well as enhancing readability. While I'm here don't reprogram multicast filter when driver is not running.
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls tojhb2011-03-231-1/+1
| | | | pci_find_cap() instead.
* Allocate the DMA memory shared between the host and the controller asmarius2011-03-111-4/+4
| | | | | | coherent. MFC after: 2 weeks
* Add flow control for 3C905B and newer controllers. Note, theseyongari2010-11-141-6/+19
| | | | | | controllers support RX pause only. Reviewed by: marius
* Correct an inverted check in r213893.marius2010-11-051-1/+1
|
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-151-18/+14
| | | | | | | | | | | | | | | | | | | | | | | the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari
* Implement basic WOL support. Note, not all xl(4) controllersyongari2010-08-232-10/+80
| | | | | | support WOL. Some controllers require additional 3-wire auxiliary remote wakeup connector to draw power. More recent xl(4) controllers may not need the wakeup connector though.
* Move xl_reset() to xl_init_locked(). This will make driveryongari2010-08-231-6/+3
| | | | | | | | | | | | | | | | initialize controller from a known good state. Previously driver used to issue controller reset while TX/RX DMA are in progress. I guess resetting controller in active TX/RX DMA cycle is to ensure stopping I/Os in xl_shutdown(). I remember some buggy controllers didn't respond with stop command if controller is under high network load at the time of shutdown so resetting controller was the only safe way to stop the I/Os. However, from my experiments, controller always responded with stop command under high network load so I think it's okay to remove the xl_reset() in device_shutdown handler. Resetting controller also will clear configured RX filter which in turn will make WOL support hard because driver have to reprogram RX filter in WOL handler as well as setting station address.
* Remove unnecessary controller reinitialization by checkingyongari2010-08-231-5/+11
| | | | IFF_DRV_RUNNING flag.
* Clean up SIOCSIFCAP handler and allow RX checksum offloading couldyongari2010-08-231-31/+38
| | | | be controlled by user.
* cardbus -> CardBusimp2010-01-031-2/+2
|
* Make xl(4) build with Tx checksum offload.yongari2009-07-091-4/+4
| | | | | PR: kern/136409 Approved by: re (kib)
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/rwatson2009-06-261-4/+4
| | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks
* When user_frac in the polling subsystem is low it is going to busy theattilio2009-05-301-9/+16
| | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated
* remove dead code with reference to IFQ_HANDOFFkmacy2009-04-271-26/+0
|
* To make it easy whether xl(4) missed Tx completion interrupt checkyongari2009-04-211-3/+19
| | | | | | | number of queued packets in watchdog timeout handler. If there are no queued packets just print a informational message and return without resetting controller. Also fix to invoke correct Tx completion handler as 3C905B needs different handler.
* Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted.yongari2009-04-211-2/+6
| | | | | | | | | | | Previously it used to clear the flag only when the transmit queue is empty which may slow down Tx performance. While I'm here check whether driver is running and whether we can queue more packets in if_start handler. This fixes occasional watchdog timeouts. Reported by: xer < xernet <> hotmail dot it > Tested by: xer < xernet <> hotmail dot it >
* remove now-redunant cardbus attachment.imp2009-03-091-1/+0
|
* Move the xl driver form sys/pci to sys/dev/xl for consistency.imp2008-08-102-0/+4109
OpenPOWER on IntegriCloud