]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Report the number of concurrent support channels
authorIlan Peer <ilan.peer@intel.com>
Sun, 21 Jul 2013 16:49:47 +0000 (19:49 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 21 Jul 2013 16:49:47 +0000 (19:49 +0300)
Previously, drivers only reported if they support multiple concurrent
channels, but did not report the maximum number of supported channels.
Add this reporting to the driver capabilities and add the implementation
to driver_nl80211.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
Signed-hostap: David Spinadel <david.spinadel@intel.com>

src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 980f913edbb691266bdeb0d809a2986102b329d1..e354c25fd6d86d8042f3afd45cc262cc69a73d57 100644 (file)
@@ -911,6 +911,11 @@ struct wpa_driver_capa {
 
        unsigned int max_acl_mac_addrs;
 
+       /**
+        * Number of supported concurrent channels
+        */
+       unsigned int num_multichan_concurrent;
+
        /**
         * extended_capa - extended capabilities in driver/device
         *
index 791a7efa1a149cfc0da118b4ad861c18923f5f27..1f51bb4c5629df2d265b7a78a467d2fc1de79a2c 100644 (file)
@@ -2875,6 +2875,8 @@ struct wiphy_info_data {
        struct wpa_driver_nl80211_data *drv;
        struct wpa_driver_capa *capa;
 
+       unsigned int num_multichan_concurrent;
+
        unsigned int error:1;
        unsigned int device_ap_sme:1;
        unsigned int poll_command_supported:1;
@@ -2885,7 +2887,6 @@ struct wiphy_info_data {
        unsigned int p2p_go_supported:1;
        unsigned int p2p_client_supported:1;
        unsigned int p2p_concurrent:1;
-       unsigned int p2p_multichan_concurrent:1;
 };
 
 
@@ -2995,8 +2996,8 @@ static int wiphy_info_iface_comb_process(struct wiphy_info_data *info,
 
        if (combination_has_p2p && combination_has_mgd) {
                info->p2p_concurrent = 1;
-               if (nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]) > 1)
-                       info->p2p_multichan_concurrent = 1;
+               info->num_multichan_concurrent =
+                       nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
                return 1;
        }
 
@@ -3246,10 +3247,12 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
                drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CONCURRENT;
                drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P;
        }
-       if (info->p2p_multichan_concurrent) {
+       if (info->num_multichan_concurrent > 1) {
                wpa_printf(MSG_DEBUG, "nl80211: Enable multi-channel "
                           "concurrent (driver advertised support)");
                drv->capa.flags |= WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT;
+               drv->capa.num_multichan_concurrent =
+                       info->num_multichan_concurrent;
        }
 
        /* default to 5000 since early versions of mac80211 don't set it */
index 59840606d899cdc729695de4c7fabcd2317856c9..13b6757d8ea4ffcff07904c6fd9c595f176f52f2 100644 (file)
@@ -2965,6 +2965,8 @@ next_driver:
                wpa_s->extended_capa = capa.extended_capa;
                wpa_s->extended_capa_mask = capa.extended_capa_mask;
                wpa_s->extended_capa_len = capa.extended_capa_len;
+               wpa_s->num_multichan_concurrent =
+                       capa.num_multichan_concurrent;
        }
        if (wpa_s->max_remain_on_chan == 0)
                wpa_s->max_remain_on_chan = 1000;
@@ -2979,6 +2981,9 @@ next_driver:
        else
                iface->p2p_mgmt = 1;
 
+       if (wpa_s->num_multichan_concurrent == 0)
+               wpa_s->num_multichan_concurrent = 1;
+
        if (wpa_supplicant_driver_init(wpa_s) < 0)
                return -1;
 
index 9240863102fc881829ef2d50012f9cc3d892e501..75979084c27bb0b990a680aa2bbfb17a5a5114ef 100644 (file)
@@ -722,6 +722,8 @@ struct wpa_supplicant {
        u8 last_gtk[32];
        size_t last_gtk_len;
 #endif /* CONFIG_TESTING_GET_GTK */
+
+       unsigned int num_multichan_concurrent;
 };