]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
driver: Add second driver capability flags bitmap
authorJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 09:29:00 +0000 (12:29 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 12:53:02 +0000 (15:53 +0300)
All 64 bits of the capability flags bitmap are used, so add a new
variable to hold future capability bits.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/ctrl_iface.c
hostapd/main.c
src/ap/hostapd.h
src/drivers/driver.h
src/drivers/driver_common.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/mesh.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index c5b258bf16d33a0643977f150c09b52dfb71816c..c6160ded3e8fcc763be1464df8bd7d3374770bc9 100644 (file)
@@ -3105,6 +3105,34 @@ static int hostapd_ctrl_driver_flags(struct hostapd_iface *iface, char *buf,
 }
 
 
+static int hostapd_ctrl_driver_flags2(struct hostapd_iface *iface, char *buf,
+                                     size_t buflen)
+{
+       int ret, i;
+       char *pos, *end;
+
+       ret = os_snprintf(buf, buflen, "%016llX:\n",
+                         (long long unsigned) iface->drv_flags2);
+       if (os_snprintf_error(buflen, ret))
+               return -1;
+
+       pos = buf + ret;
+       end = buf + buflen;
+
+       for (i = 0; i < 64; i++) {
+               if (iface->drv_flags2 & (1LLU << i)) {
+                       ret = os_snprintf(pos, end - pos, "%s\n",
+                                         driver_flag2_to_string(1LLU << i));
+                       if (os_snprintf_error(end - pos, ret))
+                               return -1;
+                       pos += ret;
+               }
+       }
+
+       return pos - buf;
+}
+
+
 static int hostapd_ctrl_iface_acl_del_mac(struct mac_acl_entry **acl, int *num,
                                          const char *txtaddr)
 {
@@ -3517,6 +3545,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
        } else if (os_strcmp(buf, "DRIVER_FLAGS") == 0) {
                reply_len = hostapd_ctrl_driver_flags(hapd->iface, reply,
                                                      reply_size);
+       } else if (os_strcmp(buf, "DRIVER_FLAGS2") == 0) {
+               reply_len = hostapd_ctrl_driver_flags2(hapd->iface, reply,
+                                                      reply_size);
        } else if (os_strcmp(buf, "TERMINATE") == 0) {
                eloop_terminate();
        } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) {
index 4af8e8f9c7aeeecbaa6e625ed5a55f71fb2acfd2..6a69412d054e4a676d526c6fe267f776b4c26be1 100644 (file)
@@ -218,6 +218,7 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
                struct wowlan_triggers *triggs;
 
                iface->drv_flags = capa.flags;
+               iface->drv_flags2 = capa.flags2;
                iface->probe_resp_offloads = capa.probe_resp_offloads;
                /*
                 * Use default extended capa values from per-radio information
index ec5b9d57feea58c5918d50bf7f77c0702cf99d96..fff15f118ffc4e4a62109dbb5fa9aee16486c7dc 100644 (file)
@@ -475,6 +475,7 @@ struct hostapd_iface {
        struct ap_info *ap_hash[STA_HASH_SIZE];
 
        u64 drv_flags;
+       u64 drv_flags2;
 
        /*
         * A bitmap of supported protocols for probe response offload. See
index 032bbd8921966240c498da6376e8b2ac6b5b48a6..e01f26c1223ef10f58d516b47cb9a5b44366ba08 100644 (file)
@@ -1852,6 +1852,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID       0x8000000000000000ULL
        u64 flags;
 
+       u64 flags2;
+
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
        (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
 
@@ -5921,6 +5923,7 @@ wpa_get_wowlan_triggers(const char *wowlan_triggers,
                        const struct wpa_driver_capa *capa);
 /* Convert driver flag to string */
 const char * driver_flag_to_string(u64 flag);
+const char * driver_flag2_to_string(u64 flag2);
 
 /* NULL terminated array of linked in driver wrappers */
 extern const struct wpa_driver_ops *const wpa_drivers[];
index 63846db2e2182e99a86f42cb38bf4943859cc48b..c62cf51e3c3e3f17562da6b03b9617bdd541185f 100644 (file)
@@ -321,3 +321,13 @@ const char * driver_flag_to_string(u64 flag)
        return "UNKNOWN";
 #undef DF2S
 }
+
+
+const char * driver_flag2_to_string(u64 flag2)
+{
+#define DF2S(x) case WPA_DRIVER_FLAGS2_ ## x: return #x
+       switch (flag2) {
+       }
+       return "UNKNOWN";
+#undef DF2S
+}
index 13e2f41a9c17f6794243a24118d8a80b9576650c..541de758eb01190edaead54741ef4b16bcae5832 100644 (file)
@@ -7960,6 +7960,34 @@ static int wpas_ctrl_iface_driver_flags(struct wpa_supplicant *wpa_s,
 }
 
 
+static int wpas_ctrl_iface_driver_flags2(struct wpa_supplicant *wpa_s,
+                                        char *buf, size_t buflen)
+{
+       int ret, i;
+       char *pos, *end;
+
+       ret = os_snprintf(buf, buflen, "%016llX:\n",
+                         (long long unsigned) wpa_s->drv_flags2);
+       if (os_snprintf_error(buflen, ret))
+               return -1;
+
+       pos = buf + ret;
+       end = buf + buflen;
+
+       for (i = 0; i < 64; i++) {
+               if (wpa_s->drv_flags2 & (1LLU << i)) {
+                       ret = os_snprintf(pos, end - pos, "%s\n",
+                                         driver_flag2_to_string(1LLU << i));
+                       if (os_snprintf_error(end - pos, ret))
+                               return -1;
+                       pos += ret;
+               }
+       }
+
+       return pos - buf;
+}
+
+
 static int wpa_supplicant_pktcnt_poll(struct wpa_supplicant *wpa_s, char *buf,
                                      size_t buflen)
 {
@@ -10730,6 +10758,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strcmp(buf, "DRIVER_FLAGS") == 0) {
                reply_len = wpas_ctrl_iface_driver_flags(wpa_s, reply,
                                                         reply_size);
+       } else if (os_strcmp(buf, "DRIVER_FLAGS2") == 0) {
+               reply_len = wpas_ctrl_iface_driver_flags2(wpa_s, reply,
+                                                         reply_size);
 #ifdef ANDROID
        } else if (os_strncmp(buf, "DRIVER ", 7) == 0) {
                reply_len = wpa_supplicant_driver_cmd(wpa_s, buf + 7, reply,
index b504124fadb062caeaa034e4e7918119483a42bc..c085466b1e71d69c21eb14a0c3638e02eefbbe63 100644 (file)
@@ -268,6 +268,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
                return -ENOMEM;
 
        ifmsh->drv_flags = wpa_s->drv_flags;
+       ifmsh->drv_flags2 = wpa_s->drv_flags2;
        ifmsh->num_bss = 1;
        ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
                               sizeof(struct hostapd_data *));
index e29ed83e135d2c84ef5ea045b0eefe7013e2fc64..6a69ccebf6952342aa0f1e7d0bc165e2b91b7019 100644 (file)
@@ -6243,6 +6243,7 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
        if (capa_res == 0) {
                wpa_s->drv_capa_known = 1;
                wpa_s->drv_flags = capa.flags;
+               wpa_s->drv_flags2 = capa.flags2;
                wpa_s->drv_enc = capa.enc;
                wpa_s->drv_rrm_flags = capa.rrm_flags;
                wpa_s->probe_resp_offloads = capa.probe_resp_offloads;
index 997e5f642a6a6b3059214e906281ab152bd3d7e6..619ae42b624830de6025555da95568aaa27b7935 100644 (file)
@@ -725,6 +725,7 @@ struct wpa_supplicant {
        unsigned int no_suitable_network;
 
        u64 drv_flags;
+       u64 drv_flags2;
        unsigned int drv_enc;
        unsigned int drv_rrm_flags;