summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_vr.c
AgeCommit message (Collapse)Author
2013-12-28The few network drivers that called their children's (ie. mii PHYTheo de Raadt
drivers) activate functions at DVACT_RESUME time do not need to do so, since their PHYs are repaired by IFF_UP.
2013-12-06Add a DVACT_WAKEUP op to the *_activate() API. This is called after theTheo de Raadt
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
2013-08-21get rid of the copy argument in m_devget that let you provide anDavid Gwynne
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@
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@
2013-03-07remove spurious semicolon at end of if statement in vr_watchdog.Stuart Henderson
from oga@bitrig, ok dtucker
2013-02-09Programme the VT6105M, VT6105 and RhineII-2 to permit frames of up toStuart Henderson
1758 bytes (MTU 1740) and raise hardmtu to allow the user to set them. Tests by Mark Patruck, Michal Markowski, mikeb, beck, dtucker. ok mikeb@
2013-01-28Add TX interrupt mitigation for vr(4) chips, loosely based on FreeBSD,Darren Tucker
but with tweaks so it works on 6105Ms like those found in pcengines alix and soekris 5501s. ok sthen@, help brad chris mikeb dlg jsing There may be other 610x chips that would benefit from the VR_Q_INTDISABLE quirk, please send me a dmesg if you can confirm it works.
2013-01-17Don't try to access m_head after it may be freed (unlikely for VT6105M,Chris Cappuccio
but possible). Also don't re-calculate vlan tag repeatedly through the descriptor loop. ok dtucker@
2013-01-16fix typo in commentDarren Tucker
2013-01-16Add hardware VLAN tag/untag support for VT6105M chips. Help/feedback/okDarren Tucker
brad@ chris@ jsing@ kettenis@ mikeb@ sthen@
2013-01-16Keep a count of packets added to the chip's TX queue and only poke the chipDarren Tucker
if we've added a packet. Reduces CPU util a tiny bit. ok brad@ jsing@
2012-12-01Don't bother to zero initialize the if_capabilities field first andBrad Smith
then set the flags. Just set the flags as is done everywhere else. ok sthen@
2012-11-29Remove setting an initial assumed baudrate upon driver attach which is notBrad Smith
necessarily correct, there might not even be a link when attaching. ok mikeb@ reyk@
2012-11-23set ifp->if_baudrate with IF_Gbps() / IF_Mbps().Gleydson Soares
OK reyk@ sthen@
2012-11-15Do not try to transmit packets if the interface is not running.Joel Sing
ok chris@ deraadt@ dtucker@ mikeb@
2012-10-20Implement transmit DMA segments. The descriptor usage is from FreeBSD,Chris Cappuccio
which contradicts the datasheet (but actually works). Also, use a segment (instead of a new mbuf and data copy) to zero-pad small packets, modeled after if_myx. ok sthen@, gerhard@, henning@
2012-10-18Convert a number of old private copies of code which predatesTheo de Raadt
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
2012-09-18Wait until all xfers have finished before giving up DMA buffer mappings.Gerhard Roth
ok deraadt@, mikeb@
2012-01-30Remove redundant call to vr_reset. From Bryan Steele, ok mikeb@Stuart Henderson
2012-01-05suspend/resume support for vr(4); from brynet@gmail.comTheo de Raadt
2011-12-08add timeout to fill rx-ring in case of mbuf shortage while in vr_intr();Markus Friedl
fixes hanging interfaces similar to in myx(4); ok dlg@, claudio@, henning@
2011-06-22kill a few more casts that aren't helpful. ok krw miodTed Unangst
2011-04-20do not disable interrupts in the isr and then enable them againDavid Gwynne
when leaving. when you're handling an interrupt it is masked. whacking the chip is work for no gain. diff from chris@ tested by marco@ ok by me :)
2011-04-05mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUTHenning Brauer
ok claudio krw
2011-03-13Wake On LAN support for vr(4).Stefan Sperling
ok deraadt
2011-01-13Get rid of "forever" loop in the interrupt handler such that we drop out of theMark Kettenis
interrupt handler if the "no rx buffer available" bit is set and no new mbufs are available to populate descriptors. While it doesn't make livelock mitigation work for everybody, it does resolve some lockup issues. ok sthen@
2010-09-03bus_dmamap_sync() freshly initialized Rx descriptors before flipping the bitMark Kettenis
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. There are sme doubts whether the i386/amd64 bus_dmamap_sync() implementation will be able to convince future compilers that do even more insanely stupid optimizations from re-ordering stores. That will be addressed in a seperate patch. ok matthew@, sthen@, oga@
2010-05-19BUS_DMA_ZERO instead of alloc, map, bzero.Owain Ainsworth
ok krw@
2009-11-25Just some minor cleanup. OK deraadt@Claudio Jeker
2009-11-25Consider any tx buffer that is freed in vr_stop() to be an unsentTheo de Raadt
packet, ie. an output error. This way, we'll be able to see if the seized interfaces had tx packets queued. ok claudio
2009-11-25Re-enable the debug messages from bus errors and tx underruns so thatTheo de Raadt
we can dianose if those ever happen. ok claudio
2009-11-25Do not call vr_stop() and vr_reset() before calling vr_init(), becauseTheo de Raadt
the latter does that itself. ok claudio
2009-08-13- consistify cfdriver for the ethernet drivers (0 -> NULL)Jasper Lievisse Adriaanse
ok dlg@
2009-08-10A few more simple cases of shutdown hooks which only call xxstop, whenTheo de Raadt
we now know the interface has already been stopped
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-18Remove the if (1) that makes blambert@ cry. Appreciated blambert@Claudio Jeker
2009-06-18MCLGETI support for vr(4) interfaces. This will make the newer soekris andClaudio Jeker
Alix boards suck a little bit less because it will be harder to live lock them with traffic. Diff mostly adapted from sis(4). OK kettenis@, dlg@, sthen@
2009-06-04move redundant bus_dmamap_sync calls outside an if/else block.Stuart Henderson
from Brad; ok chris@
2009-05-29Return the RX descriptor after pointing it to the new mbuf.Marco Pfatschbacher
Otherwise the card can mess with mbufs that have been given to the stack already. Fixes panics seen with a high rate of of small packets and POOL_DEBUG enabled. OK sthen@, chris@
2009-05-21always set VR_RXCFG_RX_MULTI when setting the chip into promiscuousStuart Henderson
mode; VR_RXCFG_RX_PROMISC isn't enough to allow reception of multicast frames. Discussed with Brad, ok dlg@.
2009-05-12cleanup and simplify promiscuous/multicast setup (setmulti -> iff).Stuart Henderson
from Brad; ok dlg.
2009-05-12Fix the URL for datasheets.Stuart Henderson
2009-05-11in the case where mbufs had to be copied _and_ checksums were enabled,Stuart Henderson
m_head could be accessed after it had been freed, so do the access earlier. from chris@.
2009-05-11preliminary parts for hw vlan tag insertion/removal, ideas gleaned fromStuart Henderson
via rhinefet. not yet used, but committing now so it isn't lost. from chris@, ok dlg.
2009-05-11On VT6105M, use hardware IP, TCP and UDP checksums in and out. Tested onStuart Henderson
alix/net5501 with and without software vlan tagging, also with NFS (v2, v3, UDP, TCP). Not used on earlier chips and does not introduce problems on original EPIA board. From chris@, based on enhancements in the FreeBSD driver. "put it in then" dlg@, looks good to claudio@.
2009-05-11Start using VR_RXSTAT_RX_OK instead of VR_RXSTAT_ERR (It existsStuart Henderson
from the oldest vt86c100a datasheet to the newest vt6105m. FreeBSD indicates that it is more reliable than VR_RXSTAT_ERR for detecting error conditions, that its use results in less incorrectly dropped packets). From chris@.
2009-05-10- fix whitespace problems (introduces no change with diff -w)Stuart Henderson
- s/FreeBSD/OpenBSD/ in comment, suggested by mpf no binary change.
2009-05-10- use nitems() rather than handrolled version.Stuart Henderson
- add HWTAG capability to the quirks table. not yet used. from chris@. no functional change.
2009-05-10- change device matching to use a quirks table.Stuart Henderson
- avoid the need for unnecessary mbuf copies on modern vr(4) devices (ancient ones required longword-alignment, but this has not been the case for several generations now). reduces cpu time, particularly for forwarded traffic. from chris@. tested by chris@, myself, Emilio Perea on various devices including original VIA EPIA, Soekris net5501, pcengines.ch ALIX. ok mpf. deraadt and dlg agree with committing at this stage.
2009-04-30The previous change did not always update vr_link on rlphy(4) basedMarco Pfatschbacher
interfaces. Therefore we now always start off with vr_link = 1. Bug found and feedback by Emilio Perea. OK sthen@