summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_sis.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* - Rewrite ioctl handling code and receive filter handling to cleansthen2009-06-041-118/+81
| | | | | | | up the code a bit. - Remove unused sc_if_flags field. from Brad.
* Convert sis(4) to MCLGETI() and make soekris suck much less. With this theclaudio2009-04-141-62/+77
| | | | | | | little green slug does not block userland even when hammered with twice as much traffic it can handle. Almost the same code I came up during h2k8 but now with two other bugs fixed that where exposed by MCLGETI(). Tested and OK dlg@ sthen@ and a lot of pushing by Theo.
* The original SiS chips seem to have an bug that marks VLAN tagged packetsclaudio2009-02-241-5/+9
| | | | | | | | with an rx error (SIS_RXSTAT_GIANT) eventhough everything is fine. Change code to clear this error on RX if the size of the packet is smaller then 1532 bytes. From FreeBSD via Brad. Tested on the more common National chips by me. Ok deraadt@
* Don't hardcode the bus_space_tag to use, grab if from pci_attach_argsoga2008-12-041-10/+3
| | | | | | like you're supposed to. Makes this file slightly less horrible. ok kettenis@, "yes" deraadt@.
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-24/+11
| | | | | | | | | | | | | | from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
* don't assign ifp to ifp; llvm/clang; ok jsgcnst2008-11-101-2/+2
|
* Change m_devget()'s outdated and unused "offset" argument: It isnaddy2008-10-141-4/+3
| | | | | | | | | | | now the offset into the first mbuf of the target chain before copying the source data over. From FreeBSD. Convert drivers' use of m_devget(). Mostly from thib@. Update mbuf(9) man page. ok claudio@, thib@
* First step towards cleaning up the Ethernet driver ioctl handling.brad2008-10-021-9/+2
| | | | | | | | | | | | | | | | | | | | Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
* Convert timeout_add() calls using multiples of hz to timeout_add_sec()blambert2008-09-101-3/+3
| | | | | | | Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
* theres no need too m_adj() the mbuf by 8bytes (u_int64_t) inthib2008-07-151-3/+1
| | | | | | sis_newbuf(), so remove the call. ok and lots of prodding dlg@, brad@
* move a common statement out of if/else;thib2008-07-101-6/+6
| | | | | | | adjust the mbuf before loading it, with bus_dmamap_load_mbuf(), that way we dont have to fiddle with ds_addr; ok dlg@
* Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() whenthib2008-07-071-4/+4
| | | | | | | we want too load an mbuf; remove a printf that fires in case we can't load the mbuf (We do error handling and recovery). ok brad@, dlg@