From patchwork Wed Jul 17 06:32:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 259612 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id E09502C013D for ; Wed, 17 Jul 2013 17:30:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E9A249C13B; Wed, 17 Jul 2013 03:30:38 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g7I91l9vbMbf; Wed, 17 Jul 2013 03:30:38 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B10E89C13D; Wed, 17 Jul 2013 03:30:21 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7A6B19C0F6 for ; Wed, 17 Jul 2013 03:30:20 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5TBGYF8c4kpZ for ; Wed, 17 Jul 2013 03:30:15 -0400 (EDT) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4138C9C12A for ; Wed, 17 Jul 2013 03:30:15 -0400 (EDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 17 Jul 2013 00:30:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,682,1367996400"; d="scan'208";a="269348410" Received: from ipeer-e6430-1.jer.intel.com ([10.12.217.147]) by AZSMGA002.ch.intel.com with ESMTP; 17 Jul 2013 00:30:11 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 1/4] nl80211: Report the number of concurrent support channels Date: Wed, 17 Jul 2013 09:32:23 +0300 Message-Id: <1374042746-8001-2-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1374042746-8001-1-git-send-email-ilan.peer@intel.com> References: <1374042746-8001-1-git-send-email-ilan.peer@intel.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Currently, drivers only report if they support multiple concurrent channels, but do 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 | 12 ++++++++---- wpa_supplicant/wpa_supplicant.c | 5 +++++ wpa_supplicant/wpa_supplicant_i.h | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 3b7e400..98bbdc1 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 * * Must be allocated and freed by driver and the pointers must be diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0115533..26487b1 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2866,6 +2866,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; @@ -2876,7 +2878,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; }; @@ -2986,8 +2987,9 @@ 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; + if (tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]) + info->num_multichan_concurrent = + nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]); return 1; } @@ -3237,10 +3239,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 5773013..e7a2d99 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2964,6 +2964,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; @@ -2978,6 +2980,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 9240863..7597908 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; };