From patchwork Thu Oct 17 08:03:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 284114 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 7F6712C00BC for ; Thu, 17 Oct 2013 19:05:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6378B9C1C0; Thu, 17 Oct 2013 04:05:13 -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 VHkfkyZAXS95; Thu, 17 Oct 2013 04:05:13 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7B04D9C173; Thu, 17 Oct 2013 04:04:35 -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 6A0F49C189 for ; Thu, 17 Oct 2013 04:04:34 -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 7xuVEJHLuwDf for ; Thu, 17 Oct 2013 04:04:29 -0400 (EDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6E3E39C179 for ; Thu, 17 Oct 2013 04:04:23 -0400 (EDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 17 Oct 2013 01:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,512,1378882800"; d="scan'208";a="412421205" Received: from ipeer-e6430-1.jer.intel.com ([10.12.217.166]) by fmsmga001.fm.intel.com with ESMTP; 17 Oct 2013 01:04:21 -0700 From: eliad@wizery.com To: hostap@lists.shmoo.com Subject: [PATCH 4/9] hostapd: verify 160/80+80 driver support Date: Thu, 17 Oct 2013 10:03:41 +0200 Message-Id: <1381997026-2324-5-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1381997026-2324-1-git-send-email-eliad@wizery.com> References: <1381997026-2324-1-git-send-email-eliad@wizery.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 From: Eliad Peller Make sure the driver supports 160/80+80 vht capabilities before trying to configure these channels. Signed-hostap: Eliad Peller --- src/ap/ap_drv_ops.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 3072562..e300870 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -469,6 +469,7 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int center_segment0, int center_segment1) { struct hostapd_freq_params data; + u32 vht_caps; int tmp; os_memset(&data, 0, sizeof(data)); @@ -482,6 +483,8 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, data.center_freq2 = 0; data.bandwidth = sec_channel_offset ? 40 : 20; + vht_caps = hapd->iface->current_mode->vht_capab; + /* * This validation code is probably misplaced, maybe it should be * in src/ap/hw_features.c and check the hardware support as well. @@ -494,6 +497,11 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, return -1; break; case VHT_CHANWIDTH_80P80MHZ: + if (!(vht_caps & VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)) { + wpa_printf(MSG_ERROR, + "80+80 channel width is not supported!"); + return -1; + } if (center_segment1 == center_segment0 + 4 || center_segment1 == center_segment0 - 4) return -1; @@ -517,6 +525,12 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, break; case VHT_CHANWIDTH_160MHZ: data.bandwidth = 160; + if (!(vht_caps & (VHT_CAP_SUPP_CHAN_WIDTH_160MHZ | + VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ))) { + wpa_printf(MSG_ERROR, + "160MHZ channel width is not supported!"); + return -1; + } if (center_segment1) return -1; if (!sec_channel_offset)