summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_stge.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-2/+2
| | | | ok dlg@ tobhe@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-4/+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@
* m_free() and m_freem() test for NULL. Simplify callers which had their ownjsg2016-11-291-3/+2
| | | | | | NULL tests. ok mpi@
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* 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
|
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Do not include <net/if_vlan_var.h> when it's not necessary.mpi2015-11-141-6/+1
| | | | | | Because of the VLAN hacks in mpw(4) this file still contains the definition of "struct ifvlan" which depends on <sys/refcnt.h> which in turns pull <sys/atomic.h>...
* arp_ifinit() is no longer needed.mpi2015-10-251-5/+1
|
* Increment if_ipackets in if_input().mpi2015-06-241-4/+1
| | | | | | | Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
* Convert moar drivers to if_input().mpi2015-04-301-13/+5
| | | | ok dlg@
* 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@
* unifdef INETtedu2014-12-221-5/+1
|
* Remove a few foo_start() calls within ioctl handlers. Odd spot to havebrad2014-12-081-4/+1
| | | | | | them and the vast majority of the rest of the drivers do not do this. ok mikeb@
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* 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@
* Convert a number of old private copies of code which predatesderaadt2012-10-181-12/+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
* mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUThenning2011-04-051-3/+3
| | | | ok claudio krw
* Fix a spacing nit, and replace a magic number with ETHER_ADDR_LEN.sthen2009-12-071-3/+3
| | | | From Brad.
* Use 16-bit writes instead of 8-bit writes for writing thejasper2009-12-031-8/+13
| | | | | | | | | | station address with the ST1023 chipset. This resolves the problem which resulted in the hack of putting the interface into promiscuous mode all the time with the ST1023 chipset. from brad, tested by me on the ST1023. ok sthen@
* - 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-24/+1
| | | | we now know the interface has already been stopped
* Replace "XXX ? from linux" with a descriptive comment. From Brad.sthen2009-07-281-2/+3
|
* Fix flow control support:kettenis2009-07-261-8/+13
| | | | | | | - un-PAUSE when the rx FIFO gets below 3056 as is done on FreeBSD and Linux. - properly update the MAC according to the negotiated flow control. From Brad.
* Rewrite ioctl parts and rx filter handling. From Brad, tested bysthen2009-07-211-73/+46
| | | | myself and jasper@.
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-26/+8
| | | | | | | | | | | | | | 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@
* Introduce bpf_mtap_ether(), which for the benefit of bpf listenersnaddy2008-11-091-3/+3
| | | | | | | | | creates the VLAN encapsulation from the tag stored in the mbuf header. Idea from FreeBSD, input from claudio@ and canacar@. Switch all hardware VLAN enabled drivers to the new function. ok claudio@
* Fix a typo with the VLAN code.brad2008-10-221-2/+2
|
* Add support TX VLAN tag insertion and RX VLAN tag stripping.brad2008-10-221-16/+39
|
* First step towards cleaning up the Ethernet driver ioctl handling.brad2008-10-021-11/+3
| | | | | | | | | | | | | | | | | | | | 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@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* Sort the PCI id table and remove a comment which is no longer true.brad2007-10-231-9/+5
| | | | ok dlg@
* only output on situations where power state is D3. unify the message infgsch2007-10-221-12/+9
| | | | such cases. ok brad@ kettenis@
* Use pci_set_powerstate(), shrinking the code and unifying the differentfgsch2007-10-221-12/+7
| | | | versions. ok by many.
* Pass MIIF_DOPAUSE to mii_attach().kettenis2006-12-291-2/+2
| | | | ok brad@
* Set Rx early threshold and Tx DMA thesholds.brad2006-10-261-3/+10
| | | | From Linux via FreeBSD
* use the Sundance TC9021 ids. this was done so that stge(4) will attachbrad2006-10-231-3/+3
| | | | properly with the sample boards and not have dmesg print unknown product.
* simplify interface flags ioctl handler.brad2006-08-041-7/+3
|
* only call the init routine if the interface is not already running.brad2006-07-121-17/+16
|
* move a few structures and macros over to the header file.brad2006-07-121-150/+1
|
* use config space macros.brad2006-07-121-91/+76
|
* check ifp->if_hardmtu instead of ETHERMTU.brad2006-07-121-2/+2
|
* increase the maximum Jumbo frame length and correct the STGE_MaxFrameSizebrad2006-07-121-1/+4
| | | | register address.
* show the number of DMA segments that were in the packet that just failedbrad2006-06-111-3/+3
| | | | to be mapped in stge_start().
* - remove ETHER_MAX_LEN_JUMBO and ETHERMTU_JUMBO.brad2006-05-281-2/+2
| | | | | | - use if_hardmtu for MTU ioctl handlers. ok reyk@
* unknown ioctl is ENOTTY not EINVALjason2006-05-281-2/+2
|
* allow bpf(4) to ignore packets based on their direction (inbound ordjm2006-03-251-3/+3
| | | | | outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
* do not inline pci_mapreg_map() anymore as it is olrite now; brad@ okmickey2005-09-111-5/+7
|
* Don't use a global variable to indicate that we arebrad2005-09-111-5/+6
| | | | | | stge1023. Use an sc member. From christos NetBSD