From patchwork Thu Jul 5 12:31:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 169140 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 339512C00E7 for ; Thu, 5 Jul 2012 22:30:50 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A8AED9C1ED; Thu, 5 Jul 2012 08:30:47 -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 fcQMK1gHeBvH; Thu, 5 Jul 2012 08:30:47 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id ABAC39C1F8; Thu, 5 Jul 2012 08:30:43 -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 8673F9C234 for ; Thu, 5 Jul 2012 08:30:42 -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 kvIqqlWrVcKy for ; Thu, 5 Jul 2012 08:30:37 -0400 (EDT) Received: from wolverine01.qualcomm.com (wolverine01.qualcomm.com [199.106.114.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "wolverine01.qualcomm.com", Issuer "VeriSign Class 3 Secure Server CA" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id A3AB19C1F8 for ; Thu, 5 Jul 2012 08:30:27 -0400 (EDT) X-IronPort-AV: E=McAfee;i="5400,1158,6762"; a="207582718" Received: from ironmsg02-l.qualcomm.com ([172.30.48.16]) by wolverine01.qualcomm.com with ESMTP; 05 Jul 2012 05:30:22 -0700 X-IronPort-AV: E=Sophos;i="4.77,530,1336374000"; d="scan'208";a="121617220" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 05 Jul 2012 05:30:22 -0700 Received: from qcmail1.qualcomm.com (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.2.309.2; Thu, 5 Jul 2012 05:30:19 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 05 Jul 2012 18:01:43 +0530 From: Rajkumar Manoharan To: Subject: [RFC] wpa_supplicant: Enable HT40 support for AP mode Date: Thu, 5 Jul 2012 18:01:41 +0530 Message-ID: <1341491501-27405-1-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.11.1 MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Right now HT40 mode is not enabled for AP/P2P GO mode in wpa_supplicant. If the HW is capable of 40MHz channel width and user specifies the secondary channel posision, lets enable the HT40 mode in wpa_s. This patch also enables HT40 support for P2P mode. ap_ht40_mode : -1 -> HT40MINUS, 1 -> HT40PLUS Signed-hostap: Rajkumar Manoharan --- wpa_supplicant/ap.c | 3 +++ wpa_supplicant/config.c | 5 ++++- wpa_supplicant/config.h | 7 +++++++ wpa_supplicant/config_file.c | 4 ++++ wpa_supplicant/p2p_supplicant.c | 2 -- wpa_supplicant/wpa_supplicant.c | 2 ++ wpa_supplicant/wpa_supplicant_i.h | 1 + 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index f9e0045..25a07d5 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -99,6 +99,9 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, if (!no_ht && mode && mode->ht_capab) { conf->ieee80211n = 1; + if (mode->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) + conf->secondary_channel = + wpa_s->global->ap_ht40_mode; /* * white-list capabilities that won't cause issues diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index a68b31e..31a5d39 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2921,7 +2921,10 @@ static const struct global_parse_data global_fields[] = { { INT_RANGE(wps_nfc_dev_pw_id, 0x10, 0xffff), 0 }, { BIN(wps_nfc_dh_pubkey), 0 }, { BIN(wps_nfc_dh_privkey), 0 }, - { BIN(wps_nfc_dev_pw), 0 } + { BIN(wps_nfc_dev_pw), 0 }, +#ifdef CONFIG_IEEE80211N + { INT(ap_ht40_mode), 0 }, +#endif }; #undef FUNC diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 46c4da2..7bb326d 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -661,6 +661,13 @@ struct wpa_config { * wps_nfc_dh_pubkey - NFC Device Password for password token */ struct wpabuf *wps_nfc_dev_pw; +#ifdef CONFIG_IEEE80211N + /** + * ap_ht40_mode - Specify HT40 mode secondary channel position + * HT40+/- mainly for AP mode + */ + int ap_ht40_mode; +#endif }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 8badc7b..3182d29 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -875,6 +875,10 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) write_global_bin(f, "wps_nfc_dh_pubkey", config->wps_nfc_dh_pubkey); write_global_bin(f, "wps_nfc_dh_privkey", config->wps_nfc_dh_privkey); write_global_bin(f, "wps_nfc_dev_pw", config->wps_nfc_dev_pw); +#ifdef CONFIG_IEEE80211N + if (config->ap_ht40_mode) + fprintf(f, "ap_ht40_mode=%d\n", config->ap_ht40_mode); +#endif } #endif /* CONFIG_NO_CONFIG_WRITE */ diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 218ed2f..0a9fc1f 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2231,10 +2231,8 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s, struct p2p_oper_class_map op_class[] = { { HOSTAPD_MODE_IEEE80211G, 81, 1, 13, 1, BW20 }, { HOSTAPD_MODE_IEEE80211G, 82, 14, 14, 1, BW20 }, -#if 0 /* Do not enable HT40 on 2 GHz for now */ { HOSTAPD_MODE_IEEE80211G, 83, 1, 9, 1, BW40PLUS }, { HOSTAPD_MODE_IEEE80211G, 84, 5, 13, 1, BW40MINUS }, -#endif { HOSTAPD_MODE_IEEE80211A, 115, 36, 48, 4, BW20 }, { HOSTAPD_MODE_IEEE80211A, 124, 149, 161, 4, BW20 }, { HOSTAPD_MODE_IEEE80211A, 116, 36, 44, 8, BW40PLUS }, diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index c65dc3c..22b063b 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2534,6 +2534,8 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s, return -1; } + wpa_s->global->ap_ht40_mode = wpa_s->conf->ap_ht40_mode; + /* * Override ctrl_interface and driver_param if set on command * line. diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index b608f29..6c4c507 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -239,6 +239,7 @@ struct wpa_global { WPA_CONC_PREF_STA, WPA_CONC_PREF_P2P } conc_pref; + int ap_ht40_mode; };