summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_vge.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-5/+5
| | | | ok dlg@ tobhe@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-101-2/+2
| | | | | | "new" API. ok dlg@ tobhe@
* consistently uppercase pci product definesjsg2020-01-051-2/+2
| | | | ok mpi@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-3/+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
|
* 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
|
* rework vge_start to avoid IFQ_POLLdlg2015-11-161-54/+34
| | | | | | | | | | | | | | | | | | | | firstly, this checks for space in the tx ring before looking at the send queue. if there's no space, then IFF_OACTIVE is set and break. if there's space use IFQ_DEQUEUE to pull a packet off. if we fail to encapsulate it, it gets dropped. encap has been changed so the dmamaps the mbufs are loaded into are created with 7 segments instead of 32. this means we detect when the packet would overflow the tx descriptor at dmamap load time, rather than after we've looped over the segments writing them into the descriptor. we now use m_defrag to defrag the mbuf instead of allocating a new one and using m_copydata. now if we have any encap error on the first mbuf, we no longer set IFF_OACTIVE and wait for an interrupt that never comes to clear it. testing and (excellent) code review by richard proctor
* 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-4/+1
|
* Make room for media types of the future. Extend the ifmedia word to 64 bits.stsp2015-09-111-2/+2
| | | | | | | | | | | | | | | | This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and grows struct ifmediareq. Old ifconfig and dhclient binaries can still assign addresses, however the 'media' subcommand stops working. Recompiling ifconfig and dhclient with new headers before a reboot should not be necessary unless in very special circumstances where non-default media settings must be used to get link and console access is not available. There may be some MD fallout but that will be cleared up later. ok deraadt miod with help and suggestions from several sharks attending l2k15
* Increment if_ipackets in if_input().mpi2015-06-241-3/+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-2/+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-04-081-7/+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
|
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* 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 receive filter handling and ioctl bits.brad2013-03-151-83/+46
| | | | ok sthen@
* Add some missing bits for flow control support and enable it.brad2013-03-141-5/+22
| | | | | | Tested with PCI and PCIe vge(4). ok sthen@
* 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@
* set ifp->if_baudrate with IF_Gbps() / IF_Mbps().gsoares2012-11-231-2/+2
| | | | OK reyk@ sthen@
* kill a few more casts that aren't helpful. ok krw miodtedu2011-06-221-8/+7
|
* mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUThenning2011-04-051-3/+3
| | | | ok claudio krw
* use nitems(); no binary change for drivers that are compiled on amd64.jasper2011-04-031-2/+2
| | | | ok claudio@
* remove the unused if_init callback in struct ifnetjsg2010-08-271-2/+1
| | | | ok deraadt@ henning@ claudio@
* Don't print "EEPROM reload timed out" message. Devices that don't have ankettenis2010-02-241-6/+1
| | | | | | | EEPROM exist (RouterBOARD RB600A) and reloading default values from the EEPROM will fail on those decives. ok deraadt@
* Make vge(4) detachable.kettenis2009-11-231-5/+58
| | | | ok jsg@, deraadt@
* Make sure the MAC address is correct on big-endian platforms if it isn't readkettenis2009-09-041-8/+3
| | | | | | from the EEPROM. ok miod@
* - consistify cfdriver for the ethernet drivers (0 -> NULL)jasper2009-08-131-2/+2
| | | | ok dlg@
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-19/+10
| | | | | | | | | | | | | | 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@
* Re-add support TX VLAN tag insertion and RX VLAN tag stripping.brad2008-10-221-1/+35
| | | | Tested by Dawe <dawedawe at gmx dot de>
* Change m_devget()'s outdated and unused "offset" argument: It isnaddy2008-10-141-5/+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-8/+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@
* More timeout(9) usage cleaned up.mk2008-05-221-3/+3
| | | | ok claudio
* Since Ethernet links can only be full duplex or half duplex the linkbrad2008-05-131-4/+2
| | | | | | | | state reporting code in the MII layer / em(4) and vge(4) will never fall back to the point of only reporting the link as being UP without the duplex setting being reported, so simplify the code a bit here. ok dlg@
* - Remove disabled and unusable HW VLAN tagging code.brad2007-12-111-34/+4
| | | | | | | | - Remove setup of the HW VLAN stripping. Issue reported by and fix tested by henric@ ok dlg@
* Fix some obviously bogus code in vge_newbuf(). Should fix PR 5582.kettenis2007-10-101-6/+8
| | | | ok claudio@
* Missing braces in vge_tick(). Fixes link state announcements.canacar2007-05-011-2/+3
| | | | ok reyk@
* report full/half duplex state for non-MII interfacesreyk2006-12-041-2/+7
| | | | ok brad@
* OpenBSD-ify the HW VLAN tag insertion code.brad2006-11-231-5/+12
|
* don't always leave the mbuf on the if_snd queue if vge_encap() fails.damien2006-11-141-16/+17
| | | | | | | | | | | if the mbuf is coalesced in vge_encap(), the mbuf reference is no longer valid. drop the mbuf in this case. bug introduced in r1.28 tested by Frank Denis fixes kernel/5291 "go for it" deraadt@
* s/Mhz/MHz/ in comments and printf() stringstom2006-10-191-2/+2
| | | | ok jsg@
* don't use IF_PREPEND() on altq's.damien2006-10-031-3/+3
| | | | | | | use IFQ_POLL()/IFQ_DEQUEUE() logic instead as described in altq(4). tested by jolan@ on macppc "diffs look ok" brad@
* do not bother playing tag with the PCI_COMMAND_STATUS_REGkettenis2006-07-281-16/+4
| | | | tested by jolan@, ok brad@
* add sys/timeout.hbrad2006-06-171-1/+2
|
* rev 1.13 fixed the MTU ioctl handler to allow adjusting the MTUbrad2006-06-131-1/+3
| | | | | | but it seems Jumbo support is broken, so disable Jumbos for now. issue reported by jolan@