summaryrefslogtreecommitdiffstats
path: root/sys/dev/sis
Commit message (Collapse)AuthorAgeFilesLines
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls tojhb2011-03-231-2/+2
| | | | pci_find_cap() instead.
* Make sure changing ownership of RX descriptor to be done as lastyongari2011-02-282-3/+3
| | | | | | | | | | | | | operation. Previously ownership was transferred to hardware before setting address of new RX buffer such that it was possible for hardware to use wrong RX buffer address. While here keep compiler from re-ordering instructions by declaring descriptor members volatile. Memory barriers would do the same job but volatile is supposed to be cheaper than using memory barriers, especially on MP systems. Submitted by: marius MFC after: 1 week
* Rework RX filter programming by providing separate handler foryongari2011-01-181-91/+90
| | | | | | | | | | | | | | | | DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > MFC after: 3 days
* Merge amd64 and i386 bus.h and move the resulting header to x86. Replacetijl2010-12-201-4/+2
| | | | | | | | | the original amd64 and i386 headers with stubs. Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere. Reviewed by: imp (previous version), jhb Approved by: kib (mentor)
* Fix double ;;kevlo2010-12-061-1/+1
|
* Correct handling of shared interrupt in sis_intr(). r212116 incorrectlyyongari2010-10-201-4/+9
| | | | | | | | | | released a drver lock for shared interrupt case such that it caused panic. While I'm here check whether driver is still running before serving TX/RX handler. Reported by: Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au > Tested by: Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au > MFC after: 3 days
* Converted the remainder of the NIC drivers to use the mii_attach()marius2010-10-151-4/+4
| | | | | | | introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari
* Fix another bug introduced in r212109. We should unload DMA mapsyongari2010-09-031-1/+1
| | | | | only after sending the last fragment of a frame so the mbuf pointer also should be stored in the last descriptor index.
* Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 wasyongari2010-09-032-31/+124
| | | | | not tested. While I'm here, clean up SIOCSIFCAP handler.
* Implement initial device suspend/resume method.yongari2010-09-021-0/+31
|
* Unlike most other controllers, NS DP83815/DP83816 controllers seemyongari2010-09-022-10/+81
| | | | | | | | | | | | | | to pad with 0xFF when it encounter short frames. According to RFC 1042 the pad bytes should be 0x00. Because manual padding consumes extra CPU cycles, introduce a new tunable which controls the padding behavior. Turning this tunable on will have driver pad manually but it's disabled by default. Users can enable software padding by setting the following tunable to non-zero value. dev.sis.%d.manual_pad="1" PR: kern/35422 (patch not used)
* Fix the last endianness issue on handling station address whichyongari2010-09-021-13/+14
| | | | | | | | prevented driver from working on big-endian machines. Also rewrite station address programming to make it work on strict-alignment architectures. With this change, sis(4) now works on sparc64 and performance number looks good even though sis(4) have to apply fixup code to align received frames on 2 bytes boundary on sparc64.
* Fix stupid error in r212109 which didn't swap DMA maps. This causedyongari2010-09-021-2/+2
| | | | IOMMU panic on sparc64 under high TX load.
* Move sis_reset() to sis_initl(). This ensures driver starts withyongari2010-09-011-7/+5
| | | | known good state of controller.
* Avoid controller reinitialization which could be triggered byyongari2010-09-011-0/+5
| | | | | | dhclient(8) or alias addresses are added. PR: kern/87506
* Do not reinitialize controller whenever promiscuous mode oryongari2010-09-012-2/+11
| | | | | | | allmulti is toggled. Controller does not require reinitialization. This removes unnecessary controller reinitialization whenever tcpdump is used. While I'm here remove unnecessary variable reinitialization.
* Report result of link state change to caller. Previously it alwaysyongari2010-09-011-2/+3
| | | | returned success.
* Overhaul link state change handling. Previously sis(4) blindlyyongari2010-09-012-88/+100
| | | | | | | | | | | | | | | | | | | | | configured TX/RX MACs before getting a valid link. After that, when link state change callback is called, it called device initialization again to reconfigure TX/RX MACs depending on resolved link state. This hack created several bad side effects and it required more hacks to not collide with sis_tick callback as well as disabling switching to currently selected media in device initialization. Also it seems sis(4) was used to be a template driver for long time so other drivers which was modeled after sis(4) also should be changed. TX/RX MACs are now reconfigured after getting a valid link. Fix for short cable error is also applied after getting a link because it's only valid when the resolved speed is 100Mbps. While I'm here slightly reorganize interrupt handler such that sis(4) always read SIS_ISR register to see whether the interrupt is ours or not. This change removes another hack and make it possible to nuke sis_stopped variable in softc.
* s/u_intXX_t/uintXX_t/gyongari2010-09-012-35/+35
|
* bus_dma(9) cleanup.yongari2010-09-012-420/+497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Enforce TX/RX descriptor ring alignment. NS data sheet says the controller needs 4 bytes alignment but use 16 to cover both SiS and NS controllers. I don't have SiS data sheet so I'm not sure what is alignment restriction of SiS controller but 16 would be enough because it's larger than the size of a TX/RX descriptor. Previously sis(4) ignored the alignment restriction. o Enforce RX buffer alignment, 4. Previously sis(4) ignored RX buffer alignment restriction. o Limit number of TX DMA segment to be used to 16. It seems controller has no restriction on number of DMA segments but using more than 16 looks resource waste. o Collapse long mbuf chains with m_collapse(9) instead of calling expensive m_defrag(9). o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove unnecessary callbacks. o Initial endianness support. o Prefer local alignment fixup code to m_devget(9). o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying these maps in fast TX/RX path. On non-x86 architectures, this is very expensive operation and there is no need to do that. o Add missing bus_dmamap_sync(9) in TX/RX path. o watchdog is now unarmed only when there are no pending frames on controller. Previously sis(4) blindly unarmed watchdog without checking the number of queued frames. o For efficiency, loaded DMA map is reused for error frames. o DMA map loading failure is now gracefully handled. Previously sis(4) ignored any DMA map loading errors. o Nuke unused macros which are not appropriate for endianness operation. o Stop embedding driver maintained structures into descriptor rings. Because TX/RX descriptor structures are shared between host and controller, frequent bus_dmamap_sync(9) operations are required in fast path. Embedding driver structures will increase the size of DMA map which in turn will slow down performance.
* Nuke unnecessary return at the end of function.yongari2010-09-011-8/+0
|
* style(9) - space after keywords.yongari2010-09-011-35/+35
|
* Remove leading and trailing white spaces.yongari2010-09-012-36/+36
| | | | No functional changes.
* It's not necessary to reset the chip every time an input overflow eventbrucec2010-04-201-12/+3
| | | | | | | | | | occurs. In addition, the delay when programming the short cable fix should be 100us, not 100ms. PR: kern/64556 Submitted by: Thomas Hurst <tom at hur.st> Approved by: rrs (mentor) MFC after: 1 week
* 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-5/+9
| | | | | | | | | | | | | | | | | | | | | 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
* Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, soyongari2009-02-131-2/+3
| | | | | | | make sis_rxeof() handle that too. Previously it used to receive the frame and reset controller. PR: kern/131414
* Fix shutdown prototypes.imp2009-02-101-1/+2
|
* Fix a long standing VLAN tagged frame handling bug.yongari2008-12-092-1/+10
| | | | | | | | | | | | | | | | | | When VLAN tagged frame is received the hardware sets 'LONG' bit of Rx status word. It is always set when the size of received frame exceeded 1518 bytes, including CRC. This VLAN tagged frame clears 'OK' bit of Rx status word such that driver should not rely on 'OK' bit of Rx status word to pass the VLAN tagged frame to upper stack. To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are configured to accept VLAN tagged frames and the received frame size is less than or equal to maximum allowed length of VLAN tagged frame, clear 'LONG' bit of Rx status word before checking Rx errors. Reported by: Vladimir Ermako < samflanker <> gmail DOT com > Tested by: Vladimir Ermako < samflanker <> gmail DOT com >
* There actually were bugs in the original handling that I missed lastimp2008-08-231-3/+4
| | | | | | | | | | night. Free the children after each pci bus that is searched. Otherwise we leak them. With free in the new place, we also have to free children before going to done when we find the device we're looking for. Also, if we can't get the children of a device, just ignore that bus.
* Actually revert last... Upon closer inspection the code works in theimp2008-08-231-2/+1
| | | | face of errors already... A bit unorthodox, but none-the-less valid.
* Handle errors in device_get_children gracefully.imp2008-08-231-1/+2
|
* Move sis to sys/dev/sis for consistency.imp2008-08-102-0/+2802
OpenPOWER on IntegriCloud