summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r331797:brooks2018-04-081-1/+2
| | | | | | | | | | | | Use an accessor function to access ifr_data. This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900
* MFC r321838:pfg2017-08-041-1/+2
| | | | | | | | sys/net8021: Add missing braces in setcurchan(). Also fix some indentation. Obtained from: DragonFlyBSD (git c69e37d6)
* MFC r304322:bdrewery2016-08-241-0/+2
| | | | [net80211] correctly lock the ifp before accessing the lladdr.
* net80211: restore interface state check for IEEE80211_IOC_SCAN_REQ ioctl.avos2016-05-191-0/+5
| | | | | | | | | Do not try to start a scan when interface is not running. How-to-reproduce: 1) ifconfig wlan0 create wlandev urtwn0 2) wlandebug -i wlan0 state 3) ifconfig wlan0 scan
* sys/net*: minor spelling fixes.pfg2016-05-031-2/+2
| | | | No functional change.
* net80211: fix MAC address change via SIOCSIFLLADDR ioctl.avos2016-05-021-1/+11
| | | | | | | Recheck MAC address on SIOCSIFFLAGS; as a result, 'ifconfig wlan0 ether <addr>' can be used after interface startup. PR: 208933
* [net80211] add the STBC ioctl support.adrian2016-04-261-0/+32
| | | | This adds configurable STBC TX and RX support.
* net80211: enable promiscuous mode state change for non-monitor/ahdemo modesavos2016-04-211-4/+20
| | | | | | | | | | | | | | | - Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by user (ifconfig wlan0 promisc), or; * interface is in MONITOR or AHDEMO mode. - Drop local workarounds in mwl(4) and malo(4). Tested with: - Intel 3945BG, STA mode; - RTL8188CUS, MONITOR mode; Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5472
* net80211: provide descriptions for reason codesavos2016-04-201-4/+6
| | | | | | | | | Add text description for deauth/disassoc/etc reason codes in addition to 'reason: <number>' string. Reviewed by: adrian Obtained from: IEEE Std 802.11-2012, 8.4.1.7 "Reason Code field" Differential Revision: https://reviews.freebsd.org/D5367
* [net80211] put in a comment about the not-quite-correctness of A-MPDU ↵adrian2016-04-181-0/+8
| | | | | | | | | | | | | | | | | parameters. Although we correctly (now!) calculate the right A-MPDU parameters, the ioctl() has some faulty logic for choosing which to display. The BSS params are what were advertised to us, and we would have chosen the lower of theirs/ours when advertising the HT bits back at them. So, we /should/ track and fix that so we display the correct A-MPDU density and size. However, since I'm a forgetful type, and I don't want to have to re-learn that this is wrong, drop in a comment so I or someone else fixes it. Or, when I discover this again in 4 years, I don't have to go digging too much to remember.
* net80211: fix 'taskqueue_drain with non-sleepable locks held' warningavos2016-02-281-3/+9
| | | | | | | Do not run ieee80211_waitfor_parent() when it's not needed. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5446
* These files were getting sys/malloc.h and vm/uma.h with header pollutionglebius2016-02-011-0/+1
| | | | via sys/mbuf.h
* net80211: reduce stack usage for ieee80211_ioctl*() methods.avos2016-01-241-89/+95
| | | | | | | | | | | | | | | | | Use malloc(9) for - struct ieee80211req_wpaie2 (518 bytes, used in ieee80211_ioctl_getwpaie()) - struct ieee80211_scan_req (128 bytes, used in setmlme_assoc_adhoc() and ieee80211_ioctl_scanreq()) Also, drop __noinline workarounds; stack overflow is not reproducible with recent compilers. Tested with Clang 3.7.1, GCC 4.2.1 (from 9.3-RELEASE) and 4.9.4 (with -fstack-usage flag) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5041
* net80211: reduce code duplicationavos2016-01-241-2/+0
| | | | | | | | Do not duplicate code between IEEE80211_IOC_WPAIE and IEEE80211_IOC_WPAIE2 switch cases. Approved by: adrian (mentor) Differential Revision: D5041 (part)
* [net80211] decode WPA cipher config '0' as "clear cipher config".adrian2015-11-261-0/+3
| | | | | | | | | | | wpa_supplicant actually calls the wpa ioctl with cipher 0 as part of the teardown process and this returns an ioctl error. It's required as part of the (hopefully!) upcoming encrypted IBSS support which does indeed do the above as part of interface setup and then exits ungracefully when it gets an ioctl error. (I'll fix wpa_supplicant in a later commit as part of other work.)
* net80211: reduce code duplication in the ieee80211_ioctl_setwmeparam() + fix ↵adrian2015-10-031-35/+17
| | | | | | | comments. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3701
* Replay r286410. Change KPI of how device drivers that provide wirelessglebius2015-08-271-55/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connectivity interact with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann, Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Revert the wifi ifnet changes until things are more baked and tested.adrian2015-08-081-16/+55
| | | | | | | | | * 286410 * 286413 * 286416 The initial commit broke a variety of debug and features that aren't in the GENERIC kernels but are enabled in other platforms.
* Change KPI of how device drivers that provide wireless connectivity interactglebius2015-08-071-55/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Details here: https://wiki.freebsd.org/projects/ifnet/net80211 Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances of problems are low. The wtap wasn't compilable even before this change. But the ndis driver is complex, and it is likely to be broken with this commit. Help with testing and debugging it is appreciated. Differential Revision: D2655, D2740 Sponsored by: Nginx, Inc. Sponsored by: Netflix
* Convert malloc/free back to #define's, as part of OS portability work.adrian2015-05-251-18/+23
| | | | | | | | | | | | | | | | | | | | | | | DragonflyBSD uses the FreeBSD wireless stack and drivers. Their malloc() API is named differently, so they don't have userland/kernel symbol clashes like we do (think libuinet.) So, to make it easier for them and to port to other BSDs/other operating systems, start hiding the malloc specific bits behind defines in ieee80211_freebsd.h. DragonflyBSD can now put these portability defines in their local ieee80211_dragonflybsd.h. This should be a great big no-op for everyone running wifi. TODO: * kill M_WAITOK - some platforms just don't want you to use it * .. and/or handle it returning NULL rather than waiting forever. * MALLOC_DEFINE() ? * Migrate the well-known malloc names (eg M_TEMP) to net80211 namespace defines.
* Use logical rather than bitwise OR in if() expression.ian2014-04-261-1/+1
|
* Modify the ioctl path to support querying things if the vap state isadrian2014-04-241-7/+7
| | | | | | | | | | | | SLEEP rather than RUN. Without this things like 'ifconfig wlan0 list sta' don't work when the NIC is power save. Tested: * AR5212, STA mode (with powersave) * AR5416, STA mode (with powersave)
* Remove IPX support.glebius2014-03-141-24/+0
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-261-0/+1
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Don't panic the kernel if we run wpa_supplicant on a hostap VAP.rpaulo2013-06-291-1/+3
| | | | Reviewed by: adrian
* Don't hold the node lock over the iterator.adrian2013-06-071-4/+24
| | | | | | | | | | | | | | | | The "find node" function call will increase the node reference anyway; so there's no reason to hold the node table lock during the MLME change. The only reason I could think of is to stop overlapping mlme ioctls from causing issues, but this should be fixed a different way. This fixes a whole class of LORs that creep up when nodes are being timed out or removed by hostapd. Tested: * AR5416, hostap, with nodes coming and going. No LORs or stability issues were observed.
* Add the ability to kick an existing mesh node without waiting for itadrian2012-01-111-0/+11
| | | | | | to time out. Submitted by: Monthadar Al Jaberi <monthadar@gmail.com>
* Fix some net80211 enum nits:bschmidt2011-12-171-2/+2
| | | | | | | | | | - ic_vap_create() uses an ieee80211_opmode argument - ieee80211_rate2media() takes an ieee80211_phymode argument - ieee80211_plcp2rate() takes an ieee80211_phytype argument - cast to enum ieee80211_protmode and ieee80211_roamingmode to silence compiler warnings Submitted by: arundel@
* Add 802.11h quiet time element support into net80211.adrian2011-11-081-0/+33
| | | | | | | | | | | | This supports both station and hostap modes: * Station mode quiet time element support listens to quiet time IE's and modifies the local quiet time configuration as appropriate; * Hostap mode both obeys the locally configured quiet time period and includes it in beacon frames so stations also can obey as needed. Submitted by: Himali Patel <himali.patel@sibridgetech.com> Sponsored by: Sibridge Technologies
* Change i_len in ieee80211req to be unsigned and fix other signed/unsignedkevlo2011-06-161-5/+5
| | | | | | | issues. Reviewed by: bschmidt Obtained from: NetBSD
* Instead of always returning 0 to a scan request, indicate if there isbschmidt2011-01-301-4/+5
| | | | | | one running already. MFC after: 1 month
* Fix resource leaks in ieee80211_ioctl_setchanlist() in case of error.rpaulo2010-06-011-2/+6
| | | | | | Found with: Coverity Prevent(tm) CID: 4115 MFC after: 3 days
* Properly initialize stack variable sr in setmlme_assoc_adhoc().rpaulo2010-06-011-0/+1
| | | | | | Found with: Coverity Prevent(tm) CID 4365 MFC after: 3 days
* Add WPA-None support:bschmidt2010-04-101-60/+106
| | | | | | | | | | | | | | | | | | * WPA-None requires ap_scan=2: The major difference between ap_scan=1 (default) and 2 is, that no IEEE80211_IOC_SCAN* ioctls/functions are called, though, there is a dependency on those. For example the call to wpa_driver_bsd_scan() sets the interface UP, this never happens, therefore the interface must be marked up in wpa_driver_bsd_associate(). IEEE80211_IOC_SSID also is not called, which means that the SSID has not been set prior to the IEEE80211_MLME_ASSOC call. * WPA-None has no support for sequence number updates, it doesn't make sense to check for replay violations.. * I had some crashes right after the switch to RUN state, issue is that sc->sc_lastrs was not yet defined. Approved by: rpaulo (mentor) MFC after: 3 weeks
* While flushing the multicast filter of an interface, do not zero the relevantsyrinx2010-01-241-2/+5
| | | | | | | | | | ifmultiaddr structures' reference to the parent interface, unless the parent interface is really detaching. While here, program only link layer multicast filters to a wlan's hardware parent interface. PR: kern/142391, kern/142392 Reviewed by: sam, rpaolo, bms MFC after: 1 week
* Implementation of the upcoming Wireless Mesh standard, 802.11s, on therpaulo2009-07-111-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
* use negotiated short gi to calculate the tx rate; using the htcapssam2009-06-111-2/+2
| | | | does not take into account local state (e.g. manual disable of sgi)
* iv_flags_ext is full, make room by moving HT-related flags to a newsam2009-06-071-35/+35
| | | | iv_flags_ht word
* o station mode channel switch supportsam2009-06-041-2/+6
| | | | | | | | | | o IEEE80211_IOC_CHANSWITCH fixups: - restrict to hostap vaps - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap or to a vap w/o 11h enabled - interpret count of 0 to mean cancel the current CSA Reviewed by: rpaulo, avatar
* fix typosam2009-06-021-1/+1
|
* Remove hack used to deal with ifnet teardown now that if_detach and thesam2009-06-021-18/+3
| | | | | | | | | | | | | bridge do a better job. o move ether_ifdetach to the top of ieee80211_detach o do not clear if_softc at the top of ieee80211_detach; we no longer need this because we are safeguarded against calls coming back through if_ioctl o simplify the bpf tracker now that we don't null if_softc This also fixes an issue where having a bpf consumer active when a vap is destroyed would cause a crash because bpf referenced free'd memory. Reviewed by: imp
* Create a taskqueue for each wireless interface which provides a serialisedthompsa2009-05-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | sleepable context for net80211 driver callbacks. This removes the need for USB and firmware based drivers to roll their own code to defer the chip programming for state changes, scan requests, channel changes and mcast/promisc updates. When a driver callback completes the hardware state is now guaranteed to have been updated and is in sync with net80211 layer. This nukes around 1300 lines of code from the wireless device drivers making them more readable and less race prone. The net80211 layer has been updated as follows - all state/channel changes are serialised on the taskqueue. - ieee80211_new_state() always queues and can now be called from any context - scanning runs from a single taskq function and executes to completion. driver callbacks are synchronous so the channel, phy mode and rx filters are guaranteed to be set in hardware before probe request frames are transmitted. Help and contributions from Sam Leffler. Reviewed by: sam
* add IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-addresssam2009-04-261-1/+6
| | | | | encapsulation when relaying frames; this reduces the cost of the test and enables use for situations other than "sta vap + dwds"
* correct bssid reporting for wds vapssam2009-04-261-4/+7
|
* o add ic_rt to track the rate table for the current channel; this enablessam2009-03-291-0/+2
| | | | | calculation of packet transmit times to do things like check txop limits o remove equivalent driver code and convert to use net80211 state
* split Atheros SuperG support out into it's own file that's included onlysam2009-03-241-39/+0
| | | | with a new IEEE80211_SUPPORT_SUPERG option
* add linker sets for get/set ioctl handlers so optional net80211sam2009-03-241-21/+50
| | | | code is isolated
* Add modes for 1/2 and 1/4-width channels so we have separate roamingsam2009-02-191-0/+2
| | | | | | | | | | | | | | | | | | and xmit parameters. This makes it possible to use tdma on fractional channels. o add IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER; note these are band-agnostic (may need revisiting) o setup all default rates in ic_sup_rates instead of doing it only for active modes; we need these to calculate the default tx parameters which are not recalculated after a regulatory update (can't just recalculate after installing a new channel list because we might clobber user settings) o remove special case code in ieee80211_get_suprates; this is now a candidate for an inline or removal o add various entries for new modes (roaming+tx params, wme, rate mapping, scan set setup, country ie construction, tdma, basic rates) Note these modes are intentionally not visible through if_media.
* o looseen abi dependencies on IEEE80211_MODE_MAX by accepting smallersam2009-02-191-49/+31
| | | | | | parameters for IEEE80211_IOC_ROAM and IEEE80211_IOC_TXPARAMS; this lets us add more modes and still have old apps work o consolidate loops to remote assumptions about mode ordering
* use c99 initializerssam2009-02-191-11/+11
|
OpenPOWER on IntegriCloud