aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sk
Commit message (Collapse)AuthorAgeFilesLines
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin2009-11-061-2/+0
| | | | | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Notes: svn path=/head/; revision=198988
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-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 Notes: svn path=/head/; revision=195049
* Separate multicast filtering of SysKonnect GENESIS and MarvellPyun YongHyeon2009-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 Notes: svn path=/head/; revision=191716
* Prefer NULL over integer 0 for pointer type.Pyun YongHyeon2008-02-141-11/+11
| | | | Notes: svn path=/head/; revision=176265
* Nuke local jumbo allocator and switch to use of UMA backed pagePyun YongHyeon2008-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 > Notes: svn path=/head/; revision=176264
* Give MEXTADD() another argument to make both void pointers to thePoul-Henning Kamp2008-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. Notes: svn path=/head/; revision=175872
* Fix function prototype for device_shutdown method.Pyun YongHyeon2007-11-221-3/+3
| | | | Notes: svn path=/head/; revision=173839
* Universally adopt most conventional spelling of acquire.Robert Watson2007-05-271-1/+1
| | | | Notes: svn path=/head/; revision=170035
* Make a missing or empty VPD non-fatal, as it was prior to rev 1.131.Stephen McKay2007-05-101-8/+6
| | | | | | | With this change, my D-Link DGE-530T rev A1 is operational again. Notes: svn path=/head/; revision=169443
* Use our own timer for watchdog instead of if_watchdog/if_timerPyun YongHyeon2007-04-022-8/+24
| | | | | | | interface. Notes: svn path=/head/; revision=168251
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-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@ Notes: svn path=/head/; revision=166901
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-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...). Notes: svn path=/head/; revision=166165
* Remove incomplete Yukon II support code which was added in if_sk.c, rev 1.123.Pyun YongHyeon2006-12-142-101/+3
| | | | | | | Yukon II users should use msk(4). Notes: svn path=/head/; revision=165197
* provide routines to access VPD data at the PCI layer...John-Mark Gurney2006-10-092-179/+7
| | | | | | | | | remove sk's own implementation, and use the new calls to get the data... Reviewed by: -arch Notes: svn path=/head/; revision=163163
* Fix invalid reference of mbuf chains.Pyun YongHyeon2006-08-121-13/+13
| | | | | | | | | | Use proper pointer dereference to inform modified mbuf chains to caller. In collaboration with: glebius Notes: svn path=/head/; revision=161235
* Fix incorrect busy check for PHY write operation.Pyun YongHyeon2006-08-021-4/+2
| | | | | | | While I'm here remove unnecessary return statement. Notes: svn path=/head/; revision=160898
* Add device ID for second generation D-Link DGE-530T.Pyun YongHyeon2006-07-272-3/+10
| | | | | | | PR: kern/99903 Notes: svn path=/head/; revision=160738
* Convert sk(4) to use the new bus_alloc_resources() API andPyun YongHyeon2006-07-192-46/+43
| | | | | | | | | | bus_{read,write}_* macros. Submitted by: Antoine Brodin <antoine.brodin AT laposte DOT net> Reviewed by: imp (initial version) Notes: svn path=/head/; revision=160492
* Fix typo in comment.Pyun YongHyeon2006-07-051-2/+2
| | | | | | | Submitted by: brad AT OpenBSD DOT org Notes: svn path=/head/; revision=160104
* Fix watchdog timeout errors seen on a few systems.Pyun YongHyeon2006-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 > Notes: svn path=/head/; revision=159366
* Re-wrok PHY setup, media handling and dual-port detection.Pyun YongHyeon2006-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 Notes: svn path=/head/; revision=158586
* Type.Pyun YongHyeon2006-05-021-1/+1
| | | | | | | Submitted by: brad@OpenBSD Notes: svn path=/head/; revision=158240
* Don't attach to Marvell 88E805X (Yukon-II) by default, the driver is notMaxim Sobolev2006-05-011-0/+2
| | | | | | | | | functional yet. Requested by: bz Notes: svn path=/head/; revision=158205
* Add some incomplete support for Marvell Yukon EC controllers based onMaxim Sobolev2006-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. Notes: svn path=/head/; revision=158096
* Bring busdmafied sk(4) to all architectures.Pyun YongHyeon2006-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 Notes: svn path=/head/; revision=158070
* Correct DRIVER_MODULE declaration.Pyun YongHyeon2006-04-271-1/+1
| | | | | | | | | skc does attach to pci bus instead of sk. Submitted by: jmg Notes: svn path=/head/; revision=158065
* The sk(4) driver has moved to /sys/dev/skPyun YongHyeon2006-04-271-3/+3
| | | | Notes: svn path=/head/; revision=158061
* Do not touch ifp->if_baudrate in miibus aware drivers.Gleb Smirnoff2006-02-141-1/+0
| | | | Notes: svn path=/head/; revision=155671
* The number of ticks per usec for YUKON_EC is 125.Pyun YongHyeon2006-01-171-1/+1
| | | | Notes: svn path=/head/; revision=154454
* fix interrupt moderation timer frequencies for YukonPyun YongHyeon2006-01-172-7/+21
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=154448
* remove trailing spacesPyun YongHyeon2006-01-171-11/+11
| | | | Notes: svn path=/head/; revision=154447
* Remove unused code.Bjoern A. Zeeb2006-01-151-3/+0
| | | | | | | Found with: Coverity Prevent(tm) Notes: svn path=/head/; revision=154388
* - Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov2005-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. Notes: svn path=/head/; revision=152315
* Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntaxWarner Losh2005-10-221-1/+1
| | | | | | | (device miibus) in time for 7.0 :-) Notes: svn path=/head/; revision=151545
* Only allow the sk(4) driver to attach to revision 2 of the LinkSys EG1032John Baldwin2005-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 Notes: svn path=/head/; revision=151341
* Mark sk(4) as capable of handling extended VLAN frames. NICsYaroslav Tykhiy2005-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 Notes: svn path=/head/; revision=151242
* Fix "struct ifnet" leaks when attach() fails in the middle, e.g.Ruslan Ermilov2005-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. Notes: svn path=/head/; revision=150213
* * Solve "No PHY found" problem for more Yukon Lite variants.Bjoern A. Zeeb2005-08-131-25/+61
| | | | | | | | | | * Catch a bus attach error. * Improve locking. MFC after: 6 days Notes: svn path=/head/; revision=149021
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-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 Notes: svn path=/head/; revision=148887
* Modify device drivers supporting multicast addresses to lock if_addr_mtxRobert Watson2005-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 Notes: svn path=/head/; revision=148654
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-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 Notes: svn path=/head/; revision=147256
* 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
* Deal with failed malloc calls[1].Bjoern A. Zeeb2005-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 Notes: svn path=/head/; revision=145501
* handle malloc failure and sk_vpd_prodname potentially being null forSam Leffler2005-03-261-5/+8
| | | | | | | | | | other reasons Noticed by: Coverity Prevent analysis tool Reviewed by: bz, jmg Notes: svn path=/head/; revision=144164
* Do not try to free non allocated memory in error case.Bjoern A. Zeeb2005-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 Notes: svn path=/head/; revision=143754
* * Lower interrupt moderation timer 200->100.Bjoern A. Zeeb2005-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) Notes: svn path=/head/; revision=143753
* * Improve chip identification.Bjoern A. Zeeb2005-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 Notes: svn path=/head/; revision=143752
* * When adding/deleting multicast addresses, only whack the address filterBjoern A. Zeeb2005-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 Notes: svn path=/head/; revision=143751
* Fix style(9) issues with __P removal.Warner Losh2005-02-241-56/+56
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=142407
* Return BUS_PROBE_DEFAULT instead of 0.Warner Losh2005-02-241-2/+2
| | | | Notes: svn path=/head/; revision=142398