summaryrefslogtreecommitdiffstats
path: root/sys/dev/sk
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r266270brueffer2014-05-311-2/+0
| | | | Remove some unused variables.
* MFC r260016:dim2014-01-041-5/+0
| | | | | Remove superfluous old-style rcsid[] from if_sk.c. There is already an __FBSDID() at the top of the file.
* - Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method seesmarius2013-05-302-7/+17
| | | | | | | | | | the actual PCI device which makes the request for DMA tag, instead of some descendant of the PCI device, by creating a pass-through trampoline. - Sprinkle const on tables. - Use NULL instead of 0 for pointers. - Take advantage of nitems(). MFC after: 1 week
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-3/+3
| | | | malloc(9) flags in sys/dev.
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againkevlo2012-01-071-1/+0
| | | | Reviewed by: yongari
* - There's no need to overwrite the default device method with the defaultmarius2011-11-221-10/+2
| | | | | | | | | | 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.
* Allocate the DMA memory shared between the host and the controller asmarius2011-03-111-6/+7
| | | | | | coherent. MFC after: 2 weeks
* Fix a long standing bug in programming station address for Yukonyongari2010-11-061-12/+13
| | | | | | | | | | | | | controllers. sk(4) never reprogrammed station address for Yukon controllers so overriding station address with ifconfig(8) was not possible. Fix the bug by reprogramming all registers that control station address, flow-control and virtual station address. Virtual station address has no use at this moment since driver does not make use of fail over feature. Tested by: "Mikhail T." <mi+thun <> aldan.algebra.com> MFC after: 1 week
* If we got an invalid station address, generate random address. Thisyongari2010-11-061-0/+19
| | | | | | | might be caused by broken BIOS. Reported by: "Mikhail T." <mi+thun <> aldan.algebra.com> MFC after: 1 week
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | 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
* Some revision of Yukon controller generates corrupted frame when TXyongari2010-07-091-8/+21
| | | | | | | | | | checksum offloading is enabled. The frame has a valid checksum value so payload might be modified during TX checksum calculation. Disable TX checksum offloading but give users chance to enable it when they know their controller works without problems with TX checksum offloading. Reported by: Andrzej Tobola <ato <> iem dot pw dot edu dot pl>
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setjhb2009-11-061-2/+0
| | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already.
* 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
* Separate multicast filtering of SysKonnect GENESIS and Marvellyongari2009-05-011-116/+81
| | | | | | | | | | | | | | | | | | | | | Yukon from common multicast handling code. Yukon uses hash-based multicast filtering(big endian form) but GENESIS uses perfect multicast filtering as well as hash-based one(little endian form). Due to the differences of multicast filtering there is no much sense to have a common code. o Remove sk_setmulti() and introduce sk_rxfilter_yukon(), sk_rxfilter_yukon() that handles multicast filtering setup. o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and nuke sk_setpromisc(). This simplifies ioctl handler as well as giving a chance to check validity of Rx control register of Yukon. o Don't reinitialize controller when IFF_ALLMULTI flags is changed. o Nuke sk_gmchash(), it's not needed anymore. o Always reconfigure Rx control register whenever a new multicast filtering condition is changed. This fixes multicast filtering setup on Yukon. PR: kern/134051
* Prefer NULL over integer 0 for pointer type.yongari2008-02-141-11/+11
|
* Nuke local jumbo allocator and switch to use of UMA backed pageyongari2008-02-142-295/+142
| | | | | | | | | | | | | | | | | | | | | | | | | allocator for jumbo frame. o Removed unneeded jlist lock which was used to manage jumbo buffers. o Don't reinitialize hardware if MTU was not changed. o Added additional check for minimal MTU size. o Added a new tunable hw.skc.jumbo_disable to disable jumbo frame support for the driver. The tunable could be set for systems that do not need to use jumbo frames and it would save (9K * number of Rx descriptors) bytes kernel memory. o Jumbo buffer allocation failure is no longer critical error for the operation of sk(4). If sk(4) encounter the allocation failure it just disables jumbo frame support and continues to work without user intervention. With these changes jumbo frame performance of sk(4) was slightly increased and users should not encounter jumbo buffer allocation failure. Previously sk(4) tried to allocate physically contiguous memory, 3388KB for 256 Rx descriptors. Sometimes that amount of contiguous memory region could not be available for running systems which in turn resulted in failure of loading the driver. Tested by: Cy Schubert < Cy.Schubert () komquats dot com >
* Give MEXTADD() another argument to make both void pointers to thephk2008-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | free function controlable, instead of passing the KVA of the buffer storage as the first argument. Fix all conventional users of the API to pass the KVA of the buffer as the first argument, to make this a no-op commit. Likely break the only non-convetional user of the API, after informing the relevant committer. Update the mbuf(9) manual page, which was already out of sync on this point. Bump __FreeBSD_version to 800016 as there is no way to tell how many arguments a CPP macro needs any other way. This paves the way for giving sendfile(9) a way to wait for the passed storage to have been accessed before returning. This does not affect the memory layout or size of mbufs. Parental oversight by: sam and rwatson. No MFC is anticipated.
* Fix function prototype for device_shutdown method.yongari2007-11-221-3/+3
|
* Universally adopt most conventional spelling of acquire.rwatson2007-05-271-1/+1
|
* Make a missing or empty VPD non-fatal, as it was prior to rev 1.131.mckay2007-05-101-8/+6
| | | | With this change, my D-Link DGE-530T rev A1 is operational again.
* Use our own timer for watchdog instead of if_watchdog/if_timeryongari2007-04-022-8/+24
| | | | interface.
* 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@
* Change the remainder of the drivers for DMA'ing devices enabled in themarius2007-01-211-1/+2
| | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...).
* Remove incomplete Yukon II support code which was added in if_sk.c, rev 1.123.yongari2006-12-142-101/+3
| | | | Yukon II users should use msk(4).
* provide routines to access VPD data at the PCI layer...jmg2006-10-092-179/+7
| | | | | | remove sk's own implementation, and use the new calls to get the data... Reviewed by: -arch
* Fix invalid reference of mbuf chains.yongari2006-08-121-13/+13
| | | | | | | Use proper pointer dereference to inform modified mbuf chains to caller. In collaboration with: glebius
* Fix incorrect busy check for PHY write operation.yongari2006-08-021-4/+2
| | | | While I'm here remove unnecessary return statement.
* Add device ID for second generation D-Link DGE-530T.yongari2006-07-272-3/+10
| | | | PR: kern/99903
* Convert sk(4) to use the new bus_alloc_resources() API andyongari2006-07-192-46/+43
| | | | | | | bus_{read,write}_* macros. Submitted by: Antoine Brodin <antoine.brodin AT laposte DOT net> Reviewed by: imp (initial version)
* Fix typo in comment.yongari2006-07-051-2/+2
| | | | Submitted by: brad AT OpenBSD DOT org
* Fix watchdog timeout errors seen on a few systems.yongari2006-06-071-6/+13
| | | | | | | | | | | | | | | | | | SK-NET GENESIS document says reading SK_ISSR should stop generating further interrupts(Since we drop a driver lock before invoking ifp->if_input handler we should disable interrupts in ISR in order to protect integrity of softc from subsequent interrupts). But it seems that there is possibility of loosing interrupts between reading SK_ISSR and determining which interrupts are reported. To cope with the situation we continuously read SK_ISSR register until there are no interrupts. However, it seems that the above work around doesn't fix all cases. To protect watchdog handler from triggering false alarm add a work around code which try to reclaim pending Tx descriptors before resetting hardware. This should fix occasional watchdog timeout errors seen on this driver. Reported by: Frank Behrens <frank AT pinky dot sax dot de > Tested by: Frank Behrens <frank AT pinky dot sax dot de >
* Re-wrok PHY setup, media handling and dual-port detection.yongari2006-05-152-37/+13
| | | | | | | | | With this change SysKonnect SK-9521 v2.0 and SK-9821 v2.0 adapter now works. Obtained from: OpenBSD Reported by: Ganbold ganbold ! micom ( mng $ net Tested by: Ganbold ganbold ! micom ( mng $ net
* Type.yongari2006-05-021-1/+1
| | | | Submitted by: brad@OpenBSD
* Don't attach to Marvell 88E805X (Yukon-II) by default, the driver is notsobomax2006-05-011-0/+2
| | | | | | functional yet. Requested by: bz
* Add some incomplete support for Marvell Yukon EC controllers based onsobomax2006-04-282-20/+134
| | | | | | | | | | OpenBSD changes. With these changes, PHY part of the driver becomes functional (it senses media changes and negotiates speed just fine), previously it just hang with no PHY message, but no data goes through interface (error message is "can not stop transfer of Tx/Rx descriptor). Hopefully somebody with more clue/free time will be able to pick up after me.
* Bring busdmafied sk(4) to all architectures.yongari2006-04-274-588/+1695
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - MPSAFE. No more recursive lock required. - bus_dma(9) conversion. I think it should work on all architectures. - optimized Rx handler for each normal and jumbo frames. Previously sk(4) used jumbo frame management code to handle normal sized frames. As the handler needs an additional lock to protect jumbo frame management structure from races, it used two lock operations for each received packet. Now sk(4) uses single lock operation for normal frame.(Jumbo frame still needs two lock operations as before.) The hardware supports DMA scatter operations for Rx descriptors such that it's possible to take advantagee of m_cljget(9) for jumbo frames. However, due to a unknown reasons it resulted in poor performance on sparc64. So I dropped m_cljget(9) approach. This should be revisited since it would reduce one lock operation for jumbo frame handling. - Tx TCP/Rx IP checksum offload support. According to the data sheet of SK-NET GENESIS the hardware supports Rx IP/TCP/UDP offload. But I couldn't make it work on my Yukon hardware. So Rx TCP/UDP was disabled at the moment. It seems that newer Yukon chips can support Tx UDP checksum offload too. But I need more documentation first. - Added more wait time in reading VPD data. It seems that ASUS LOM takes a very long time to respond VPD read signal. - Added an additional lock for MII register access callbacks. - Added more strict received packet validation routine. Previously it passed corrupted packets to upper layers under certain conditions. - A new function sk_yukon_tick() to handle auto-negotiation properly. - Interrupt handler now checks shared interrupt source and protects the interrupt handler from NULL pointer dereference which was caused by odd status word value. The status word can returns 0xffffffff if cable is unplugged while Rx/Tx/auto-negotiation is in progress. - suspend/resume support(not tested). - Added Rx/Tx FIFO flush routine for Yukon - Activate Tx descriptor poll timer in order to protect possible loss of SK_TXBMU_TX_START command. Previously the driver continuously issued SK_TXBMU_TX_START when it notices pending Tx descriptors not processed yet in interrupt handler. That approach would add additional PCI write access overhead under high Tx load situations and it might fail if the first SK_TXBMU_TX_START was lost and no interrupt is generated from the first SK_TXBMU_TX_START command. - s/printf/if_printf/, s/printf/device_printf/, Axe sk_unit in softc. - Setting multicast/station address is now safe on strict-alignment architectures. - Fix long standing bug in VLAN header length setup. - Added/corrected register definitions for Yukon. (Register information from Linux skge driver.) - Added Rx status definition for Marvell Yukon/XaQti XMAC. (Rx status register information from Linux skge driver.) - Update if_oerrors if we encounter watchdog error. - callout(9) conversion Special thanks to jkim who let me know RX status differences between Yukon and XaQti XMAC. It seems that there is still occasional watchdog timeout error but I couldn't reproduce it and need more information to analyze it from users. Tested by: bz(amd64), me(i386, sparc64), current ML Frank Behrens frank ! pinky ( sax $ de
* Correct DRIVER_MODULE declaration.yongari2006-04-271-1/+1
| | | | | | skc does attach to pci bus instead of sk. Submitted by: jmg
* The sk(4) driver has moved to /sys/dev/skyongari2006-04-271-3/+3
|
* Do not touch ifp->if_baudrate in miibus aware drivers.glebius2006-02-141-1/+0
|
* The number of ticks per usec for YUKON_EC is 125.yongari2006-01-171-1/+1
|
* fix interrupt moderation timer frequencies for Yukonyongari2006-01-172-7/+21
| | | | Obtained from: OpenBSD
* remove trailing spacesyongari2006-01-171-11/+11
|
* Remove unused code.bz2006-01-151-3/+0
| | | | Found with: Coverity Prevent(tm)
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-5/+5
| | | | | | | | | | 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 :-)
* Only allow the sk(4) driver to attach to revision 2 of the LinkSys EG1032jhb2005-10-142-0/+16
| | | | | | | | cards and teach the re(4) driver to attach to revision 3 cards. Submitted by: Fredrik Lindberg fli+freebsd-current at shapeshifter dot se MFC after: 2 weeks Reviewed by: imp, mdodd
* Mark sk(4) as capable of handling extended VLAN frames. NICsyar2005-10-111-0/+6
| | | | | | | | | based on XMAC II chip should be ready for this in their initial mode of operation, and Yukon-based NICs are configured so by the driver. PR: kern/79998 MFC after: 1 month
* Fix "struct ifnet" leaks when attach() fails in the middle, e.g.ru2005-09-161-3/+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.
* * Solve "No PHY found" problem for more Yukon Lite variants.bz2005-08-131-25/+61
| | | | | | | * Catch a bus attach error. * Improve locking. MFC after: 6 days
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-14/+16
| | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud