From 4752147d88007a099d64f926937508bd7efa5045 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Sun, 21 Jul 2013 19:49:47 +0300 Subject: [PATCH] nl80211: Report the number of concurrent support channels 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 Signed-hostap: David Spinadel --- src/drivers/driver.h | 5 +++++ src/drivers/driver_nl80211.c | 11 +++++++---- wpa_supplicant/wpa_supplicant.c | 5 +++++ wpa_supplicant/wpa_supplicant_i.h | 2 ++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 980f913ed..e354c25fd 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -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 * diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 791a7efa1..1f51bb4c5 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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 */ diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 59840606d..13b6757d8 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 924086310..75979084c 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -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; };