diff options
author | Sunil Ravi <sunilravi@google.com> | 2022-03-05 11:09:09 -0800 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2022-03-05 16:23:11 -0800 |
commit | 44e0e5863bbb752931c2f4aed781513a309fc76f (patch) | |
tree | 867b76ae0ba21def07dac76161dc341f9c1a3d14 /info.c | |
parent | c3891e2ae42f5fb80bd7e105ceb69639acb12cf8 (diff) | |
download | iw-44e0e5863bbb752931c2f4aed781513a309fc76f.tar.gz |
Cumulative patch from upstream commit 5909e73
5909e73 iw: survey: add support for radio stats
7e06706 iw: event: report missing radar events
d034d73 bump version to 5.16
4624220 info: add FILS_CRYPTO_OFFLOAD extended feature
b8d5974 update nl80211.h
8614608 iw: print BSS coloring capability if supported
ba4f75b iw: add set sar_specs command
50918cb iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions
5a29126 iw: mesh: add comments in the mesh confguration parameter printing sections
e848afe iw: event: add the missing time display format in the "iw event" help menu
25bb9c3 iw: link: mention the need for MAC addr arg in link get_sta cmd usage menu
f71bd68 iw: fix vendor event static warnings
3d3d8fc iw: fix various sparse static warnings
24fb155 iw: make parse_he_gi static
bfc4a63 iw: add support for configuring the bss color for ranging measurements
e0f0ee3 iw: update nl80211.h
0ed91f5 iw: use cipher suite defines in util.c
d893e72 iw: add cipher suites definitions
a6cedc6 iw: unify interface type list printing
d59e908 iw: mesh: add new cmd to dump all the supported mesh config params at once
87728df iw: mesh: fix crash when attempting to print the conf param "mesh_nolearn"
3307775 iw: ps: fix "get power_save" documentation
a0f53c1 iw: add option to set auth type for connect
c9e7d27 update nl80211.h
1325244 iw: allow specifying CFLAGS/LIBS externally
8fab0c9 iw: fix ftm_request missing arguments segfault
e816fbc iw: fix mgmt dump missing arguments segfault
5d9d1b8 iw: Fix timestamp output on 32-bit architectures
4b25ae3 iw: fix pointer arithmetic in __print_he_capa
c3df363 iw: add option to print human readable event time
cd64525 iw: print ctrl port tx status event
0ba98b9 iw: use correct type in policy check for mesh
9e38dee iw: scan: fixup HE caps whitespace
17e8564 iw: scan: parse HE capabilities
5735e58 iw: util: factor out HE capability parser
6d8d507 iw: scan: add extension tag parsing
b4e1ec4 man: update wikipage URL, reformat SEE ALSO section
c56036a iw: enable 80MHz support for 6GHz band 11s mesh
fa72728 iw: handle positive error codes gracefully
7ba9093 iw: scan: add flag for scanning colocated ap
5ec60ed iw: Add 'coloc' and 'flush' options to sched_scan
f8ade75 iw: update wikipage URL
b6f2dac iw: Add support for specifying the 160MHz bandwidth when setting the channel/frequency
8934cc4 bump version to 5.9
562404c iw: support HE rate configuration in 6 GHz band
3071b52 iw: add HE rate/gi/ltf support
5864fa5 iw: update nl80211.h
4d2749a iw: add TID specific Tx bitrate configuration
e90b693 iw: fix tid config help entries
49831d0 bump version to 5.8
8b159da iw: print hop_count and path_change info of mpath
700f7d9 iw: handle more mesh station info
0789fd2 iw: handle all mesh config parameters
06e9839 iw: print current ext feature set
e0a45db update nl80211.h to 5.8-rc1
8e58fe9 iw: add support for vendor events
125abec iw: add support for NDP ranging - trigger based and non trigger based
b3999a3 reg: Fix getting PHY specific regulatory information
b12fc8a iw: update freq to chan mappings for 6GHz band per IEEE P802.11ax/D6.1
94ded88 iw: mesh: add mesh_param "mesh_nolearn" to skip path discovery
f718f11 update nl80211.h
8e7cd59 iw: print current ext feature set
e9d87a7 update nl80211.h
4378919 iw: sync frequency to channel mapping with kernel for 6GHz band
71ad41c iw: add TID specific configuration command
d2a29c0 update nl80211.h
10b9b03 iw: Print limit for maximum associated stations in AP mode
83689ee iw: 'phy <name> reg get' shouldn't dump all domains
88f9e98 iw: tiny code style fixes
19b80cd iw: event: log rssi value for cqm
0250318 iw: event: also handle reg change on wiphy
ec9f3e7 iw: update extended features in info
05157b1 iw: Complete Extended Key ID detection
cb07eab iw: update nl80211.h
11c35ae iw: phy: dump wiphy index
08d7c40 scan: Fix printing of unknown WPS vendor extension
71340cd iw: correctly print signed TX power level
715cd40 resync nl80211.h
7d36556 scan: wps: remove useless string length checks
ff32636 scan: wps: fix some misplaced code
fe969ad iw: scan: parse AP Channel Report
f395f75 iw: scan: parse wps version2
84289c0 scan: wps: add more bounds checks
7be767c iw: scan: better length checks in print_wifi_wps()
6e0ce46 iw: scan: fix some format string warnings found by clang
a7375d5 iw: scan: fix undefined behaviour in print_vht_capa()
22145cf iw: scan: fix undefined behaviour in rm capa print
505f9e4 iw: scan: fix buffer over-read in print_p2p
e4ebc46 iw: scan: fix buffer over-read in print_wifi_wps
baea1a0 iw: scan: fix buffer over-read in parsing roaming consortium
cb13b9d iw: scan: fix buffer over-read in print_ies()
7d8fcdc build: add -Wdeclaration-after-statement
0e6d544 iw: scan: parse measurement pilot element
2dfd1f0 iw: scan: parse tx power envelope
3d34360 iw: scan: parse 'supported Operating Classes element'
a532a81 iw: scan: add missing word for rm capabilities
ad5bd08 iw: reg: parse the NO_HE regulatory flag
97dd4da iw: print ru-alloc values when dumping stations
ba300c3 update nl80211.h
4d72d1d iw: scan: print radio measurement capabilities
bb391d2 iw: event: parse channel switch
b31864b iw: info: add missing extended flags for 5.5
ce87a25 iw: event: parse stop ap and frame wait cancel events
51bfd5a iw: event: handle interface add/del
e9b5958 iw: update nl80211.h
a39d32a iw: info: print missing extended feature flag information
68257d0 event: remove unnecessary braces
47650ff iw: event: add sta opmode changed command
7d17ba9 iw: event: add set interface command
d98f794 iw: event: add new peer candidate command
d5b145c iw: bump version to 5.4
8e322f8 iw: scan: fix double-free in error paths
68dd562 iw: Fix typo in iw --help
3708f61 iw: Print current time in station info dump
0b39c40 iw: Support associated-at station statistic.
0c1a26b update nl80211.h
959fa3b bump version to 5.3
b5c0c33 info: update extended feature list
02b53ea info: macro-ify ext_feat_print()
732c1aa util: update command list
a0c07e4 update nl80211.h
08c3f7d iw: scan: add missing newline
c741be9 iw: print HE capabilities
35a458a iw: really fix build
848d97d iw: add HE support to station dump call
71e6d18 cac: fix error handling in channel parsing
4fadb60 nan: fix memory leak
1ea6085 mesh: initialize err in set_interface_meshparam()
fc38d3e iw: fix fp handling inside handle_vendor
2f74c59 iw: fix memory leaks inside handle_scan
edb5f4f iw: fix memory leak inside parse_sched_scan
3a51540 iw: fix fd leak inside handle_netns
6a7cc86 iw: fix memory leak inside handle_cac
2f31605 iw: fix endless loop inside handle_mgmt_dump
0b41c3b iw: fix memory leak inside register_mgmt_frame
f46aab4 iw: add version.o to objects
f561cfc iw: include all C files into the binary
338059a iw: change __cmd section scheme to fit gcc/clang
5bdf11e iw: Add support for controlling tx power for per station
24091b7 iw: add command to inject a frame via direct mesh link to mesh peer
2c8026d update nl80211.h
e99bc38 iw: print 4ADDR attribute when dumping interface
4323f5a iw: small cleanup for the sizer code
ae03bc6 iw: fix cmd_size determination with LTO
691c585 update nl80211.h
5c0784d iw: Print airtime fairness feature
8290324 iw: Add command to set airtime weight
a85d693 iw: Add printing of station tx duration and airtime weight
1b0f808 iw: bump version to 5.0.1
6439859 iw: make it build with older compilers again
311c9f2 iw: bump version to 5.0
02b85d8 iw: add FTM responder commands
8ddb960 iw: add FTM initiator support
2e192ce iw: separate wait/print when waiting for an event
3c0117c iw: make parse_random_mac_addr() more generally available
806bb9a update nl80211.h and command list
687eeb3 iw: make all code files non-executable
9b2849e iw: add FEATURE support for scan randomization
5c01d5a iw: dump 'rx bitrate' in link stats
77bbbf1 iw: use -Wstringop-overflow=4
02bc775 iw: honor CPPFLAGS when compiling
adfc102 iw: Fix NAN match event formatting
ed3552e iw: nan: fix warning of uninitialized variable
572aae9 remove stray evp.h include
63d6aac iw: nan: Add NAN Commands
7c4e86c iw: nan: Handle NAN Events
084184e iw: Add inactivity timeout configuration support
b7e8163 wowlan: Use MAX_NL80211_ATTR instead of NUM in nla_parse
0e39f10 connect: fix parsing of WEP keys
d4f1ea1 connect: Fix parsing of PSK
bcdceae iw: fix various static checker warnings
fc16607 iw: scan: parse OWE Transition Mode element
7f87d3c iw: Make input to mac_addr_n2a() const
a58f492 scan: Decode additional Authentication types
befb32d iw: fix enum warnings
0fc9283 iw: fix the beacon average signal parsing
d227267 iw: ack signal support for tx ack packets
c8edf8f scan: fix fall through warning
75b78ff update nl80211.h
c9c3b69 scan: fix indentation in previous change
86d907a scan: fix crash when driver doesn't report frame type
8a2dfd5 iw: 'idby' might be used uninitialized in main function
6ab936f iw: enable -Wextra and fix warnings caused by it
b50d145 scan: print out "Information elements from Probe Response frame" only if certain
f3c9666 iw: fix some scan code indentation
1eb2f5c iw: Add getting and setting of TXQ params for phy
910792c iw: Print TXQ statistics for stations and interfaces
7110108 update nl80211.h
56e36b2 iw: support reloading the regulatory database
3a99ff6 iw: Add duration parameter to scan command
c1bdfe6 iw: add printout of all supported ext_features to phy info
e06485e iw: update nl80211.h
f328848 bump version to 4.14
45de060 update nl80211.h
378286c util: update command list
f750458 ocb: Use common freqchan helper for setting the operating channel
86dbcee iw: add support for mfp
c91fdbe iw: ap: don't return -EPERM
ab50848 iw: ap: support hidden/zeroed SSID
26cab67 iw: ap: add support for passing a proper chandef
60b6c63 iw: Add support for start/stop AP
5f310d8 iw: print missing extended capabilities
d792470 iw: allow CCMP-128/GCMP-128 as CCMP/GCMP aliases
6c2a012 iw: add support for WPA2 PSK CCMP / GCMP association
7e0a7c4 update nl80211.h
48e0a01 iw: add command to register and dump mgmt frames
86da57a iw: define SOL_NETLINK if it isn't
3a80732 iw: add extack support
8a9e0b3 update nl80211.h
5ce1f6c iw: Fix bitrate output when no rate info found
4871fcf iw: parse_freqs: check how many center frequencies to expect
c37f6c6 iw: split str_to_bw() from parse_freqs()
03fb59d Print frequency of radar events.
444674c Add commands to send CSA
2ba2f59 Add cac command to allow clearing channels
3e1debe mesh: Use common freqchan helper for joining a mesh
2b8047a ibss: Use common freqchan helper for joining an ibss
159d5e4 phy: Use common freqchan helper for setting the operating channel
997c60f util: Add generic frequency/channel command line handler
f13627c update version to 4.9
ed9b77e iw: nan: Add NAN interface type
386bacb iw: add support for VHT MU-MIMO air sniffer
2781d64 add new commands
4d17e34 ibss: remove _POSIX_SOURCE
a574be4 update nl80211.h (kernel 4.9)
27ea56b event: handle NL80211_ATTR_TIMED_OUT in connect event
0a12cf8 iw: add scan-abort command
9ad3cc2 utils: make hex2byte and hex2bin parameter const
432b5ae iw: display 5/10 MHz channel widths
b0c5a4a iw: recognize 256-bit cipher suites
db9d405 add "channels" PHY command listing frequencies with more details
feea0ff iw: bump version to 4.7
26e074a iw: version.sh: update to get version with git correctly
8ccc479 iw: Fix -Wabsolute-value compiler warning in iw.c
d738686 iw: support setting frame subtype and reason code when deleting station
e7c0923 iw: add vendor command response support
045c1c6 iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute
7687d59 iw: Change socket configuration to avoid buffer allocation error
f45d458 update nl80211.h
9ae0d10 iw: add scheduled scan plans configuration
568c705 iw: add missing station statistics
b2c4bf4 iw: document handler return value 1 as HANDLER_RET_USAGE
94af668 iw: fix "iw reg get" double output
f6fca12 print BSS boottime if received
478438c update nl80211.h
8366d19 iw: print NOHT always as first in usage texts
1029a54 iw: use get_cf1 and struct chanmode for ocb
e7271e7 iw: add VHT80 support for 802.11s
c1b2b63 iw: prepare get_cf1 for use in join_* functions
96fa73c iw: don't use NULL pointer in nla_nest_end()
ab65a09 iw: Fix memory leak if nla_put fails
33cbe6c mesh: show mesh parameters when no args are given
f755a22 iw: remove superfluous includes
7082f96 iw: Fix segfault when no args are given to offchannel
0ee571d iw: add and fix -Wsign-compare
ef65e9c iw: fix help text for event command
6cd3634 iw: add helpful hints for vendor cmd
f0dff70 ocb: use correct "MHz" instead of "MHZ"
86a9801 iw: Fix return values when parameters are wrong
24cc1cf iw: Fix memory leak in error path
5f17068 iw: remove superfluous includes
7187aad ibss: use correct "MHz" instead of "MHZ"
faeef83 ibss: add VHT80 support for IBSS
d06cda9 scan: Add FTM info to scan results
619d28a iw: display interface TX power if available
5d290c8 bump version to 4.3
516ef62 iw: fix off-by-one
8823f67 add a few new commands/events
a723a10 print IR-concurrent instead of GO-concurrent
5c83c0e update nl80211.h to kernel 4.3
7d19e35 iw: don't mix declaration into code
c0441e6 iw: make netns_get_fd static
7faa1ba iw: fix s_cb leak
572e47a iw: avoid passing NULL to nla_data()
8b80a2b iw: cqm: check nlmsg_alloc() return
63e11c4 iw: remove android-nl.c with unneeded workaround
74c7449 iw: fix references to libnl in Android.mk
367e7dd iw: free memory on scan parse errors
34b2301 iw: remove cb from arguments and simplify valid handler
Bug: 206715716
Test: Manual - Wifi ON/OFF - executed iw commands
Change-Id: Ia743f040e222602bb8eb047366ccc5b41710736a
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 227 |
1 files changed, 154 insertions, 73 deletions
@@ -1,6 +1,4 @@ #include <stdbool.h> -#include <errno.h> -#include <net/if.h> #include <netlink/genl/genl.h> #include <netlink/genl/family.h> @@ -33,11 +31,21 @@ static char *cipher_name(__u32 c) case 0x000fac02: return "TKIP (00-0f-ac:2)"; case 0x000fac04: - return "CCMP (00-0f-ac:4)"; + return "CCMP-128 (00-0f-ac:4)"; case 0x000fac06: return "CMAC (00-0f-ac:6)"; case 0x000fac08: - return "GCMP (00-0f-ac:8)"; + return "GCMP-128 (00-0f-ac:8)"; + case 0x000fac09: + return "GCMP-256 (00-0f-ac:9)"; + case 0x000fac0a: + return "CCMP-256 (00-0f-ac:10)"; + case 0x000fac0b: + return "GMAC-128 (00-0f-ac:11)"; + case 0x000fac0c: + return "GMAC-256 (00-0f-ac:12)"; + case 0x000fac0d: + return "CMAC-256 (00-0f-ac:13)"; case 0x00147201: return "WPI-SMS4 (00-14-72:1)"; default: @@ -49,20 +57,6 @@ static char *cipher_name(__u32 c) } } -static char *dfs_state_name(enum nl80211_dfs_state state) -{ - switch (state) { - case NL80211_DFS_USABLE: - return "usable"; - case NL80211_DFS_AVAILABLE: - return "available"; - case NL80211_DFS_UNAVAILABLE: - return "unavailable"; - default: - return "unknown"; - } -} - static int ext_feature_isset(const unsigned char *ext_features, int ext_features_len, enum nl80211_ext_feature_index ftidx) { @@ -75,6 +69,16 @@ static int ext_feature_isset(const unsigned char *ext_features, int ext_features return (ft_byte & BIT(ftidx % 8)) != 0; } +static void _ext_feat_print(const struct nlattr *tb, + enum nl80211_ext_feature_index idx, + const char *feature_name, const char *feature_desc) +{ + if (ext_feature_isset(nla_data(tb), nla_len(tb),idx)) + printf("\t\t* [ %s ]: %s\n", feature_name, feature_desc); +} +#define ext_feat_print(tb, name, desc) \ + _ext_feat_print(tb, NL80211_EXT_FEATURE_##name, #name, desc) + static int print_phy_handler(struct nl_msg *msg, void *arg) { struct nlattr *tb_msg[NL80211_ATTR_MAX + 1]; @@ -101,10 +105,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg) struct nlattr *nl_band; struct nlattr *nl_freq; struct nlattr *nl_rate; - struct nlattr *nl_mode; struct nlattr *nl_cmd; struct nlattr *nl_if, *nl_ftype; - int rem_band, rem_freq, rem_rate, rem_mode, rem_cmd, rem_ftype, rem_if; + int rem_band, rem_freq, rem_rate, rem_cmd, rem_ftype, rem_if; int open; /* * static variables only work here, other applications need to use the @@ -129,6 +132,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg) if (print_name && tb_msg[NL80211_ATTR_WIPHY_NAME]) printf("Wiphy %s\n", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME])); + if (print_name && tb_msg[NL80211_ATTR_WIPHY]) + printf("\twiphy index: %u\n", nla_get_u32(tb_msg[NL80211_ATTR_WIPHY])); + /* needed for split dump */ if (tb_msg[NL80211_ATTR_WIPHY_BANDS]) { nla_for_each_nested(nl_band, tb_msg[NL80211_ATTR_WIPHY_BANDS], rem_band) { @@ -160,7 +166,13 @@ static int print_phy_handler(struct nl_msg *msg, void *arg) tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]) print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]), nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])); + if (tb_band[NL80211_BAND_ATTR_IFTYPE_DATA]) { + struct nlattr *nl_iftype; + int rem_band; + nla_for_each_nested(nl_iftype, tb_band[NL80211_BAND_ATTR_IFTYPE_DATA], rem_band) + print_he_info(nl_iftype); + } if (tb_band[NL80211_BAND_ATTR_FREQS]) { if (!band_had_freq) { printf("\t\tFrequencies:\n"); @@ -200,22 +212,6 @@ next: if (open) printf(")"); printf("\n"); - - if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED] && tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) { - enum nl80211_dfs_state state = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]); - unsigned long time; - - printf("\t\t\t DFS state: %s", dfs_state_name(state)); - if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]) { - time = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]); - printf(" (for %lu sec)", time/1000); - } - printf("\n"); - if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME]) - printf("\t\t\t DFS CAC time: %u ms\n", - nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME])); - } - } } @@ -250,6 +246,15 @@ next: if (tb_msg[NL80211_ATTR_MAX_MATCH_SETS]) printf("\tmax # match sets: %d\n", nla_get_u8(tb_msg[NL80211_ATTR_MAX_MATCH_SETS])); + if (tb_msg[NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS]) + printf("\tmax # scan plans: %d\n", + nla_get_u32(tb_msg[NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS])); + if (tb_msg[NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL]) + printf("\tmax scan plan interval: %d\n", + nla_get_u32(tb_msg[NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL])); + if (tb_msg[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]) + printf("\tmax scan plan iterations: %d\n", + nla_get_u32(tb_msg[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS])); if (tb_msg[NL80211_ATTR_WIPHY_FRAG_THRESHOLD]) { unsigned int frag; @@ -315,17 +320,13 @@ next: nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]), nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX])); - if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) { - printf("\tSupported interface modes:\n"); - nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES], rem_mode) - printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); - } + if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) + print_iftype_list("\tSupported interface modes", "\t\t", + tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]); - if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) { - printf("\tsoftware interface modes (can always be added):\n"); - nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode) - printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); - } + if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) + print_iftype_list("\tsoftware interface modes (can always be added)", + "\t\t", tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]); if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) { struct nlattr *nl_combi; @@ -367,8 +368,6 @@ next: } nla_for_each_nested(nl_limit, tb_comb[NL80211_IFACE_COMB_LIMITS], rem_limit) { - bool ift_comma = false; - err = nla_parse_nested(tb_limit, MAX_NL80211_IFACE_LIMIT, nl_limit, iface_limit_policy); if (err || !tb_limit[NL80211_IFACE_LIMIT_TYPES]) { @@ -379,13 +378,8 @@ next: if (comma) printf(", "); comma = true; - printf("#{"); - - nla_for_each_nested(nl_mode, tb_limit[NL80211_IFACE_LIMIT_TYPES], rem_mode) { - printf("%s %s", ift_comma ? "," : "", - iftype_name(nla_type(nl_mode))); - ift_comma = true; - } + printf("#{ "); + print_iftype_line(tb_limit[NL80211_IFACE_LIMIT_TYPES]); printf(" } <= %u", nla_get_u32(tb_limit[NL80211_IFACE_LIMIT_MAX])); } printf(",\n\t\t "); @@ -494,12 +488,13 @@ broken_combination: if (tb_wowlan[NL80211_WOWLAN_TRIG_MAGIC_PKT]) printf("\t\t * wake up on magic packet\n"); if (tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) { + unsigned int len = nla_len(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]); + pat = nla_data(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]); printf("\t\t * wake up on pattern match, up to %u patterns of %u-%u bytes,\n" "\t\t maximum packet offset %u bytes\n", pat->max_patterns, pat->min_pattern_len, pat->max_pattern_len, - (nla_len(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) < - sizeof(*pat)) ? 0 : pat->max_pkt_offset); + len < sizeof(*pat) ? 0 : pat->max_pkt_offset); } if (tb_wowlan[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED]) printf("\t\t * can do GTK rekeying\n"); @@ -527,8 +522,10 @@ broken_combination: if (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]) { struct ieee80211_ht_cap *cm; + unsigned int len = nla_len(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]); + printf("\tHT Capability overrides:\n"); - if (nla_len(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]) >= sizeof(*cm)) { + if (len >= sizeof(*cm)) { cm = nla_data(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]); printf("\t\t * MCS: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx" " %02hhx %02hhx %02hhx %02hhx\n", @@ -611,19 +608,102 @@ broken_combination: printf("\tDevice supports configuring vdev MAC-addr on create.\n"); if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) printf("\tDevice supports TDLS channel switching\n"); + if (features & NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR) + printf("\tDevice supports randomizing MAC-addr in scans.\n"); + if (features & NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR) + printf("\tDevice supports randomizing MAC-addr in sched scans.\n"); + if (features & NL80211_FEATURE_ND_RANDOM_MAC_ADDR) + printf("\tDevice supports randomizing MAC-addr in net-detect scans.\n"); } + if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) + printf("\tDevice supports T-DLS.\n"); + if (tb_msg[NL80211_ATTR_EXT_FEATURES]) { struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES]; - if (ext_feature_isset(nla_data(tb), nla_len(tb), - NL80211_EXT_FEATURE_VHT_IBSS)) - printf("\tDevice supports VHT-IBSS.\n"); + printf("\tSupported extended features:\n"); + + ext_feat_print(tb, VHT_IBSS, "VHT-IBSS"); + ext_feat_print(tb, RRM, "RRM"); + ext_feat_print(tb, MU_MIMO_AIR_SNIFFER, "MU-MIMO sniffer"); + ext_feat_print(tb, SCAN_START_TIME, "scan start timestamp"); + ext_feat_print(tb, BSS_PARENT_TSF, + "BSS last beacon/probe TSF"); + ext_feat_print(tb, SET_SCAN_DWELL, "scan dwell setting"); + ext_feat_print(tb, BEACON_RATE_LEGACY, + "legacy beacon rate setting"); + ext_feat_print(tb, BEACON_RATE_HT, "HT beacon rate setting"); + ext_feat_print(tb, BEACON_RATE_VHT, "VHT beacon rate setting"); + ext_feat_print(tb, FILS_STA, + "STA FILS (Fast Initial Link Setup)"); + ext_feat_print(tb, MGMT_TX_RANDOM_TA, + "randomized TA while not associated"); + ext_feat_print(tb, MGMT_TX_RANDOM_TA_CONNECTED, + "randomized TA while associated"); + ext_feat_print(tb, SCHED_SCAN_RELATIVE_RSSI, + "sched_scan for BSS with better RSSI report"); + ext_feat_print(tb, CQM_RSSI_LIST, + "multiple CQM_RSSI_THOLD records"); + ext_feat_print(tb, FILS_SK_OFFLOAD, + "FILS shared key authentication offload"); + ext_feat_print(tb, 4WAY_HANDSHAKE_STA_PSK, + "4-way handshake with PSK in station mode"); + ext_feat_print(tb, 4WAY_HANDSHAKE_STA_1X, + "4-way handshake with 802.1X in station mode"); + ext_feat_print(tb, FILS_MAX_CHANNEL_TIME, + "FILS max channel attribute override with dwell time"); + ext_feat_print(tb, ACCEPT_BCAST_PROBE_RESP, + "accepts broadcast probe response"); + ext_feat_print(tb, OCE_PROBE_REQ_HIGH_TX_RATE, + "probe request TX at high rate (at least 5.5Mbps)"); + ext_feat_print(tb, OCE_PROBE_REQ_DEFERRAL_SUPPRESSION, + "probe request tx deferral and suppression"); + ext_feat_print(tb, MFP_OPTIONAL, + "MFP_OPTIONAL value in ATTR_USE_MFP"); + ext_feat_print(tb, LOW_SPAN_SCAN, "low span scan"); + ext_feat_print(tb, LOW_POWER_SCAN, "low power scan"); + ext_feat_print(tb, HIGH_ACCURACY_SCAN, "high accuracy scan"); + ext_feat_print(tb, DFS_OFFLOAD, "DFS offload"); + ext_feat_print(tb, CONTROL_PORT_OVER_NL80211, + "control port over nl80211"); + ext_feat_print(tb, ACK_SIGNAL_SUPPORT, + "ack signal level support"); + ext_feat_print(tb, TXQS, "FQ-CoDel-enabled intermediate TXQs"); + ext_feat_print(tb, AIRTIME_FAIRNESS, + "airtime fairness scheduling"); + ext_feat_print(tb, AQL, + "Airtime Queue Limits (AQL)"); + ext_feat_print(tb, SCAN_RANDOM_SN, + "use random sequence numbers in scans"); + ext_feat_print(tb, SCAN_MIN_PREQ_CONTENT, + "use probe request with only rate IEs in scans"); + ext_feat_print(tb, CAN_REPLACE_PTK0, + "can safely replace PTK 0 when rekeying"); + ext_feat_print(tb, ENABLE_FTM_RESPONDER, + "enable FTM (Fine Time Measurement) responder"); + ext_feat_print(tb, AP_PMKSA_CACHING, + "PMKSA caching supported in AP mode"); + ext_feat_print(tb, SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, + "band specific RSSI thresholds for scheduled scan"); + ext_feat_print(tb, EXT_KEY_ID, "Extended Key ID support"); + ext_feat_print(tb, STA_TX_PWR, "TX power control per station"); + ext_feat_print(tb, SAE_OFFLOAD, "SAE offload support"); + ext_feat_print(tb, VLAN_OFFLOAD, "VLAN offload support"); + ext_feat_print(tb, BEACON_PROTECTION, "beacon protection support"); + ext_feat_print(tb, CONTROL_PORT_NO_PREAUTH, "disable pre-auth over nl80211 control port support"); + ext_feat_print(tb, PROTECTED_TWT, "protected Target Wake Time (TWT) support"); + ext_feat_print(tb, DEL_IBSS_STA, "deletion of IBSS station support"); + ext_feat_print(tb, MULTICAST_REGISTRATIONS, "mgmt frame registration for multicast"); + ext_feat_print(tb, BEACON_PROTECTION_CLIENT, "beacon prot. for clients support"); + ext_feat_print(tb, SCAN_FREQ_KHZ, "scan on kHz frequency support"); + ext_feat_print(tb, CONTROL_PORT_OVER_NL80211_TX_STATUS, "tx status for nl80211 control port support"); + ext_feat_print(tb, OPERATING_CHANNEL_VALIDATION, "Operating Channel Validation (OCV) support"); + ext_feat_print(tb, 4WAY_HANDSHAKE_AP_PSK, "AP mode PSK offload support"); + ext_feat_print(tb, BSS_COLOR, "BSS coloring support"); + ext_feat_print(tb, FILS_CRYPTO_OFFLOAD, "FILS crypto offload"); } - if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) - printf("\tDevice supports T-DLS.\n"); - if (tb_msg[NL80211_ATTR_COALESCE_RULE]) { struct nl80211_coalesce_rule_support *rule; struct nl80211_pattern_support *pat; @@ -639,13 +719,16 @@ broken_combination: pat->max_pattern_len, pat->max_pkt_offset, rule->max_delay); } + if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]) + printf("\tMaximum associated stations in AP mode: %u\n", + nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])); + return NL_SKIP; } static bool nl80211_has_split_wiphy = false; static int handle_info(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, int argc, char **argv, enum id_input id) @@ -653,13 +736,13 @@ static int handle_info(struct nl80211_state *state, char *feat_args[] = { "features", "-q" }; int err; - err = handle_cmd(state, CIB_NONE, 2, feat_args); + err = handle_cmd(state, II_NONE, 2, feat_args); if (!err && nl80211_has_split_wiphy) { nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP); nlmsg_hdr(msg)->nlmsg_flags |= NLM_F_DUMP; } - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_phy_handler, NULL); + register_handler(print_phy_handler, NULL); return 0; } @@ -669,12 +752,11 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, "List all wireless devices and their capabilities."); TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL); -static int handle_commands(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, +static int handle_commands(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { int i; - for (i = 1; i < NL80211_CMD_MAX; i++) + for (i = 1; i <= NL80211_CMD_MAX; i++) printf("%d (0x%x): %s\n", i, i, command_name(i)); /* don't send netlink messages */ return 2; @@ -705,12 +787,11 @@ static int print_feature_handler(struct nl_msg *msg, void *arg) return NL_SKIP; } -static int handle_features(struct nl80211_state *state, - struct nl_cb *cb, struct nl_msg *msg, +static int handle_features(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { unsigned long print = argc == 0 || strcmp(argv[0], "-q"); - nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_feature_handler, (void *)print); + register_handler(print_feature_handler, (void *)print); return 0; } |