Removed partial IEEE 802.11h implementation
This code was not finished and did not work with the current mac80211 design. In order to avoid confusing users, it is better to remove this completely for now and look at new implementation to work with mac80211.
This commit is contained in:
parent
d337b6fb65
commit
d52e94f965
10 changed files with 7 additions and 157 deletions
|
@ -43,7 +43,7 @@ OBJS = hostapd.o ieee802_1x.o eapol_sm.o \
|
|||
sta_info.o wpa.o ctrl_iface.o \
|
||||
drivers.o preauth.o pmksa_cache.o beacon.o \
|
||||
hw_features.o wme.o ap_list.o \
|
||||
mlme.o vlan_init.o ieee802_11h.o wpa_auth_ie.o
|
||||
mlme.o vlan_init.o wpa_auth_ie.o
|
||||
|
||||
OBJS += ../src/utils/eloop.o
|
||||
OBJS += ../src/utils/common.o
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "hw_features.h"
|
||||
#include "driver.h"
|
||||
#include "sta_info.h"
|
||||
#include "ieee802_11h.h"
|
||||
|
||||
|
||||
static u8 ieee802_11_erp_info(struct hostapd_data *hapd)
|
||||
|
@ -101,8 +100,7 @@ static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid,
|
|||
{
|
||||
u8 *pos = eid;
|
||||
|
||||
if ((!hapd->iconf->ieee80211d && !hapd->iface->dfs_enable) ||
|
||||
max_len < 6)
|
||||
if (!hapd->iconf->ieee80211d || max_len < 6)
|
||||
return eid;
|
||||
|
||||
*pos++ = WLAN_EID_COUNTRY;
|
||||
|
@ -119,45 +117,6 @@ static u8 * hostapd_eid_country(struct hostapd_data *hapd, u8 *eid,
|
|||
}
|
||||
|
||||
|
||||
static u8 * hostapd_eid_power_constraint(struct hostapd_data *hapd, u8 *eid)
|
||||
|
||||
{
|
||||
if (!hapd->iface->dfs_enable)
|
||||
return eid;
|
||||
*eid++ = WLAN_EID_PWR_CONSTRAINT;
|
||||
*eid++ = 1;
|
||||
*eid++ = hapd->iface->pwr_const;
|
||||
return eid;
|
||||
}
|
||||
|
||||
|
||||
static u8 * hostapd_eid_tpc_report(struct hostapd_data *hapd, u8 *eid)
|
||||
|
||||
{
|
||||
if (!hapd->iface->dfs_enable)
|
||||
return eid;
|
||||
*eid++ = WLAN_EID_TPC_REPORT;
|
||||
*eid++ = 2;
|
||||
*eid++ = hapd->iface->tx_power; /* TX POWER */
|
||||
*eid++ = 0; /* Link Margin */
|
||||
return eid;
|
||||
}
|
||||
|
||||
static u8 * hostapd_eid_channel_switch(struct hostapd_data *hapd, u8 *eid)
|
||||
|
||||
{
|
||||
if (!hapd->iface->dfs_enable || !hapd->iface->channel_switch)
|
||||
return eid;
|
||||
*eid++ = WLAN_EID_CHANNEL_SWITCH;
|
||||
*eid++ = 3;
|
||||
*eid++ = CHAN_SWITCH_MODE_QUIET;
|
||||
*eid++ = hapd->iface->channel_switch; /* New channel */
|
||||
/* 0 - very soon; 1 - before next TBTT; num - after num beacons */
|
||||
*eid++ = 0;
|
||||
return eid;
|
||||
}
|
||||
|
||||
|
||||
static u8 * hostapd_eid_wpa(struct hostapd_data *hapd, u8 *eid, size_t len,
|
||||
struct sta_info *sta)
|
||||
{
|
||||
|
@ -270,9 +229,6 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
|
|||
|
||||
pos = hostapd_eid_country(hapd, pos, epos - pos);
|
||||
|
||||
pos = hostapd_eid_power_constraint(hapd, pos);
|
||||
pos = hostapd_eid_tpc_report(hapd, pos);
|
||||
|
||||
/* ERP Information element */
|
||||
pos = hostapd_eid_erp_info(hapd, pos);
|
||||
|
||||
|
@ -361,10 +317,6 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
|
|||
tailpos = hostapd_eid_country(hapd, tailpos,
|
||||
tail + BEACON_TAIL_BUF_SIZE - tailpos);
|
||||
|
||||
tailpos = hostapd_eid_power_constraint(hapd, tailpos);
|
||||
tailpos = hostapd_eid_channel_switch(hapd, tailpos);
|
||||
tailpos = hostapd_eid_tpc_report(hapd, tailpos);
|
||||
|
||||
/* ERP Information element */
|
||||
tailpos = hostapd_eid_erp_info(hapd, tailpos);
|
||||
|
||||
|
|
|
@ -1445,8 +1445,6 @@ struct hostapd_config * hostapd_config_read(const char *fname)
|
|||
conf->country[2] = ' ';
|
||||
} else if (os_strcmp(buf, "ieee80211d") == 0) {
|
||||
conf->ieee80211d = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ieee80211h") == 0) {
|
||||
conf->ieee80211h = atoi(pos);
|
||||
} else if (os_strcmp(buf, "assoc_ap_addr") == 0) {
|
||||
if (hwaddr_aton(pos, bss->assoc_ap_addr)) {
|
||||
printf("Line %d: invalid MAC address '%s'\n",
|
||||
|
|
|
@ -343,7 +343,6 @@ struct hostapd_config {
|
|||
*/
|
||||
|
||||
int ieee80211d;
|
||||
unsigned int ieee80211h; /* Enable/Disable 80211h */
|
||||
|
||||
struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
|
||||
|
||||
|
|
|
@ -1618,13 +1618,12 @@ static int setup_interface1(struct hostapd_iface *iface)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (hapd->iconf->ieee80211d || hapd->iconf->ieee80211h) {
|
||||
if (hostapd_set_ieee80211d(hapd, 1) < 0) {
|
||||
if (hapd->iconf->ieee80211d &&
|
||||
hostapd_set_ieee80211d(hapd, 1) < 0) {
|
||||
printf("Failed to set ieee80211d (%d)\n",
|
||||
hapd->iconf->ieee80211d);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (hapd->iconf->bridge_packets != INTERNAL_BRIDGE_DO_NOT_CONTROL &&
|
||||
hostapd_set_internal_bridge(hapd, hapd->iconf->bridge_packets)) {
|
||||
|
|
|
@ -90,19 +90,6 @@ ssid=test
|
|||
# (default: 0 = disabled)
|
||||
#ieee80211d=1
|
||||
|
||||
# Enable IEEE 802.11h. This enables the TPC and DFS services when operating
|
||||
# in a regulatory domain which requires them. Once enabled it will be
|
||||
# operational only when working in hw_mode a and in countries where it is
|
||||
# required. The end user should not be allowed to disable this.
|
||||
# The country_code setting must be configured with the correct country for
|
||||
# IEEE 802.11h to function.
|
||||
# When IEEE 802.11h is operational, the configured channel settings will be
|
||||
# ignored and automatic channel selection is used. When IEEE 802.11h is enabled
|
||||
# but not operational (for example, if the radio mode is changed from "a" to
|
||||
# "b") the channel setting take effect again.
|
||||
# (default: 0 = disabled)
|
||||
#ieee80211h=1
|
||||
|
||||
# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g,
|
||||
# Default: IEEE 802.11b
|
||||
hw_mode=a
|
||||
|
|
|
@ -234,13 +234,6 @@ struct hostapd_iface {
|
|||
/* Overlapping BSS information */
|
||||
int olbc_ht;
|
||||
|
||||
int dfs_enable;
|
||||
u8 pwr_const;
|
||||
unsigned int tx_power;
|
||||
unsigned int sta_max_power;
|
||||
|
||||
unsigned int channel_switch;
|
||||
|
||||
#ifdef CONFIG_IEEE80211N
|
||||
u16 ht_op_mode;
|
||||
#endif /* CONFIG_IEEE80211N */
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "ap_list.h"
|
||||
#include "accounting.h"
|
||||
#include "driver.h"
|
||||
#include "ieee802_11h.h"
|
||||
#include "mlme.h"
|
||||
|
||||
|
||||
|
@ -283,9 +282,6 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
hapd->iface->num_sta_no_short_slot_time == 0)
|
||||
capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
|
||||
|
||||
if (hapd->iface->dfs_enable)
|
||||
capab |= WLAN_CAPABILITY_SPECTRUM_MGMT;
|
||||
|
||||
return capab;
|
||||
}
|
||||
|
||||
|
@ -1004,20 +1000,6 @@ static void handle_assoc(struct hostapd_data *hapd,
|
|||
#endif /* CONFIG_IEEE80211R */
|
||||
}
|
||||
|
||||
if (hapd->iface->dfs_enable &&
|
||||
hapd->iconf->ieee80211h == SPECT_STRICT_BINDING) {
|
||||
if (hostapd_check_power_cap(hapd, elems.power_cap,
|
||||
elems.power_cap_len)) {
|
||||
resp = WLAN_STATUS_PWR_CAPABILITY_NOT_VALID;
|
||||
hostapd_logger(hapd, sta->addr,
|
||||
HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_DEBUG,
|
||||
"Power capabilities of the station not "
|
||||
"acceptable");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G)
|
||||
sta->flags |= WLAN_STA_NONERP;
|
||||
for (i = 0; i < sta->supported_rates_len; i++) {
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* hostapd / IEEE 802.11h
|
||||
* Copyright (c) 2005-2006, Devicescape Software, Inc.
|
||||
* Copyright (c) 2007, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* 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 "includes.h"
|
||||
|
||||
#include "hostapd.h"
|
||||
|
||||
|
||||
int hostapd_check_power_cap(struct hostapd_data *hapd, u8 *power, u8 len)
|
||||
{
|
||||
unsigned int max_pwr;
|
||||
|
||||
if (len < 2) {
|
||||
wpa_printf(MSG_DEBUG, "Too short power capability IE");
|
||||
return -1;
|
||||
}
|
||||
max_pwr = power[1];
|
||||
if (max_pwr > hapd->iface->sta_max_power)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* hostapd / IEEE 802.11h
|
||||
* Copyright (c) 2005-2006, Devicescape Software, Inc.
|
||||
* Copyright (c) 2007, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef IEEE802_11H_H
|
||||
#define IEEE802_11H_H
|
||||
|
||||
#define SPECT_LOOSE_BINDING 1
|
||||
#define SPECT_STRICT_BINDING 2
|
||||
|
||||
#define CHAN_SWITCH_MODE_NOISY 0
|
||||
#define CHAN_SWITCH_MODE_QUIET 1
|
||||
|
||||
int hostapd_check_power_cap(struct hostapd_data *hapd, u8 *power, u8 len);
|
||||
|
||||
#endif /* IEEE802_11H_H */
|
Loading…
Reference in a new issue