summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_otus.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* we don't have to cast to caddr_t when calling m_copydata anymore.dlg2021-02-251-2/+2
| | | | | | | | | | | | | | | | the first cut of this diff was made with coccinelle using this spatch: @rule@ type caddr_t; expression m, off, len, cp; @@ -m_copydata(m, off, len, (caddr_t)cp) +m_copydata(m, off, len, cp) i had fix it's opinionated idea of formatting by hand though, so i'm not sure it was worth it. ok deraadt@ bluhm@
* Fix deferred key tasks along the same lines as urtwn(4) and run(4).krw2020-11-301-4/+21
| | | | | | | athn(4) tested by stsp@, who points out that otus(4) and rsu(4) don't yet invoke the code path to do their own key setting. ok stsp@
* Nuke all occurrences of usbd_abort_pipe() if it gets called rightmglocker2020-07-311-4/+2
| | | | | | | | | | before usbd_close_pipe(), since usbd_close_pipe() already takes care about aborting non-empty pipes. As investigated by gerhard@ usbdi.c rev. 1.57 did add usbd_abort_pipe() to usbd_close_pipe(), but the drivers didn't get cleaned up afterwards. ok gerhard@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-101-2/+2
| | | | | | "new" API. ok dlg@ tobhe@
* Convert tsleep(9) that wait for a multiple of `hz' to tsleep_nsec(9).mpi2019-11-121-2/+2
| | | | ok cheloha@
* Make wireless drivers call if_input() only once per interrupt.stsp2019-09-121-5/+9
| | | | | | | | | | | | | | This reduces drops caused by the ifq pressure drop mechanism and hence increases throughput. Such drops are visible with e.g. 'netstat -dnI iwm0'. Not all affected drivers have been tested yet but these changes are largely mechanical and should be safe. As usual, please report any regressions. With help from dlg@ and mpi@ Problem found by robert@ Tested by robert, jmc, Tracey Emer, Matthias Schmidt, florian, Björn Ketelaars ok mpi@
* Make otus(4) modify its DMA_TRIGGER register with readable macrosstsp2019-01-151-3/+3
| | | | | instead of magic numbers. No functional change. ok kettenis@
* Fix potential use-after-free if xfer allocation fails when otus(4) attaches.stsp2019-01-121-1/+2
| | | | ok mpi@ ian@
* Make the scan loop in otus(4) terminate properly when the interfacestsp2019-01-121-2/+5
| | | | | is going down. Problem reported by ian@. ok mpi@ ian@
* Move common code to add/remove multicast filters to ieee80211_ioctl(9).mpi2017-10-261-11/+1
| | | | ok jsg@, stsp@
* Make otus(4) drop frames larger than MCLBYTES.stsp2017-07-201-1/+6
| | | | | Problem reported by Ilja Van Sprundel. ok deraadt@ tb@
* Replace slot time durations with macros.kevlo2017-07-031-2/+3
| | | | ok stsp@
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-2/+3
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* Add sizes to various free(9) calls. Fixing the simpler ones first.deraadt2017-03-261-4/+5
| | | | ok natano visa
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+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@
* Avoid calling usbd_set_config_no() in *_attach() and let the stack dompi2016-11-061-8/+2
| | | | | | | | | it instead. If anything bad happen due to a malformed descriptor it makes no sense to try to attach a driver, and bail before probing. This is similar to the change to avoid calling usbd_set_config_index().
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* Replace mountroothook_establish(9) by config_mountroot(9) a narrower APImpi2015-12-111-8/+5
| | | | | | similar to config_defer(9). ok mikeb@, deraadt@
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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@
* No need to include <net/if_arp.h>mpi2015-11-241-2/+1
| | | | | | | | | This header is only needed because <netinet/if_ether.h> declares a structure that needs it. But it turns out that <net/if.h> already includes it as workaround. A proper solution would be to stop declarting "struct ether_arp" there. But no driver should need this header.
* The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.mpi2015-11-241-2/+1
|
* replace the ifqueues in net80211 with mbuf_queues.dlg2015-11-041-2/+2
| | | | | | | | the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw had its own queue for beacons. tested by mpi@ and jmc@ ok mpi@
* arp_ifinit() is no longer needed.mpi2015-10-251-5/+1
|
* 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@
* Wireless drivers call if_input() via ieee80211_input() which set `rcvif'mpi2015-02-101-2/+1
| | | | | | | on every received mbuf, so there's no need to initialize this pointer in the drivers. Tested by and ok phessler@
* unifdef INETtedu2014-12-221-3/+1
|
* Use <sys/endian.h> instead of <machine/endian.h>guenther2014-12-191-2/+2
| | | | ok dlg@ mpi@ bcook@ millert@ miod@
* No need for <netinet/in_systm.h> here.mpi2014-07-131-3/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* Kill a bunch of DVACT_DEACTIVATE handlers whose only purpose were tompi2014-07-121-18/+2
| | | | | | | | | | | | | | set the 'dying' flag of a device. Such handlers are useless now that usbd_detach() already set this flag. Even if the purpose of this flag is questionnable on OpenBSD because DVACT_DEACTIVATE acts as a pre-detach event, this is just a first small step towards the simplification of the autoconf(9) device states. This cleaning is now possible thanks to the work of pirofti@ to convert all the USB drivers to properly use usbd_is_dying(). Discussed many times with deraadt@
* Stop abusing the rcvif pointer to pass wireless nodes down to thempi2014-03-191-2/+2
| | | | | | | | | | driver start routines. Instead add & use a pointer in the pkthdr since we don't want the overhead of using a mbuf_tags(9). claudio@ pointed out that other subsystems might want to use this pointer too, so here's a new cookie! ok claudio@, mikeb@, deraadt@
* Do not define per-driver DEBUG variable when USB_DEBUG is defined. It'smpi2014-03-071-5/+1
| | | | | really impossible to debug the USB stack when any single device you plug in your machine starts to vomit its own poetry,
* 1 << 31 cleanup. Eitan Adler pointed out that there has been aderaadt2013-11-261-2/+2
| | | | | resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
* Instead of comparing the lower and higher addresses of all the multicastmpi2013-11-051-6/+4
| | | | | | | | entries to decide if the IFF_ALLMULTI flag should be set, check if there is at least one real range between them. This should not introduce any behavior change but will help changing our representation of multicast entries.
* 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@
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-7/+7
| | | | | | | | | definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
* Instead of using a wrapper around usbd_transfer() when submitting ampi2013-04-121-3/+4
| | | | | | | transfer synchronously just pass the USBD_SYNCHRONOUS flag like any other flags when creating a transfer. ok sthen@, mglocker@
* Cleanup false positives for uninitialized uses.haesbaert2012-10-121-2/+4
| | | | | | Part of the work to remove -Wno-uninitialized. ok blambert jsg
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-4/+1
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* now that usb_wait_task() is back, bring back recently revertedjakemsr2011-02-101-12/+36
| | | | | | | | | | | | | changes: * use usb_ref_{incr,decr,wait}() to avoid detaching the driver while a process is still using the hardware. * don't add timeout(9)s if the device is detached. * add checks to see if the device has been detached before running ioctls, timeouts, and tasks. * use usb_wait_task() to wait for tasks to complete. ok damien@
* revert usb.c to r1.72, and all subsequent changes that depend on it.jakemsr2011-02-091-36/+12
| | | | this is causing problems with suspend/resume for some people.
* * use usb_ref_{incr,decr,wait}() to avoid detaching the driver while ajakemsr2011-02-051-12/+36
| | | | | | | | | | process is still using the hardware. * don't add timeout(9)s if the device is detached. * add checks to see if the device has been detached before running ioctls, timeouts, and tasks. * use usb_wait_task() to wait for tasks to complete. ok damien@
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-5/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* Remove dead links.damien2011-01-061-3/+2
| | | | Atheros have reworked their website.
* * add cfattach activate functions and call usbd_deactivate() in thejakemsr2010-12-271-2/+21
| | | | | | | | DVACT_DEACTIVATE case for drivers that don't have activate finctions * fill out cfattach activate functions and call usbd_deactivate() in the DVACT_DEACTIVATE case for drivers that don't have a dying flag "ok with the intent" miod@
* in otus, tx() can return on error without releasing the nodedamien2010-10-301-2/+4
| | | | | so release the node in the caller (if_start) instead and do the same in run(4) for consistency.
* always decrement the number of xfers queued in txeof() evendamien2010-10-301-3/+5
| | | | if transfer failed.
* don't release the node twice if tx() failsdamien2010-10-301-2/+1
|
* use (ifp->if_softc != NULL) instead of (ifp->if_flags != 0) to checkdamien2010-10-301-2/+2
| | | | | if interface was attached. both are correct but this is for consistency with other drivers.
* check that a timeout(9) has been initialized before deleting itjakemsr2010-10-231-3/+5
| | | | ok phessler