New upstream version 5.8
Paride Legovini
3 years ago
13 | 13 | CFLAGS_EVAL := $(call cc-option,-Wstringop-overflow=4) |
14 | 14 | |
15 | 15 | CFLAGS ?= -O2 -g |
16 | CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \ | |
17 | -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter \ | |
18 | $(CFLAGS_EVAL) | |
16 | CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common | |
17 | CFLAGS += -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter | |
18 | CFLAGS += -Wdeclaration-after-statement | |
19 | CFLAGS += $(CFLAGS_EVAL) | |
19 | 20 | |
20 | 21 | _OBJS := $(sort $(patsubst %.c,%.o,$(wildcard *.c))) |
21 | 22 | VERSION_OBJS := $(filter-out version.o, $(_OBJS)) |
63 | 63 | memset(txrate_vht, 0, sizeof(*txrate_vht)); |
64 | 64 | |
65 | 65 | for (i = 0; i < argc; i++) { |
66 | if(!parse_vht_chunk(argv[i], &nss, &mcs)) | |
66 | if (!parse_vht_chunk(argv[i], &nss, &mcs)) | |
67 | 67 | return 0; |
68 | 68 | |
69 | 69 | nss--; |
199 | 199 | } |
200 | 200 | |
201 | 201 | if (have_vht_mcs_24) |
202 | if(!setup_vht(&txrate_vht_24, vht_argc_24, vht_argv_24)) | |
202 | if (!setup_vht(&txrate_vht_24, vht_argc_24, vht_argv_24)) | |
203 | 203 | return -EINVAL; |
204 | 204 | |
205 | 205 | if (have_vht_mcs_5) |
206 | if(!setup_vht(&txrate_vht_5, vht_argc_5, vht_argv_5)) | |
206 | if (!setup_vht(&txrate_vht_5, vht_argc_5, vht_argv_5)) | |
207 | 207 | return -EINVAL; |
208 | 208 | |
209 | 209 | if (sgi_5 && lgi_5) |
121 | 121 | |
122 | 122 | if (cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]) { |
123 | 123 | enum nl80211_cqm_rssi_threshold_event rssi_event; |
124 | int32_t rssi_level = -1; | |
124 | 125 | bool found_one = false; |
125 | 126 | |
126 | 127 | rssi_event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]); |
128 | if (cqm[NL80211_ATTR_CQM_RSSI_LEVEL]) | |
129 | rssi_level = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]); | |
127 | 130 | |
128 | 131 | switch (rssi_event) { |
129 | 132 | case NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: |
130 | printf("RSSI went above threshold\n"); | |
133 | printf("RSSI (%i dBm) went above threshold\n", rssi_level); | |
131 | 134 | found_one = true; |
132 | 135 | break; |
133 | 136 | case NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: |
134 | printf("RSSI went below threshold\n"); | |
137 | printf("RSSI (%i dBm) went below threshold\n", rssi_level); | |
135 | 138 | found_one = true; |
136 | 139 | break; |
137 | 140 | case NL80211_CQM_RSSI_BEACON_LOSS_EVENT: |
290 | 293 | printf("\t* TCP connection lost\n"); |
291 | 294 | if (tb[NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS]) |
292 | 295 | printf("\t* TCP connection ran out of tokens\n"); |
296 | } | |
297 | ||
298 | extern struct vendor_event *__start_vendor_event[]; | |
299 | extern struct vendor_event *__stop_vendor_event; | |
300 | ||
301 | // Dummy to force the section to exist | |
302 | VENDOR_EVENT(0xffffffff, 0xffffffff, NULL); | |
303 | ||
304 | static void parse_vendor_event(struct nlattr **attrs, bool dump) | |
305 | { | |
306 | __u32 vendor_id, subcmd; | |
307 | unsigned int i; | |
308 | ||
309 | if (!attrs[NL80211_ATTR_VENDOR_ID] || | |
310 | !attrs[NL80211_ATTR_VENDOR_SUBCMD]) | |
311 | return; | |
312 | ||
313 | vendor_id = nla_get_u32(attrs[NL80211_ATTR_VENDOR_ID]); | |
314 | subcmd = nla_get_u32(attrs[NL80211_ATTR_VENDOR_SUBCMD]); | |
315 | ||
316 | printf("vendor event %.6x:%d", vendor_id, subcmd); | |
317 | ||
318 | for (i = 0; i < &__stop_vendor_event - __start_vendor_event; i++) { | |
319 | struct vendor_event *ev = __start_vendor_event[i]; | |
320 | ||
321 | if (!ev) | |
322 | continue; | |
323 | ||
324 | if (ev->vendor_id != vendor_id) | |
325 | continue; | |
326 | if (ev->subcmd != subcmd) | |
327 | continue; | |
328 | if (!ev->callback) | |
329 | continue; | |
330 | ||
331 | ev->callback(vendor_id, subcmd, attrs[NL80211_ATTR_VENDOR_DATA]); | |
332 | goto out; | |
333 | } | |
334 | ||
335 | if (dump && attrs[NL80211_ATTR_VENDOR_DATA]) | |
336 | iw_hexdump("vendor event", | |
337 | nla_data(attrs[NL80211_ATTR_VENDOR_DATA]), | |
338 | nla_len(attrs[NL80211_ATTR_VENDOR_DATA])); | |
339 | out: | |
340 | printf("\n"); | |
293 | 341 | } |
294 | 342 | |
295 | 343 | static void parse_nan_term(struct nlattr **attrs) |
649 | 697 | printf("\n"); |
650 | 698 | } |
651 | 699 | |
700 | static void parse_new_peer_candidate(struct nlattr **attrs) | |
701 | { | |
702 | char macbuf[ETH_ALEN * 3]; | |
703 | int32_t sig_dbm; | |
704 | ||
705 | printf("new peer candidate"); | |
706 | if (attrs[NL80211_ATTR_MAC]) { | |
707 | mac_addr_n2a(macbuf, nla_data(attrs[NL80211_ATTR_MAC])); | |
708 | printf(" %s", macbuf); | |
709 | } | |
710 | if (attrs[NL80211_ATTR_RX_SIGNAL_DBM]) { | |
711 | sig_dbm = nla_get_u32(attrs[NL80211_ATTR_RX_SIGNAL_DBM]); | |
712 | printf(" %d dBm", sig_dbm); | |
713 | } | |
714 | ||
715 | printf("\n"); | |
716 | } | |
717 | ||
718 | static void parse_recv_interface(struct nlattr **attrs, int command) | |
719 | { | |
720 | switch (command) { | |
721 | case NL80211_CMD_NEW_INTERFACE: | |
722 | printf("new interface"); | |
723 | break; | |
724 | case NL80211_CMD_DEL_INTERFACE: | |
725 | printf("del interface"); | |
726 | break; | |
727 | case NL80211_CMD_SET_INTERFACE: | |
728 | printf("set interface"); | |
729 | break; | |
730 | default: | |
731 | printf("unknown interface command (%i) received\n", command); | |
732 | return; | |
733 | } | |
734 | ||
735 | if (attrs[NL80211_ATTR_IFTYPE]) { | |
736 | printf(" type "); | |
737 | switch (nla_get_u32(attrs[NL80211_ATTR_IFTYPE])) { | |
738 | case NL80211_IFTYPE_STATION: | |
739 | printf("station"); | |
740 | break; | |
741 | case NL80211_IFTYPE_AP: | |
742 | printf("access point"); | |
743 | break; | |
744 | case NL80211_IFTYPE_MESH_POINT: | |
745 | printf("mesh point"); | |
746 | break; | |
747 | case NL80211_IFTYPE_ADHOC: | |
748 | printf("IBSS"); | |
749 | break; | |
750 | case NL80211_IFTYPE_MONITOR: | |
751 | printf("monitor"); | |
752 | break; | |
753 | case NL80211_IFTYPE_AP_VLAN: | |
754 | printf("AP-VLAN"); | |
755 | break; | |
756 | case NL80211_IFTYPE_WDS: | |
757 | printf("WDS"); | |
758 | break; | |
759 | case NL80211_IFTYPE_P2P_CLIENT: | |
760 | printf("P2P-client"); | |
761 | break; | |
762 | case NL80211_IFTYPE_P2P_GO: | |
763 | printf("P2P-GO"); | |
764 | break; | |
765 | case NL80211_IFTYPE_P2P_DEVICE: | |
766 | printf("P2P-Device"); | |
767 | break; | |
768 | case NL80211_IFTYPE_OCB: | |
769 | printf("OCB"); | |
770 | break; | |
771 | case NL80211_IFTYPE_NAN: | |
772 | printf("NAN"); | |
773 | break; | |
774 | default: | |
775 | printf("unknown (%d)", | |
776 | nla_get_u32(attrs[NL80211_ATTR_IFTYPE])); | |
777 | break; | |
778 | } | |
779 | } | |
780 | ||
781 | if (attrs[NL80211_ATTR_MESH_ID]) { | |
782 | printf(" meshid "); | |
783 | print_ssid_escaped(nla_len(attrs[NL80211_ATTR_MESH_ID]), | |
784 | nla_data(attrs[NL80211_ATTR_MESH_ID])); | |
785 | } | |
786 | ||
787 | if (attrs[NL80211_ATTR_4ADDR]) { | |
788 | printf(" use 4addr %d", nla_get_u8(attrs[NL80211_ATTR_4ADDR])); | |
789 | } | |
790 | ||
791 | printf("\n"); | |
792 | } | |
793 | ||
794 | static void parse_sta_opmode_changed(struct nlattr **attrs) | |
795 | { | |
796 | char macbuf[ETH_ALEN*3]; | |
797 | ||
798 | printf("sta opmode changed"); | |
799 | ||
800 | if (attrs[NL80211_ATTR_MAC]) { | |
801 | mac_addr_n2a(macbuf, nla_data(attrs[NL80211_ATTR_MAC])); | |
802 | printf(" %s", macbuf); | |
803 | } | |
804 | ||
805 | if (attrs[NL80211_ATTR_SMPS_MODE]) | |
806 | printf(" smps mode %d", nla_get_u8(attrs[NL80211_ATTR_SMPS_MODE])); | |
807 | ||
808 | if (attrs[NL80211_ATTR_CHANNEL_WIDTH]) | |
809 | printf(" chan width %d", nla_get_u8(attrs[NL80211_ATTR_CHANNEL_WIDTH])); | |
810 | ||
811 | if (attrs[NL80211_ATTR_NSS]) | |
812 | printf(" nss %d", nla_get_u8(attrs[NL80211_ATTR_NSS])); | |
813 | ||
814 | printf("\n"); | |
815 | } | |
816 | ||
817 | static void parse_ch_switch_notify(struct nlattr **attrs, int command) | |
818 | { | |
819 | switch (command) { | |
820 | case NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: | |
821 | printf("channel switch started"); | |
822 | break; | |
823 | case NL80211_CMD_CH_SWITCH_NOTIFY: | |
824 | printf("channel switch"); | |
825 | break; | |
826 | default: | |
827 | printf("unknown channel switch command (%i) received\n", command); | |
828 | return; | |
829 | } | |
830 | ||
831 | if (attrs[NL80211_ATTR_CH_SWITCH_COUNT]) | |
832 | printf(" (count=%d)", nla_get_u32(attrs[NL80211_ATTR_CH_SWITCH_COUNT])); | |
833 | ||
834 | if (attrs[NL80211_ATTR_WIPHY_FREQ]) | |
835 | printf(" freq=%d", nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ])); | |
836 | ||
837 | if (attrs[NL80211_ATTR_CHANNEL_WIDTH]) { | |
838 | printf(" width="); | |
839 | switch(nla_get_u32(attrs[NL80211_ATTR_CHANNEL_WIDTH])) { | |
840 | case NL80211_CHAN_WIDTH_20_NOHT: | |
841 | case NL80211_CHAN_WIDTH_20: | |
842 | printf("\"20 MHz\""); | |
843 | break; | |
844 | case NL80211_CHAN_WIDTH_40: | |
845 | printf("\"40 MHz\""); | |
846 | break; | |
847 | case NL80211_CHAN_WIDTH_80: | |
848 | printf("\"80 MHz\""); | |
849 | break; | |
850 | case NL80211_CHAN_WIDTH_80P80: | |
851 | printf("\"80+80 MHz\""); | |
852 | break; | |
853 | case NL80211_CHAN_WIDTH_160: | |
854 | printf("\"160 MHz\""); | |
855 | break; | |
856 | case NL80211_CHAN_WIDTH_5: | |
857 | printf("\"5 MHz\""); | |
858 | break; | |
859 | case NL80211_CHAN_WIDTH_10: | |
860 | printf("\"10 MHz\""); | |
861 | break; | |
862 | default: | |
863 | printf("\"unknown\""); | |
864 | } | |
865 | } | |
866 | ||
867 | if (attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) { | |
868 | printf(" type="); | |
869 | switch(nla_get_u32(attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE])) { | |
870 | case NL80211_CHAN_NO_HT: | |
871 | printf("\"No HT\""); | |
872 | break; | |
873 | case NL80211_CHAN_HT20: | |
874 | printf("\"HT20\""); | |
875 | break; | |
876 | case NL80211_CHAN_HT40MINUS: | |
877 | printf("\"HT40-\""); | |
878 | break; | |
879 | case NL80211_CHAN_HT40PLUS: | |
880 | printf("\"HT40+\""); | |
881 | break; | |
882 | } | |
883 | } | |
884 | ||
885 | if (attrs[NL80211_ATTR_CENTER_FREQ1]) | |
886 | printf(" freq1=%d", nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ1])); | |
887 | ||
888 | if (attrs[NL80211_ATTR_CENTER_FREQ2]) | |
889 | printf(" freq2=%d", nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ2])); | |
890 | ||
891 | printf("\n"); | |
892 | } | |
893 | ||
652 | 894 | static int print_event(struct nl_msg *msg, void *arg) |
653 | 895 | { |
654 | 896 | struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); |
682 | 924 | genlmsg_attrlen(gnlh, 0), NULL); |
683 | 925 | |
684 | 926 | if (tb[NL80211_ATTR_IFINDEX] && tb[NL80211_ATTR_WIPHY]) { |
685 | if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname); | |
686 | printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY])); | |
927 | /* if_indextoname may fails on delete interface/wiphy event */ | |
928 | if (if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname)) | |
929 | printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY])); | |
930 | else | |
931 | printf("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY])); | |
687 | 932 | } else if (tb[NL80211_ATTR_WDEV] && tb[NL80211_ATTR_WIPHY]) { |
688 | 933 | printf("wdev 0x%llx (phy #%d): ", |
689 | 934 | (unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]), |
733 | 978 | case NL80211_CMD_SCHED_SCAN_RESULTS: |
734 | 979 | printf("got scheduled scan results\n"); |
735 | 980 | break; |
981 | case NL80211_CMD_WIPHY_REG_CHANGE: | |
736 | 982 | case NL80211_CMD_REG_CHANGE: |
737 | printf("regulatory domain change: "); | |
983 | if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE) | |
984 | printf("regulatory domain change (phy): "); | |
985 | else | |
986 | printf("regulatory domain change: "); | |
738 | 987 | |
739 | 988 | reg_type = nla_get_u8(tb[NL80211_ATTR_REG_TYPE]); |
740 | 989 | |
905 | 1154 | nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]), |
906 | 1155 | (unsigned long long)nla_get_u64(tb[NL80211_ATTR_COOKIE])); |
907 | 1156 | break; |
1157 | case NL80211_CMD_FRAME_WAIT_CANCEL: | |
1158 | printf("frame wait cancel on freq %d (cookie %llx)\n", | |
1159 | nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]), | |
1160 | (unsigned long long)nla_get_u64(tb[NL80211_ATTR_COOKIE])); | |
1161 | break; | |
908 | 1162 | case NL80211_CMD_NOTIFY_CQM: |
909 | 1163 | parse_cqm_event(tb); |
910 | 1164 | break; |
933 | 1187 | tb[NL80211_ATTR_ACK] ? "acked" : "no ack"); |
934 | 1188 | break; |
935 | 1189 | case NL80211_CMD_VENDOR: |
936 | printf("vendor event %.6x:%d\n", | |
937 | nla_get_u32(tb[NL80211_ATTR_VENDOR_ID]), | |
938 | nla_get_u32(tb[NL80211_ATTR_VENDOR_SUBCMD])); | |
939 | if (args->frame && tb[NL80211_ATTR_VENDOR_DATA]) | |
940 | iw_hexdump("vendor event", | |
941 | nla_data(tb[NL80211_ATTR_VENDOR_DATA]), | |
942 | nla_len(tb[NL80211_ATTR_VENDOR_DATA])); | |
1190 | parse_vendor_event(tb, args->frame); | |
943 | 1191 | break; |
944 | 1192 | case NL80211_CMD_RADAR_DETECT: { |
945 | 1193 | enum nl80211_radar_event event_type; |
984 | 1232 | case NL80211_CMD_DEL_NAN_FUNCTION: |
985 | 1233 | parse_nan_term(tb); |
986 | 1234 | break; |
987 | case NL80211_CMD_NAN_MATCH: { | |
1235 | case NL80211_CMD_NAN_MATCH: | |
988 | 1236 | parse_nan_match(tb); |
989 | 1237 | break; |
990 | } | |
1238 | case NL80211_CMD_NEW_PEER_CANDIDATE: | |
1239 | parse_new_peer_candidate(tb); | |
1240 | break; | |
1241 | case NL80211_CMD_NEW_INTERFACE: | |
1242 | case NL80211_CMD_SET_INTERFACE: | |
1243 | case NL80211_CMD_DEL_INTERFACE: | |
1244 | parse_recv_interface(tb, gnlh->cmd); | |
1245 | break; | |
1246 | case NL80211_CMD_STA_OPMODE_CHANGED: | |
1247 | parse_sta_opmode_changed(tb); | |
1248 | break; | |
1249 | case NL80211_CMD_STOP_AP: | |
1250 | printf("stop ap\n"); | |
1251 | break; | |
1252 | case NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: | |
1253 | case NL80211_CMD_CH_SWITCH_NOTIFY: | |
1254 | parse_ch_switch_notify(tb, gnlh->cmd); | |
1255 | break; | |
991 | 1256 | default: |
992 | 1257 | printf("unknown event %d (%s)\n", |
993 | 1258 | gnlh->cmd, command_name(gnlh->cmd)); |
131 | 131 | } |
132 | 132 | if (print_name && tb_msg[NL80211_ATTR_WIPHY_NAME]) |
133 | 133 | printf("Wiphy %s\n", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME])); |
134 | ||
135 | if (print_name && tb_msg[NL80211_ATTR_WIPHY]) | |
136 | printf("\twiphy index: %u\n", nla_get_u32(tb_msg[NL80211_ATTR_WIPHY])); | |
134 | 137 | |
135 | 138 | /* needed for split dump */ |
136 | 139 | if (tb_msg[NL80211_ATTR_WIPHY_BANDS]) { |
675 | 678 | ext_feat_print(tb, DFS_OFFLOAD, "DFS offload"); |
676 | 679 | ext_feat_print(tb, CONTROL_PORT_OVER_NL80211, |
677 | 680 | "control port over nl80211"); |
681 | ext_feat_print(tb, ACK_SIGNAL_SUPPORT, | |
682 | "ack signal level support"); | |
678 | 683 | ext_feat_print(tb, TXQS, "FQ-CoDel-enabled intermediate TXQs"); |
679 | 684 | ext_feat_print(tb, AIRTIME_FAIRNESS, |
680 | 685 | "airtime fairness scheduling"); |
686 | ext_feat_print(tb, AQL, | |
687 | "Airtime Queue Limits (AQL)"); | |
688 | ext_feat_print(tb, SCAN_RANDOM_SN, | |
689 | "use random sequence numbers in scans"); | |
690 | ext_feat_print(tb, SCAN_MIN_PREQ_CONTENT, | |
691 | "use probe request with only rate IEs in scans"); | |
692 | ext_feat_print(tb, CAN_REPLACE_PTK0, | |
693 | "can safely replace PTK 0 when rekeying"); | |
694 | ext_feat_print(tb, ENABLE_FTM_RESPONDER, | |
695 | "enable FTM (Fine Time Measurement) responder"); | |
681 | 696 | ext_feat_print(tb, AP_PMKSA_CACHING, |
682 | 697 | "PMKSA caching supported in AP mode"); |
683 | 698 | ext_feat_print(tb, SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, |
684 | 699 | "band specific RSSI thresholds for scheduled scan"); |
685 | ext_feat_print(tb, EXT_KEY_ID, "extended key ID support"); | |
700 | ext_feat_print(tb, EXT_KEY_ID, "Extended Key ID support"); | |
686 | 701 | ext_feat_print(tb, STA_TX_PWR, "TX power control per station"); |
687 | 702 | ext_feat_print(tb, SAE_OFFLOAD, "SAE offload support"); |
703 | ext_feat_print(tb, VLAN_OFFLOAD, "VLAN offload support"); | |
704 | ext_feat_print(tb, BEACON_PROTECTION, "beacon protection support"); | |
705 | ext_feat_print(tb, CONTROL_PORT_NO_PREAUTH, "disable pre-auth over nl80211 control port support"); | |
706 | ext_feat_print(tb, PROTECTED_TWT, "protected Target Wake Time (TWT) support"); | |
707 | ext_feat_print(tb, DEL_IBSS_STA, "deletion of IBSS station support"); | |
708 | ext_feat_print(tb, MULTICAST_REGISTRATIONS, "mgmt frame registration for multicast"); | |
709 | ext_feat_print(tb, BEACON_PROTECTION_CLIENT, "beacon prot. for clients support"); | |
710 | ext_feat_print(tb, SCAN_FREQ_KHZ, "scan on kHz frequency support"); | |
711 | ext_feat_print(tb, CONTROL_PORT_OVER_NL80211_TX_STATUS, "tx status for nl80211 control port support"); | |
712 | ext_feat_print(tb, OPERATING_CHANNEL_VALIDATION, "Operating Channel Validation (OCV) support"); | |
713 | ext_feat_print(tb, 4WAY_HANDSHAKE_AP_PSK, "AP mode PSK offload support"); | |
688 | 714 | } |
689 | 715 | |
690 | 716 | if (tb_msg[NL80211_ATTR_COALESCE_RULE]) { |
701 | 727 | rule->max_rules, pat->max_patterns, pat->min_pattern_len, |
702 | 728 | pat->max_pattern_len, pat->max_pkt_offset, rule->max_delay); |
703 | 729 | } |
730 | ||
731 | if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]) | |
732 | printf("\tMaximum associated stations in AP mode: %u\n", | |
733 | nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])); | |
704 | 734 | |
705 | 735 | return NL_SKIP; |
706 | 736 | } |
434 | 434 | } |
435 | 435 | |
436 | 436 | if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) { |
437 | uint32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]); | |
437 | int32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]); | |
438 | 438 | |
439 | 439 | printf("%s\ttxpower %d.%.2d dBm\n", |
440 | 440 | indent, txp / 100, txp % 100); |
726 | 726 | "Switch the operating channel by sending a channel switch announcement (CSA)."); |
727 | 727 | COMMAND(switch, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]", |
728 | 728 | NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); |
729 | ||
730 | ||
731 | static int toggle_tid_param(const char *argv0, const char *argv1, | |
732 | struct nl_msg *msg, uint32_t attr) | |
733 | { | |
734 | uint8_t val; | |
735 | ||
736 | if (strcmp(argv1, "on") == 0) { | |
737 | val = NL80211_TID_CONFIG_ENABLE; | |
738 | } else if (strcmp(argv1, "off") == 0) { | |
739 | val = NL80211_TID_CONFIG_DISABLE; | |
740 | } else { | |
741 | fprintf(stderr, "Invalid %s parameter: %s\n", argv0, argv1); | |
742 | return 2; | |
743 | } | |
744 | ||
745 | NLA_PUT_U8(msg, attr, val); | |
746 | return 0; | |
747 | ||
748 | nla_put_failure: | |
749 | return -ENOBUFS; | |
750 | } | |
751 | ||
752 | static int handle_tid_config(struct nl80211_state *state, | |
753 | struct nl_msg *msg, | |
754 | int argc, char **argv, | |
755 | enum id_input id) | |
756 | { | |
757 | struct nlattr *tids_array = NULL; | |
758 | struct nlattr *tids_entry = NULL; | |
759 | unsigned char peer[ETH_ALEN]; | |
760 | int tids_num = 0; | |
761 | char *end; | |
762 | int ret; | |
763 | enum { | |
764 | PS_ADDR, | |
765 | PS_TIDS, | |
766 | PS_CONF, | |
767 | } parse_state = PS_ADDR; | |
768 | ||
769 | while (argc) { | |
770 | switch (parse_state) { | |
771 | case PS_ADDR: | |
772 | if (strcmp(argv[0], "peer") == 0) { | |
773 | if (argc < 2) { | |
774 | fprintf(stderr, "Not enough args for %s\n", argv[0]); | |
775 | return HANDLER_RET_USAGE; | |
776 | } | |
777 | ||
778 | if (mac_addr_a2n(peer, argv[1])) { | |
779 | fprintf(stderr, "Invalid MAC address\n"); | |
780 | return 2; | |
781 | } | |
782 | ||
783 | NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, peer); | |
784 | ||
785 | argc -= 2; | |
786 | argv += 2; | |
787 | parse_state = PS_TIDS; | |
788 | ||
789 | } else if (strcmp(argv[0], "tids") == 0) { | |
790 | parse_state = PS_TIDS; | |
791 | } else { | |
792 | fprintf(stderr, "Peer MAC address expected\n"); | |
793 | return HANDLER_RET_USAGE; | |
794 | } | |
795 | ||
796 | break; | |
797 | case PS_TIDS: | |
798 | if (strcmp(argv[0], "tids") == 0) { | |
799 | if (argc < 2) { | |
800 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
801 | return HANDLER_RET_USAGE; | |
802 | } | |
803 | ||
804 | if (!tids_array) { | |
805 | tids_array = nla_nest_start(msg, NL80211_ATTR_TID_CONFIG); | |
806 | if (!tids_array) | |
807 | return -ENOBUFS; | |
808 | } | |
809 | ||
810 | if (tids_entry) { | |
811 | nla_nest_end(msg, tids_entry); | |
812 | tids_num++; | |
813 | } | |
814 | ||
815 | tids_entry = nla_nest_start(msg, tids_num); | |
816 | if (!tids_entry) | |
817 | return -ENOBUFS; | |
818 | ||
819 | NLA_PUT_U16(msg, NL80211_TID_CONFIG_ATTR_TIDS, strtol(argv[1], &end, 0)); | |
820 | if (*end) { | |
821 | fprintf(stderr, "Invalid TID mask value: %s\n", argv[1]); | |
822 | return 2; | |
823 | } | |
824 | ||
825 | argc -= 2; | |
826 | argv += 2; | |
827 | parse_state = PS_CONF; | |
828 | } else { | |
829 | fprintf(stderr, "TID mask expected\n"); | |
830 | return HANDLER_RET_USAGE; | |
831 | } | |
832 | ||
833 | break; | |
834 | case PS_CONF: | |
835 | if (strcmp(argv[0], "tids") == 0) { | |
836 | parse_state = PS_TIDS; | |
837 | } else if (strcmp(argv[0], "override") == 0) { | |
838 | NLA_PUT_FLAG(msg, NL80211_TID_CONFIG_ATTR_OVERRIDE); | |
839 | ||
840 | argc -= 1; | |
841 | argv += 1; | |
842 | } else if (strcmp(argv[0], "ampdu") == 0) { | |
843 | if (argc < 2) { | |
844 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
845 | return HANDLER_RET_USAGE; | |
846 | } | |
847 | ||
848 | ret = toggle_tid_param(argv[0], argv[1], msg, | |
849 | NL80211_TID_CONFIG_ATTR_AMPDU_CTRL); | |
850 | if (ret) | |
851 | return ret; | |
852 | ||
853 | argc -= 2; | |
854 | argv += 2; | |
855 | } else if (strcmp(argv[0], "amsdu") == 0) { | |
856 | if (argc < 2) { | |
857 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
858 | return HANDLER_RET_USAGE; | |
859 | } | |
860 | ||
861 | ret = toggle_tid_param(argv[0], argv[1], msg, | |
862 | NL80211_TID_CONFIG_ATTR_AMSDU_CTRL); | |
863 | if (ret) | |
864 | return ret; | |
865 | ||
866 | argc -= 2; | |
867 | argv += 2; | |
868 | } else if (strcmp(argv[0], "noack") == 0) { | |
869 | if (argc < 2) { | |
870 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
871 | return HANDLER_RET_USAGE; | |
872 | } | |
873 | ||
874 | ret = toggle_tid_param(argv[0], argv[1], msg, | |
875 | NL80211_TID_CONFIG_ATTR_NOACK); | |
876 | if (ret) | |
877 | return ret; | |
878 | ||
879 | argc -= 2; | |
880 | argv += 2; | |
881 | } else if (strcmp(argv[0], "rtscts") == 0) { | |
882 | if (argc < 2) { | |
883 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
884 | return HANDLER_RET_USAGE; | |
885 | } | |
886 | ||
887 | ret = toggle_tid_param(argv[0], argv[1], msg, | |
888 | NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL); | |
889 | if (ret) | |
890 | return ret; | |
891 | ||
892 | argc -= 2; | |
893 | argv += 2; | |
894 | } else if (strcmp(argv[0], "sretry") == 0) { | |
895 | if (argc < 2) { | |
896 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
897 | return HANDLER_RET_USAGE; | |
898 | } | |
899 | ||
900 | NLA_PUT_U8(msg, NL80211_TID_CONFIG_ATTR_RETRY_SHORT, strtol(argv[1], &end, 0)); | |
901 | if (*end) { | |
902 | fprintf(stderr, "Invalid short_retry value: %s\n", argv[1]); | |
903 | return 2; | |
904 | } | |
905 | ||
906 | argc -= 2; | |
907 | argv += 2; | |
908 | } else if (strcmp(argv[0], "lretry") == 0) { | |
909 | if (argc < 2) { | |
910 | fprintf(stderr, "not enough args for %s\n", argv[0]); | |
911 | return HANDLER_RET_USAGE; | |
912 | } | |
913 | ||
914 | NLA_PUT_U8(msg, NL80211_TID_CONFIG_ATTR_RETRY_LONG, strtol(argv[1], &end, 0)); | |
915 | if (*end) { | |
916 | fprintf(stderr, "Invalid long_retry value: %s\n", argv[1]); | |
917 | return 2; | |
918 | } | |
919 | ||
920 | argc -= 2; | |
921 | argv += 2; | |
922 | } else { | |
923 | fprintf(stderr, "Unknown parameter: %s\n", argv[0]); | |
924 | return HANDLER_RET_USAGE; | |
925 | } | |
926 | ||
927 | break; | |
928 | default: | |
929 | fprintf(stderr, "Failed to parse: internal failure\n"); | |
930 | return HANDLER_RET_USAGE; | |
931 | } | |
932 | } | |
933 | ||
934 | if (tids_entry) | |
935 | nla_nest_end(msg, tids_entry); | |
936 | ||
937 | if (tids_array) | |
938 | nla_nest_end(msg, tids_array); | |
939 | ||
940 | return 0; | |
941 | ||
942 | nla_put_failure: | |
943 | return -ENOBUFS; | |
944 | } | |
945 | ||
946 | COMMAND(set, tidconf, "[peer <MAC address>] tids <mask> [override] [sretry <num>] [lretry <num>] " | |
947 | "[ampdu [on|off]] [amsdu [on|off]] [noack [on|off]] [rtscts [on|off]]", | |
948 | NL80211_CMD_SET_TID_CONFIG, 0, CIB_NETDEV, handle_tid_config, | |
949 | "Setup per-node TID specific configuration for TIDs selected by bitmask.\n" | |
950 | "If MAC address is not specified, then supplied TID configuration\n" | |
951 | "applied to all the peers.\n" | |
952 | "Examples:\n" | |
953 | " $ iw dev wlan0 tids 0x1 ampdu off\n" | |
954 | " $ iw dev wlan0 tids 0x5 ampdu off amsdu off rtscts on\n" | |
955 | " $ iw dev wlan0 tids 0x3 override ampdu on noack on rtscts on\n" | |
956 | " $ iw dev wlan0 peer xx:xx:xx:xx:xx:xx tids 0x1 ampdu off tids 0x3 amsdu off rtscts on\n" | |
957 | ); |
154 | 154 | #define DECLARE_SECTION(_name) \ |
155 | 155 | extern struct cmd __section ## _ ## _name; |
156 | 156 | |
157 | struct vendor_event { | |
158 | unsigned int vendor_id, subcmd; | |
159 | void (*callback)(unsigned int vendor_id, unsigned int subcmd, | |
160 | struct nlattr *data); | |
161 | }; | |
162 | ||
163 | #define VENDOR_EVENT(_id, _subcmd, _callback) \ | |
164 | const struct vendor_event \ | |
165 | vendor_event_ ## _id ## _ ## _subcmd = { \ | |
166 | .vendor_id = _id, \ | |
167 | .subcmd = _subcmd, \ | |
168 | .callback = _callback, \ | |
169 | }, * const vendor_event_ ## _id ## _ ## _subcmd ## _p \ | |
170 | __attribute__((used,section("vendor_event"))) = \ | |
171 | &vendor_event_ ## _id ## _ ## _subcmd | |
172 | ||
157 | 173 | extern const char iw_version[]; |
158 | 174 | |
159 | 175 | extern int iw_debug; |
138 | 138 | printf("Invalid preamble %s\n", pos + 9); |
139 | 139 | return HANDLER_RET_USAGE; |
140 | 140 | } |
141 | preamble = true; | |
142 | } else if (strncmp(pos, "tb", 2) == 0) { | |
143 | NLA_PUT_FLAG(msg, | |
144 | NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED); | |
145 | NLA_PUT_U32(msg, NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE, | |
146 | NL80211_PREAMBLE_HE); | |
147 | preamble = true; | |
148 | } else if (strncmp(pos, "non_tb", 6) == 0) { | |
149 | NLA_PUT_FLAG(msg, | |
150 | NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED); | |
151 | NLA_PUT_U32(msg, NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE, | |
152 | NL80211_PREAMBLE_HE); | |
141 | 153 | preamble = true; |
142 | 154 | } else { |
143 | 155 | printf("Unknown parameter %s\n", pos); |
165 | 177 | case NL80211_CHAN_WIDTH_160: |
166 | 178 | preamble = NL80211_PREAMBLE_VHT; |
167 | 179 | break; |
180 | default: | |
181 | return HANDLER_RET_USAGE; | |
168 | 182 | } |
169 | 183 | |
170 | 184 | NLA_PUT_U32(msg, NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE, preamble); |
314 | 328 | CIB_NETDEV, handle_ftm_req, |
315 | 329 | "Send an FTM request to the targets supplied in the config file.\n" |
316 | 330 | "Each line in the file represents a target, with the following format:\n" |
317 | "<addr> bw=<[20|40|80|80+80|160]> cf=<center_freq> [cf1=<center_freq1>] [cf2=<center_freq2>] [ftms_per_burst=<samples per burst>] [ap-tsf] [asap] [bursts_exp=<num of bursts exponent>] [burst_period=<burst period>] [retries=<num of retries>] [burst_duration=<burst duration>] [preamble=<legacy,ht,vht,dmg>] [lci] [civic]"); | |
331 | "<addr> bw=<[20|40|80|80+80|160]> cf=<center_freq> [cf1=<center_freq1>] [cf2=<center_freq2>] [ftms_per_burst=<samples per burst>] [ap-tsf] [asap] [bursts_exp=<num of bursts exponent>] [burst_period=<burst period>] [retries=<num of retries>] [burst_duration=<burst duration>] [preamble=<legacy,ht,vht,dmg>] [lci] [civic] [tb] [non_tb]"); | |
318 | 332 | HIDDEN(measurement, ftm_request_send, "", NL80211_CMD_PEER_MEASUREMENT_START, |
319 | 333 | 0, CIB_NETDEV, handle_ftm_req_send); |
263 | 263 | _my_nla_put_u16, _parse_u16, _print_u16_in_TUs}, |
264 | 264 | {"mesh_plink_timeout", NL80211_MESHCONF_PLINK_TIMEOUT, |
265 | 265 | _my_nla_put_u32, _parse_u32, _print_u32_in_seconds}, |
266 | {"mesh_connected_to_gate", NL80211_MESHCONF_CONNECTED_TO_GATE, | |
267 | _my_nla_put_u8, _parse_u8_as_bool, _print_u8}, | |
268 | {"mesh_nolearn", NL80211_MESHCONF_NOLEARN, | |
269 | _my_nla_put_u8, _parse_u8_as_bool, _print_u8}, | |
270 | {"mesh_connected_to_as", NL80211_MESHCONF_CONNECTED_TO_AS, | |
271 | _my_nla_put_u8, _parse_u8_as_bool, _print_u8}, | |
266 | 272 | }; |
267 | 273 | |
268 | 274 | static void print_all_mesh_param_descr(void) |
37 | 37 | [NL80211_MPATH_INFO_DISCOVERY_TIMEOUT] = { .type = NLA_U32 }, |
38 | 38 | [NL80211_MPATH_INFO_DISCOVERY_RETRIES] = { .type = NLA_U8 }, |
39 | 39 | [NL80211_MPATH_INFO_FLAGS] = { .type = NLA_U8 }, |
40 | [NL80211_MPATH_INFO_HOP_COUNT] = { .type = NLA_U8 }, | |
41 | [NL80211_MPATH_INFO_PATH_CHANGE] = { .type = NLA_U32 }, | |
40 | 42 | }; |
41 | 43 | |
42 | 44 | nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), |
84 | 86 | if (pinfo[NL80211_MPATH_INFO_FLAGS]) |
85 | 87 | printf("\t0x%x", |
86 | 88 | nla_get_u8(pinfo[NL80211_MPATH_INFO_FLAGS])); |
89 | if (pinfo[NL80211_MPATH_INFO_HOP_COUNT]) | |
90 | printf("\t%u", | |
91 | nla_get_u8(pinfo[NL80211_MPATH_INFO_HOP_COUNT])); | |
92 | if (pinfo[NL80211_MPATH_INFO_PATH_CHANGE]) | |
93 | printf("\t%u", | |
94 | nla_get_u32(pinfo[NL80211_MPATH_INFO_PATH_CHANGE])); | |
87 | 95 | |
88 | 96 | printf("\n"); |
89 | 97 | return NL_SKIP; |
217 | 225 | enum id_input id) |
218 | 226 | { |
219 | 227 | printf("DEST ADDR NEXT HOP IFACE\tSN\tMETRIC\tQLEN\t" |
220 | "EXPTIME\t\tDTIM\tDRET\tFLAGS\n"); | |
228 | "EXPTIME\t\tDTIM\tDRET\tFLAGS\tHOP_COUNT\tPATH_CHANGE\n"); | |
221 | 229 | register_handler(print_mpath_handler, NULL); |
222 | 230 | return 0; |
223 | 231 | } |
10 | 10 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> |
11 | 11 | * Copyright 2008 Colin McCabe <colin@cozybit.com> |
12 | 12 | * Copyright 2015-2017 Intel Deutschland GmbH |
13 | * Copyright (C) 2018-2019 Intel Corporation | |
13 | * Copyright (C) 2018-2020 Intel Corporation | |
14 | 14 | * |
15 | 15 | * Permission to use, copy, modify, and/or distribute this software for any |
16 | 16 | * purpose with or without fee is hereby granted, provided that the above |
182 | 182 | * |
183 | 183 | * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers |
184 | 184 | * can indicate they support offloading EAPOL handshakes for WPA/WPA2 |
185 | * preshared key authentication. In %NL80211_CMD_CONNECT the preshared | |
186 | * key should be specified using %NL80211_ATTR_PMK. Drivers supporting | |
187 | * this offload may reject the %NL80211_CMD_CONNECT when no preshared | |
188 | * key material is provided, for example when that driver does not | |
189 | * support setting the temporal keys through %CMD_NEW_KEY. | |
185 | * preshared key authentication in station mode. In %NL80211_CMD_CONNECT | |
186 | * the preshared key should be specified using %NL80211_ATTR_PMK. Drivers | |
187 | * supporting this offload may reject the %NL80211_CMD_CONNECT when no | |
188 | * preshared key material is provided, for example when that driver does | |
189 | * not support setting the temporal keys through %NL80211_CMD_NEW_KEY. | |
190 | 190 | * |
191 | 191 | * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be |
192 | 192 | * set by drivers indicating offload support of the PTK/GTK EAPOL |
193 | * handshakes during 802.1X authentication. In order to use the offload | |
194 | * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS | |
195 | * attribute flag. Drivers supporting this offload may reject the | |
196 | * %NL80211_CMD_CONNECT when the attribute flag is not present. | |
193 | * handshakes during 802.1X authentication in station mode. In order to | |
194 | * use the offload the %NL80211_CMD_CONNECT should have | |
195 | * %NL80211_ATTR_WANT_1X_4WAY_HS attribute flag. Drivers supporting this | |
196 | * offload may reject the %NL80211_CMD_CONNECT when the attribute flag is | |
197 | * not present. | |
198 | * | |
199 | * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK flag drivers | |
200 | * can indicate they support offloading EAPOL handshakes for WPA/WPA2 | |
201 | * preshared key authentication in AP mode. In %NL80211_CMD_START_AP | |
202 | * the preshared key should be specified using %NL80211_ATTR_PMK. Drivers | |
203 | * supporting this offload may reject the %NL80211_CMD_START_AP when no | |
204 | * preshared key material is provided, for example when that driver does | |
205 | * not support setting the temporal keys through %NL80211_CMD_NEW_KEY. | |
197 | 206 | * |
198 | 207 | * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK |
199 | 208 | * using %NL80211_CMD_SET_PMK. For offloaded FT support also |
248 | 257 | */ |
249 | 258 | |
250 | 259 | /** |
260 | * DOC: VLAN offload support for setting group keys and binding STAs to VLANs | |
261 | * | |
262 | * By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they | |
263 | * support offloading VLAN functionality in a manner where the driver exposes a | |
264 | * single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs | |
265 | * can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet | |
266 | * case. Frames received from stations that are not assigned to any VLAN are | |
267 | * delivered on the main netdev and frames to such stations can be sent through | |
268 | * that main netdev. | |
269 | * | |
270 | * %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and | |
271 | * %NL80211_CMD_SET_STATION will optionally specify vlan_id using | |
272 | * %NL80211_ATTR_VLAN_ID. | |
273 | */ | |
274 | ||
275 | /** | |
276 | * DOC: TID configuration | |
277 | * | |
278 | * TID config support can be checked in the %NL80211_ATTR_TID_CONFIG | |
279 | * attribute given in wiphy capabilities. | |
280 | * | |
281 | * The necessary configuration parameters are mentioned in | |
282 | * &enum nl80211_tid_config_attr and it will be passed to the | |
283 | * %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG. | |
284 | * | |
285 | * If the configuration needs to be applied for specific peer then the MAC | |
286 | * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the | |
287 | * configuration will be applied for all the connected peers in the vif except | |
288 | * any peers that have peer specific configuration for the TID by default; if | |
289 | * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values | |
290 | * will be overwritten. | |
291 | * | |
292 | * All this configuration is valid only for STA's current connection | |
293 | * i.e. the configuration will be reset to default when the STA connects back | |
294 | * after disconnection/roaming, and this configuration will be cleared when | |
295 | * the interface goes down. | |
296 | */ | |
297 | ||
298 | /** | |
251 | 299 | * enum nl80211_commands - supported nl80211 commands |
252 | 300 | * |
253 | 301 | * @NL80211_CMD_UNSPEC: unspecified command to catch errors |
256 | 304 | * to get a list of all present wiphys. |
257 | 305 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
258 | 306 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
259 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the | |
260 | * attributes determining the channel width; this is used for setting | |
261 | * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, | |
262 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | |
263 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | |
264 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL | |
265 | * instead, the support here is for backward compatibility only. | |
307 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, | |
308 | * %NL80211_ATTR_WIPHY_FREQ_OFFSET (and the attributes determining the | |
309 | * channel width; this is used for setting monitor mode channel), | |
310 | * %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG, | |
311 | * %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or | |
312 | * %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel, | |
313 | * see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward | |
314 | * compatibility only. | |
266 | 315 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request |
267 | 316 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and |
268 | 317 | * %NL80211_ATTR_WIPHY_NAME. |
311 | 360 | * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, |
312 | 361 | * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. |
313 | 362 | * The channel to use can be set on the interface or be given using the |
314 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. | |
363 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_FREQ_OFFSET, and the | |
364 | * attributes determining channel width. | |
315 | 365 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
316 | 366 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
317 | 367 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
321 | 371 | * @NL80211_CMD_SET_STATION: Set station attributes for station identified by |
322 | 372 | * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. |
323 | 373 | * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the |
324 | * the interface identified by %NL80211_ATTR_IFINDEX. | |
374 | * interface identified by %NL80211_ATTR_IFINDEX. | |
325 | 375 | * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC |
326 | 376 | * or, if no MAC address given, all stations, on the interface identified |
327 | 377 | * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and |
341 | 391 | * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by |
342 | 392 | * %NL80211_ATTR_MAC. |
343 | 393 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the |
344 | * the interface identified by %NL80211_ATTR_IFINDEX. | |
394 | * interface identified by %NL80211_ATTR_IFINDEX. | |
345 | 395 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC |
346 | 396 | * or, if no MAC address given, all mesh paths, on the interface identified |
347 | 397 | * by %NL80211_ATTR_IFINDEX. |
496 | 546 | * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and |
497 | 547 | * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify |
498 | 548 | * the SSID (mainly for association, but is included in authentication |
499 | * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used | |
500 | * to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE | |
501 | * is used to specify the authentication type. %NL80211_ATTR_IE is used to | |
502 | * define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs) | |
503 | * to be added to the frame. | |
549 | * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ + | |
550 | * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the | |
551 | * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the | |
552 | * authentication type. %NL80211_ATTR_IE is used to define IEs | |
553 | * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added | |
554 | * to the frame. | |
504 | 555 | * When used as an event, this reports reception of an Authentication |
505 | 556 | * frame in station and IBSS modes when the local MLME processed the |
506 | 557 | * frame, i.e., it was for the local STA and was received in correct |
555 | 606 | * requests to connect to a specified network but without separating |
556 | 607 | * auth and assoc steps. For this, you need to specify the SSID in a |
557 | 608 | * %NL80211_ATTR_SSID attribute, and can optionally specify the association |
558 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, | |
559 | * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, | |
609 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, | |
610 | * %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, | |
611 | * %NL80211_ATTR_WIPHY_FREQ_OFFSET, %NL80211_ATTR_CONTROL_PORT, | |
560 | 612 | * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, |
561 | 613 | * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, |
562 | 614 | * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and |
570 | 622 | * set of BSSID,frequency parameters is used (i.e., either the enforcing |
571 | 623 | * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict |
572 | 624 | * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). |
625 | * Driver shall not modify the IEs specified through %NL80211_ATTR_IE if | |
626 | * %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is | |
627 | * included, these IEs through %NL80211_ATTR_IE are specified by the user | |
628 | * space based on the best possible BSS selected. Thus, if the driver ends | |
629 | * up selecting a different BSS, it can modify these IEs accordingly (e.g. | |
630 | * userspace asks the driver to perform PMKSA caching with BSS1 and the | |
631 | * driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE | |
632 | * has to get updated with the apt PMKID). | |
573 | 633 | * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within |
574 | 634 | * the ESS in case the device is already associated and an association with |
575 | 635 | * a different BSS is desired. |
639 | 699 | * four bytes for vendor frames including the OUI. The registration |
640 | 700 | * cannot be dropped, but is removed automatically when the netlink |
641 | 701 | * socket is closed. Multiple registrations can be made. |
702 | * The %NL80211_ATTR_RECEIVE_MULTICAST flag attribute can be given if | |
703 | * %NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS is available, in which | |
704 | * case the registration can also be modified to include/exclude the | |
705 | * flag, rather than requiring unregistration to change it. | |
642 | 706 | * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for |
643 | 707 | * backward compatibility |
644 | 708 | * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This |
738 | 802 | * various triggers. These triggers can be configured through this |
739 | 803 | * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For |
740 | 804 | * more background information, see |
741 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. | |
805 | * https://wireless.wiki.kernel.org/en/users/Documentation/WoWLAN. | |
742 | 806 | * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification |
743 | 807 | * from the driver reporting the wakeup reason. In this case, the |
744 | 808 | * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason |
878 | 942 | * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules. |
879 | 943 | * |
880 | 944 | * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the |
881 | * the new channel information (Channel Switch Announcement - CSA) | |
945 | * new channel information (Channel Switch Announcement - CSA) | |
882 | 946 | * in the beacon for some time (as defined in the |
883 | 947 | * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the |
884 | 948 | * new channel. Userspace provides the new channel information (using |
1057 | 1121 | * randomization may be enabled and configured by specifying the |
1058 | 1122 | * %NL80211_ATTR_MAC and %NL80211_ATTR_MAC_MASK attributes. |
1059 | 1123 | * If a timeout is requested, use the %NL80211_ATTR_TIMEOUT attribute. |
1060 | * A u64 cookie for further %NL80211_ATTR_COOKIE use is is returned in | |
1124 | * A u64 cookie for further %NL80211_ATTR_COOKIE use is returned in | |
1061 | 1125 | * the netlink extended ack message. |
1062 | 1126 | * |
1063 | 1127 | * To cancel a measurement, close the socket that requested it. |
1100 | 1164 | * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame |
1101 | 1165 | * content. The frame is ethernet data. |
1102 | 1166 | * |
1167 | * @NL80211_CMD_SET_TID_CONFIG: Data frame TID specific configuration | |
1168 | * is passed using %NL80211_ATTR_TID_CONFIG attribute. | |
1169 | * | |
1170 | * @NL80211_CMD_UNPROT_BEACON: Unprotected or incorrectly protected Beacon | |
1171 | * frame. This event is used to indicate that a received Beacon frame was | |
1172 | * dropped because it did not include a valid MME MIC while beacon | |
1173 | * protection was enabled (BIGTK configured in station mode). | |
1174 | * | |
1175 | * @NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS: Report TX status of a control | |
1176 | * port frame transmitted with %NL80211_CMD_CONTROL_PORT_FRAME. | |
1177 | * %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME | |
1178 | * includes the contents of the frame. %NL80211_ATTR_ACK flag is included | |
1179 | * if the recipient acknowledged the frame. | |
1180 | * | |
1103 | 1181 | * @NL80211_CMD_MAX: highest used command number |
1104 | 1182 | * @__NL80211_CMD_AFTER_LAST: internal use |
1105 | 1183 | */ |
1323 | 1401 | NL80211_CMD_UPDATE_OWE_INFO, |
1324 | 1402 | |
1325 | 1403 | NL80211_CMD_PROBE_MESH_LINK, |
1404 | ||
1405 | NL80211_CMD_SET_TID_CONFIG, | |
1406 | ||
1407 | NL80211_CMD_UNPROT_BEACON, | |
1408 | ||
1409 | NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, | |
1326 | 1410 | |
1327 | 1411 | /* add new commands above here */ |
1328 | 1412 | |
1369 | 1453 | * of &enum nl80211_chan_width, describing the channel width. See the |
1370 | 1454 | * documentation of the enum for more information. |
1371 | 1455 | * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the |
1372 | * channel, used for anything but 20 MHz bandwidth | |
1456 | * channel, used for anything but 20 MHz bandwidth. In S1G this is the | |
1457 | * operating channel center frequency. | |
1373 | 1458 | * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the |
1374 | 1459 | * channel, used only for 80+80 MHz bandwidth |
1375 | 1460 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ |
1434 | 1519 | * rates as defined by IEEE 802.11 7.3.2.2 but without the length |
1435 | 1520 | * restriction (at most %NL80211_MAX_SUPP_RATES). |
1436 | 1521 | * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station |
1437 | * to, or the AP interface the station was originally added to to. | |
1522 | * to, or the AP interface the station was originally added to. | |
1438 | 1523 | * @NL80211_ATTR_STA_INFO: information about a station, part of station info |
1439 | 1524 | * given for %NL80211_CMD_GET_STATION, nested attribute containing |
1440 | 1525 | * info as possible, see &enum nl80211_sta_info. |
1579 | 1664 | * flag is included, then control port frames are sent over NL80211 instead |
1580 | 1665 | * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is |
1581 | 1666 | * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER |
1582 | * flag. | |
1667 | * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth | |
1668 | * frames are not forwared over the control port. | |
1583 | 1669 | * |
1584 | 1670 | * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. |
1585 | 1671 | * We recommend using nested, driver-specific attributes within this. |
2006 | 2092 | * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels. |
2007 | 2093 | * |
2008 | 2094 | * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported |
2009 | * supported operating classes. | |
2095 | * operating classes. | |
2010 | 2096 | * |
2011 | 2097 | * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space |
2012 | 2098 | * controls DFS operation in IBSS mode. If the flag is included in |
2284 | 2370 | * |
2285 | 2371 | * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with |
2286 | 2372 | * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID. |
2287 | * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way | |
2288 | * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is | |
2289 | * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute | |
2290 | * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well. | |
2373 | * For %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP it is used to provide | |
2374 | * PSK for offloading 4-way handshake for WPA/WPA2-PSK networks. For 802.1X | |
2375 | * authentication it is used with %NL80211_CMD_SET_PMK. For offloaded FT | |
2376 | * support this attribute specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME | |
2377 | * is included as well. | |
2291 | 2378 | * |
2292 | 2379 | * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to |
2293 | 2380 | * indicate that it supports multiple active scheduled scan requests. |
2317 | 2404 | * nl80211_txq_stats) |
2318 | 2405 | * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy. |
2319 | 2406 | * The smaller of this and the memory limit is enforced. |
2320 | * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the | |
2407 | * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory limit (in bytes) for the | |
2321 | 2408 | * TXQ queues for this phy. The smaller of this and the packet limit is |
2322 | 2409 | * enforced. |
2323 | 2410 | * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes |
2372 | 2459 | * the allowed channel bandwidth configurations. (u8 attribute) |
2373 | 2460 | * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. |
2374 | 2461 | * |
2462 | * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key | |
2463 | * (u16). | |
2464 | * | |
2465 | * @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings. | |
2466 | * | |
2467 | * @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry | |
2468 | * using attributes from &enum nl80211_iftype_akm_attributes. This | |
2469 | * attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating | |
2470 | * supported AKM suites capability per interface. AKMs advertised in | |
2471 | * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not | |
2472 | * advertised for a specific interface type. | |
2473 | * | |
2474 | * @NL80211_ATTR_TID_CONFIG: TID specific configuration in a | |
2475 | * nested attribute with &enum nl80211_tid_config_attr sub-attributes; | |
2476 | * on output (in wiphy attributes) it contains only the feature sub- | |
2477 | * attributes. | |
2478 | * | |
2479 | * @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control | |
2480 | * port in order to forward/receive them as ordinary data frames. | |
2481 | * | |
2482 | * @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32, | |
2483 | * dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value). | |
2484 | * An optional parameter configured through %NL80211_CMD_SET_PMKSA. | |
2485 | * Drivers that trigger roaming need to know the lifetime of the | |
2486 | * configured PMKSA for triggering the full vs. PMKSA caching based | |
2487 | * authentication. This timeout helps authentication methods like SAE, | |
2488 | * where PMK gets updated only by going through a full (new SAE) | |
2489 | * authentication instead of getting updated during an association for EAP | |
2490 | * authentication. No new full authentication within the PMK expiry shall | |
2491 | * result in a disassociation at the end of the lifetime. | |
2492 | * | |
2493 | * @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in | |
2494 | * terms of percentage of %NL80211_ATTR_PMK_LIFETIME | |
2495 | * (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional | |
2496 | * parameter configured through %NL80211_CMD_SET_PMKSA. Requests the | |
2497 | * driver to trigger a full authentication roam (without PMKSA caching) | |
2498 | * after the reauthentication threshold time, but before the PMK lifetime | |
2499 | * has expired. | |
2500 | * | |
2501 | * Authentication methods like SAE need to be able to generate a new PMKSA | |
2502 | * entry without having to force a disconnection after the PMK timeout. If | |
2503 | * no roaming occurs between the reauth threshold and PMK expiration, | |
2504 | * disassociation is still forced. | |
2505 | * @NL80211_ATTR_RECEIVE_MULTICAST: multicast flag for the | |
2506 | * %NL80211_CMD_REGISTER_FRAME command, see the description there. | |
2507 | * @NL80211_ATTR_WIPHY_FREQ_OFFSET: offset of the associated | |
2508 | * %NL80211_ATTR_WIPHY_FREQ in positive KHz. Only valid when supplied with | |
2509 | * an %NL80211_ATTR_WIPHY_FREQ_OFFSET. | |
2510 | * @NL80211_ATTR_CENTER_FREQ1_OFFSET: Center frequency offset in KHz for the | |
2511 | * first channel segment specified in %NL80211_ATTR_CENTER_FREQ1. | |
2512 | * @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies | |
2513 | * | |
2514 | * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from | |
2515 | * association request when used with NL80211_CMD_NEW_STATION). | |
2516 | * | |
2375 | 2517 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
2376 | 2518 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
2377 | 2519 | * @__NL80211_ATTR_AFTER_LAST: internal use |
2833 | 2975 | |
2834 | 2976 | NL80211_ATTR_WIPHY_EDMG_CHANNELS, |
2835 | 2977 | NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, |
2978 | ||
2979 | NL80211_ATTR_VLAN_ID, | |
2980 | ||
2981 | NL80211_ATTR_HE_BSS_COLOR, | |
2982 | ||
2983 | NL80211_ATTR_IFTYPE_AKM_SUITES, | |
2984 | ||
2985 | NL80211_ATTR_TID_CONFIG, | |
2986 | ||
2987 | NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, | |
2988 | ||
2989 | NL80211_ATTR_PMK_LIFETIME, | |
2990 | NL80211_ATTR_PMK_REAUTH_THRESHOLD, | |
2991 | ||
2992 | NL80211_ATTR_RECEIVE_MULTICAST, | |
2993 | NL80211_ATTR_WIPHY_FREQ_OFFSET, | |
2994 | NL80211_ATTR_CENTER_FREQ1_OFFSET, | |
2995 | NL80211_ATTR_SCAN_FREQ_KHZ, | |
2996 | ||
2997 | NL80211_ATTR_HE_6GHZ_CAPABILITY, | |
2836 | 2998 | |
2837 | 2999 | /* add attributes here, update the policy in nl80211.c */ |
2838 | 3000 | |
3217 | 3379 | * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station |
3218 | 3380 | * @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds) |
3219 | 3381 | * of STA's association |
3382 | * @NL80211_STA_INFO_CONNECTED_TO_AS: set to true if STA has a path to a | |
3383 | * authentication server (u8, 0 or 1) | |
3220 | 3384 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
3221 | 3385 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
3222 | 3386 | */ |
3264 | 3428 | NL80211_STA_INFO_AIRTIME_WEIGHT, |
3265 | 3429 | NL80211_STA_INFO_AIRTIME_LINK_METRIC, |
3266 | 3430 | NL80211_STA_INFO_ASSOC_AT_BOOTTIME, |
3431 | NL80211_STA_INFO_CONNECTED_TO_AS, | |
3267 | 3432 | |
3268 | 3433 | /* keep last */ |
3269 | 3434 | __NL80211_STA_INFO_AFTER_LAST, |
3412 | 3577 | * defined in HE capabilities IE |
3413 | 3578 | * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently |
3414 | 3579 | * defined |
3580 | * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16), | |
3581 | * given for all 6 GHz band channels | |
3415 | 3582 | * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use |
3416 | 3583 | */ |
3417 | 3584 | enum nl80211_band_iftype_attr { |
3422 | 3589 | NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, |
3423 | 3590 | NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, |
3424 | 3591 | NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, |
3592 | NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA, | |
3425 | 3593 | |
3426 | 3594 | /* keep last */ |
3427 | 3595 | __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST, |
3553 | 3721 | * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations. |
3554 | 3722 | * This is a nested attribute that contains the wmm limitation per AC. |
3555 | 3723 | * (see &enum nl80211_wmm_rule) |
3724 | * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel | |
3725 | * in current regulatory domain. | |
3726 | * @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz | |
3556 | 3727 | * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number |
3557 | 3728 | * currently defined |
3558 | 3729 | * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use |
3582 | 3753 | NL80211_FREQUENCY_ATTR_NO_20MHZ, |
3583 | 3754 | NL80211_FREQUENCY_ATTR_NO_10MHZ, |
3584 | 3755 | NL80211_FREQUENCY_ATTR_WMM, |
3756 | NL80211_FREQUENCY_ATTR_NO_HE, | |
3757 | NL80211_FREQUENCY_ATTR_OFFSET, | |
3585 | 3758 | |
3586 | 3759 | /* keep last */ |
3587 | 3760 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, |
3779 | 3952 | * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation |
3780 | 3953 | * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed |
3781 | 3954 | * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed |
3955 | * @NL80211_RRF_NO_HE: HE operation not allowed | |
3782 | 3956 | */ |
3783 | 3957 | enum nl80211_reg_rule_flags { |
3784 | 3958 | NL80211_RRF_NO_OFDM = 1<<0, |
3796 | 3970 | NL80211_RRF_NO_HT40PLUS = 1<<14, |
3797 | 3971 | NL80211_RRF_NO_80MHZ = 1<<15, |
3798 | 3972 | NL80211_RRF_NO_160MHZ = 1<<16, |
3973 | NL80211_RRF_NO_HE = 1<<17, | |
3799 | 3974 | }; |
3800 | 3975 | |
3801 | 3976 | #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR |
4072 | 4247 | * will advertise that it is connected to a gate in the mesh formation |
4073 | 4248 | * field. If left unset then the mesh formation field will only |
4074 | 4249 | * advertise such if there is an active root mesh path. |
4250 | * | |
4251 | * @NL80211_MESHCONF_NOLEARN: Try to avoid multi-hop path discovery (e.g. | |
4252 | * PREQ/PREP for HWMP) if the destination is a direct neighbor. Note that | |
4253 | * this might not be the optimal decision as a multi-hop route might be | |
4254 | * better. So if using this setting you will likely also want to disable | |
4255 | * dot11MeshForwarding and use another mesh routing protocol on top. | |
4256 | * | |
4257 | * @NL80211_MESHCONF_CONNECTED_TO_AS: If set to true then this mesh STA | |
4258 | * will advertise that it is connected to a authentication server | |
4259 | * in the mesh formation field. | |
4075 | 4260 | * |
4076 | 4261 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
4077 | 4262 | */ |
4106 | 4291 | NL80211_MESHCONF_AWAKE_WINDOW, |
4107 | 4292 | NL80211_MESHCONF_PLINK_TIMEOUT, |
4108 | 4293 | NL80211_MESHCONF_CONNECTED_TO_GATE, |
4294 | NL80211_MESHCONF_NOLEARN, | |
4295 | NL80211_MESHCONF_CONNECTED_TO_AS, | |
4109 | 4296 | |
4110 | 4297 | /* keep last */ |
4111 | 4298 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
4274 | 4461 | * attribute must be provided as well |
4275 | 4462 | * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel |
4276 | 4463 | * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel |
4464 | * @NL80211_CHAN_WIDTH_1: 1 MHz OFDM channel | |
4465 | * @NL80211_CHAN_WIDTH_2: 2 MHz OFDM channel | |
4466 | * @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel | |
4467 | * @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel | |
4468 | * @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel | |
4277 | 4469 | */ |
4278 | 4470 | enum nl80211_chan_width { |
4279 | 4471 | NL80211_CHAN_WIDTH_20_NOHT, |
4284 | 4476 | NL80211_CHAN_WIDTH_160, |
4285 | 4477 | NL80211_CHAN_WIDTH_5, |
4286 | 4478 | NL80211_CHAN_WIDTH_10, |
4479 | NL80211_CHAN_WIDTH_1, | |
4480 | NL80211_CHAN_WIDTH_2, | |
4481 | NL80211_CHAN_WIDTH_4, | |
4482 | NL80211_CHAN_WIDTH_8, | |
4483 | NL80211_CHAN_WIDTH_16, | |
4287 | 4484 | }; |
4288 | 4485 | |
4289 | 4486 | /** |
4294 | 4491 | * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible |
4295 | 4492 | * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide |
4296 | 4493 | * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide |
4494 | * @NL80211_BSS_CHAN_WIDTH_1: control channel is 1 MHz wide | |
4495 | * @NL80211_BSS_CHAN_WIDTH_2: control channel is 2 MHz wide | |
4297 | 4496 | */ |
4298 | 4497 | enum nl80211_bss_scan_width { |
4299 | 4498 | NL80211_BSS_CHAN_WIDTH_20, |
4300 | 4499 | NL80211_BSS_CHAN_WIDTH_10, |
4301 | 4500 | NL80211_BSS_CHAN_WIDTH_5, |
4501 | NL80211_BSS_CHAN_WIDTH_1, | |
4502 | NL80211_BSS_CHAN_WIDTH_2, | |
4302 | 4503 | }; |
4303 | 4504 | |
4304 | 4505 | /** |
4350 | 4551 | * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update. |
4351 | 4552 | * Contains a nested array of signal strength attributes (u8, dBm), |
4352 | 4553 | * using the nesting index as the antenna number. |
4554 | * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz | |
4353 | 4555 | * @__NL80211_BSS_AFTER_LAST: internal |
4354 | 4556 | * @NL80211_BSS_MAX: highest BSS attribute |
4355 | 4557 | */ |
4374 | 4576 | NL80211_BSS_PARENT_TSF, |
4375 | 4577 | NL80211_BSS_PARENT_BSSID, |
4376 | 4578 | NL80211_BSS_CHAIN_SIGNAL, |
4579 | NL80211_BSS_FREQUENCY_OFFSET, | |
4377 | 4580 | |
4378 | 4581 | /* keep last */ |
4379 | 4582 | __NL80211_BSS_AFTER_LAST, |
4502 | 4705 | * See &enum nl80211_key_default_types. |
4503 | 4706 | * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode. |
4504 | 4707 | * Defaults to @NL80211_KEY_RX_TX. |
4708 | * @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key | |
4505 | 4709 | * |
4506 | 4710 | * @__NL80211_KEY_AFTER_LAST: internal |
4507 | 4711 | * @NL80211_KEY_MAX: highest key attribute |
4517 | 4721 | NL80211_KEY_TYPE, |
4518 | 4722 | NL80211_KEY_DEFAULT_TYPES, |
4519 | 4723 | NL80211_KEY_MODE, |
4724 | NL80211_KEY_DEFAULT_BEACON, | |
4520 | 4725 | |
4521 | 4726 | /* keep last */ |
4522 | 4727 | __NL80211_KEY_AFTER_LAST, |
4573 | 4778 | * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) |
4574 | 4779 | * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz) |
4575 | 4780 | * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz) |
4781 | * @NL80211_BAND_S1GHZ: around 900MHz, supported by S1G PHYs | |
4576 | 4782 | * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace |
4577 | 4783 | * since newer kernel versions may support more bands |
4578 | 4784 | */ |
4581 | 4787 | NL80211_BAND_5GHZ, |
4582 | 4788 | NL80211_BAND_60GHZ, |
4583 | 4789 | NL80211_BAND_6GHZ, |
4790 | NL80211_BAND_S1GHZ, | |
4584 | 4791 | |
4585 | 4792 | NUM_NL80211_BANDS, |
4586 | 4793 | }; |
4670 | 4877 | NL80211_TX_POWER_AUTOMATIC, |
4671 | 4878 | NL80211_TX_POWER_LIMITED, |
4672 | 4879 | NL80211_TX_POWER_FIXED, |
4880 | }; | |
4881 | ||
4882 | /** | |
4883 | * enum nl80211_tid_config - TID config state | |
4884 | * @NL80211_TID_CONFIG_ENABLE: Enable config for the TID | |
4885 | * @NL80211_TID_CONFIG_DISABLE: Disable config for the TID | |
4886 | */ | |
4887 | enum nl80211_tid_config { | |
4888 | NL80211_TID_CONFIG_ENABLE, | |
4889 | NL80211_TID_CONFIG_DISABLE, | |
4890 | }; | |
4891 | ||
4892 | /* enum nl80211_tx_rate_setting - TX rate configuration type | |
4893 | * @NL80211_TX_RATE_AUTOMATIC: automatically determine TX rate | |
4894 | * @NL80211_TX_RATE_LIMITED: limit the TX rate by the TX rate parameter | |
4895 | * @NL80211_TX_RATE_FIXED: fix TX rate to the TX rate parameter | |
4896 | */ | |
4897 | enum nl80211_tx_rate_setting { | |
4898 | NL80211_TX_RATE_AUTOMATIC, | |
4899 | NL80211_TX_RATE_LIMITED, | |
4900 | NL80211_TX_RATE_FIXED, | |
4901 | }; | |
4902 | ||
4903 | /* enum nl80211_tid_config_attr - TID specific configuration. | |
4904 | * @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values | |
4905 | * @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported | |
4906 | * for per-vif configuration; doesn't list the ones that are generic | |
4907 | * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE). | |
4908 | * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but | |
4909 | * per peer instead. | |
4910 | * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates | |
4911 | * that the new configuration overrides all previous peer | |
4912 | * configurations, otherwise previous peer specific configurations | |
4913 | * should be left untouched. | |
4914 | * @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7) | |
4915 | * Its type is u16. | |
4916 | * @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID. | |
4917 | * specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config. | |
4918 | * Its type is u8. | |
4919 | * @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame | |
4920 | * transmission, user-space sets this configuration in | |
4921 | * &NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and | |
4922 | * the max value is advertised by the driver in this attribute on | |
4923 | * output in wiphy capabilities. | |
4924 | * @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame | |
4925 | * transmission, user-space sets this configuration in | |
4926 | * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and | |
4927 | * the max value is advertised by the driver in this attribute on | |
4928 | * output in wiphy capabilities. | |
4929 | * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable MPDU aggregation | |
4930 | * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. | |
4931 | * Its type is u8, using the values from &nl80211_tid_config. | |
4932 | * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TIDs | |
4933 | * specified in %NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type, using | |
4934 | * the values from &nl80211_tid_config. | |
4935 | * @NL80211_TID_CONFIG_ATTR_AMSDU_CTRL: Enable/Disable MSDU aggregation | |
4936 | * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. | |
4937 | * Its type is u8, using the values from &nl80211_tid_config. | |
4938 | * @NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE: This attribute will be useful | |
4939 | * to notfiy the driver that what type of txrate should be used | |
4940 | * for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. using | |
4941 | * the values form &nl80211_tx_rate_setting. | |
4942 | * @NL80211_TID_CONFIG_ATTR_TX_RATE: Data frame TX rate mask should be applied | |
4943 | * with the parameters passed through %NL80211_ATTR_TX_RATES. | |
4944 | * configuration is applied to the data frame for the tid to that connected | |
4945 | * station. | |
4946 | */ | |
4947 | enum nl80211_tid_config_attr { | |
4948 | __NL80211_TID_CONFIG_ATTR_INVALID, | |
4949 | NL80211_TID_CONFIG_ATTR_PAD, | |
4950 | NL80211_TID_CONFIG_ATTR_VIF_SUPP, | |
4951 | NL80211_TID_CONFIG_ATTR_PEER_SUPP, | |
4952 | NL80211_TID_CONFIG_ATTR_OVERRIDE, | |
4953 | NL80211_TID_CONFIG_ATTR_TIDS, | |
4954 | NL80211_TID_CONFIG_ATTR_NOACK, | |
4955 | NL80211_TID_CONFIG_ATTR_RETRY_SHORT, | |
4956 | NL80211_TID_CONFIG_ATTR_RETRY_LONG, | |
4957 | NL80211_TID_CONFIG_ATTR_AMPDU_CTRL, | |
4958 | NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL, | |
4959 | NL80211_TID_CONFIG_ATTR_AMSDU_CTRL, | |
4960 | NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE, | |
4961 | NL80211_TID_CONFIG_ATTR_TX_RATE, | |
4962 | ||
4963 | /* keep last */ | |
4964 | __NL80211_TID_CONFIG_ATTR_AFTER_LAST, | |
4965 | NL80211_TID_CONFIG_ATTR_MAX = __NL80211_TID_CONFIG_ATTR_AFTER_LAST - 1 | |
4673 | 4966 | }; |
4674 | 4967 | |
4675 | 4968 | /** |
5143 | 5436 | |
5144 | 5437 | #define NL80211_KCK_LEN 16 |
5145 | 5438 | #define NL80211_KEK_LEN 16 |
5439 | #define NL80211_KCK_EXT_LEN 24 | |
5440 | #define NL80211_KEK_EXT_LEN 32 | |
5146 | 5441 | #define NL80211_REPLAY_CTR_LEN 8 |
5147 | 5442 | |
5148 | 5443 | /** |
5151 | 5446 | * @NL80211_REKEY_DATA_KEK: key encryption key (binary) |
5152 | 5447 | * @NL80211_REKEY_DATA_KCK: key confirmation key (binary) |
5153 | 5448 | * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary) |
5449 | * @NL80211_REKEY_DATA_AKM: AKM data (OUI, suite type) | |
5154 | 5450 | * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal) |
5155 | 5451 | * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal) |
5156 | 5452 | */ |
5159 | 5455 | NL80211_REKEY_DATA_KEK, |
5160 | 5456 | NL80211_REKEY_DATA_KCK, |
5161 | 5457 | NL80211_REKEY_DATA_REPLAY_CTR, |
5458 | NL80211_REKEY_DATA_AKM, | |
5162 | 5459 | |
5163 | 5460 | /* keep last */ |
5164 | 5461 | NUM_NL80211_REKEY_DATA, |
5379 | 5676 | * enum nl80211_ext_feature_index - bit index of extended features. |
5380 | 5677 | * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. |
5381 | 5678 | * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can |
5382 | * can request to use RRM (see %NL80211_ATTR_USE_RRM) with | |
5679 | * request to use RRM (see %NL80211_ATTR_USE_RRM) with | |
5383 | 5680 | * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set |
5384 | 5681 | * the ASSOC_REQ_USE_RRM flag in the association request even if |
5385 | 5682 | * NL80211_FEATURE_QUIET is not advertized. |
5483 | 5780 | * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in |
5484 | 5781 | * station mode (SAE password is passed as part of the connect command). |
5485 | 5782 | * |
5783 | * @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev | |
5784 | * with VLAN tagged frames and separate VLAN-specific netdevs added using | |
5785 | * vconfig similarly to the Ethernet case. | |
5786 | * | |
5787 | * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) | |
5788 | * feature, which prevents bufferbloat by using the expected transmission | |
5789 | * time to limit the amount of data buffered in the hardware. | |
5790 | * | |
5791 | * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection | |
5792 | * and can receive key configuration for BIGTK using key indexes 6 and 7. | |
5793 | * @NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT: The driver supports Beacon | |
5794 | * protection as a client only and cannot transmit protected beacons. | |
5795 | * | |
5796 | * @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the | |
5797 | * forwarding of preauth frames over the control port. They are then | |
5798 | * handled as ordinary data frames. | |
5799 | * | |
5800 | * @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames | |
5801 | * | |
5802 | * @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations | |
5803 | * in IBSS mode, essentially by dropping their state. | |
5804 | * | |
5805 | * @NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS: management frame registrations | |
5806 | * are possible for multicast frames and those will be reported properly. | |
5807 | * | |
5808 | * @NL80211_EXT_FEATURE_SCAN_FREQ_KHZ: This driver supports receiving and | |
5809 | * reporting scan request with %NL80211_ATTR_SCAN_FREQ_KHZ. In order to | |
5810 | * report %NL80211_ATTR_SCAN_FREQ_KHZ, %NL80211_SCAN_FLAG_FREQ_KHZ must be | |
5811 | * included in the scan request. | |
5812 | * | |
5813 | * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS: The driver | |
5814 | * can report tx status for control port over nl80211 tx operations. | |
5815 | * | |
5816 | * @NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION: Driver supports Operating | |
5817 | * Channel Validation (OCV) when using driver's SME for RSNA handshakes. | |
5818 | * | |
5819 | * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK: Device wants to do 4-way | |
5820 | * handshake with PSK in AP mode (PSK is passed as part of the start AP | |
5821 | * command). | |
5822 | * | |
5486 | 5823 | * @NUM_NL80211_EXT_FEATURES: number of extended features. |
5487 | 5824 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. |
5488 | 5825 | */ |
5528 | 5865 | NL80211_EXT_FEATURE_EXT_KEY_ID, |
5529 | 5866 | NL80211_EXT_FEATURE_STA_TX_PWR, |
5530 | 5867 | NL80211_EXT_FEATURE_SAE_OFFLOAD, |
5868 | NL80211_EXT_FEATURE_VLAN_OFFLOAD, | |
5869 | NL80211_EXT_FEATURE_AQL, | |
5870 | NL80211_EXT_FEATURE_BEACON_PROTECTION, | |
5871 | NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH, | |
5872 | NL80211_EXT_FEATURE_PROTECTED_TWT, | |
5873 | NL80211_EXT_FEATURE_DEL_IBSS_STA, | |
5874 | NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS, | |
5875 | NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT, | |
5876 | NL80211_EXT_FEATURE_SCAN_FREQ_KHZ, | |
5877 | NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS, | |
5878 | NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION, | |
5879 | NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK, | |
5531 | 5880 | |
5532 | 5881 | /* add new features before the definition below */ |
5533 | 5882 | NUM_NL80211_EXT_FEATURES, |
5639 | 5988 | * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to |
5640 | 5989 | * only have supported rates and no additional capabilities (unless |
5641 | 5990 | * added by userspace explicitly.) |
5991 | * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with | |
5992 | * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means | |
5993 | * %NL80211_ATTR_SCAN_FREQUENCIES will not be included. | |
5642 | 5994 | */ |
5643 | 5995 | enum nl80211_scan_flags { |
5644 | 5996 | NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, |
5654 | 6006 | NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10, |
5655 | 6007 | NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, |
5656 | 6008 | NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, |
6009 | NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13, | |
5657 | 6010 | }; |
5658 | 6011 | |
5659 | 6012 | /** |
5741 | 6094 | }; |
5742 | 6095 | |
5743 | 6096 | /** |
5744 | * enum enum nl80211_protocol_features - nl80211 protocol features | |
6097 | * enum nl80211_protocol_features - nl80211 protocol features | |
5745 | 6098 | * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting |
5746 | 6099 | * wiphy dumps (if requested by the application with the attribute |
5747 | 6100 | * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the |
6150 | 6503 | * @NL80211_PREAMBLE_HT: HT preamble |
6151 | 6504 | * @NL80211_PREAMBLE_VHT: VHT preamble |
6152 | 6505 | * @NL80211_PREAMBLE_DMG: DMG preamble |
6506 | * @NL80211_PREAMBLE_HE: HE preamble | |
6153 | 6507 | */ |
6154 | 6508 | enum nl80211_preamble { |
6155 | 6509 | NL80211_PREAMBLE_LEGACY, |
6156 | 6510 | NL80211_PREAMBLE_HT, |
6157 | 6511 | NL80211_PREAMBLE_VHT, |
6158 | 6512 | NL80211_PREAMBLE_DMG, |
6513 | NL80211_PREAMBLE_HE, | |
6159 | 6514 | }; |
6160 | 6515 | |
6161 | 6516 | /** |
6348 | 6703 | * is valid) |
6349 | 6704 | * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating |
6350 | 6705 | * the maximum FTMs per burst (if not present anything is valid) |
6706 | * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if | |
6707 | * trigger based ranging measurement is supported | |
6708 | * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating | |
6709 | * if non trigger based ranging measurement is supported | |
6351 | 6710 | * |
6352 | 6711 | * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal |
6353 | 6712 | * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number |
6363 | 6722 | NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS, |
6364 | 6723 | NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT, |
6365 | 6724 | NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST, |
6725 | NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED, | |
6726 | NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED, | |
6366 | 6727 | |
6367 | 6728 | /* keep last */ |
6368 | 6729 | NUM_NL80211_PMSR_FTM_CAPA_ATTR, |
6392 | 6753 | * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag) |
6393 | 6754 | * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data |
6394 | 6755 | * (flag) |
6756 | * @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging | |
6757 | * measurement (flag). | |
6758 | * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are | |
6759 | * mutually exclusive. | |
6760 | * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor | |
6761 | * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based | |
6762 | * ranging will be used. | |
6763 | * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based | |
6764 | * ranging measurement (flag) | |
6765 | * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are | |
6766 | * mutually exclusive. | |
6767 | * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor | |
6768 | * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based | |
6769 | * ranging will be used. | |
6395 | 6770 | * |
6396 | 6771 | * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal |
6397 | 6772 | * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number |
6408 | 6783 | NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES, |
6409 | 6784 | NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI, |
6410 | 6785 | NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, |
6786 | NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, | |
6787 | NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, | |
6411 | 6788 | |
6412 | 6789 | /* keep last */ |
6413 | 6790 | NUM_NL80211_PMSR_FTM_REQ_ATTR, |
6547 | 6924 | NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1, |
6548 | 6925 | }; |
6549 | 6926 | |
6927 | /** | |
6928 | * enum nl80211_bss_color_attributes - BSS Color attributes | |
6929 | * @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid | |
6930 | * | |
6931 | * @NL80211_HE_BSS_COLOR_ATTR_COLOR: the current BSS Color. | |
6932 | * @NL80211_HE_BSS_COLOR_ATTR_DISABLED: is BSS coloring disabled. | |
6933 | * @NL80211_HE_BSS_COLOR_ATTR_PARTIAL: the AID equation to be used.. | |
6934 | * | |
6935 | * @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal | |
6936 | * @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute. | |
6937 | */ | |
6938 | enum nl80211_bss_color_attributes { | |
6939 | __NL80211_HE_BSS_COLOR_ATTR_INVALID, | |
6940 | ||
6941 | NL80211_HE_BSS_COLOR_ATTR_COLOR, | |
6942 | NL80211_HE_BSS_COLOR_ATTR_DISABLED, | |
6943 | NL80211_HE_BSS_COLOR_ATTR_PARTIAL, | |
6944 | ||
6945 | /* keep last */ | |
6946 | __NL80211_HE_BSS_COLOR_ATTR_LAST, | |
6947 | NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1, | |
6948 | }; | |
6949 | ||
6950 | /** | |
6951 | * enum nl80211_iftype_akm_attributes - interface type AKM attributes | |
6952 | * @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid | |
6953 | * | |
6954 | * @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag | |
6955 | * attribute for each interface type that supports AKM suites specified in | |
6956 | * %NL80211_IFTYPE_AKM_ATTR_SUITES | |
6957 | * @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported | |
6958 | * AKM suites for the specified interface types. | |
6959 | * | |
6960 | * @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal | |
6961 | * @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute. | |
6962 | */ | |
6963 | enum nl80211_iftype_akm_attributes { | |
6964 | __NL80211_IFTYPE_AKM_ATTR_INVALID, | |
6965 | ||
6966 | NL80211_IFTYPE_AKM_ATTR_IFTYPES, | |
6967 | NL80211_IFTYPE_AKM_ATTR_SUITES, | |
6968 | ||
6969 | /* keep last */ | |
6970 | __NL80211_IFTYPE_AKM_ATTR_LAST, | |
6971 | NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, | |
6972 | }; | |
6550 | 6973 | |
6551 | 6974 | #endif /* __LINUX_NL80211_H */ |
208 | 208 | PARSE_FLAG(NL80211_RRF_NO_HT40PLUS, "NO-HT40PLUS"); |
209 | 209 | PARSE_FLAG(NL80211_RRF_NO_80MHZ, "NO-80MHZ"); |
210 | 210 | PARSE_FLAG(NL80211_RRF_NO_160MHZ, "NO-160MHZ"); |
211 | PARSE_FLAG(NL80211_RRF_NO_HE, "NO-HE"); | |
211 | 212 | |
212 | 213 | /* Kernels that support NO_IR always turn on both flags */ |
213 | 214 | if ((flags & NL80211_RRF_NO_IR) && (flags & __NL80211_RRF_NO_IBSS)) { |
242 | 243 | char *dump_args[] = { "reg", "dump" }; |
243 | 244 | int err; |
244 | 245 | |
246 | /* | |
247 | * If PHY was specifically given, get the PHY specific regulatory | |
248 | * information. Otherwise, dump the entire regulatory information. | |
249 | */ | |
250 | if (id == II_PHY_IDX || id == II_PHY_NAME) { | |
251 | register_handler(print_reg_handler, NULL); | |
252 | return 0; | |
253 | } | |
254 | ||
245 | 255 | err = handle_cmd(state, II_NONE, 2, dump_args); |
256 | ||
246 | 257 | /* |
247 | 258 | * dump might fail since it's not supported on older kernels, |
248 | 259 | * in that case the handler is still registered already |
254 | 265 | } |
255 | 266 | COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_NONE, handle_reg_get, |
256 | 267 | "Print out the kernel's current regulatory domain information."); |
257 | COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_PHY, handle_reg_get, | |
268 | COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_PHY, handle_reg_dump, | |
258 | 269 | "Print out the devices' current regulatory domain information."); |
259 | 270 | HIDDEN(reg, dump, NULL, NL80211_CMD_GET_REG, NLM_F_DUMP, CIB_NONE, |
260 | 271 | handle_reg_dump); |
581 | 581 | printf("\n"); |
582 | 582 | } |
583 | 583 | |
584 | static void print_rm_enabled_capabilities(const uint8_t type, uint8_t len, | |
585 | const uint8_t *data, | |
586 | const struct print_ies_data *ie_buffer) | |
587 | { | |
588 | __u64 capa = ((__u64) data[0]) | | |
589 | ((__u64) data[1]) << 8 | | |
590 | ((__u64) data[2]) << 16 | | |
591 | ((__u64) data[3]) << 24 | | |
592 | ((__u64) data[4]) << 32; | |
593 | ||
594 | printf("\n"); | |
595 | printf("\t\tCapabilities: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", | |
596 | data[0], data[1], | |
597 | data[2], data[3], | |
598 | data[4]); | |
599 | ||
600 | #define PRINT_RM_CAPA(_bit, _str) \ | |
601 | do { \ | |
602 | if (capa & BIT(_bit)) \ | |
603 | printf("\t\t\t" _str "\n"); \ | |
604 | } while (0) | |
605 | ||
606 | PRINT_RM_CAPA(0, "Link Measurement"); | |
607 | PRINT_RM_CAPA(1, "Neighbor Report"); | |
608 | PRINT_RM_CAPA(2, "Parallel Measurements"); | |
609 | PRINT_RM_CAPA(3, "Repeated Measurements"); | |
610 | PRINT_RM_CAPA(4, "Beacon Passive Measurement"); | |
611 | PRINT_RM_CAPA(5, "Beacon Active Measurement"); | |
612 | PRINT_RM_CAPA(6, "Beacon Table Measurement"); | |
613 | PRINT_RM_CAPA(7, "Beacon Measurement Reporting Conditions"); | |
614 | PRINT_RM_CAPA(8, "Frame Measurement"); | |
615 | PRINT_RM_CAPA(9, "Channel Load"); | |
616 | PRINT_RM_CAPA(10, "Noise Histogram Measurement"); | |
617 | PRINT_RM_CAPA(11, "Statistics Measurement"); | |
618 | PRINT_RM_CAPA(12, "LCI Measurement"); | |
619 | PRINT_RM_CAPA(13, "LCI Azimuth"); | |
620 | PRINT_RM_CAPA(14, "Transmit Stream/Category Measurement"); | |
621 | PRINT_RM_CAPA(15, "Triggered Transmit Stream/Category"); | |
622 | PRINT_RM_CAPA(16, "AP Channel Report"); | |
623 | PRINT_RM_CAPA(17, "RM MIB Capability"); | |
624 | ||
625 | PRINT_RM_CAPA(27, "Measurement Pilot Transmission Information"); | |
626 | PRINT_RM_CAPA(28, "Neighbor Report TSF Offset"); | |
627 | PRINT_RM_CAPA(29, "RCPI Measurement"); | |
628 | PRINT_RM_CAPA(30, "RSNI Measurement"); | |
629 | PRINT_RM_CAPA(31, "BSS Average Access Delay"); | |
630 | PRINT_RM_CAPA(32, "BSS Available Admission"); | |
631 | PRINT_RM_CAPA(33, "Antenna"); | |
632 | PRINT_RM_CAPA(34, "FTM Range Report"); | |
633 | PRINT_RM_CAPA(35, "Civic Location Measurement"); | |
634 | ||
635 | printf("\t\tNonoperating Channel Max Measurement Duration: %i\n", data[3] >> 5); | |
636 | printf("\t\tMeasurement Pilot Capability: %i\n", data[4] & 7); | |
637 | } | |
638 | ||
584 | 639 | static void print_ds(const uint8_t type, uint8_t len, const uint8_t *data, |
585 | 640 | const struct print_ies_data *ie_buffer) |
586 | 641 | { |
673 | 728 | printf(" Use_Protection"); |
674 | 729 | if (data[0] & 0x04) |
675 | 730 | printf(" Barker_Preamble_Mode"); |
731 | printf("\n"); | |
732 | } | |
733 | ||
734 | static void print_ap_channel_report(const uint8_t type, uint8_t len, const uint8_t *data, | |
735 | const struct print_ies_data *ie_buffer) | |
736 | { | |
737 | uint8_t oper_class = data[0]; | |
738 | int i; | |
739 | ||
740 | printf("\n"); | |
741 | printf("\t\t * operating class: %d\n", oper_class); | |
742 | printf("\t\t * channel(s):"); | |
743 | for (i = 1; i < len; ++i) { | |
744 | printf(" %d", data[i]); | |
745 | } | |
676 | 746 | printf("\n"); |
677 | 747 | } |
678 | 748 | |
947 | 1017 | printf(" SPP-AMSDU-capable"); |
948 | 1018 | if (capa & 0x0800) |
949 | 1019 | printf(" SPP-AMSDU-required"); |
1020 | if (capa & 0x2000) | |
1021 | printf(" Extended-Key-ID"); | |
950 | 1022 | printf(" (0x%.4x)\n", capa); |
951 | 1023 | data += 2; |
952 | 1024 | len -= 2; |
1075 | 1147 | printf("\t\tVenue Type: %i\n", (int)(data[2])); |
1076 | 1148 | } |
1077 | 1149 | if (len == 9) |
1078 | printf("\t\tHESSID: %02hx:%02hx:%02hx:%02hx:%02hx:%02hx\n", | |
1150 | printf("\t\tHESSID: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", | |
1079 | 1151 | data[3], data[4], data[5], data[6], data[7], data[8]); |
1080 | 1152 | else if (len == 7) |
1081 | printf("\t\tHESSID: %02hx:%02hx:%02hx:%02hx:%02hx:%02hx\n", | |
1153 | printf("\t\tHESSID: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", | |
1082 | 1154 | data[1], data[2], data[3], data[4], data[5], data[6]); |
1083 | 1155 | } |
1084 | 1156 | |
1137 | 1209 | printf("Invalid IE length.\n"); |
1138 | 1210 | } else { |
1139 | 1211 | for (idx = 0; idx < ln0; idx++) { |
1140 | printf("%02hx", data[2 + idx]); | |
1212 | printf("%02hhx", data[2 + idx]); | |
1141 | 1213 | } |
1142 | 1214 | printf("\n"); |
1143 | 1215 | } |
1149 | 1221 | printf("Invalid IE length.\n"); |
1150 | 1222 | } else { |
1151 | 1223 | for (idx = 0; idx < ln1; idx++) { |
1152 | printf("%02hx", data[2 + ln0 + idx]); | |
1224 | printf("%02hhx", data[2 + ln0 + idx]); | |
1153 | 1225 | } |
1154 | 1226 | printf("\n"); |
1155 | 1227 | } |
1161 | 1233 | printf("Invalid IE length.\n"); |
1162 | 1234 | } else { |
1163 | 1235 | for (idx = 0; idx < ln2; idx++) { |
1164 | printf("%02hx", data[2 + ln0 + ln1 + idx]); | |
1236 | printf("%02hhx", data[2 + ln0 + ln1 + idx]); | |
1165 | 1237 | } |
1166 | 1238 | printf("\n"); |
1167 | 1239 | } |
1240 | } | |
1241 | } | |
1242 | ||
1243 | static void print_tx_power_envelope(const uint8_t type, uint8_t len, | |
1244 | const uint8_t *data, | |
1245 | const struct print_ies_data *ie_buffer) | |
1246 | { | |
1247 | const uint8_t local_max_tx_power_count = data[0] & 7; | |
1248 | const uint8_t local_max_tx_power_unit_interp = (data[0] >> 3) & 7; | |
1249 | int i; | |
1250 | static const char *power_names[] = { | |
1251 | "Local Maximum Transmit Power For 20 MHz", | |
1252 | "Local Maximum Transmit Power For 40 MHz", | |
1253 | "Local Maximum Transmit Power For 80 MHz", | |
1254 | "Local Maximum Transmit Power For 160/80+80 MHz", | |
1255 | }; | |
1256 | ||
1257 | printf("\n"); | |
1258 | ||
1259 | if (local_max_tx_power_count + 2 != len) | |
1260 | return; | |
1261 | if (local_max_tx_power_unit_interp != 0) | |
1262 | return; | |
1263 | for (i = 0; i < local_max_tx_power_count + 1; ++i) { | |
1264 | int8_t power_val = ((int8_t)data[1 + i]) >> 1; | |
1265 | int8_t point5 = data[1 + i] & 1; | |
1266 | if (point5) | |
1267 | printf("\t\t * %s: %i.5 dBm\n", power_names[i], power_val); | |
1268 | else | |
1269 | printf("\t\t * %s: %i dBm\n", power_names[i], power_val); | |
1168 | 1270 | } |
1169 | 1271 | } |
1170 | 1272 | |
1388 | 1490 | const struct print_ies_data *ie_buffer) |
1389 | 1491 | { |
1390 | 1492 | printf("\n"); |
1391 | print_vht_info(data[0] | (data[1] << 8) | | |
1392 | (data[2] << 16) | (data[3] << 24), | |
1493 | print_vht_info((__u32) data[0] | ((__u32)data[1] << 8) | | |
1494 | ((__u32)data[2] << 16) | ((__u32)data[3] << 24), | |
1393 | 1495 | data + 4); |
1394 | 1496 | } |
1395 | 1497 | |
1409 | 1511 | printf("\t\t * center freq segment 1: %d\n", data[1]); |
1410 | 1512 | printf("\t\t * center freq segment 2: %d\n", data[2]); |
1411 | 1513 | printf("\t\t * VHT basic MCS set: 0x%.2x%.2x\n", data[4], data[3]); |
1514 | } | |
1515 | ||
1516 | static void print_supp_op_classes(const uint8_t type, uint8_t len, | |
1517 | const uint8_t *data, | |
1518 | const struct print_ies_data *ie_buffer) | |
1519 | { | |
1520 | uint8_t *p = (uint8_t*) data; | |
1521 | const uint8_t *next_data = p + len; | |
1522 | int zero_delimiter = 0; | |
1523 | int one_hundred_thirty_delimiter = 0; | |
1524 | ||
1525 | printf("\n"); | |
1526 | printf("\t\t * current operating class: %d\n", *p); | |
1527 | while (++p < next_data) { | |
1528 | if (*p == 130) { | |
1529 | one_hundred_thirty_delimiter = 1; | |
1530 | break; | |
1531 | } | |
1532 | if (*p == 0) { | |
1533 | zero_delimiter = 0; | |
1534 | break; | |
1535 | } | |
1536 | printf("\t\t * operating class: %d\n", *p); | |
1537 | } | |
1538 | if (one_hundred_thirty_delimiter) | |
1539 | while (++p < next_data) { | |
1540 | printf("\t\t * current operating class extension: %d\n", *p); | |
1541 | } | |
1542 | if (zero_delimiter) | |
1543 | while (++p < next_data - 1) { | |
1544 | printf("\t\t * operating class tuple: %d %d\n", p[0], p[1]); | |
1545 | if (*p == 0) | |
1546 | break; | |
1547 | } | |
1548 | } | |
1549 | ||
1550 | static void print_measurement_pilot_tx(const uint8_t type, uint8_t len, | |
1551 | const uint8_t *data, | |
1552 | const struct print_ies_data *ie_buffer) | |
1553 | { | |
1554 | uint8_t *p, len_remaining; | |
1555 | ||
1556 | printf("\n"); | |
1557 | printf("\t\t * interval: %d TUs\n", data[0]); | |
1558 | ||
1559 | if (len <= 1) | |
1560 | return; | |
1561 | ||
1562 | p = (uint8_t *) data + 1; | |
1563 | len_remaining = len - 1; | |
1564 | ||
1565 | while (len_remaining >=5) { | |
1566 | uint8_t subelement_id = *p, len, *end; | |
1567 | ||
1568 | p++; | |
1569 | len = *p; | |
1570 | p++; | |
1571 | end = p + len; | |
1572 | ||
1573 | len_remaining -= 2; | |
1574 | ||
1575 | /* 802.11-2016 only allows vendor specific elements */ | |
1576 | if (subelement_id != 221) { | |
1577 | printf("\t\t * <Invalid subelement ID %d>\n", subelement_id); | |
1578 | return; | |
1579 | } | |
1580 | ||
1581 | if (len < 3 || len > len_remaining) { | |
1582 | printf(" <Parse error, element too short>\n"); | |
1583 | return; | |
1584 | } | |
1585 | ||
1586 | printf("\t\t * vendor specific: OUI %.2x:%.2x:%.2x, data:", | |
1587 | p[0], p[1], p[2]); | |
1588 | /* add only two here and use ++p in while loop */ | |
1589 | p += 2; | |
1590 | ||
1591 | while (++p < end) | |
1592 | printf(" %.2x", *p); | |
1593 | printf("\n"); | |
1594 | ||
1595 | len_remaining -= len; | |
1596 | } | |
1412 | 1597 | } |
1413 | 1598 | |
1414 | 1599 | static void print_obss_scan_params(const uint8_t type, uint8_t len, |
1532 | 1717 | [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), }, |
1533 | 1718 | [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), }, |
1534 | 1719 | [47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), }, |
1720 | [51] = { "AP Channel Report", print_ap_channel_report, 1, 255, BIT(PRINT_SCAN), }, | |
1721 | [59] = { "Supported operating classes", print_supp_op_classes, 1, 255, BIT(PRINT_SCAN), }, | |
1722 | [66] = { "Measurement Pilot Transmission", print_measurement_pilot_tx, 1, 255, BIT(PRINT_SCAN), }, | |
1535 | 1723 | [74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), }, |
1536 | 1724 | [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, |
1537 | 1725 | [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), }, |
1539 | 1727 | [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, |
1540 | 1728 | [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, |
1541 | 1729 | [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, |
1730 | [70] = { "RM enabled capabilities", print_rm_enabled_capabilities, 5, 5, BIT(PRINT_SCAN), }, | |
1542 | 1731 | [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), }, |
1543 | 1732 | [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, |
1544 | 1733 | [127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), }, |
1545 | 1734 | [107] = { "802.11u Interworking", print_interworking, 0, 255, BIT(PRINT_SCAN), }, |
1546 | 1735 | [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), }, |
1547 | [111] = { "802.11u Roaming Consortium", print_11u_rcon, 0, 255, BIT(PRINT_SCAN), }, | |
1736 | [111] = { "802.11u Roaming Consortium", print_11u_rcon, 2, 255, BIT(PRINT_SCAN), }, | |
1737 | [195] = { "Transmit Power Envelope", print_tx_power_envelope, 2, 5, BIT(PRINT_SCAN), }, | |
1548 | 1738 | }; |
1549 | 1739 | |
1550 | 1740 | static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, |
1654 | 1844 | while (len >= 4) { |
1655 | 1845 | subtype = (data[0] << 8) + data[1]; |
1656 | 1846 | sublen = (data[2] << 8) + data[3]; |
1657 | if (sublen > len) | |
1847 | if (sublen > len - 4) | |
1658 | 1848 | break; |
1659 | 1849 | |
1660 | 1850 | switch (subtype) { |
1661 | 1851 | case 0x104a: |
1662 | 1852 | tab_on_first(&first); |
1853 | if (sublen < 1) { | |
1854 | printf("\t * Version: (invalid " | |
1855 | "length %d)\n", sublen); | |
1856 | break; | |
1857 | } | |
1663 | 1858 | printf("\t * Version: %d.%d\n", data[4] >> 4, data[4] & 0xF); |
1664 | 1859 | break; |
1665 | 1860 | case 0x1011: |
1670 | 1865 | uint16_t id; |
1671 | 1866 | tab_on_first(&first); |
1672 | 1867 | if (sublen != 2) { |
1673 | printf("\t * Device Password ID: (invalid " | |
1674 | "length %d)\n", sublen); | |
1868 | printf("\t * Device Password ID: (invalid length %d)\n", | |
1869 | sublen); | |
1675 | 1870 | break; |
1676 | 1871 | } |
1677 | 1872 | id = data[4] << 8 | data[5]; |
1692 | 1887 | printf("\t * Model Number: %.*s\n", sublen, data + 4); |
1693 | 1888 | break; |
1694 | 1889 | case 0x103b: { |
1695 | __u8 val = data[4]; | |
1890 | __u8 val; | |
1891 | ||
1892 | if (sublen < 1) { | |
1893 | printf("\t * Response Type: (invalid length %d)\n", | |
1894 | sublen); | |
1895 | break; | |
1896 | } | |
1897 | val = data[4]; | |
1696 | 1898 | tab_on_first(&first); |
1697 | 1899 | printf("\t * Response Type: %d%s\n", |
1698 | 1900 | val, val == 3 ? " (AP)" : ""); |
1699 | 1901 | break; |
1700 | 1902 | } |
1701 | 1903 | case 0x103c: { |
1702 | __u8 val = data[4]; | |
1904 | __u8 val; | |
1905 | ||
1906 | if (sublen < 1) { | |
1907 | printf("\t * RF Bands: (invalid length %d)\n", | |
1908 | sublen); | |
1909 | break; | |
1910 | } | |
1911 | val = data[4]; | |
1703 | 1912 | tab_on_first(&first); |
1704 | 1913 | printf("\t * RF Bands: 0x%x\n", val); |
1705 | 1914 | break; |
1706 | 1915 | } |
1707 | 1916 | case 0x1041: { |
1708 | __u8 val = data[4]; | |
1917 | __u8 val; | |
1918 | ||
1919 | if (sublen < 1) { | |
1920 | printf("\t * Selected Registrar: (invalid length %d)\n", | |
1921 | sublen); | |
1922 | break; | |
1923 | } | |
1924 | val = data[4]; | |
1709 | 1925 | tab_on_first(&first); |
1710 | 1926 | printf("\t * Selected Registrar: 0x%x\n", val); |
1711 | 1927 | break; |
1715 | 1931 | printf("\t * Serial Number: %.*s\n", sublen, data + 4); |
1716 | 1932 | break; |
1717 | 1933 | case 0x1044: { |
1718 | __u8 val = data[4]; | |
1934 | __u8 val; | |
1935 | ||
1936 | if (sublen < 1) { | |
1937 | printf("\t * Wi-Fi Protected Setup State: (invalid length %d)\n", | |
1938 | sublen); | |
1939 | break; | |
1940 | } | |
1941 | val = data[4]; | |
1719 | 1942 | tab_on_first(&first); |
1720 | 1943 | printf("\t * Wi-Fi Protected Setup State: %d%s%s\n", |
1721 | 1944 | val, |
1737 | 1960 | data[12], data[13], data[14], data[15], |
1738 | 1961 | data[16], data[17], data[18], data[19]); |
1739 | 1962 | break; |
1963 | case 0x1049: | |
1964 | tab_on_first(&first); | |
1965 | if (sublen == 6 && | |
1966 | data[4] == 0x00 && | |
1967 | data[5] == 0x37 && | |
1968 | data[6] == 0x2a && | |
1969 | data[7] == 0x00 && | |
1970 | data[8] == 0x01) { | |
1971 | uint8_t v2 = data[9]; | |
1972 | printf("\t * Version2: %d.%d\n", v2 >> 4, v2 & 0xf); | |
1973 | } else { | |
1974 | printf("\t * Unknown vendor extension. len=%u\n", | |
1975 | sublen); | |
1976 | } | |
1977 | break; | |
1740 | 1978 | case 0x1054: { |
1741 | 1979 | tab_on_first(&first); |
1742 | 1980 | if (sublen != 8) { |
1743 | printf("\t * Primary Device Type: (invalid " | |
1744 | "length %d)\n", sublen); | |
1981 | printf("\t * Primary Device Type: (invalid length %d)\n", | |
1982 | sublen); | |
1745 | 1983 | break; |
1746 | 1984 | } |
1747 | 1985 | printf("\t * Primary Device Type: " |
1752 | 1990 | break; |
1753 | 1991 | } |
1754 | 1992 | case 0x1057: { |
1755 | __u8 val = data[4]; | |
1993 | __u8 val; | |
1756 | 1994 | tab_on_first(&first); |
1995 | if (sublen < 1) { | |
1996 | printf("\t * AP setup locked: (invalid length %d)\n", | |
1997 | sublen); | |
1998 | break; | |
1999 | } | |
2000 | val = data[4]; | |
1757 | 2001 | printf("\t * AP setup locked: 0x%.2x\n", val); |
1758 | 2002 | break; |
1759 | 2003 | } |
1760 | 2004 | case 0x1008: |
1761 | 2005 | case 0x1053: { |
1762 | __u16 meth = (data[4] << 8) + data[5]; | |
1763 | bool comma = false; | |
2006 | __u16 meth; | |
2007 | bool comma; | |
2008 | ||
2009 | if (sublen < 2) { | |
2010 | printf("\t * Config methods: (invalid length %d)\n", | |
2011 | sublen); | |
2012 | break; | |
2013 | } | |
2014 | meth = (data[4] << 8) + data[5]; | |
2015 | comma = false; | |
1764 | 2016 | tab_on_first(&first); |
1765 | 2017 | printf("\t * %sConfig methods:", |
1766 | 2018 | subtype == 0x1053 ? "Selected Registrar ": ""); |
1872 | 2124 | case 0x12: /* invitation flags */ |
1873 | 2125 | case 0xdd: /* vendor specific */ |
1874 | 2126 | default: { |
1875 | const __u8 *subdata = data + 4; | |
2127 | const __u8 *subdata = data + 3; | |
1876 | 2128 | __u16 tmplen = sublen; |
1877 | 2129 | |
1878 | 2130 | tab_on_first(&first); |
2017 | 2269 | .ie = ie, |
2018 | 2270 | .ielen = ielen }; |
2019 | 2271 | |
2020 | while (ielen >= 2 && ielen >= ie[1]) { | |
2272 | if (ie == NULL || ielen < 0) | |
2273 | return; | |
2274 | ||
2275 | while (ielen >= 2 && ielen - 2 >= ie[1]) { | |
2021 | 2276 | if (ie[0] < ARRAY_SIZE(ieprinters) && |
2022 | 2277 | ieprinters[ie[0]].name && |
2023 | 2278 | ieprinters[ie[0]].flags & BIT(ptype)) { |
255 | 255 | if (rinfo[NL80211_RATE_INFO_HE_DCM]) |
256 | 256 | pos += snprintf(pos, buflen - (pos - buf), |
257 | 257 | " HE-DCM %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_DCM])); |
258 | if (rinfo[NL80211_RATE_INFO_HE_RU_ALLOC]) | |
259 | pos += snprintf(pos, buflen - (pos - buf), | |
260 | " HE-RU-ALLOC %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_RU_ALLOC])); | |
258 | 261 | } |
259 | 262 | |
260 | 263 | static char *get_chain_signal(struct nlattr *attr_list) |
324 | 327 | [NL80211_STA_INFO_TX_DURATION] = { .type = NLA_U64 }, |
325 | 328 | [NL80211_STA_INFO_ACK_SIGNAL] = {.type = NLA_U8 }, |
326 | 329 | [NL80211_STA_INFO_ACK_SIGNAL_AVG] = { .type = NLA_U8 }, |
330 | [NL80211_STA_INFO_AIRTIME_LINK_METRIC] = { .type = NLA_U32 }, | |
331 | [NL80211_STA_INFO_CONNECTED_TO_AS] = { .type = NLA_FLAG }, | |
332 | [NL80211_STA_INFO_CONNECTED_TO_GATE] = { .type = NLA_FLAG }, | |
327 | 333 | }; |
328 | 334 | char *chain; |
329 | 335 | struct timeval now; |
493 | 499 | } |
494 | 500 | printf("\n\tmesh plink:\t%s", state_name); |
495 | 501 | } |
502 | if (sinfo[NL80211_STA_INFO_AIRTIME_LINK_METRIC]) | |
503 | printf("\n\tmesh airtime link metric: %d", | |
504 | nla_get_u32(sinfo[NL80211_STA_INFO_AIRTIME_LINK_METRIC])); | |
505 | if (sinfo[NL80211_STA_INFO_CONNECTED_TO_GATE]) | |
506 | printf("\n\tmesh connected to gate:\t%s", | |
507 | nla_get_u8(sinfo[NL80211_STA_INFO_CONNECTED_TO_GATE]) ? | |
508 | "yes" : "no"); | |
509 | if (sinfo[NL80211_STA_INFO_CONNECTED_TO_AS]) | |
510 | printf("\n\tmesh connected to auth server:\t%s", | |
511 | nla_get_u8(sinfo[NL80211_STA_INFO_CONNECTED_TO_AS]) ? | |
512 | "yes" : "no"); | |
513 | ||
496 | 514 | if (sinfo[NL80211_STA_INFO_LOCAL_PM]) { |
497 | 515 | printf("\n\tmesh local PS mode:\t"); |
498 | 516 | print_power_mode(sinfo[NL80211_STA_INFO_LOCAL_PM]); |
179 | 179 | else |
180 | 180 | return 5000 + chan * 5; |
181 | 181 | break; |
182 | case NL80211_BAND_6GHZ: | |
183 | /* see 802.11ax D6.1 27.3.23.2 */ | |
184 | if (chan == 2) | |
185 | return 5935; | |
186 | if (chan <= 253) | |
187 | return 5950 + chan * 5; | |
188 | break; | |
182 | 189 | case NL80211_BAND_60GHZ: |
183 | if (chan < 5) | |
190 | if (chan < 7) | |
184 | 191 | return 56160 + chan * 2160; |
185 | 192 | break; |
186 | 193 | default: |
194 | 201 | /* see 802.11-2007 17.3.8.3.2 and Annex J */ |
195 | 202 | if (freq == 2484) |
196 | 203 | return 14; |
204 | /* see 802.11ax D6.1 27.3.23.2 and Annex E */ | |
205 | else if (freq == 5935) | |
206 | return 2; | |
197 | 207 | else if (freq < 2484) |
198 | 208 | return (freq - 2407) / 5; |
199 | 209 | else if (freq >= 4910 && freq <= 4980) |
200 | 210 | return (freq - 4000) / 5; |
211 | else if (freq < 5950) | |
212 | return (freq - 5000) / 5; | |
201 | 213 | else if (freq <= 45000) /* DMG band lower limit */ |
202 | return (freq - 5000) / 5; | |
203 | else if (freq >= 58320 && freq <= 64800) | |
214 | /* see 802.11ax D6.1 27.3.23.2 */ | |
215 | return (freq - 5950) / 5; | |
216 | else if (freq >= 58320 && freq <= 70200) | |
204 | 217 | return (freq - 56160) / 2160; |
205 | 218 | else |
206 | 219 | return 0; |
493 | 506 | case NL80211_CHAN_WIDTH_80: |
494 | 507 | case NL80211_CHAN_WIDTH_160: |
495 | 508 | need_cf1 = true; |
509 | break; | |
510 | case NL80211_CHAN_WIDTH_1: | |
511 | case NL80211_CHAN_WIDTH_2: | |
512 | case NL80211_CHAN_WIDTH_4: | |
513 | case NL80211_CHAN_WIDTH_8: | |
514 | case NL80211_CHAN_WIDTH_16: | |
515 | /* can't happen yet */ | |
496 | 516 | break; |
497 | 517 | } |
498 | 518 |