From patchwork Fri Nov 25 13:57:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 127701 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 73A441007D5 for ; Sat, 26 Nov 2011 00:57:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C24759C12D; Fri, 25 Nov 2011 08:57:46 -0500 (EST) 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 QdEWoQ2PAOML; Fri, 25 Nov 2011 08:57:46 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 80E849C133; Fri, 25 Nov 2011 08:57:42 -0500 (EST) 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 087669C133 for ; Fri, 25 Nov 2011 08:57:42 -0500 (EST) 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 eSdIk2KHjaVa for ; Fri, 25 Nov 2011 08:57:38 -0500 (EST) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 17F7E9C12D for ; Fri, 25 Nov 2011 08:57:37 -0500 (EST) Received: by faaq16 with SMTP id q16so2508968faa.17 for ; Fri, 25 Nov 2011 05:57:36 -0800 (PST) Received: by 10.152.113.101 with SMTP id ix5mr20434689lab.23.1322229456621; Fri, 25 Nov 2011 05:57:36 -0800 (PST) Received: from localhost.localdomain (89-139-15-10.bb.netvision.net.il. [89.139.15.10]) by mx.google.com with ESMTPS id ni5sm22848722lab.3.2011.11.25.05.57.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Nov 2011 05:57:34 -0800 (PST) From: Arik Nemtsov To: hostap@lists.shmoo.com Subject: [PATCH v3] hostap: set ht_capab from wiphy when in P2P GO mode Date: Fri, 25 Nov 2011 15:57:28 +0200 Message-Id: <1322229448-30037-1-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.7.5.4 Cc: Arik Nemtsov 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: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Set the HT capabilities of a P2P GO according to the wiphy supported ones. Mask-in a white-list of HT capabilities that won't cause problems for non-supporting stations. Signed-hostap: Arik Nemtsov --- v2->3: OR with the original HT capabilities to preserve SMPS mode. wpa_supplicant/ap.c | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 7acbefe..0dfa1a3 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -80,9 +80,10 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, #ifdef CONFIG_IEEE80211N /* - * Enable HT20 if the driver supports it, by setting conf->ieee80211n. + * Enable HT20 if the driver supports it, by setting conf->ieee80211n + * and a mask of allowed capabilities within conf->ht_capab. * Using default config settings for: conf->ht_op_mode_fixed, - * conf->ht_capab, conf->secondary_channel, conf->require_ht + * conf->secondary_channel, conf->require_ht */ if (wpa_s->hw.modes) { struct hostapd_hw_modes *mode = NULL; @@ -93,8 +94,21 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, break; } } - if (mode && mode->ht_capab) + if (mode && mode->ht_capab) { conf->ieee80211n = 1; + + /* + * white-list capabilities that won't cause issues + * to connecting stations, while leaving the current + * capabilities intact (currently disabled SMPS). + */ + conf->ht_capab |= mode->ht_capab & + (HT_CAP_INFO_GREEN_FIELD | + HT_CAP_INFO_SHORT_GI20MHZ | + HT_CAP_INFO_SHORT_GI40MHZ | + HT_CAP_INFO_RX_STBC_MASK | + HT_CAP_INFO_MAX_AMSDU_SIZE); + } } #endif /* CONFIG_IEEE80211N */