aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifieee80211.c
Commit message (Collapse)AuthorAgeFilesLines
* ifconfig(8): display 802.11n rates correctly for 'roam:rate' parameterAndriy Voskoboinyk2019-02-101-1/+3
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=343980
* ifconfig(8): actually, non-11n rates should be divided by 2...Andriy Voskoboinyk2019-02-031-4/+12
| | | | | | | | MFC after: 1 week MFC with: 343698 Notes: svn path=/head/; revision=343700
* ifconfig(8): display management / multicast wlan(4) rates properlyAndriy Voskoboinyk2019-02-031-4/+15
| | | | | | | | | | | | For 11n / 11ac we are still using non-11n rates for management and multicast traffic by default; check 'MCS rate' bit to determine how to print them correctly. PR: 161035 MFC after: 1 week Notes: svn path=/head/; revision=343698
* ifconfig(8): interpret VHT rates correctly for 'list roam / txparam' optionsAndriy Voskoboinyk2019-02-031-2/+8
| | | | | | | | | They are represented via MCS rate index, not as a 'speed in MBps' * 2. MFC after: 5 days Notes: svn path=/head/; revision=343690
* ifconfig: drop unused macros from ifieee80211.cAndriy Voskoboinyk2019-01-231-5/+0
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=343341
* [ifconfig] Print more WPS attributes in verbose "list scan" outputOleksandr Tymoshenko2019-01-201-18/+187
| | | | | | | | | | | | - Move WPS related defines to dedicated file - Add handlers for more WPS attributes PR: 217317 Submitted by: J.R. Oldroyd <fbsd@opal.com> MFC after: 3 weeks Notes: svn path=/head/; revision=343204
* IEEE!Sevan Janiyan2018-08-111-2/+2
| | | | | | | Pointy hat: myself Notes: svn path=/head/; revision=337617
* Drop the ternary operator for calculating ssid display length in list_scan().Sevan Janiyan2018-08-111-5/+4
| | | | | | | | | | | | | | Regardless if a verbose scan is required or not, we'd still want to display the full SSID name by default so use the IEE80211_NWID_LEN constant to set the value to use instead. Tested on rene@'s laptop. Reviewed by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16566 Notes: svn path=/head/; revision=337614
* ifconfig(8): Attempt to render non-printable sequences w/ UTF-8 EnvironmentKyle Evans2018-06-281-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently ifconfig(8) only prints the hex representation of ssid names with non-ASCII characters. Many modern terminals are able to properly render non-ASCII characters. This change checks if the terminal charmap is UTF-8, and if so, will render the characters, rather than the hex value. This behavior is circumvented by running ifconfig(8) in a non-UTF8 locale; e.g. C or POSIX. It was pointed out by kp@ during the review that APs have the option to broadcast whether their SSIDs may be interpreted as UTF-8. Ideally, we would honor this and only attempt this behavior if it's so-broadcasted by the AP. However, a sample survey showed that hostapd will advertise this if indicated in config but it doesn't seem to be so common in the AP market, so this would be effectively useless as we'll rarely know if the SSID should be renderable as UTF-8. Despite this, it was decided to be OK with this anyways- there's a straightforward path to doing it the right way based on advertisement by AP if we need to go that route, and one can revert to old behavior easily enough at runtime if we get it wrong. Submitted by: Farhan Khan <khanzf@gmail.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D15922 Notes: svn path=/head/; revision=335757
* Extend SSID maximum string length to 32 chars to support longer SSIDKirill Ponomarev2018-03-161-1/+1
| | | | | | | | | | names. Approved by: adrian Differential Revision: https://reviews.freebsd.org/D14710 Notes: svn path=/head/; revision=331064
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* [ifconfig] add some comments around missing net80211 VHT configuration.Adrian Chadd2017-03-311-0/+6
| | | | | | | | VHT STBC, A-MPDU density and A-MPDU size configuration parameters are different when doing VHT. Notes: svn path=/head/; revision=316340
* [ifconfig] handle illegal WPS framesAdrian Chadd2017-02-231-0/+8
| | | | | | | | | | | | | | | | Some APs broadcast WPS IE frames with totally broken data. Ifconfig's printwpsie() loops through WPS frames printing the attributes out; if the frame's data is bad, printwpsie() can end up looking at out-of-bounds addresses causing ifconfig to bus error. Thanks to Takashi Inoue at Nihon U for his efforts in debugging this. PR: bin/217312 Submitted by: fbsd@opal.com MFC after: 1 week Notes: svn path=/head/; revision=314181
* [ifconfig] fix a memory leak.Adrian Chadd2017-02-201-0/+1
| | | | | | | | Submitted by: Tom Rix <trix@juniper.net> Differential Revision: https://reviews.freebsd.org/D9654 Notes: svn path=/head/; revision=313978
* [net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and ↵Adrian Chadd2017-02-201-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 160MHz channels. * Migrate the rx_params stuff out from ieee80211_freebsd.h where it doesn't belong - this isn't freebsd specific anymore. * Don't use a hard-coded number of chains in the ioctl header; now we can shuffle MAX_CHAINS around so it can be used in the right spot. * Extend the signal/noisefloor levels in the mimo stats struct to userland to include the signal and noisefloor levels for each 20MHz slice of a 160MHz channel. * Bump the number of EVM pilots in preparation for 4x4 and 160MHz channels. Tested: * ath(4), STA mode * iwn(4), STA mode * local ath10k port, STA mode TODO: * 11ax chips will come with 5GHz 8x8 hardware for lots of MU-MIMO - I'll re-bump it at that point. Note: * This breaks the driver and ifconfig ABI; please recompile the kernel, ifconfig and wpa_supplicant/hostapd. Notes: svn path=/head/; revision=313977
* [net80211] fix quiet_duration parameter to match what is provided in the ↵Adrian Chadd2017-02-041-6/+6
| | | | | | | manpage. Notes: svn path=/head/; revision=313253
* net80211: allow to configure LDPC supportAndriy Voskoboinyk2017-01-211-0/+38
| | | | | | | | | | Tested with RTL8821AU, STA mode (Tx support only) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9268 Notes: svn path=/head/; revision=312596
* ifconfig(8): fix '-stbc' parameter name.Andriy Voskoboinyk2017-01-201-1/+1
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=312560
* [ifconfig] add initial VHT (802.11ac) configuration and channel support to ↵Adrian Chadd2017-01-071-4/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ifconfig. This is very preliminary and mostly enough for me (with other patches) to work on VHT support. It adds: * VHT20, VHT40 and VHT80 regulatory/band awareness * VHT20, VHT40 and VHT80 channel configuration / population * Parses vht channel specifications (eg ifconfig wlan0 create wlandev athp0 wlanmode monitor channel 36:vht/80) * Configuration of VHT, VHT40, VHT80, VHT80+80, VHT160 channel width (IEEE80211_FVHT_VHT* flags in net80211) TODO: * No VHT80+80 or VHT160 channels yet - I don't yet have hardware, and I'm not yet sure how to support/populate VHT80+80 channels. * No, I won't update the manpage until this is "more done", lest someone tries using vht and gets upset with me. * No, I won't commit the regulatory database I'm testing with, so you'll just end up with no VHT channels ever populated. Which is good, as there isn't an 11ac driver in-tree yet to try it with. Notes: svn path=/head/; revision=311579
* ifconfig: do not truncate SSID in verbose mode.Andriy Voskoboinyk2016-12-141-1/+1
| | | | | | | | | | | Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command. PR: 215301 Submitted by: <ms-freebsd-bugzilla@stoffnet.at> MFC after: 4 days Notes: svn path=/head/; revision=310089
* [ifconfig] remove now duplicate IEEE80211_C_BITS definition; it's now in ↵Adrian Chadd2016-11-181-6/+0
| | | | | | | | | | _ieee80211.h . Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D8553 Notes: svn path=/head/; revision=308812
* Remove MATCHOUI macro, unused since r197980.Gavin Atkinson2016-11-011-6/+0
| | | | Notes: svn path=/head/; revision=308182
* [ifconfig] correctly display RSSI.Adrian Chadd2016-10-081-2/+2
| | | | Notes: svn path=/head/; revision=306836
* ifconfig: fix wlan creation when unit number is not providedAndriy Voskoboinyk2016-06-081-0/+7
| | | | | | | | | | (was broken after r300738). Reported by: Yoshihiro Ota <ota@j.email.ne.jp>, adrian Tested by: Yoshihiro Ota <ota@j.email.ne.jp> Notes: svn path=/head/; revision=301651
* ifconfig: set by default FCC regulatory domain for wireless interfaces.Andriy Voskoboinyk2016-05-261-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change default regulatory domain from DEBUG (no limitations; exposes all device channels) to FCC; as a result, newly created wireless interface with default settings will have less chances to violate country-specific regulations. This change will not affect drivers with pre-initialized regdomain structure (currentry ath(4) and mwl(4)); in that case, the default channel list must correspond to the default regdomain / country setting. You can switch to another regdomain / country via corresponding ifconfig(8) options; the driver must implement ic_getradiocaps() method to restore full channel list. Full country / regdomain list may be obtained via 'ifconfig <iface> list countries' command. Example: change country to Germany: ifconfig wlan0 down # all wlans on the device must be down ifconfig wlan0 country DE ifconfig wlan0 up # wpa_supplicant(8), dhclient(8) etc At the creation time: ifconfig wlan0 create wlandev wpi0 country DE To make changes permanent add the following line to the rc.conf(5): create_args_wlan0="country DE" Tested with - Intel 3945BG (wpi(4)). - WUSB54GC (rum(4)). Reviewed by: adrian Relnotes: yes Differential Revision: https://reviews.freebsd.org/D6228 Notes: svn path=/head/; revision=300738
* Add an assertion to catch a potential underflow in an array indexDon Lewis2016-05-161-0/+1
| | | | | | | | | | | calculation, though this should not happen in the current code. Reported by: Coverity CID: 1008486 MFC after: 3 weeks Notes: svn path=/head/; revision=299921
* Use strlcpy() instead of strncpy() when copying ifname to ensureDon Lewis2016-05-161-6/+6
| | | | | | | | | | | | | | | | | | | | | that it is NUL terminated. Additional NUL padding is not required for short names. Use sizeof(destination) in a few places instead of IFNAMSIZ. Cast afp->af_ridreq and afp->af_addreq to make the intent of the code more obvious. Reported by: Coverity CID: 1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638 CID: 1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645 CID: 1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053 CID: 1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298 CID: 1011299, 1305821, 1351720, 1351721 MFC after: 1 week Notes: svn path=/head/; revision=299873
* ifconfig: fix check for 40 MHz channels while applying country/regdomain.Andriy Voskoboinyk2016-05-091-4/+0
| | | | | | | | | | | | Do not use 20 MHz channel list while checking 40 MHz channels; it may be different. Just use the corresponding list instead. Tested by: Masachika ISHIZUKA <ish@amail.plala.or.jp> PR: 209328 Notes: svn path=/head/; revision=299264
* [ifconfig] add STBC TX/RX configurationAdrian Chadd2016-04-261-1/+39
| | | | | | | | | | | | | | This adds the ability to view and configure the STBC parameter for both transmit and receive. Whilst here, fix a typo for AMSDU. TODO: * manpage update Notes: svn path=/head/; revision=298606
* ifconfig: prevent some improbable signed integer overflows.Pedro F. Giffuni2016-04-251-6/+6
| | | | | | | | | | | | | | ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int. Use an unsigned index to prevent overflowing the index. Adopt unsigned integers in other cases where it is useful to be aware of the unsigned quantities and there is no risk of the values being negative. MFC after: 1 week Notes: svn path=/head/; revision=298556
* Add VHT power envelope parsing to ifconfig.Adrian Chadd2016-04-191-1/+36
| | | | Notes: svn path=/head/; revision=298252
* Add parsing for AP channel report IE.Adrian Chadd2016-03-181-3/+23
| | | | | | | | | | | | | | Eg: TP-LINK_D579 60:e3:27:e1:d5:79 10 54M -72:-95 100 EP SSID<TP-LINK_D579> RATES<B2,B4,B11,B22,18,36,72,108> DSPARMS<10> XRATES<12,24,48,96> COUNTRY<US 1-11,20> APCHANREP<class 32, chan:[1,2,3,4,5,6,7]> APCHANREP<class 33, chan:[5,6,7,8,9,10,11]> TIM<050400010000> ERP<0x4> HTCAP<cap 0x106e param 0x17 mcsset[0-15,32] extcap 0x0 txbf 0x0 antenna 0x0> HTINFO<ctl 10, 7,0,0,0 basicmcs[]> ???<4a0e14000a002c01c800140005001900> RSN<v1 mc:AES-CCMP uc:AES-CCMP km:8021X-PSK> WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn 7 cwmin 4 cwmax 10 txop 0] VO[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]> BSSLOAD<sta count 0, chan load 11, aac 18> VEN<dd07000c4300000000> Notes: svn path=/head/; revision=297010
* Remove duplicate LE_READ_4() definition.Adrian Chadd2016-03-181-8/+0
| | | | | | | | | Tested: * typed 'make', seemed to work. Notes: svn path=/head/; revision=297009
* Decode VHTCAP, VHTINFO and BSSLOAD.Adrian Chadd2016-03-181-0/+62
| | | | | | | | | BSSLOAD is based on work from Idwer Vollering. Obtained from: Idwer Vollering <vidwer@gmail.com> (bssload) Notes: svn path=/head/; revision=297007
* Display the VHT IE names.Adrian Chadd2016-03-161-0/+3
| | | | | | | | | | | | | This doesn't decode the IEs just yet. Tested: * Archer c2 AP: TP-LINK_D579_5G 60:e3:27:e1:d5:78 44 54M 26:0 100 EP SSID<TP-LINK_D579_5G> RATES<B12,18,B24,36,B48,72,96,108> DSPARMS<44> COUNTRY<US 36-48,20> TIM<050400010000> HTCAP<cap 0x6e param 0x16 mcsset[0-7,32] extcap 0x0 txbf 0x0 antenna 0x0> HTINFO<ctl 44, 5,0,0,0 basicmcs[]> VHTCAP<bf0c2000c031feff2401feff2401> VHTOPMODE<c005012a00feff> RSN<v1 mc:AES-CCMP uc:AES-CCMP km:8021X-PSK> WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn 7 cwmin 4 cwmax 10 txop 0] VO[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]> BSSLOAD<0b05000001127a> VEN<dd07000c4300000000> Notes: svn path=/head/; revision=296931
* [net80211] handle unlisted information elements.Adrian Chadd2016-03-141-0/+2
| | | | | | | | | | This displays the IE names in ifconfig but it doesn't yet decode things. Submitted by: Idwer Vollering <vidwer@gmail.com> Differential Revision: https://reviews.freebsd.org/D3782 Notes: svn path=/head/; revision=296823
* Convert ifconfig to use lib80211.Adrian Chadd2015-11-301-36/+9
| | | | | | | | | * remove regdomain.[ch] - it's now part of lib80211. * convert ifieee80211.c to use the ioctl routines in lib80211 and implement the "error? exit" wrapper behaviour the callers expect. Notes: svn path=/head/; revision=291470
* [ifconfig] handle IBSS mediatype correctly.Adrian Chadd2015-11-261-0/+2
| | | | | | | | | Right now net80211 is configured as type IBSS but then treats it as mediatype ADHOC. This doesn't change that; it just correctly handles being given a mediatype of IBSS. Notes: svn path=/head/; revision=291352
* ifconfig: fix padding for '<ifname> scan' command outputAndriy Voskoboinyk2015-11-061-2/+2
| | | | | | | | | | (S:N and beacon interval fields). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4085 Notes: svn path=/head/; revision=290438
* Replace N #defines with nitems to simplify ifconfig code slightlyEnji Cooper2015-09-271-9/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=288305
* Mark a mesh path to a mesh gate with a 'G'.Monthadar Al Jaberi2013-02-071-1/+3
| | | | | | | Approved by: adrian (mentor) Notes: svn path=/head/; revision=246505
* * Modified ifconfig to show the IEEE80211_MESHRT_FLAGS_DISCOVER flag with a 'D';Monthadar Al Jaberi2012-05-011-0/+2
| | | | | | | Approved by: adrian Notes: svn path=/head/; revision=234895
* * Added new command to ifconfig to activate Mesh Gate Announcement calledMonthadar Al Jaberi2012-05-011-0/+14
| | | | | | | | | meshgate with corresponding explanation; Approved by: adrian Notes: svn path=/head/; revision=234893
* Also fix the parameter usage in set80211meshpeering().Bernhard Schmidt2012-03-231-1/+1
| | | | | | | | | Submitted by: Monthadar Al Jaberi MFC after: 1 week X-MFC after: r233328 Notes: svn path=/head/; revision=233382
* Fix an incorrect parameter usage here.Adrian Chadd2012-03-221-1/+1
| | | | | | | Submitted by: monthadar@gmail.com Notes: svn path=/head/; revision=233328
* Fix warning when compiling with gcc46:Eitan Adler2012-01-101-3/+0
| | | | | | | | | | error: variable 'firstkey' set but not used Approved by: dim MFC after: 3 days Notes: svn path=/head/; revision=229914
* Spelling fixes for sbin/Ulrich Spörlein2012-01-071-1/+1
| | | | Notes: svn path=/head/; revision=229778
* Add quiet time element configuration support to ifconfig.Adrian Chadd2011-11-081-0/+36
| | | | | | | | | | | | | This allows a hostap to specify to a set of stations that they should not transmit for a certain period of time after each beacon interval has expired. This is used when searching for radar pulses or general interference. Submitted by: Himali Patel <himali.patel@sibridgetech.com> Sponsored by: Sibridge Technologies Notes: svn path=/head/; revision=227336
* This patch removes a check in ifconfig which disables HT/40 channelsAdrian Chadd2011-07-201-12/+0
| | | | | | | | | | | | | | | | on frequency bands with DFS. All Atheros chipsets >= AR9001 support radar event detection on HT40 extension channels. This should be a chipset specific item rather than enforced in the regulatory domain database. In addition, it's irrelevant for STA mode, as the radar detection is done by the access point, not the STA. Approved by: re (kib) Notes: svn path=/head/; revision=224224
* This patch enables listing DFS related flags when 'ifconfig -v wlanXAdrian Chadd2011-07-191-3/+14
| | | | | | | | | | | | | | | | | | list channel' is run. The following new options are introduced: * D: channel requires DFS * R: channel has a radar event * I: channel has detected inteference * C: the CAC period has completed on a channel that requires it (ie, DFS + PASSIVE.) It's relevant for developing, debugging and using the DFS and interference options. Approved by: re (bz) Notes: svn path=/head/; revision=224219