summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_vr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Get rid of "forever" loop in the interrupt handler such that we drop out of thekettenis2011-01-131-10/+6
| | | | | | | | 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@
* bus_dmamap_sync() freshly initialized Rx descriptors before flipping the bitkettenis2010-09-031-1/+5
| | | | | | | | | | | | | 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@
* BUS_DMA_ZERO instead of alloc, map, bzero.oga2010-05-191-3/+3
| | | | ok krw@
* Just some minor cleanup. OK deraadt@claudio2009-11-251-6/+1
|
* Consider any tx buffer that is freed in vr_stop() to be an unsentderaadt2009-11-251-1/+2
| | | | | | packet, ie. an output error. This way, we'll be able to see if the seized interfaces had tx packets queued. ok claudio
* Re-enable the debug messages from bus errors and tx underruns so thatderaadt2009-11-251-3/+1
| | | | | we can dianose if those ever happen. ok claudio
* Do not call vr_stop() and vr_reset() before calling vr_init(), becausederaadt2009-11-251-6/+1
| | | | | the latter does that itself. ok claudio
* - 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-16/+1
| | | | we now know the interface has already been stopped
* MCLGETI() will now allocate a mbuf header if it is not provided, thusderaadt2009-08-091-9/+3
| | | | | | reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
* Remove the if (1) that makes blambert@ cry. Appreciated blambert@claudio2009-06-181-7/+6
|
* MCLGETI support for vr(4) interfaces. This will make the newer soekris andclaudio2009-06-181-55/+62
| | | | | | 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@
* move redundant bus_dmamap_sync calls outside an if/else block.sthen2009-06-041-9/+8
| | | | from Brad; ok chris@
* Return the RX descriptor after pointing it to the new mbuf.mpf2009-05-291-2/+2
| | | | | | | 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@
* always set VR_RXCFG_RX_MULTI when setting the chip into promiscuoussthen2009-05-211-3/+2
| | | | | | | mode; VR_RXCFG_RX_PROMISC isn't enough to allow reception of multicast frames. Discussed with Brad, ok dlg@.
* cleanup and simplify promiscuous/multicast setup (setmulti -> iff).sthen2009-05-121-78/+43
| | | | from Brad; ok dlg.
* Fix the URL for datasheets.sthen2009-05-121-2/+2
|
* in the case where mbufs had to be copied _and_ checksums were enabled,sthen2009-05-111-10/+10
| | | | | m_head could be accessed after it had been freed, so do the access earlier. from chris@.
* preliminary parts for hw vlan tag insertion/removal, ideas gleaned fromsthen2009-05-111-5/+5
| | | | | | via rhinefet. not yet used, but committing now so it isn't lost. from chris@, ok dlg.
* On VT6105M, use hardware IP, TCP and UDP checksums in and out. Tested onsthen2009-05-111-13/+38
| | | | | | | | | 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@.
* Start using VR_RXSTAT_RX_OK instead of VR_RXSTAT_ERR (It existssthen2009-05-111-2/+2
| | | | | | | 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@.
* - fix whitespace problems (introduces no change with diff -w)sthen2009-05-101-25/+25
| | | | | | - s/FreeBSD/OpenBSD/ in comment, suggested by mpf no binary change.
* - use nitems() rather than handrolled version.sthen2009-05-101-4/+5
| | | | | - add HWTAG capability to the quirks table. not yet used. from chris@. no functional change.
* - change device matching to use a quirks table.sthen2009-05-101-44/+97
| | | | | | | | | | | | - 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.
* The previous change did not always update vr_link on rlphy(4) basedmpf2009-04-301-2/+2
| | | | | | interfaces. Therefore we now always start off with vr_link = 1. Bug found and feedback by Emilio Perea. OK sthen@
* The TX engine can get stuck if the interface went through a linkmpf2009-04-281-14/+33
| | | | | | | | state change. Workaround by resetting the chip if necessary. Also do not try to send packets if our link is down, as this triggers watchdog timeouts. While there correct the VR_RXSTAT_RX_OK define (not used yet). Changes inspired from FreeBSDs overhauled vr(4). Testing, input and OK sthen@
* make various strings ("can't map mem space" and similar) more consistentsthen2009-03-291-5/+5
| | | | | | | 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-24/+11
| | | | | | | | | | | | | | 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@
* Change m_devget()'s outdated and unused "offset" argument: It isnaddy2008-10-141-4/+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-9/+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@
* Fix a vr(4) panic that occurs under high load.mpf2008-09-241-2/+3
| | | | | | | | If the RX path runs into an out of mbuf scenario, the code will leave the RX chain with a NULL'd mbuf-slot. We now always reassign a valid mbuf, even if m_devget() fails. OK brad@, thib@
* 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@
* dont need malloc.h anymore; plus two tiny whitespace fixesthib2008-07-241-4/+3
|
* o Use mbufs, for the RX ring, instead of malloc()'ing an MCLBYTES sized buffer.thib2008-07-181-68/+95
| | | | | | | | | | | | | o On non-strict alignment archs, dont copy the mbuf, every time, unload it, and send it up the stack and just get a new one for the rx ring. We still do the copy on strict alignment archs though... o create a function to handle mbuf allocation for the rx ring, vr_mbuf_alloc(), use it to allocate the mbufs and shuffle the bus dma setup around. ideas/code from vic(4) and sis(4); ok reyk@, brad@, dlg@ tested by many, been in snapshots for a while.
* More timeout(9) usage cleaned up.mk2008-05-221-3/+2
| | | | ok claudio
* Add the SIOCSIFMTU ioctl to allow ioctl changes;thib2008-02-071-1/+7
| | | | ok brad@ (w/ comments), reyk@
* typos; ok jmc@martynas2007-11-261-2/+2
| | | | | sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
* In vr_attach() only touch the VR_STICKHW register if the adapterbrad2007-10-021-2/+4
| | | | | | | | | | | | | is found to have PCI power management capability. It has been found that unconditionally touching this register with the original VIA Rhine chipset, which does not have power management capability, and due to the shorter width of the IO addess space, it is possible for the vr(4) driver to do bad things with hw with IO address space adjacent to a vr(4) adapter. Tested by a few users, brad@ and jmc@. ok dlg@
* Remove the old software bit-banging MII interface, we started usingbrad2007-09-121-186/+2
| | | | | | | | | | the Rhine's shift registers four and a half years ago (1.31). From phk@FreeBSD ok dlg@ Tested by brad@ and Jacob Yocom-Piatt.
* Add VLAN reception support to vr(4). Diff from Brad.mglocker2007-09-011-1/+3
| | | | OK claudio@
* vr_rxeof(): stick receive error messages under VR_DEBUG.brad2006-11-031-4/+21
| | | | vr_init(): add debug printfs for some error conditions.
* vr_intr(): remove duplicate check for VR_ISR_RX_NOBUF and the "packet lost"brad2006-11-031-6/+3
| | | | printf which will never be reached.
* put a few printf's in the interrupt handler under VR_DEBUG.brad2006-09-221-2/+6
|
* add sys/timeout.hbrad2006-06-171-1/+2
|
* unknown ioctl is ENOTTY not EINVALjason2006-05-281-2/+2
|
* check for IFF_RUNNING being set before calling vr_init().brad2006-04-281-22/+12
|
* allow bpf(4) to ignore packets based on their direction (inbound ordjm2006-03-251-3/+4
| | | | | outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
* de-register.brad2006-03-201-3/+3
|
* move the devices list up a bit.brad2006-02-071-11/+11
|
* vr_start(): return if IFF_OACTIVE is set.brad2006-02-061-1/+4
| | | | From FreeBSD via Andrey Matveev