summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_athn_usb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Avoid unnecessary dynamic memory allocation in athn_usb_newauth().stsp2018-12-061-10/+5
| | | | | Patch by Benjamin Baier ok ratchov@ mpi@
* fix whitespacejsg2018-09-061-3/+3
|
* claim copyrightstsp2018-02-051-1/+2
|
* Move athn(4) USB devices to the open source atk9k HTC firmware.stsp2018-02-051-67/+361
| | | | | | | | | Also fix support for AR7010 devices, fix mode hostap by properly managing the firmware station table, and fix Tx rate reporting. Tested on AR7010 and AR9271 devices. ok kevlo@
* Move common code to add/remove multicast filters to ieee80211_ioctl(9).mpi2017-10-261-11/+1
| | | | ok jsg@, 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-5/+6
| | | | 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@
* Finish initial 11n support for athn(4).stsp2017-01-121-21/+22
| | | | | | | | | | | The heavy lifting was done by damien@ years ago. I didn't even have to figure out what the hardware expects, the code was already there. This driver now supports MCS 0-15 in client and hostap mode. No Tx aggregation and no 40 MHz channels yet. tested by vgross@, bmercer@, tb@, jmc@, Vadim Vygonets, Peter Kay ok bmercer@ tb@ phessler@
* m_free() and m_freem() test for NULL. Simplify callers which had their ownjsg2016-11-291-3/+2
| | | | | | NULL tests. ok mpi@
* 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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
|
* Revert previous, doesn't fix anything. I managed to reproducestsp2015-07-091-5/+4
| | | | | the problem on one of my machines and the patch doesn't help. See http://marc.info/?l=openbsd-tech&m=143645936727569&w=2
* Allow more time for USB athn(4) firmware boot. It seems people on daemonforumsstsp2015-07-091-4/+5
| | | | | | | | | are running into the previous 1 second timeout on some machines, which the driver will treat as fatal. Not sure if this will really fix the issue but it won't hurt. Also reported in NetBSD land which inherited our driver: http://mail-index.netbsd.org/current-users/2014/05/06/msg024793.html ok mpi@
* Only match devices with a valid configuration.mpi2015-06-121-18/+4
| | | | | | | | Most of the WiFi/Ethernet USB adapter only have one configuration and always use its first interface. In order to improve USB descriptors parsing start by reducing the number of places where a configuration is set. Tests & ok stsp@
* Remove stray ')' from athn(4) "firmware command timed out" error message.stsp2015-03-021-2/+2
|
* athn(4) USB drops received frames larger than MCLBYTES.stsp2015-03-021-1/+7
| | | | Count these dropped frames as input errors.
* Fix re-associations with athn(4) USB devices in station mode.stsp2015-03-021-6/+23
| | | | | | | | | | | | Sending the firmware a NODE_ADD command for our BSS doesn't seem to have the desired effect in station mode. It made a new association after ifconfig down/up impossible until the device was re-plugged. Leave the code in place but limit it to hostap mode, just in case it is needed there (hard to tell since hostap mode seems to be broken -- no beacons are sent by the device). Also, when leaving run state, reset the RX filer to allow all beacons again. ok mpi@
* Rework ath(4) USB firmware command handling.stsp2015-03-021-29/+54
| | | | | | | | | | | | | | | | | | | The previous code was racy and could dead-lock the USB task thread when a firmware command timed out (e.g. because the user pulled out the device). Handle this condition by marking the device as dying as soon as the interrupt handler gets an IOERROR and making sleeping firmware command threads check for a dying device when waking up. Ensure that no thread will try to send a command before the previous one has completed. There is only a single xfer data structure for firmware command transfers and reusing an in-flight xfer will give the USB stack curly toenails ("xfer not free"). Allow up to ATHN_USB_HOST_CMD_RING_COUNT firmware commands to be enqueued on the command ring, rather than just one. Use standard usdb_wait_task() when waiting for command ring completion instead of hand-rolled tsleep()s. discussed with and ok mpi@
* Fix scanning with athn(4) USB devices.stsp2015-03-021-5/+32
| | | | | | | | | | | | | | | | | The driver artificially limited the number of slots for nodes in its net80211 node cache to 8, the rationale being the device firmware can only handle 8 associated nodes at a time. But that's not a good reason to only cache 8 of potentially many APs in the area. Instead of crippling upper layer data structures, impose the limit locally by raising an error if more than 8 nodes are trying to associate (which can only happen in hostap mode, and hostap mode seems to be broken anyway). This matches what Linux ath9k does. Also, use a USB-specific scan timeout callback to we can do USB refcounting while scanning. ok mpi@
* In athn(4), set USB pipe pointers to NULL after closing pipes. Not reallystsp2015-03-021-6/+14
| | | | | | | required since this code runs during device detach but looks prettier. Also remove an unneeded call to usbd_abort_pipe() which is implied by usbd_close_pipe(). ok mpi@
* Teach athn(4) about USB reference counting to prevent it from causing majorstsp2015-03-021-2/+18
| | | | | confusion in the USB stack. Also add some usbd_is_dying checks. suggested by + ok mpi@
* 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@
* atheros ub94 support, from Matt Markforttedu2014-10-311-1/+3
|
* 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-4/+4
| | | | after discussions with beck deraadt kettenis.
* Kill a bunch of DVACT_DEACTIVATE handlers whose only purpose were tompi2014-07-121-17/+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@
* 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@
* Replace more ovbcopy with memmove; swap the src and dst arguments tooderaadt2013-06-111-2/+2
|
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-11/+11
| | | | | | | | | 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@
* Fix USB athn(4) to be able to build on the RAMDISK. RAMDISK has SMALL_KERNELbrad2013-04-051-1/+3
| | | | | | | | so there is no HostAP. athn_usb_newassoc() would return if not in HostAP mode so just stub out the function and don't build the callback function for the RAMDISK. ok deraadt@
* removed unneccessary .h filederaadt2013-03-281-2/+1
|
* Fix the sotfware.jsing2013-01-141-2/+2
|
* Call the correct callback on node disassociation.jsing2013-01-141-2/+2
|
* protect rxeof path with an splnet; ok kettenismikeb2012-11-121-1/+5
|
* add a flag indicating whether shared code was initialized so that wemikeb2012-11-101-2/+4
| | | | can prevent calling athn_detach if it wasn't; suggestion and ok stsp
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-3/+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
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-4/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* reserve one xfer for beacons during init.damien2011-01-081-7/+9
|
* fix LEDs handling.damien2011-01-081-7/+6
| | | | | | | do not read back the LED GPIO pin since it is configured in output only mode. makes the link LED blink on the WiFiStation EXT when scanning (the LEDs indicating the signal strength are not working yet).
* cleanup athn_usb_rx_frame().damien2011-01-061-28/+32
| | | | remove padding after 802.11 header if any.
* implement fast channel change.damien2011-01-061-16/+26
| | | | | | this dramatically reduces the number of register reads/writes and thus the number of context switches when changing channel. makes scanning much faster.