From patchwork Fri Jun 22 06:35:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahesh Palivela X-Patchwork-Id: 166519 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 E6BD6B6F86 for ; Fri, 22 Jun 2012 16:35:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 23EE29D3B7; Fri, 22 Jun 2012 02:35:18 -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 0dLrPUl02cwr; Fri, 22 Jun 2012 02:35:17 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C1D4C9D3B9; Fri, 22 Jun 2012 02:35:13 -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 75A669D3B9 for ; Fri, 22 Jun 2012 02:35:12 -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 rVZjtaEINqq5 for ; Fri, 22 Jun 2012 02:35:08 -0400 (EDT) Received: from HUB022-nj-5.exch022.serverdata.net (hub022-nj-5.exch022.serverdata.net [206.225.164.188]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id A09B19D3B7 for ; Fri, 22 Jun 2012 02:35:08 -0400 (EDT) Received: from MBX022-E1-NJ-10.exch022.domain.local ([10.240.6.62]) by HUB022-NJ-5.exch022.domain.local ([10.240.6.48]) with mapi id 14.02.0309.002; Thu, 21 Jun 2012 23:35:08 -0700 From: Mahesh Palivela To: "hostap@lists.shmoo.com" Subject: [RFC v2 2/2] hostapd: 11ac VHT IEs Thread-Topic: [RFC v2 2/2] hostapd: 11ac VHT IEs Thread-Index: Ac1QQNXFXSQPnkZjQ7qSKDRS6EPTsQ== Date: Fri, 22 Jun 2012 06:35:07 +0000 Message-ID: <952C5D5D0470AE4FB7D8A75C6ADC71CA0B3DFB@mbx022-e1-nj-10.exch022.domain.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.183.20.86] MIME-Version: 1.0 Cc: "j@w1.fi" 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 11ac VHT changes to include VHT IEs in beacons and probe resp. Updated with Jouni's review comments. Apart from existing file changes in hostap tree, a new file ieee802_11_vht.c is created and placed in src/ap path. File location is src/ap/ieee802_11_vht.c Signed-hostap: Mahesh Palivela Cc: Jouni Malinen --- hostapd/Makefile | 4 ++++ src/ap/beacon.c | 10 ++++++++++ src/ap/ieee802_11.h | 2 ++ 3 files changed, 16 insertions(+), 0 deletions(-) src/ap/ieee802_11_vht.c /* * hostapd / IEEE 802.11ac VHT * Copyright (c) 2002-2009, Jouni Malinen * * This program is free software; you can redistribute it and/or modify * it under the terms of BSD license * * See README and COPYING for more details. */ #include "utils/includes.h" #include "utils/common.h" #include "common/ieee802_11_defs.h" #include "drivers/driver.h" #include "hostapd.h" #include "ap_config.h" #include "sta_info.h" #include "beacon.h" #include "ieee802_11.h" u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_vht_capabilities *cap; u8 *pos = eid; if (!hapd->iconf->ieee80211ac || !hapd->iface->current_mode || hapd->conf->disable_11ac) return eid; *pos++ = WLAN_EID_VHT_CAP; *pos++ = sizeof(*cap); cap = (struct ieee80211_vht_capabilities *) pos; os_memset(cap, 0, sizeof(*cap)); //cap->vht_capabilities_info = host_to_le32(hapd->iconf->vht_capab); cap->vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab); /* Supported MCS set comes from hw */ os_memcpy(cap->vht_supported_mcs_set, hapd->iface->current_mode->vht_mcs_set, 8); pos += sizeof(*cap); return pos; } u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_vht_operation *oper; u8 *pos = eid; if (!hapd->iconf->ieee80211ac || hapd->conf->disable_11ac) return eid; *pos++ = WLAN_EID_VHT_OPERATION; *pos++ = sizeof(*oper); oper = (struct ieee80211_vht_operation *) pos; os_memset(oper, 0, sizeof(*oper)); oper->vht_op_info_chwidth = hapd->iconf->vht_oper_chwidth; /* VHT Basic MCS set comes from hw */ /* Hard code 1 stream, MCS0-7 is a min Basic VHT MCS rates */ oper->vht_basic_mcs_set = 0xfffc; pos += sizeof(*oper); return pos; } diff --git a/hostapd/Makefile b/hostapd/Makefile index 2a82920..93881a7 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -757,6 +757,10 @@ ifdef CONFIG_IEEE80211N OBJS += ../src/ap/ieee802_11_ht.o endif +ifdef CONFIG_IEEE80211AC +OBJS += ../src/ap/ieee802_11_vht.o +endif + ifdef CONFIG_P2P_MANAGER CFLAGS += -DCONFIG_P2P_MANAGER OBJS += ../src/ap/p2p_hostapd.o diff --git a/src/ap/beacon.c b/src/ap/beacon.c index b711063..0f29ccd 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -262,6 +262,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_adv_proto(hapd, pos); pos = hostapd_eid_roaming_consortium(hapd, pos); +#ifdef CONFIG_IEEE80211AC + pos = hostapd_eid_vht_capabilities(hapd, pos); + pos = hostapd_eid_vht_operation(hapd, pos); +#endif /* CONFIG_IEEE80211AC */ + /* Wi-Fi Alliance WMM */ pos = hostapd_eid_wmm(hapd, pos); @@ -595,6 +600,11 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd) tailpos = hostapd_eid_adv_proto(hapd, tailpos); tailpos = hostapd_eid_roaming_consortium(hapd, tailpos); +#ifdef CONFIG_IEEE80211AC + tailpos = hostapd_eid_vht_capabilities(hapd, tailpos); + tailpos = hostapd_eid_vht_operation(hapd, tailpos); +#endif /* CONFIG_IEEE80211AC */ + /* Wi-Fi Alliance WMM */ tailpos = hostapd_eid_wmm(hapd, tailpos); diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index b60350f..9993bee 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -45,6 +45,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid); +u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid); +u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid); int hostapd_ht_operation_update(struct hostapd_iface *iface); void ieee802_11_send_sa_query_req(struct hostapd_data *hapd, const u8 *addr, const u8 *trans_id);