summaryrefslogtreecommitdiffstats
path: root/sys/dev/sk
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-102-22/+32
| | | | | | | | | | | | | | | | | | | | 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)
* Deal with failed malloc calls[1].bz2005-04-251-0/+22
| | | | | | | | | While there also check for failed device_add_child calls. Found by: Coventry Analysis tool[1]. Submitted by: sam[1] Approved by: pjd (mentor) MFC after: 1 week
* handle malloc failure and sk_vpd_prodname potentially being null forsam2005-03-261-5/+8
| | | | | | | other reasons Noticed by: Coverity Prevent analysis tool Reviewed by: bz, jmg
* Do not try to free non allocated memory in error case.bz2005-03-172-13/+61
| | | | | | | | | | | | | | | | Do our best to plug some memory leaks (VPD data, jumbo memory buffer,...). Log if we cannot free because memory still in use[1]. Change locking to avoid ''acquiring duplicate lock of same type: "network driver"'' and potential deadlock. Also seems to fix LOR #063. [1] This change does not solve problems if buffers are still in use when unloading if_sk.ko. There is ongoing work which will address jumbogram allocations in a more general way. PR: kern/75677 (with changes, no mii fixes in here) Tested by: net, Antoine Brodin (slightly different version) Approved by: rwatson (mentor) MFC after: 5 days
* * Lower interrupt moderation timer 200->100.bz2005-03-172-1/+65
| | | | | | | | Obtained from: NetBSD if_sk.c rev. 1.11 * Make interrupt moderation configurable via sysctl/tuneable. PR: kern/41220 Approved by: rwatson (mentor)
* * Improve chip identification.bz2005-03-172-32/+142
| | | | | | | | | | | Obtained from: NetBSD if_sk.c rev. 1.11 * Take PHY out of reset for Yukon Lite Rev. A3. Submitted by: postings on net@ in thread "skc0: no PHY found", 2005-02-22 Tested by: net Approved by: rwatson (mentor) MFC after: 5 days
* * When adding/deleting multicast addresses, only whack the address filterbz2005-03-171-6/+15
| | | | | | | | | | | | | | | | if the interface is marked RUNNING. Obtained from: NetBSD if_sk.c rev. 1.12 * Don't initialize the card (and start an autonegotiation) every time the IP address changes. Makes 'dhclient sk0' invocations way faster and more consistant. i.e. one DHCPREQUEST elicits the DHCPACK. Obtained from: OpenBSD if_sk.c rev. 1.56 * Additional locking changes in sk_ioctl. PR: kern/61296 should see improvements by the last two. Approved by: rwatson (mentor) MFC after: 5 days
* Fix style(9) issues with __P removal.imp2005-02-241-56/+56
| | | | Noticed by: bde
* Return BUS_PROBE_DEFAULT instead of 0.imp2005-02-241-2/+2
|
* Cleanup debugging code and put it under bootverbosebz2005-01-291-35/+36
| | | | | | (includes minor style polishing). Approved by: rwatson (mentor)
* /* -> /*- for license, minor formatting changesimp2005-01-074-6/+6
|
* Enable sk(4) for ATLQ.mlaier2004-12-241-5/+7
| | | | | Thoroughly tested by: Ender <ender NO tog SPAM net> MFC after: 4 weeks
OpenPOWER on IntegriCloud