summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_lii.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-4/+2
| | | | | | | 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
|
* 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@
* Convert lii(4) to if_input().jsing2015-04-111-8/+5
| | | | ok mpi@
* 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
|
* Set the MRU to a full size frame instead of basing it on the MTU.brad2014-08-301-3/+2
| | | | ok dlg@
* 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
* Move setting of reception of broadcast packets from lii_init() intosthen2010-09-191-4/+9
| | | | | lii_iff() to be consistent with age/alc and other drivers. No functional change. From Brad, tested by oga@.
* Add DVACT_QUIECE support. This is called before splhigh() and beforederaadt2010-08-311-2/+5
| | | | | | | | 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.
* remove the unused if_init callback in struct ifnetjsg2010-08-271-2/+1
| | | | ok deraadt@ henning@ claudio@
* ca_activate function brings eeepc701 network back after resume.deraadt2010-07-261-2/+27
| | | | tested by oga
* When initialising the chip actually set the hardware MAC address, thusjsing2010-02-081-1/+8
| | | | allowing the MAC address to be changed/set via ifconfig.
* Use nitems.jsing2010-02-031-2/+2
|
* Bring multicast/promisc handling in line with other network drives.jsing2009-11-241-14/+12
| | | | From Brad.
* Remove erroneous spaces.jsing2009-04-121-3/+3
| | | | From brad
* make various strings ("can't map mem space" and similar) more consistentsthen2009-03-291-8/+8
| | | | | | | between instances, saving space in the kernel. feedback from many (some incorporated, some left for future work). ok deraadt, kettenis, "why not" miod.
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-10/+4
| | | | | | | | | | | | | | 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@
* If we fail to read the MAC address from the eeprom, fallback to readingjsing2008-10-071-11/+8
| | | | | | | | the MAC address registers. In most cases these already have the correct MAC address. This should address PR5743. Thanks to Rodolfo Gouveia for testing earlier diffs. ok dlg@
* First step towards cleaning up the Ethernet driver ioctl handling.brad2008-10-021-10/+4
| | | | | | | | | | | | | | | | | | | | 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@
* Finish the rest... ATL2 -> LIIbrad2008-09-011-75/+75
| | | | ok jsing@
* Remove clause 3 from NetBSD license.jsing2008-07-171-4/+1
| | | | ok deraadt@
* Teach lii(4) how to clean up after itself.jsing2008-06-301-25/+30
| | | | ok dlg@
* Rename access macros so that they match the driver name.jsing2008-06-101-77/+77
| | | | ok dlg@
* Add multicast support to lii(4), with suggestions/changes from brad@.jsing2008-05-201-22/+53
| | | | ok brad@ dlg@
* - Use pci_matchbyid().brad2008-05-151-19/+12
| | | | | | - Simplify the use of pci_mapreg_map(). ok jsing@
* The driver is called lii, not atl2. Change function and variable names tojsing2008-05-131-116/+116
| | | | | | match. go go go dlg@
* Ensure that we wrap around to the start of the TXD buffer when incrementingjsing2008-04-031-2/+2
| | | | | | the TXD pointer beyond the end. Fixes PR5786.
* Add code to configure the vendor specific opcodes of the SPI Flash.jsing2008-03-301-2/+53
| | | | | | From NetBSD. ok dlg@
* Enable setting of interrupt timers.jsing2008-03-301-3/+1
| | | | ok dlg@
* Pad the RXD buffer so that packets are aligned on a 128-byte boundary. Thisjsing2008-03-301-6/+11
| | | | | | | | | | prevents the chip from hard locking the machine when receiving packets. Diff committed from an ASUS EeePC using lii(4). From NetBSD. ok dlg@
* even better attach message locationderaadt2008-01-051-4/+4
|
* print info in attach before if_attachderaadt2008-01-051-5/+3
|
* read the hardware mac address into the drivers ac_enaddr thing rather thandlg2008-01-041-4/+3
| | | | a useless buffer. should hook the mac address up.
* we have pci_vpd_read now. get rid of the (bad) comment that left it outdlg2008-01-041-3/+2
| | | | pointed out by deraadt@
* use OpenBSD rcs id'sjasper2007-12-311-1/+1
|
* lii(4) is a driver for the atheros l2 ethernet chip as found on the asusdlg2007-12-311-0/+1087
eeepc. unfortunately it doesnt work, but its going into the tree so it can be worked on. if anyone wants to have a go at it, please do. this driver was written by Quentin Garnier for NetBSD