summaryrefslogtreecommitdiff
path: root/sys/dev/ic/hme.c
AgeCommit message (Collapse)Author
2015-11-24No need for "vlan.h" if you don't check for "#if NVLAN > 0".Martin Pieuchot
2015-11-20shuffle struct ifqueue so in flight mbufs are protected by a mutex.David Gwynne
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@
2015-10-25arp_ifinit() is no longer needed.Martin Pieuchot
2015-09-11Make room for media types of the future. Extend the ifmedia word to 64 bits.Stefan Sperling
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
2015-06-24Increment if_ipackets in if_input().Martin Pieuchot
Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
2015-03-30Convert to if_input(), tested by sebastia@.Martin Pieuchot
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-22unifdef INETTed Unangst
2014-11-27Garbage collect some bits that were never used.Brad Smith
ok mikeb@
2014-11-27rxr ioctl handling.Brad Smith
2014-07-22Fewer <netinet/in_systm.h>Martin Pieuchot
2014-07-08cut things that relied on mclgeti for rx ring accounting/restriction overDavid Gwynne
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@
2014-06-17ansi function declarations.David Gwynne
ok gcc sha256
2014-04-22Remove RX checksum offloading support. The chip is too limited, andChristian Weisgerber
examining higher protocol layers to adjust the checksum and calculate the pseudo-header in the driver is too complex to be worthwhile. ok henning@
2013-08-07Most network drivers include netinet/in_var.h, but apparently theyAlexander Bluhm
don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
2011-07-05When the kernel runs out of mbuf clusters, the hme receive ring mayAlexander Bluhm
become empty. In that case, the hme driver could not recover as the ring was only filled after receiving data. Check and potentially fill an empty receive ring every second in hme_tick(). ok kettenis@
2009-10-15Add detach support to a few more drivers, and in others do the neccessaryTheo de Raadt
operations in the detach function in the right order. Also ensure that the interrupt handlers not trust registers that go away. read over very carefully by dms, tested by me
2009-08-10More cases of shutdown hooks not needed after card is already stopped. InTheo de Raadt
these cases the xxstop function is a bit more complicated and has a flag of some sort, but the use of that flag does not matter; DMA is already ceased ok dlg
2009-08-09MCLGETI() will now allocate a mbuf header if it is not provided, thusTheo de Raadt
reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
2009-06-22Tidy up promiscuous mode and multicast handling; tested by Simon KuhnleStuart Henderson
and myself. From Brad.
2009-06-11Simplify the ioctl handling code. From Brad.Stuart Henderson
Tested by myself and Simon Kuhnle.
2009-04-23Clear IFF_RUNNING and IFF_OACTIVE flags and cancel watchdog timer inMark Kettenis
hme_stop(). From Brad.
2009-04-17Switch hme(4) over to using MCLGETI when allocating mbufs for the RX ring.Mark Kettenis
tested by okan@, sthen@
2008-12-10Replace m_free() with m_freem() in foo_start() to ensure that upon errorBrad Smith
the full mbuf chain is freed. ok claudio@ kettenis@
2008-11-28Eliminate the redundant bits of code for MTU and multicast handlingBrad Smith
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@
2008-11-26Use bus_dmamap_load_mbuf instead of loading mbuf fragments ourselves, andMark Kettenis
use m_defrag to linearize packets that don't fit in 16 segments. ok claudio@
2008-10-02First step towards cleaning up the Ethernet driver ioctl handling.Brad Smith
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@
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
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@
2007-11-18revert previous commit as requested by kettenis and deraadt.Brad Smith
2007-11-18remove use of static.Brad Smith
ok dlg@
2006-12-21betetr yet, just nuke sc_enaddr all together, just fill in arpcom andJason Wright
everybody is happy
2006-12-21better yet, nuke all references to sc_enaddr except for the copy into ↵Jason Wright
arpcom.ac_enaddr
2006-12-21use the arpcom copy of the ethernet address so that updates to lladdr can workJason Wright
2006-06-25fix a typo in a comment and add the comment to the sparc hme driver.Brad Smith
2006-03-25allow bpf(4) to ignore packets based on their direction (inbound orDamien Miller
outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
2006-01-12- add a missing htons() to the receive checksum routine to fixBrad Smith
checksumming on little endian systems. - only set the Ok flag in the checksum routine. Checksumming fix from: Pyun YongHyeon <pyunyh at gmail dot com>
2005-12-16a little quieterBrad Smith
2005-10-21tidy up dmesg printing a bit, makes PCI hme only take 2 linesBrad Smith
per interface instead of 3.
2005-06-26rev 1.29Brad Smith
hme_init(): call mii_mediachg() to make sure the current media is set. From NetBSD
2005-06-08disable RX checksum offload until its fixed on little endian systemsBrad Smith
2005-04-25csum -> csum_flagsBrad Smith
ok krw@ canacar@
2005-02-04add hme(4) RX TCP/UDP checksum offloadBrad Smith
From a diff posted to sparc@ by Pyun YongHyeon ok dlg@, tested by mickey@ "i get some badass improvement here." and a few other users.
2005-01-15make sure interface is in RUNNING state before touching the multicast filtersBrad Smith
From NetBSD NetBSD PR 27678 for details ok mcbride@
2004-09-28- Use ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN instead of HME_MTUBrad Smith
- Use ETHER_CRC_POLY_LE instead of MC_POLY_LE from hmereg.h
2004-08-08do not reset the chip (and subsequently the phy) when unnecessary; that is,Brad Smith
for address changes, multicast filter changes, or adjusting promiscuous mode. Fixes resetting the phy for things like start/stopping tcpdump. From NetBSD tested by me, miod@, otto@ and a few others. ok deraadt@
2004-05-31Don't reinvent the wheel, use ether_crc32_le() instead.Ryan Thomas McBride
2004-05-12network drivers don't need to include bpfdesc.hTed Unangst
ok krw@ canacar@
2003-06-18we already set the rx descriptor length to accept vlan packets... justJason Wright
need to advertise the capability; tested by tsar at polarcap dot org
2003-04-27strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.Hakan Olsson