]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - info.c
info: add FILS_CRYPTO_OFFLOAD extended feature
[thirdparty/iw.git] / info.c
diff --git a/info.c b/info.c
index 92c7d1d7aa72f360eb04f328e060795175e888c7..3a45b3fa4afa7729eaae4e7177a9484c5256a37a 100644 (file)
--- a/info.c
+++ b/info.c
@@ -69,13 +69,15 @@ static int ext_feature_isset(const unsigned char *ext_features, int ext_features
        return (ft_byte & BIT(ftidx % 8)) != 0;
 }
 
-static void ext_feat_print(const struct nlattr *tb,
-                          enum nl80211_ext_feature_index idx,
-                          const char *feature_name, const char *feature_desc)
+static void _ext_feat_print(const struct nlattr *tb,
+                           enum nl80211_ext_feature_index idx,
+                           const char *feature_name, const char *feature_desc)
 {
        if (ext_feature_isset(nla_data(tb), nla_len(tb),idx))
                printf("\t\t* [ %s ]: %s\n", feature_name, feature_desc);
 }
+#define ext_feat_print(tb, name, desc) \
+       _ext_feat_print(tb, NL80211_EXT_FEATURE_##name, #name, desc)
 
 static int print_phy_handler(struct nl_msg *msg, void *arg)
 {
@@ -103,10 +105,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
        struct nlattr *nl_band;
        struct nlattr *nl_freq;
        struct nlattr *nl_rate;
-       struct nlattr *nl_mode;
        struct nlattr *nl_cmd;
        struct nlattr *nl_if, *nl_ftype;
-       int rem_band, rem_freq, rem_rate, rem_mode, rem_cmd, rem_ftype, rem_if;
+       int rem_band, rem_freq, rem_rate, rem_cmd, rem_ftype, rem_if;
        int open;
        /*
         * static variables only work here, other applications need to use the
@@ -131,6 +132,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
        if (print_name && tb_msg[NL80211_ATTR_WIPHY_NAME])
                printf("Wiphy %s\n", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
 
+       if (print_name && tb_msg[NL80211_ATTR_WIPHY])
+               printf("\twiphy index: %u\n", nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]));
+
        /* needed for split dump */
        if (tb_msg[NL80211_ATTR_WIPHY_BANDS]) {
                nla_for_each_nested(nl_band, tb_msg[NL80211_ATTR_WIPHY_BANDS], rem_band) {
@@ -162,7 +166,13 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
                            tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])
                                print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]),
                                               nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]));
+                       if (tb_band[NL80211_BAND_ATTR_IFTYPE_DATA]) {
+                               struct nlattr *nl_iftype;
+                               int rem_band;
 
+                               nla_for_each_nested(nl_iftype, tb_band[NL80211_BAND_ATTR_IFTYPE_DATA], rem_band)
+                                       print_he_info(nl_iftype);
+                       }
                        if (tb_band[NL80211_BAND_ATTR_FREQS]) {
                                if (!band_had_freq) {
                                        printf("\t\tFrequencies:\n");
@@ -310,17 +320,13 @@ next:
                       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]),
                       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]));
 
-       if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) {
-               printf("\tSupported interface modes:\n");
-               nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES], rem_mode)
-                       printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
-       }
+       if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
+               print_iftype_list("\tSupported interface modes", "\t\t",
+                                 tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]);
 
-       if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) {
-               printf("\tsoftware interface modes (can always be added):\n");
-               nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode)
-                       printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
-       }
+       if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES])
+               print_iftype_list("\tsoftware interface modes (can always be added)",
+                                 "\t\t", tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]);
 
        if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) {
                struct nlattr *nl_combi;
@@ -362,8 +368,6 @@ next:
                        }
 
                        nla_for_each_nested(nl_limit, tb_comb[NL80211_IFACE_COMB_LIMITS], rem_limit) {
-                               bool ift_comma = false;
-
                                err = nla_parse_nested(tb_limit, MAX_NL80211_IFACE_LIMIT,
                                                       nl_limit, iface_limit_policy);
                                if (err || !tb_limit[NL80211_IFACE_LIMIT_TYPES]) {
@@ -374,13 +378,8 @@ next:
                                if (comma)
                                        printf(", ");
                                comma = true;
-                               printf("#{");
-
-                               nla_for_each_nested(nl_mode, tb_limit[NL80211_IFACE_LIMIT_TYPES], rem_mode) {
-                                       printf("%s %s", ift_comma ? "," : "",
-                                               iftype_name(nla_type(nl_mode)));
-                                       ift_comma = true;
-                               }
+                               printf("#{ ");
+                               print_iftype_line(tb_limit[NL80211_IFACE_LIMIT_TYPES]);
                                printf(" } <= %u", nla_get_u32(tb_limit[NL80211_IFACE_LIMIT_MAX]));
                        }
                        printf(",\n\t\t   ");
@@ -625,77 +624,84 @@ broken_combination:
 
                printf("\tSupported extended features:\n");
 
-               ext_feat_print(tb, NL80211_EXT_FEATURE_VHT_IBSS,
-                              "VHT_IBSS", "VHT-IBSS");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_RRM,
-                              "RRM", "RRM");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER,
-                              "MU_MIMO_AIR_SNIFFER", "MU-MIMO sniffer");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_SCAN_START_TIME,
-                              "SCAN_START_TIME", "scan start timestamp");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_BSS_PARENT_TSF,
-                              "BSS_PARENT_TSF", "BSS last beacon/probe TSF");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_SET_SCAN_DWELL,
-                              "SET_SCAN_DWELL", "scan dwell setting");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
-                              "BEACON_RATE_LEGACY", "legacy beacon rate setting");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_HT,
-                              "BEACON_RATE_HT", "HT beacon rate setting");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_BEACON_RATE_VHT,
-                              "BEACON_RATE_VHT", "VHT beacon rate setting");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_STA,
-                              "FILS_STA", "STA FILS (Fast Initial Link Setup)");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA,
-                              "MGMT_TX_RANDOM_TA",
+               ext_feat_print(tb, VHT_IBSS, "VHT-IBSS");
+               ext_feat_print(tb, RRM, "RRM");
+               ext_feat_print(tb, MU_MIMO_AIR_SNIFFER, "MU-MIMO sniffer");
+               ext_feat_print(tb, SCAN_START_TIME, "scan start timestamp");
+               ext_feat_print(tb, BSS_PARENT_TSF,
+                              "BSS last beacon/probe TSF");
+               ext_feat_print(tb, SET_SCAN_DWELL, "scan dwell setting");
+               ext_feat_print(tb, BEACON_RATE_LEGACY,
+                              "legacy beacon rate setting");
+               ext_feat_print(tb, BEACON_RATE_HT, "HT beacon rate setting");
+               ext_feat_print(tb, BEACON_RATE_VHT, "VHT beacon rate setting");
+               ext_feat_print(tb, FILS_STA,
+                              "STA FILS (Fast Initial Link Setup)");
+               ext_feat_print(tb, MGMT_TX_RANDOM_TA,
                               "randomized TA while not associated");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED,
-                              "MGMT_TX_RANDOM_TA_CONNECTED",
+               ext_feat_print(tb, MGMT_TX_RANDOM_TA_CONNECTED,
                               "randomized TA while associated");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI,
-                              "SCHED_SCAN_RELATIVE_RSSI",
+               ext_feat_print(tb, SCHED_SCAN_RELATIVE_RSSI,
                               "sched_scan for BSS with better RSSI report");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_CQM_RSSI_LIST,
-                              "CQM_RSSI_LIST",
+               ext_feat_print(tb, CQM_RSSI_LIST,
                               "multiple CQM_RSSI_THOLD records");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_SK_OFFLOAD,
-                              "FILS_SK_OFFLOAD",
+               ext_feat_print(tb, FILS_SK_OFFLOAD,
                               "FILS shared key authentication offload");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK,
-                              "4WAY_HANDSHAKE_STA_PSK",
+               ext_feat_print(tb, 4WAY_HANDSHAKE_STA_PSK,
                               "4-way handshake with PSK in station mode");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X,
-                              "4WAY_HANDSHAKE_STA_1X",
+               ext_feat_print(tb, 4WAY_HANDSHAKE_STA_1X,
                               "4-way handshake with 802.1X in station mode");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME,
-                              "FILS_MAX_CHANNEL_TIME",
+               ext_feat_print(tb, FILS_MAX_CHANNEL_TIME,
                               "FILS max channel attribute override with dwell time");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP,
-                              "ACCEPT_BCAST_PROBE_RESP",
+               ext_feat_print(tb, ACCEPT_BCAST_PROBE_RESP,
                               "accepts broadcast probe response");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE,
-                              "OCE_PROBE_REQ_HIGH_TX_RATE",
+               ext_feat_print(tb, OCE_PROBE_REQ_HIGH_TX_RATE,
                               "probe request TX at high rate (at least 5.5Mbps)");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION,
-                              "OCE_PROBE_REQ_DEFERRAL_SUPPRESSION",
+               ext_feat_print(tb, OCE_PROBE_REQ_DEFERRAL_SUPPRESSION,
                               "probe request tx deferral and suppression");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_MFP_OPTIONAL,
-                              "MFP_OPTIONAL",
+               ext_feat_print(tb, MFP_OPTIONAL,
                               "MFP_OPTIONAL value in ATTR_USE_MFP");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_LOW_SPAN_SCAN,
-                              "LOW_SPAN_SCAN", "low span scan");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_LOW_POWER_SCAN,
-                              "LOW_POWER_SCAN", "low power scan");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
-                              "HIGH_ACCURACY_SCAN", "high accuracy scan");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_DFS_OFFLOAD,
-                              "DFS_OFFLOAD", "DFS offload");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
-                              "CONTROL_PORT_OVER_NL80211",
+               ext_feat_print(tb, LOW_SPAN_SCAN, "low span scan");
+               ext_feat_print(tb, LOW_POWER_SCAN, "low power scan");
+               ext_feat_print(tb, HIGH_ACCURACY_SCAN, "high accuracy scan");
+               ext_feat_print(tb, DFS_OFFLOAD, "DFS offload");
+               ext_feat_print(tb, CONTROL_PORT_OVER_NL80211,
                               "control port over nl80211");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_TXQS,
-                              "TXQS", "FQ-CoDel-enabled intermediate TXQs");
-               ext_feat_print(tb, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
-                              "AIRTIME_FAIRNESS", "airtime fairness scheduling");
+               ext_feat_print(tb, ACK_SIGNAL_SUPPORT,
+                              "ack signal level support");
+               ext_feat_print(tb, TXQS, "FQ-CoDel-enabled intermediate TXQs");
+               ext_feat_print(tb, AIRTIME_FAIRNESS,
+                              "airtime fairness scheduling");
+               ext_feat_print(tb, AQL,
+                              "Airtime Queue Limits (AQL)");
+               ext_feat_print(tb, SCAN_RANDOM_SN,
+                              "use random sequence numbers in scans");
+               ext_feat_print(tb, SCAN_MIN_PREQ_CONTENT,
+                              "use probe request with only rate IEs in scans");
+               ext_feat_print(tb, CAN_REPLACE_PTK0,
+                              "can safely replace PTK 0 when rekeying");
+               ext_feat_print(tb, ENABLE_FTM_RESPONDER,
+                              "enable FTM (Fine Time Measurement) responder");
+               ext_feat_print(tb, AP_PMKSA_CACHING,
+                              "PMKSA caching supported in AP mode");
+               ext_feat_print(tb, SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
+                              "band specific RSSI thresholds for scheduled scan");
+               ext_feat_print(tb, EXT_KEY_ID, "Extended Key ID support");
+               ext_feat_print(tb, STA_TX_PWR, "TX power control per station");
+               ext_feat_print(tb, SAE_OFFLOAD, "SAE offload support");
+               ext_feat_print(tb, VLAN_OFFLOAD, "VLAN offload support");
+               ext_feat_print(tb, BEACON_PROTECTION, "beacon protection support");
+               ext_feat_print(tb, CONTROL_PORT_NO_PREAUTH, "disable pre-auth over nl80211 control port support");
+               ext_feat_print(tb, PROTECTED_TWT, "protected Target Wake Time (TWT) support");
+               ext_feat_print(tb, DEL_IBSS_STA, "deletion of IBSS station support");
+               ext_feat_print(tb, MULTICAST_REGISTRATIONS, "mgmt frame registration for multicast");
+               ext_feat_print(tb, BEACON_PROTECTION_CLIENT, "beacon prot. for clients support");
+               ext_feat_print(tb, SCAN_FREQ_KHZ, "scan on kHz frequency support");
+               ext_feat_print(tb, CONTROL_PORT_OVER_NL80211_TX_STATUS, "tx status for nl80211 control port support");
+               ext_feat_print(tb, OPERATING_CHANNEL_VALIDATION, "Operating Channel Validation (OCV) support");
+               ext_feat_print(tb, 4WAY_HANDSHAKE_AP_PSK, "AP mode PSK offload support");
+               ext_feat_print(tb, BSS_COLOR, "BSS coloring support");
+               ext_feat_print(tb, FILS_CRYPTO_OFFLOAD, "FILS crypto offload");
        }
 
        if (tb_msg[NL80211_ATTR_COALESCE_RULE]) {
@@ -713,6 +719,10 @@ broken_combination:
                        pat->max_pattern_len, pat->max_pkt_offset, rule->max_delay);
        }
 
+       if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])
+               printf("\tMaximum associated stations in AP mode: %u\n",
+                      nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
+
        return NL_SKIP;
 }