From 079a28f7b88bef62249872f0d7b7947ba1d77ac9 Mon Sep 17 00:00:00 2001 From: Ahmad Kholaif Date: Thu, 23 Jul 2015 17:01:17 -0700 Subject: [PATCH] nl80211: Add concurrency capabilities to driver status Extend the nl80211 interface command "driver status" to retrieve the concurrency capabilities from the driver using the QCA vendor extensions. Signed-off-by: Jouni Malinen --- src/drivers/driver.h | 7 +++++++ src/drivers/driver_nl80211.c | 10 ++++++++-- src/drivers/driver_nl80211_capa.c | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index e3d322998..d5946f46f 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1297,6 +1297,13 @@ struct wpa_driver_capa { */ #define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008 u32 rrm_flags; + + /* Driver concurrency capabilities */ + unsigned int conc_capab; + /* Maximum number of concurrent channels on 2.4 GHz */ + unsigned int max_conc_chan_2_4; + /* Maximum number of concurrent channels on 5 GHz */ + unsigned int max_conc_chan_5_0; }; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 15210ffbe..1f274065a 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7488,7 +7488,10 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen) "capa.max_acl_mac_addrs=%u\n" "capa.num_multichan_concurrent=%u\n" "capa.mac_addr_rand_sched_scan_supported=%d\n" - "capa.mac_addr_rand_scan_supported=%d\n", + "capa.mac_addr_rand_scan_supported=%d\n" + "capa.conc_capab=%u\n" + "capa.max_conc_chan_2_4=%u\n" + "capa.max_conc_chan_5_0=%u\n", drv->capa.key_mgmt, drv->capa.enc, drv->capa.auth, @@ -7504,7 +7507,10 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen) drv->capa.max_acl_mac_addrs, drv->capa.num_multichan_concurrent, drv->capa.mac_addr_rand_sched_scan_supported, - drv->capa.mac_addr_rand_scan_supported); + drv->capa.mac_addr_rand_scan_supported, + drv->capa.conc_capab, + drv->capa.max_conc_chan_2_4, + drv->capa.max_conc_chan_5_0); if (os_snprintf_error(end - pos, res)) return pos - buf; pos += res; diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 4929cea21..926c11545 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -751,6 +751,7 @@ static void qca_nl80211_check_dfs_capa(struct wpa_driver_nl80211_data *drv) struct features_info { u8 *flags; size_t flags_len; + struct wpa_driver_capa *capa; }; @@ -776,6 +777,19 @@ static int features_info_handler(struct nl_msg *msg, void *arg) info->flags = nla_data(attr); info->flags_len = nla_len(attr); } + attr = tb_vendor[QCA_WLAN_VENDOR_ATTR_CONCURRENCY_CAPA]; + if (attr) + info->capa->conc_capab = nla_get_u32(attr); + + attr = tb_vendor[ + QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_2_4_BAND]; + if (attr) + info->capa->max_conc_chan_2_4 = nla_get_u32(attr); + + attr = tb_vendor[ + QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_5_0_BAND]; + if (attr) + info->capa->max_conc_chan_5_0 = nla_get_u32(attr); } return NL_SKIP; @@ -810,6 +824,7 @@ static void qca_nl80211_get_features(struct wpa_driver_nl80211_data *drv) } os_memset(&info, 0, sizeof(info)); + info.capa = &drv->capa; ret = send_and_recv_msgs(drv, msg, features_info_handler, &info); if (ret || !info.flags) return;