summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_sis.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan2020-12-121-2/+2
| | | | | | OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
* Initialize sis_ring_init() 'sis_rx_prod' and 'sis_rx_cons' to 0.kevlo2020-07-161-2/+2
| | | | ok mpi@, deraadt@
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-4/+4
| | | | ok dlg@ tobhe@
* use ifiq_input and use it's return value to apply backpressure to rxrs.dlg2020-06-221-2/+3
| | | | this is a step toward deprecating softclock based livelock detection.
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* Work around buggy zero-length packets produced by the DP83816A.mpi2016-01-081-1/+13
| | | | From Nathanael Rensen, ok dlg@
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
* You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.mpi2015-11-241-2/+1
|
* The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.mpi2015-11-241-2/+1
|
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the code is refactored so the IFQ macros call newly implemented ifq functions. the ifq code is split so each discipline (priq and hfsc in our case) is an opaque set of operations that the common ifq code can call. the common code does the locking, accounting (ifq_len manipulation), and freeing of the mbuf if the disciplines enqueue function rejects it. theyre kind of like bufqs in the block layer with their fifo and nscan disciplines. the new api also supports atomic switching of disciplines at runtime. the hfsc setup in pf_ioctl.c has been tweaked to build a complete hfsc_if structure which it attaches to the send queue in a single operation, rather than attaching to the interface up front and building up a list of queues. the send queue is now mutexed, which raises the expectation that packets can be enqueued or purged on one cpu while another cpu is dequeueing them in a driver for transmission. a lot of drivers use IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before committing to it with a later IFQ_DEQUEUE operation. if the mbuf gets freed in between the POLL and DEQUEUE operations, fireworks will ensue. to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback, and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq mutex and get a reference to the mbuf they wish to try and tx. if there's space, they can ifq_deq_commit it to remove the mbuf and release the mutex. if there's no space, ifq_deq_rollback simply releases the mutex. this api was developed to make updating the drivers using IFQ_POLL easy, instead of having to do significant semantic changes to avoid POLL that we cannot test on all the hardware. the common code has been tested pretty hard, and all the driver modifications are straightforward except for de(4). if that breaks it can be dealt with later. ok mpi@ jmatthew@
* arp_ifinit() is no longer needed.mpi2015-10-251-4/+1
|
* Increment if_ipackets in if_input().mpi2015-06-241-2/+1
| | | | | | | Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
* Now that if_input() set the receiving interface pointer on mbufs for usmpi2015-04-131-3/+2
| | | | | | | | | | | | there's no need to do it in m_devget(9). Stop passing an ``ifp'' will help for upcoming interface pointer -> index conversion. While here remove unused ``ifp'' argument from m_clget(9) and kill two birds^W layer violations in one commit. ok henning@
* Convert to if_input().mpi2015-03-301-9/+5
| | | | Tested by sebastia@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* - Make use of m_defrag().brad2015-02-111-9/+26
| | | | | | | | | | - Lower the max # of TX DMA segments from close to the whole ring down to a more sensible value. From FreeBSD - Move the TX ring full check out of and above the for loop. - Use dm_nsegs to provide the total # of DMA segments instead of the value from the for loop. ok mikeb@
* Always enable the receive filter. It was being enabled via sis_init()brad2015-01-061-4/+5
| | | | but not if calling sis_iff() via sis_ioctl().
* unifdef INETtedu2014-12-221-5/+1
|
* Do as the datasheet recommends and disable the RX filter before adjustingbrad2014-12-171-6/+27
| | | | | | the RX filter. From FreeBSD
* Have foo_init() call foo_reset() to reset the chip to a known statebrad2014-12-081-6/+7
| | | | | | | | as is the case for a lot of the other drivers. Remove some redundant calls to foo_stop() and foo_reset() before foo_init(). Tested with DP83815, 3c905C, 8139 and ST201. Mostly from FreeBSD.
* rxr ioctl handling.brad2014-11-241-1/+6
|
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* cut things that relied on mclgeti for rx ring accounting/restriction overdlg2014-07-081-9/+11
| | | | | | | | | | to using if_rxr. cut the reporting systat did over to the rxr ioctl. tested as much as i can on alpha, amd64, and sparc64. mpi@ has run it on macppc. ok mpi@
* The few network drivers that called their children's (ie. mii PHYderaadt2013-12-281-2/+1
| | | | | drivers) activate functions at DVACT_RESUME time do not need to do so, since their PHYs are repaired by IFF_UP.
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-4/+4
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* get rid of the copy argument in m_devget that let you provide andlg2013-08-211-2/+2
| | | | | | | | | alternative to bcopy since noone uses it. while there use memcpy instead of bcopy because we know the memory cannot overlap. ok henning@ matthew@ mikeb@ deraadt@
* Most network drivers include netinet/in_var.h, but apparently theybluhm2013-08-071-2/+1
| | | | | don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
* Rewrite the media / link state handling and have itbrad2013-06-281-66/+90
| | | | | | | | | handled within sis_miibus_statchg() instead of calling sis_init(). Based on the FreeBSD sis(4) driver. ok mikeb@ sthen@
* - Apply the AcceptPerfectMatch workaround for DP83815 chipsets to the 15Dbrad2013-03-171-18/+20
| | | | | | | | | | | | | revision as well. - Sync the short cable workaround a bit closer to FreeBSD. No functional change. From FreeBSD - Add some comments. From NetBSD ok sthen@
* Correct the delay when programming the short cable fix. It should bebrad2013-03-071-2/+2
| | | | | | | | 100us, not 100ms. From FreeBSD ok chris@
* Allow the user to configure an MTU of up to 1518, which does not requiresthen2013-02-091-1/+2
| | | | | any additional chip reprogramming, and is tested to work fine on DP83815. ok mikeb@
* Remove setting an initial assumed baudrate upon driver attach which is notbrad2012-11-291-2/+1
| | | | | | necessarily correct, there might not even be a link when attaching. ok mikeb@ reyk@
* Convert a number of old private copies of code which predatesderaadt2012-10-181-29/+2
| | | | | | | | pci_set_powerstate() to using it instead. Many of these chunks of code had bugs in them, especially missing delay() calls. Some of them were doing things our PCI subsystem is now responsible for handling. If you have any of the affected devices, please keep an eye out for regressions. ok kettenis
* kill a few more casts that aren't helpful. ok krw miodtedu2011-06-221-6/+6
|
* do not disable interrupts in the isr and then enable them againdlg2011-04-141-49/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | when leaving. when you're handling an interrupt it is masked. whacking the chip is work for no gain. modify the interrupt handler so it only processes the rings once, rather than looping over them until it runs out of work to do. looping in the isr is bad for several reasons: firstly, the chip does interrupt mitigation so you have a decent/predictable amount of work to do in the isr. your first loop will do that chunk of work (ie, it pulls off 50ish packets), and then the successive looping aggressively pull one or two packets off the rx ring. these extra loops work against the benefit that interrupt mitigation provides. bus space reads are slow. we should avoid doing them where possible (but we should always do them when necessary). doing the loop 5 times per isr works against the mclgeti semantics. it knows a nic is busy and therefore needs more rx descriptors by watching to see when the nic uses all of its descriptors between interrupts. if we're aggressively pulling packets off by looping in the isr then we're skewing this check. ok henning@ krw@ testing by sthen@
* use nitems(); no binary change for drivers that are compiled on amd64.jasper2011-04-031-2/+2
| | | | ok claudio@
* bus_dmamap_sync() freshly initialized Rx descriptors before flipping the bitkettenis2011-02-151-1/+6
| | | | | | that hands them over to the hardware. This prevents the hardware from seeing stale contents if the compiler decides to re-order stores or if the hardware does store-reordering.
* Add DVACT_QUIECE support. This is called before splhigh() and beforederaadt2010-08-311-1/+4
| | | | | | | | DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
* activate function should return result of config_activate_childrenderaadt2010-08-311-4/+5
|
* ca_activate function for suspend/resume; tested by mlarkinderaadt2010-08-061-2/+25
|
* BUS_DMA_ZERO instead of alloc, map, bzero.oga2010-05-191-3/+2
| | | | ok krw@
* - consistify cfdriver for the ethernet drivers (0 -> NULL)jasper2009-08-131-2/+2
| | | | ok dlg@
* A few more simple cases of shutdown hooks which only call xxstop, whenderaadt2009-08-101-16/+1
| | | | we now know the interface has already been stopped
* MCLGETI() will now allocate a mbuf header if it is not provided, thusderaadt2009-08-091-9/+3
| | | | | | reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
* Add big-endian platform support to sis(4). Tested to not break anything onmiod2009-07-221-36/+40
| | | | sokeris by mk@, and to work on sparc64 by brad@ and on sgi by yours truly.
* Sync the strict alignment with vr(4). Remove the if (1) and replace it withclaudio2009-06-221-7/+6
| | | | an #ifdef #else #endif dance. Reminded by Brad.
* First sync the descriptor then check if the owner of the descriptor.claudio2009-06-181-5/+5
| | | | | While there switch some m_freem() to m_free() where only a single mbuf is involved.
* Remove #if 0 code that is of no use at all. Ring overflows will actuallyclaudio2009-06-121-17/+1
| | | | happen with MCLGETI and nothing serious at all.
* merge some individual SIS_SETBIT (done for natsemi chips only)sthen2009-06-041-14/+7
| | | | into sis_iff_ns() (called only for natsemi). from Brad.