[RFC 1/2] 11ac changes - VHT IEs in beacons

Mahesh Palivela maheshp
Tue Jun 5 03:12:50 PDT 2012


________________________________________
From: Johannes Berg [johannes at sipsolutions.net]
Sent: Monday, June 04, 2012 12:57 PM
To: Mahesh Palivela
Cc: hostap at lists.shmoo.com
Subject: Re: [RFC1/2] 11ac changes - VHT IEs in beacons

On Mon, 2012-06-04 at 07:13 +0000, Mahesh Palivela wrote:
> Hi,
>
> I had modified hostapd code to include VHT IEs as part of 11ac changes.
> Please review and let me know your comments.

VHT is complicated enough that I think we should take the HW
capabilities (as will be advertised by nl80211) into account more when
configuring this. Hardly anyone will ever be able to come up with a
correct configuration and they shouldn't have to unless overriding
specific things for testing?

johannes

Modified to fill VHT Capability from nl80211 data.

Signed-of-by: Mahesh Palivela (maheshp at posedge.com)
---
/*
 * hostapd / IEEE 802.11ac VHT
 * Copyright (c) 2002-2009, Jouni Malinen <j at w1.fi>
 * Copyright (c) 2007-2008, Intel Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Alternatively, this software may be distributed 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_operation_information_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;
}


u8 * hostapd_eid_vht_tx_power_envelope(struct hostapd_data *hapd, u8 *eid)
{
	struct ieee80211_vht_tx_power_envelope *power;
	u8 *pos = eid;

	if (!hapd->iconf->ieee80211ac || hapd->conf->disable_11ac)
		return eid;

	*pos++ = WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE;
	*pos++ = sizeof(*power);

	power = (struct ieee80211_vht_tx_power_envelope *) pos;
	os_memset(power, 0, sizeof(*power));

    /* Fill the Tx power envelope for variuos chan freq segments */

    power->vht_max_tx_power = 0;
    power->vht_chan_center_freq_segment = 52;
    power->vht_segment_chan_width = 8;
    pos += sizeof(*power);
    return pos;
}



More information about the Hostap mailing list