blob: e9b376bbcef762e03d1d542afe5d2beb39b480d1 [file] [log] [blame]
/*SH0
*******************************************************************************
** **
** Copyright (c) 2016 Quantenna Communications, Inc. **
** All Rights Reserved **
** **
** File : ieee80211_bsa.h **
** Description : Quantenna Band steering defines **
** **
** This module implements portions of the IEEE Std 802.11z specification, **
** as well as a proprietary discovery mechanism. **
** **
*******************************************************************************
** **
** Redistribution and use in source and binary forms, with or without **
** modification, are permitted provided that the following conditions **
** are met: **
** 1. Redistributions of source code must retain the above copyright **
** notice, this list of conditions and the following disclaimer. **
** 2. Redistributions in binary form must reproduce the above copyright **
** notice, this list of conditions and the following disclaimer in the **
** documentation and/or other materials provided with the distribution. **
** 3. The name of the author may not be used to endorse or promote products **
** derived from this software without specific prior written permission. **
** **
** Alternatively, this software may be distributed under the terms of the **
** GNU General Public License ("GPL") version 2, or (at your option) any **
** later version as published by the Free Software Foundation. **
** **
** In the case this software is distributed under the GPL license, **
** you should have received a copy of the GNU General Public License **
** along with this software; if not, write to the Free Software **
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **
** **
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR **
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES**
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. **
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, **
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT **
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,**
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY **
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT **
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF **
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **
** **
*******************************************************************************
EH0*/
#ifndef _NET80211_IEEE80211_BSA_H_
#define _NET80211_IEEE80211_BSA_H_
#define BSA_STATUS_ACTIVE 1
#define BSA_STATUS_INACTIVE 0
#define BSA_PROBE_EVENT_REQ 3
#define BSA_CONNECT_COMPLETE_EVENT 4
#define BSA_EVENT_BSS_TRANS_STATUS 8
#define IEEE80211_MAX_EVENT_DATA_LEN 256
#define CAPABILITY_INFOMATION 12
#define BSA_EVENT_DEAUTH 5
#define BSA_EVENT_DISASSOC 6
#define BSA_HT_NOT_SUPPORTED 0
#define BSA_HT_SUPPORTED 2
#define BSA_VHT_NOT_SUPPORTED 0
#define BSA_VHT_SUPPORTED 1
#define BSA_WNM_NOT_SUPPORTED 0
#define BSA_WNM_SUPPORTED 1
#define BSA_MU_NOT_SUPPORTED 0
#define BSA_MU_SUPPORTED 1
#define BSA_VHT_MCSMAP_NOT_SUPPORT 0xC000
#define BSA_VHT_MCSMAP_MASK 0xC000
#define DEFAULT_BANDWIDTH 40
#define BSA_MACFILTER_HASHSIZE 32
#define BSA_MACFILTER_HASH(addr) \
(((u_int8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % BSA_MACFILTER_HASHSIZE)
enum {
BSA_MACFILTER_OPEN = 0,
BSA_MACFILTER_DENY = 1,
BSA_MACFILTER_ALLOW = 2,
};
enum bsa_curr_band {
BSA_OPER_BAND_2G = 0,
BSA_OPER_BAND_5G = 1,
BSA_OPER_BAND_MAX = 2,
};
enum bsa_disconnect_dir {
BSA_DISCONNECT_SELF_GENERATED = 0,
BSA_DISCONNECT_PEER_GENERATED = 1,
};
struct qtn_bsa_peer_event_data {
char bsa_name[32];
uint8_t bsa_bssid[IEEE80211_ADDR_LEN];
uint16_t bsa_event_id;
uint32_t offset;
}__packed;
struct qtn_bsa_probe_event_info {
uint8_t bsa_sta_mac[IEEE80211_ADDR_LEN];
uint16_t bsa_nss;
int32_t bsa_rssi;
uint16_t bsa_max_phy_rate;
uint16_t reserved;
uint16_t bsa_curr_band;
uint16_t bsa_channel;
uint16_t bsa_band_width;
uint16_t bsa_bss_transition;
uint8_t bsa_vht_capab;
uint8_t bsa_mu_mimo_capab;
uint16_t cookie_len;
void *cookie;
}__packed;
struct qtn_bsa_assoc_compl_event_info {
uint8_t bsa_sta_mac[IEEE80211_ADDR_LEN];
uint16_t reserved;
int32_t bsa_rssi;
uint16_t bsa_nss;
uint16_t bsa_max_phy_rate;
uint16_t bsa_curr_band;
uint16_t bsa_channel;
uint32_t bsa_band_width;
uint8_t bsa_bss_transition_support;
uint8_t bsa_vht_capab;
uint8_t bsa_mu_mimo_capab;
}__packed;
struct qtn_bsa_disconnect_event_info {
uint8_t bsa_sta_mac[IEEE80211_ADDR_LEN];
uint16_t reason_code;
uint8_t direction;
}__packed;
struct bsa_deny_sta {
LIST_ENTRY(bsa_deny_sta) list;
uint8_t bsa_macaddr[IEEE80211_ADDR_LEN];
};
uint32_t ieee80211_wlan_vht_mcs_streams(uint16_t mcsmap);
uint32_t ieee80211_wlan_vht_rxstreams(struct ieee80211_ie_vhtcap *vhtcap);
uint32_t ieee80211_wlan_ht_rx_maxrate(struct ieee80211_ie_htcap *htcap, uint32_t *rx_ss);
uint32_t ieee80211_wlan_vht_rx_maxrate(struct ieee80211_ie_vhtcap *vhtcap);
/* probe and assoc complete event sent to bsa peer entity*/
int ieee80211_bsa_probe_event_send(struct ieee80211vap *vap,struct sk_buff *skb,
uint8_t *bssid,uint8_t *sta_mac, int rssi);
int ieee80211_bsa_disconnect_event_send(struct ieee80211vap *vap, struct ieee80211_node *ni,
uint16_t reason_code, uint8_t fc_subtype, uint8_t direction);
int ieee80211_bsa_connect_complete_event_send(struct ieee80211vap *vap,struct ieee80211_node *ni);
int ieee80211_bsa_macfilter_check(struct ieee80211vap *vap, uint8_t mac[IEEE80211_ADDR_LEN]);
#endif /* BSA_IEEE80211_H */