2013-05-08 21:45:39 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
2013-05-19 04:28:07 +00:00
|
|
|
*
|
2013-05-08 21:45:39 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
#ifndef __RTW_MLME_EXT_H_
|
|
|
|
#define __RTW_MLME_EXT_H_
|
|
|
|
|
|
|
|
#include <osdep_service.h>
|
|
|
|
#include <drv_types.h>
|
|
|
|
#include <wlan_bssdef.h>
|
|
|
|
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
/* Commented by Albert 20101105 */
|
|
|
|
/* Increase the SURVEY_TO value from 100 to 150 ( 100ms to 150ms ) */
|
|
|
|
/* The Realtek 8188CE SoftAP will spend around 100ms to send the probe response after receiving the probe request. */
|
|
|
|
/* So, this driver tried to extend the dwell time for each scanning channel. */
|
|
|
|
/* This will increase the chance to receive the probe response from SoftAP. */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define SURVEY_TO (100)
|
2013-08-12 04:36:23 +00:00
|
|
|
#define REAUTH_TO (300) /* 50) */
|
|
|
|
#define REASSOC_TO (300) /* 50) */
|
|
|
|
/* define DISCONNECT_TO (3000) */
|
2013-05-08 21:45:39 +00:00
|
|
|
#define ADDBA_TO (2000)
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
#define LINKED_TO (1) /* unit:2 sec, 1x2=2 sec */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define REAUTH_LIMIT (4)
|
|
|
|
#define REASSOC_LIMIT (4)
|
|
|
|
#define READDBA_LIMIT (2)
|
|
|
|
|
2013-07-11 18:35:36 +00:00
|
|
|
#define ROAMING_LIMIT 8
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define DYNAMIC_FUNC_DISABLE (0x0)
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* ====== ODM_ABILITY_E ======== */
|
|
|
|
/* BB ODM section BIT 0-15 */
|
2013-05-08 21:45:39 +00:00
|
|
|
#define DYNAMIC_BB_DIG BIT(0)
|
|
|
|
#define DYNAMIC_BB_RA_MASK BIT(1)
|
2013-05-19 04:28:07 +00:00
|
|
|
#define DYNAMIC_BB_DYNAMIC_TXPWR BIT(2)
|
|
|
|
#define DYNAMIC_BB_BB_FA_CNT BIT(3)
|
|
|
|
|
|
|
|
#define DYNAMIC_BB_RSSI_MONITOR BIT(4)
|
|
|
|
#define DYNAMIC_BB_CCK_PD BIT(5)
|
|
|
|
#define DYNAMIC_BB_ANT_DIV BIT(6)
|
|
|
|
#define DYNAMIC_BB_PWR_SAVE BIT(7)
|
2013-05-25 20:45:50 +00:00
|
|
|
#define DYNAMIC_BB_PWR_TRA BIT(8)
|
2013-05-19 04:28:07 +00:00
|
|
|
#define DYNAMIC_BB_RATE_ADAPTIVE BIT(9)
|
|
|
|
#define DYNAMIC_BB_PATH_DIV BIT(10)
|
|
|
|
#define DYNAMIC_BB_PSD BIT(11)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* MAC DM section BIT 16-23 */
|
2013-05-19 04:28:07 +00:00
|
|
|
#define DYNAMIC_MAC_EDCA_TURBO BIT(16)
|
|
|
|
#define DYNAMIC_MAC_EARLY_MODE BIT(17)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* RF ODM section BIT 24-31 */
|
2013-05-19 04:28:07 +00:00
|
|
|
#define DYNAMIC_RF_TX_PWR_TRACK BIT(24)
|
|
|
|
#define DYNAMIC_RF_RX_GAIN_TRACK BIT(25)
|
|
|
|
#define DYNAMIC_RF_CALIBRATION BIT(26)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-05-19 04:28:07 +00:00
|
|
|
#define DYNAMIC_ALL_FUNC_ENABLE 0xFFFFFFF
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define _HW_STATE_NOLINK_ 0x00
|
|
|
|
#define _HW_STATE_ADHOC_ 0x01
|
2013-05-19 04:28:07 +00:00
|
|
|
#define _HW_STATE_STATION_ 0x02
|
2013-05-08 21:45:39 +00:00
|
|
|
#define _HW_STATE_AP_ 0x03
|
|
|
|
|
|
|
|
|
|
|
|
#define _1M_RATE_ 0
|
|
|
|
#define _2M_RATE_ 1
|
|
|
|
#define _5M_RATE_ 2
|
|
|
|
#define _11M_RATE_ 3
|
|
|
|
#define _6M_RATE_ 4
|
|
|
|
#define _9M_RATE_ 5
|
|
|
|
#define _12M_RATE_ 6
|
|
|
|
#define _18M_RATE_ 7
|
|
|
|
#define _24M_RATE_ 8
|
|
|
|
#define _36M_RATE_ 9
|
|
|
|
#define _48M_RATE_ 10
|
|
|
|
#define _54M_RATE_ 11
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned char RTW_WPA_OUI[];
|
|
|
|
extern unsigned char WMM_OUI[];
|
|
|
|
extern unsigned char WPS_OUI[];
|
|
|
|
extern unsigned char WFD_OUI[];
|
|
|
|
extern unsigned char P2P_OUI[];
|
|
|
|
|
|
|
|
extern unsigned char WMM_INFO_OUI[];
|
|
|
|
extern unsigned char WMM_PARA_OUI[];
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* Channel Plan Type. */
|
|
|
|
/* Note: */
|
2013-08-15 21:11:51 +00:00
|
|
|
/* We just add new channel plan when the new channel plan is different
|
|
|
|
* from any of the following channel plan. */
|
2013-11-29 22:10:20 +00:00
|
|
|
/* If you just want to customize the actions(scan period or join actions)
|
2013-08-15 21:11:51 +00:00
|
|
|
* about one of the channel plan, */
|
|
|
|
/* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */
|
2013-07-26 18:02:50 +00:00
|
|
|
enum RT_CHANNEL_DOMAIN {
|
2013-08-12 04:36:23 +00:00
|
|
|
/* old channel plan mapping ===== */
|
2013-05-08 21:45:39 +00:00
|
|
|
RT_CHANNEL_DOMAIN_FCC = 0x00,
|
|
|
|
RT_CHANNEL_DOMAIN_IC = 0x01,
|
|
|
|
RT_CHANNEL_DOMAIN_ETSI = 0x02,
|
|
|
|
RT_CHANNEL_DOMAIN_SPAIN = 0x03,
|
|
|
|
RT_CHANNEL_DOMAIN_FRANCE = 0x04,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK = 0x05,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK1 = 0x06,
|
|
|
|
RT_CHANNEL_DOMAIN_ISRAEL = 0x07,
|
|
|
|
RT_CHANNEL_DOMAIN_TELEC = 0x08,
|
|
|
|
RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN = 0x09,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_WIDE_13 = 0x0A,
|
|
|
|
RT_CHANNEL_DOMAIN_TAIWAN = 0x0B,
|
|
|
|
RT_CHANNEL_DOMAIN_CHINA = 0x0C,
|
|
|
|
RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO = 0x0D,
|
|
|
|
RT_CHANNEL_DOMAIN_KOREA = 0x0E,
|
|
|
|
RT_CHANNEL_DOMAIN_TURKEY = 0x0F,
|
|
|
|
RT_CHANNEL_DOMAIN_JAPAN = 0x10,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
|
|
|
|
RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
|
|
|
|
RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* new channel plan mapping, (2GDOMAIN_5GDOMAIN) ===== */
|
2013-05-08 21:45:39 +00:00
|
|
|
RT_CHANNEL_DOMAIN_WORLD_NULL = 0x20,
|
|
|
|
RT_CHANNEL_DOMAIN_ETSI1_NULL = 0x21,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC1_NULL = 0x22,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK1_NULL = 0x23,
|
|
|
|
RT_CHANNEL_DOMAIN_ETSI2_NULL = 0x24,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC1_FCC1 = 0x25,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_ETSI1 = 0x26,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK1_MKK1 = 0x27,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_KCC1 = 0x28,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_FCC2 = 0x29,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_FCC3 = 0x30,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_FCC4 = 0x31,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_FCC5 = 0x32,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_FCC6 = 0x33,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC1_FCC7 = 0x34,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_ETSI2 = 0x35,
|
|
|
|
RT_CHANNEL_DOMAIN_WORLD_ETSI3 = 0x36,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK1_MKK2 = 0x37,
|
|
|
|
RT_CHANNEL_DOMAIN_MKK1_MKK3 = 0x38,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC1_NCC1 = 0x39,
|
|
|
|
RT_CHANNEL_DOMAIN_FCC1_NCC2 = 0x40,
|
|
|
|
RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G = 0x41,
|
2013-08-12 04:36:23 +00:00
|
|
|
/* Add new channel plan above this line=============== */
|
2013-05-08 21:45:39 +00:00
|
|
|
RT_CHANNEL_DOMAIN_MAX,
|
|
|
|
RT_CHANNEL_DOMAIN_REALTEK_DEFINE = 0x7F,
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
enum RT_CHANNEL_DOMAIN_2G {
|
2013-08-15 21:11:51 +00:00
|
|
|
RT_CHANNEL_DOMAIN_2G_WORLD = 0x00, /* Worldwide 13 */
|
2013-08-12 04:36:23 +00:00
|
|
|
RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01, /* Europe */
|
|
|
|
RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02, /* US */
|
|
|
|
RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03, /* Japan */
|
|
|
|
RT_CHANNEL_DOMAIN_2G_ETSI2 = 0x04, /* France */
|
2013-05-08 21:45:39 +00:00
|
|
|
RT_CHANNEL_DOMAIN_2G_NULL = 0x05,
|
2013-08-12 04:36:23 +00:00
|
|
|
/* Add new channel plan above this line=============== */
|
2013-05-08 21:45:39 +00:00
|
|
|
RT_CHANNEL_DOMAIN_2G_MAX,
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
#define rtw_is_channel_plan_valid(chplan) \
|
|
|
|
(chplan < RT_CHANNEL_DOMAIN_MAX || \
|
|
|
|
chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
struct rt_channel_plan {
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char Channel[MAX_CHANNEL_NUM];
|
|
|
|
unsigned char Len;
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
struct rt_channel_plan_2g {
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char Channel[MAX_CHANNEL_NUM_2G];
|
|
|
|
unsigned char Len;
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
struct rt_channel_plan_map {
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char Index2G;
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
enum Associated_AP {
|
2013-05-08 21:45:39 +00:00
|
|
|
atherosAP = 0,
|
|
|
|
broadcomAP = 1,
|
|
|
|
ciscoAP = 2,
|
|
|
|
marvellAP = 3,
|
|
|
|
ralinkAP = 4,
|
|
|
|
realtekAP = 5,
|
2013-05-19 04:28:07 +00:00
|
|
|
airgocapAP = 6,
|
2013-05-08 21:45:39 +00:00
|
|
|
unknownAP = 7,
|
|
|
|
maxAP,
|
|
|
|
};
|
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
enum HT_IOT_PEER {
|
2013-08-15 21:11:51 +00:00
|
|
|
HT_IOT_PEER_UNKNOWN = 0,
|
|
|
|
HT_IOT_PEER_REALTEK = 1,
|
|
|
|
HT_IOT_PEER_REALTEK_92SE = 2,
|
2013-05-19 04:28:07 +00:00
|
|
|
HT_IOT_PEER_BROADCOM = 3,
|
2013-08-15 21:11:51 +00:00
|
|
|
HT_IOT_PEER_RALINK = 4,
|
|
|
|
HT_IOT_PEER_ATHEROS = 5,
|
|
|
|
HT_IOT_PEER_CISCO = 6,
|
|
|
|
HT_IOT_PEER_MERU = 7,
|
|
|
|
HT_IOT_PEER_MARVELL = 8,
|
|
|
|
HT_IOT_PEER_REALTEK_SOFTAP = 9,/* peer is RealTek SOFT_AP */
|
|
|
|
HT_IOT_PEER_SELF_SOFTAP = 10, /* Self is SoftAP */
|
|
|
|
HT_IOT_PEER_AIRGO = 11,
|
|
|
|
HT_IOT_PEER_INTEL = 12,
|
|
|
|
HT_IOT_PEER_RTK_APCLIENT = 13,
|
|
|
|
HT_IOT_PEER_REALTEK_81XX = 14,
|
|
|
|
HT_IOT_PEER_REALTEK_WOW = 15,
|
|
|
|
HT_IOT_PEER_TENDA = 16,
|
|
|
|
HT_IOT_PEER_MAX = 17
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
enum SCAN_STATE {
|
2013-05-08 21:45:39 +00:00
|
|
|
SCAN_DISABLE = 0,
|
|
|
|
SCAN_START = 1,
|
|
|
|
SCAN_TXNULL = 2,
|
|
|
|
SCAN_PROCESS = 3,
|
|
|
|
SCAN_COMPLETE = 4,
|
|
|
|
SCAN_STATE_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mlme_handler {
|
|
|
|
unsigned int num;
|
2013-08-15 21:11:51 +00:00
|
|
|
char *str;
|
2014-11-16 00:18:30 +00:00
|
|
|
unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct action_handler {
|
|
|
|
unsigned int num;
|
2014-11-16 00:18:30 +00:00
|
|
|
char *str;
|
|
|
|
unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
struct ss_res {
|
2013-05-08 21:45:39 +00:00
|
|
|
int state;
|
|
|
|
int bss_cnt;
|
|
|
|
int channel_idx;
|
|
|
|
int scan_mode;
|
|
|
|
u8 ssid_num;
|
|
|
|
u8 ch_num;
|
2013-07-24 02:31:04 +00:00
|
|
|
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
|
2013-05-08 21:45:39 +00:00
|
|
|
struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
|
|
|
|
};
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* define AP_MODE 0x0C */
|
|
|
|
/* define STATION_MODE 0x08 */
|
|
|
|
/* define AD_HOC_MODE 0x04 */
|
|
|
|
/* define NO_LINK_MODE 0x00 */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
#define WIFI_FW_NULL_STATE _HW_STATE_NOLINK_
|
2013-05-08 21:45:39 +00:00
|
|
|
#define WIFI_FW_STATION_STATE _HW_STATE_STATION_
|
2013-08-15 21:11:51 +00:00
|
|
|
#define WIFI_FW_AP_STATE _HW_STATE_AP_
|
|
|
|
#define WIFI_FW_ADHOC_STATE _HW_STATE_ADHOC_
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
#define WIFI_FW_AUTH_NULL 0x00000100
|
|
|
|
#define WIFI_FW_AUTH_STATE 0x00000200
|
|
|
|
#define WIFI_FW_AUTH_SUCCESS 0x00000400
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
#define WIFI_FW_ASSOC_STATE 0x00002000
|
2013-05-08 21:45:39 +00:00
|
|
|
#define WIFI_FW_ASSOC_SUCCESS 0x00004000
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
#define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | \
|
|
|
|
WIFI_FW_AUTH_STATE | \
|
|
|
|
WIFI_FW_AUTH_SUCCESS | \
|
|
|
|
WIFI_FW_ASSOC_STATE)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-12 01:13:07 +00:00
|
|
|
struct FW_Sta_Info {
|
2013-05-08 21:45:39 +00:00
|
|
|
struct sta_info *psta;
|
|
|
|
u32 status;
|
|
|
|
u32 rx_pkt;
|
|
|
|
u32 retry;
|
2013-07-24 02:31:04 +00:00
|
|
|
unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Usage:
|
2013-05-19 04:28:07 +00:00
|
|
|
* When one iface acted as AP mode and the other iface is STA mode and scanning,
|
2013-05-08 21:45:39 +00:00
|
|
|
* it should switch back to AP's operating channel periodically.
|
|
|
|
* Parameters info:
|
2013-08-15 21:11:51 +00:00
|
|
|
* When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to
|
|
|
|
* AP's operating channel for
|
2013-05-08 21:45:39 +00:00
|
|
|
* RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds.
|
|
|
|
* Example:
|
2013-05-19 04:28:07 +00:00
|
|
|
* For chip supports 2.4G + 5GHz and AP mode is operating in channel 1,
|
2013-08-15 21:11:51 +00:00
|
|
|
* RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MS is 3 and SURVEY_TO is 100.
|
2013-05-19 04:28:07 +00:00
|
|
|
* When it's STA mode gets set_scan command,
|
|
|
|
* it would
|
|
|
|
* 1. Doing the scan on channel 1.2.3.4.5.6.7.8
|
2013-05-08 21:45:39 +00:00
|
|
|
* 2. Back to channel 1 for 300 milliseconds
|
|
|
|
* 3. Go through doing site survey on channel 9.10.11.36.40.44.48.52
|
|
|
|
* 4. Back to channel 1 for 300 milliseconds
|
|
|
|
* 5. ... and so on, till survey done.
|
|
|
|
*/
|
|
|
|
|
2013-07-12 03:50:49 +00:00
|
|
|
struct mlme_ext_info {
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 state;
|
|
|
|
u32 reauth_count;
|
|
|
|
u32 reassoc_count;
|
|
|
|
u32 link_count;
|
|
|
|
u32 auth_seq;
|
2013-08-12 04:36:23 +00:00
|
|
|
u32 auth_algo; /* 802.11 auth, could be open, shared, auto */
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 authModeToggle;
|
2013-08-12 04:36:23 +00:00
|
|
|
u32 enc_algo;/* encrypt algorithm; */
|
2013-08-15 21:11:51 +00:00
|
|
|
u32 key_index; /* this is only valid for legacy wep,
|
|
|
|
* 0~3 for key id. */
|
2013-05-08 21:45:39 +00:00
|
|
|
u32 iv;
|
|
|
|
u8 chg_txt[128];
|
|
|
|
u16 aid;
|
|
|
|
u16 bcn_interval;
|
|
|
|
u16 capability;
|
|
|
|
u8 assoc_AP_vendor;
|
|
|
|
u8 slotTime;
|
|
|
|
u8 preamble_mode;
|
|
|
|
u8 WMM_enable;
|
|
|
|
u8 ERP_enable;
|
|
|
|
u8 ERP_IE;
|
|
|
|
u8 HT_enable;
|
2013-05-19 04:28:07 +00:00
|
|
|
u8 HT_caps_enable;
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 HT_info_enable;
|
|
|
|
u8 HT_protection;
|
|
|
|
u8 turboMode_cts2self;
|
|
|
|
u8 turboMode_rtsen;
|
|
|
|
u8 SM_PS;
|
|
|
|
u8 agg_enable_bitmap;
|
|
|
|
u8 ADDBA_retry_count;
|
|
|
|
u8 candidate_tid_bitmap;
|
|
|
|
u8 dialogToken;
|
2013-08-12 04:36:23 +00:00
|
|
|
/* Accept ADDBA Request */
|
2013-05-19 04:48:10 +00:00
|
|
|
bool bAcceptAddbaReq;
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 bwmode_updated;
|
|
|
|
u8 hidden_ssid_mode;
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
struct ADDBA_request ADDBA_req;
|
2013-05-08 21:45:39 +00:00
|
|
|
struct WMM_para_element WMM_param;
|
|
|
|
struct HT_caps_element HT_caps;
|
2013-08-15 21:11:51 +00:00
|
|
|
struct HT_info_element HT_info;
|
|
|
|
struct wlan_bssid_ex network;/* join network or bss_network,
|
|
|
|
* if in ap mode, it is the same
|
|
|
|
* as cur_network.network */
|
|
|
|
struct FW_Sta_Info FW_sta_info[NUM_STA];
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
/* The channel information about this channel including joining,
|
|
|
|
* scanning, and power constraints. */
|
2013-07-26 18:02:50 +00:00
|
|
|
struct rt_channel_info {
|
2013-08-15 21:11:51 +00:00
|
|
|
u8 ChannelNum; /* The channel number. */
|
|
|
|
enum rt_scan_type ScanType; /* Scan type such as passive
|
|
|
|
* or active scan. */
|
|
|
|
u32 rx_count;
|
2013-07-26 18:02:50 +00:00
|
|
|
};
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-26 18:02:50 +00:00
|
|
|
int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */
|
2013-05-08 21:45:39 +00:00
|
|
|
#define P2P_MAX_REG_CLASSES 10
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
/* P2P_MAX_REG_CLASS_CHANNELS - Maximum number of chan per regulatory class */
|
2013-05-08 21:45:39 +00:00
|
|
|
#define P2P_MAX_REG_CLASS_CHANNELS 20
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* struct p2p_channels - List of supported channels */
|
2013-05-08 21:45:39 +00:00
|
|
|
struct p2p_channels {
|
2013-08-12 04:36:23 +00:00
|
|
|
/* struct p2p_reg_class - Supported regulatory class */
|
2013-05-08 21:45:39 +00:00
|
|
|
struct p2p_reg_class {
|
2013-08-12 04:36:23 +00:00
|
|
|
/* reg_class - Regulatory class (IEEE 802.11-2007, Annex J) */
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 reg_class;
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* channel - Supported channels */
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 channel[P2P_MAX_REG_CLASS_CHANNELS];
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* channels - Number of channel entries in use */
|
2013-05-08 21:45:39 +00:00
|
|
|
size_t channels;
|
|
|
|
} reg_class[P2P_MAX_REG_CLASSES];
|
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* reg_classes - Number of reg_class entries in use */
|
2013-05-08 21:45:39 +00:00
|
|
|
size_t reg_classes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct p2p_oper_class_map {
|
2013-10-19 17:45:47 +00:00
|
|
|
enum hw_mode {IEEE80211G} mode;
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 op_class;
|
|
|
|
u8 min_chan;
|
|
|
|
u8 max_chan;
|
|
|
|
u8 inc;
|
2013-08-15 21:11:51 +00:00
|
|
|
enum {BW20, BW40PLUS, BW40MINUS} bw;
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
struct mlme_ext_priv {
|
2013-07-27 01:08:39 +00:00
|
|
|
struct adapter *padapter;
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 mlmeext_init;
|
2014-11-16 00:18:30 +00:00
|
|
|
atomic_t event_seq;
|
2013-05-08 21:45:39 +00:00
|
|
|
u16 mgnt_seq;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char cur_channel;
|
|
|
|
unsigned char cur_bwmode;
|
2013-08-12 04:36:23 +00:00
|
|
|
unsigned char cur_ch_offset;/* PRIME_CHNL_OFFSET */
|
|
|
|
unsigned char cur_wireless_mode; /* NETWORK_TYPE */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned char oper_channel; /* saved chan info when call
|
|
|
|
* set_channel_bw */
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char oper_bwmode;
|
2013-08-12 04:36:23 +00:00
|
|
|
unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char max_chan_nums;
|
2013-07-26 18:02:50 +00:00
|
|
|
struct rt_channel_info channel_set[MAX_CHANNEL_NUM];
|
2013-05-08 21:45:39 +00:00
|
|
|
struct p2p_channels channel_list;
|
|
|
|
unsigned char basicrate[NumRates];
|
|
|
|
unsigned char datarate[NumRates];
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
struct ss_res sitesurvey_res;
|
2013-08-15 21:11:51 +00:00
|
|
|
struct mlme_ext_info mlmext_info;/* for sta/adhoc mode, including
|
|
|
|
* current scan/connecting/connected
|
|
|
|
* related info. For ap mode,
|
|
|
|
* network includes ap's cap_info*/
|
2013-07-24 20:10:50 +00:00
|
|
|
struct timer_list survey_timer;
|
|
|
|
struct timer_list link_timer;
|
2013-08-15 21:11:51 +00:00
|
|
|
u16 chan_scan_time;
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
u8 scan_abort;
|
2013-08-12 04:36:23 +00:00
|
|
|
u8 tx_rate; /* TXRATE when USERATE is set. */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
u32 retry; /* retry for issue probereq */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
u64 TSFValue;
|
|
|
|
|
2013-10-19 17:45:47 +00:00
|
|
|
#ifdef CONFIG_88EU_AP_MODE
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned char bstart_bss;
|
|
|
|
#endif
|
|
|
|
u8 update_channel_plan_by_ap_done;
|
2013-08-12 04:36:23 +00:00
|
|
|
/* recv_decache check for Action_public frame */
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 action_public_dialog_token;
|
2013-05-19 04:28:07 +00:00
|
|
|
u16 action_public_rxseq;
|
2013-05-08 21:45:39 +00:00
|
|
|
u8 active_keep_alive_check;
|
|
|
|
};
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
int init_mlme_ext_priv(struct adapter *adapter);
|
2013-07-27 01:08:39 +00:00
|
|
|
int init_hw_mlme_ext(struct adapter *padapter);
|
2014-11-28 17:08:37 +00:00
|
|
|
void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
|
2013-07-27 01:08:39 +00:00
|
|
|
extern void init_mlme_ext_timer(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
extern void init_addba_retry_timer(struct adapter *adapt, struct sta_info *sta);
|
2013-05-08 21:45:39 +00:00
|
|
|
extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
|
|
|
|
|
|
|
|
unsigned char networktype_to_raid(unsigned char network_type);
|
2013-08-15 21:11:51 +00:00
|
|
|
u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len);
|
|
|
|
void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *len);
|
|
|
|
void UpdateBrateTbl(struct adapter *padapter, u8 *mBratesOS);
|
2013-05-08 21:45:39 +00:00
|
|
|
void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
|
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void Save_DM_Func_Flag(struct adapter *padapter);
|
|
|
|
void Restore_DM_Func_Flag(struct adapter *padapter);
|
|
|
|
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void Set_MSR(struct adapter *padapter, u8 type);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
u8 rtw_get_oper_ch(struct adapter *adapter);
|
|
|
|
void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
|
|
|
|
u8 rtw_get_oper_bw(struct adapter *adapter);
|
|
|
|
void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
|
|
|
|
u8 rtw_get_oper_choffset(struct adapter *adapter);
|
|
|
|
void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void set_channel_bwmode(struct adapter *padapter, unsigned char channel,
|
|
|
|
unsigned char channel_offset, unsigned short bwmode);
|
2013-07-27 01:08:39 +00:00
|
|
|
void SelectChannel(struct adapter *padapter, unsigned char channel);
|
2013-08-15 21:11:51 +00:00
|
|
|
void SetBWMode(struct adapter *padapter, unsigned short bwmode,
|
|
|
|
unsigned char channel_offset);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);
|
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
|
|
|
|
void clear_cam_entry(struct adapter *padapter, u8 entry);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void invalidate_cam_all(struct adapter *padapter);
|
2014-11-16 00:18:30 +00:00
|
|
|
void CAM_empty_entry(struct adapter *Adapter, u8 ucIndex);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
int allocate_fw_sta_entry(struct adapter *padapter);
|
|
|
|
void flush_all_cam_entry(struct adapter *padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void site_survey(struct adapter *padapter);
|
2014-11-16 00:18:30 +00:00
|
|
|
u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame,
|
2013-08-15 21:11:51 +00:00
|
|
|
struct wlan_bssid_ex *bssid);
|
|
|
|
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
|
|
|
|
struct adapter *adapter, bool update_ie);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
int get_bsstype(unsigned short capability);
|
2013-08-15 21:11:51 +00:00
|
|
|
u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
|
2013-07-24 02:31:04 +00:00
|
|
|
u16 get_beacon_interval(struct wlan_bssid_ex *bss);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
int is_client_associated_to_ap(struct adapter *padapter);
|
|
|
|
int is_client_associated_to_ibss(struct adapter *padapter);
|
|
|
|
int is_IBSS_empty(struct adapter *padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
unsigned char check_assoc_AP(u8 *pframe, uint len);
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
|
2013-07-27 01:08:39 +00:00
|
|
|
void WMMOnAssocRsp(struct adapter *padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
|
|
|
|
void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
|
2013-07-27 01:08:39 +00:00
|
|
|
void HTOnAssocRsp(struct adapter *padapter);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
|
2013-07-27 01:08:39 +00:00
|
|
|
void VCS_update(struct adapter *padapter, struct sta_info *psta);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len,
|
|
|
|
struct sta_info *psta);
|
2013-07-27 01:08:39 +00:00
|
|
|
int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len);
|
|
|
|
void update_IOT_info(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
void update_capinfo(struct adapter *adapter, u16 updatecap);
|
|
|
|
void update_wireless_mode(struct adapter *padapter);
|
2013-07-27 01:08:39 +00:00
|
|
|
void update_tx_basic_rate(struct adapter *padapter, u8 modulation);
|
|
|
|
void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id);
|
2013-08-15 21:11:51 +00:00
|
|
|
int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie,
|
|
|
|
uint var_ie_len, int cam_idx);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-12 04:36:23 +00:00
|
|
|
/* for sta/adhoc mode */
|
2013-07-27 01:08:39 +00:00
|
|
|
void update_sta_info(struct adapter *padapter, struct sta_info *psta);
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz);
|
|
|
|
unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz);
|
|
|
|
unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps);
|
2013-07-27 01:08:39 +00:00
|
|
|
void Update_RA_Entry(struct adapter *padapter, u32 mac_id);
|
|
|
|
void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int receive_disconnect(struct adapter *padapter,
|
|
|
|
unsigned char *macaddr, unsigned short reason);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
unsigned char get_highest_rate_idx(u32 mask);
|
2013-08-15 21:11:51 +00:00
|
|
|
int support_short_GI(struct adapter *padapter, struct HT_caps_element *caps);
|
2013-07-27 01:08:39 +00:00
|
|
|
unsigned int is_ap_in_tkip(struct adapter *padapter);
|
|
|
|
unsigned int is_ap_in_wep(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int should_forbid_n_rate(struct adapter *padapter);
|
2013-07-27 01:08:39 +00:00
|
|
|
|
|
|
|
void report_join_res(struct adapter *padapter, int res);
|
2014-11-16 00:18:30 +00:00
|
|
|
void report_survey_event(struct adapter *padapter,
|
|
|
|
struct recv_frame *precv_frame);
|
2013-07-27 01:08:39 +00:00
|
|
|
void report_surveydone_event(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
void report_del_sta_event(struct adapter *padapter,
|
|
|
|
unsigned char *addr, unsigned short reason);
|
2014-11-16 00:18:30 +00:00
|
|
|
void report_add_sta_event(struct adapter *padapter, unsigned char *addr,
|
2013-08-15 21:11:51 +00:00
|
|
|
int cam_idx);
|
2013-07-27 01:08:39 +00:00
|
|
|
|
|
|
|
void beacon_timing_control(struct adapter *padapter);
|
2014-11-16 00:18:30 +00:00
|
|
|
extern u8 set_tx_beacon_cmd(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int setup_beacon_frame(struct adapter *padapter,
|
|
|
|
unsigned char *beacon_frame);
|
2013-07-27 01:08:39 +00:00
|
|
|
void update_mgnt_tx_rate(struct adapter *padapter, u8 rate);
|
2013-08-15 21:11:51 +00:00
|
|
|
void update_mgntframe_attrib(struct adapter *padapter,
|
|
|
|
struct pkt_attrib *pattrib);
|
2013-07-27 01:08:39 +00:00
|
|
|
void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe);
|
2013-08-15 21:11:51 +00:00
|
|
|
s32 dump_mgntframe_and_wait(struct adapter *padapter,
|
|
|
|
struct xmit_frame *pmgntframe, int timeout_ms);
|
|
|
|
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter,
|
|
|
|
struct xmit_frame *pmgntframe);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
void issue_beacon(struct adapter *padapter, int timeout_ms);
|
2013-08-15 21:11:51 +00:00
|
|
|
void issue_probersp(struct adapter *padapter, unsigned char *da,
|
|
|
|
u8 is_valid_p2p_probereq);
|
2013-07-27 01:08:39 +00:00
|
|
|
void issue_assocreq(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
void issue_asocrsp(struct adapter *padapter, unsigned short status,
|
|
|
|
struct sta_info *pstat, int pkt_type);
|
|
|
|
void issue_auth(struct adapter *padapter, struct sta_info *psta,
|
|
|
|
unsigned short status);
|
|
|
|
void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
|
|
|
|
u8 *da);
|
|
|
|
s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid,
|
2014-11-16 00:18:30 +00:00
|
|
|
u8 *da, int try_cnt, int wait_ms);
|
2013-08-15 21:11:51 +00:00
|
|
|
int issue_nulldata(struct adapter *padapter, unsigned char *da,
|
|
|
|
unsigned int power_mode, int try_cnt, int wait_ms);
|
|
|
|
int issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
|
|
|
|
u16 tid, int try_cnt, int wait_ms);
|
|
|
|
int issue_deauth(struct adapter *padapter, unsigned char *da,
|
|
|
|
unsigned short reason);
|
|
|
|
int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason,
|
|
|
|
int try_cnt, int wait_ms);
|
|
|
|
void issue_action_spct_ch_switch(struct adapter *padapter, u8 *ra, u8 new_ch,
|
|
|
|
u8 ch_offset);
|
|
|
|
void issue_action_BA(struct adapter *padapter, unsigned char *raddr,
|
|
|
|
unsigned char action, unsigned short status);
|
2013-07-27 01:08:39 +00:00
|
|
|
unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
|
|
|
|
unsigned int send_beacon(struct adapter *padapter);
|
|
|
|
|
|
|
|
void start_clnt_assoc(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
void start_clnt_auth(struct adapter *padapter);
|
|
|
|
void start_clnt_join(struct adapter *padapter);
|
|
|
|
void start_create_ibss(struct adapter *padapter);
|
|
|
|
|
|
|
|
unsigned int OnAssocReq(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAssocRsp(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnProbeReq(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnProbeRsp(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int DoReserved(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnBeacon(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAtim(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnDisassoc(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAuth(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAuthClient(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnDeAuth(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
|
|
|
|
unsigned int on_action_spct(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_qos(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_dls(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_back(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int on_action_public(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_ht(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_wmm(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-08-15 21:11:51 +00:00
|
|
|
unsigned int OnAction_p2p(struct adapter *padapter,
|
2014-11-16 00:18:30 +00:00
|
|
|
struct recv_frame *precv_frame);
|
2013-07-27 01:08:39 +00:00
|
|
|
|
|
|
|
void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
|
|
|
|
void mlmeext_sta_del_event_callback(struct adapter *padapter);
|
2013-08-15 21:11:51 +00:00
|
|
|
void mlmeext_sta_add_event_callback(struct adapter *padapter,
|
|
|
|
struct sta_info *psta);
|
2013-07-27 01:08:39 +00:00
|
|
|
|
|
|
|
void linked_status_chk(struct adapter *padapter);
|
|
|
|
|
2014-11-28 17:08:37 +00:00
|
|
|
void survey_timer_hdl (void *function_context);
|
|
|
|
void link_timer_hdl (void *funtion_context);
|
2014-11-16 00:18:30 +00:00
|
|
|
void addba_timer_hdl(void *function_context);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define set_survey_timer(mlmeext, ms) \
|
|
|
|
do { \
|
|
|
|
_set_timer(&(mlmeext)->survey_timer, (ms)); \
|
2013-05-09 04:04:25 +00:00
|
|
|
} while (0)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define set_link_timer(mlmeext, ms) \
|
|
|
|
do { \
|
|
|
|
_set_timer(&(mlmeext)->link_timer, (ms)); \
|
2013-05-09 04:04:25 +00:00
|
|
|
} while (0)
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
int cckrates_included(unsigned char *rate, int ratelen);
|
|
|
|
int cckratesonly_included(unsigned char *rate, int ratelen);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
|
|
|
|
void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
struct cmd_hdl {
|
|
|
|
uint parmsize;
|
2013-07-27 01:08:39 +00:00
|
|
|
u8 (*h2cfuns)(struct adapter *padapter, u8 *pbuf);
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2013-07-27 01:08:39 +00:00
|
|
|
u8 read_macreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 write_macreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 read_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 write_bbreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 read_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 write_rfreg_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 NULL_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 disconnect_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 createbss_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 setauth_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 setkey_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 set_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 del_assocsta_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf);
|
|
|
|
|
|
|
|
u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf);
|
|
|
|
u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf);
|
|
|
|
u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf);
|
|
|
|
u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf);
|
|
|
|
u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf);
|
|
|
|
u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf);
|
2013-08-15 21:11:51 +00:00
|
|
|
/* Handling DFS channel switch announcement ie. */
|
|
|
|
u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf);
|
2013-07-27 01:08:39 +00:00
|
|
|
u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
|
|
|
#define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl},
|
|
|
|
#define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd},
|
|
|
|
|
|
|
|
#ifdef _RTW_CMD_C_
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
static struct cmd_hdl wlancmds[] = {
|
2014-11-28 17:08:37 +00:00
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct wlan_bssid_ex), join_cmd_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct disconnect_parm), disconnect_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct wlan_bssid_ex), createbss_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct setopmode_parm), setopmode_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct sitesurvey_parm), sitesurvey_cmd_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct setauth_parm), setauth_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct setkey_parm), setkey_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct set_stakey_parm), set_stakey_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof (struct set_assocsta_parm), NULL)
|
2013-05-19 04:28:07 +00:00
|
|
|
GEN_MLME_EXT_HANDLER(sizeof(struct addBaReq_parm), add_ba_hdl)
|
2014-11-16 00:18:30 +00:00
|
|
|
GEN_MLME_EXT_HANDLER(sizeof(struct set_ch_parm), set_ch_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof(struct wlan_bssid_ex), tx_beacon_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl)
|
|
|
|
GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl)
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
struct C2HEvent_Header {
|
2013-05-15 18:57:38 +00:00
|
|
|
#ifdef __LITTLE_ENDIAN
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned int len:16;
|
|
|
|
unsigned int ID:8;
|
|
|
|
unsigned int seq:8;
|
2013-05-15 18:57:38 +00:00
|
|
|
#elif defined(__BIG_ENDIAN)
|
2013-05-08 21:45:39 +00:00
|
|
|
unsigned int seq:8;
|
|
|
|
unsigned int ID:8;
|
|
|
|
unsigned int len:16;
|
|
|
|
#endif
|
|
|
|
unsigned int rsvd;
|
|
|
|
};
|
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
void rtw_dummy_event_callback(struct adapter *adapter, u8 *pbuf);
|
|
|
|
void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
enum rtw_c2h_event {
|
|
|
|
GEN_EVT_CODE(_Read_MACREG) = 0, /*0*/
|
2013-05-08 21:45:39 +00:00
|
|
|
GEN_EVT_CODE(_Read_BBREG),
|
2013-05-19 04:28:07 +00:00
|
|
|
GEN_EVT_CODE(_Read_RFREG),
|
|
|
|
GEN_EVT_CODE(_Read_EEPROM),
|
|
|
|
GEN_EVT_CODE(_Read_EFUSE),
|
2013-08-15 21:11:51 +00:00
|
|
|
GEN_EVT_CODE(_Read_CAM), /*5*/
|
2013-05-19 04:28:07 +00:00
|
|
|
GEN_EVT_CODE(_Get_BasicRate),
|
|
|
|
GEN_EVT_CODE(_Get_DataRate),
|
|
|
|
GEN_EVT_CODE(_Survey), /*8*/
|
|
|
|
GEN_EVT_CODE(_SurveyDone), /*9*/
|
|
|
|
|
|
|
|
GEN_EVT_CODE(_JoinBss) , /*10*/
|
|
|
|
GEN_EVT_CODE(_AddSTA),
|
|
|
|
GEN_EVT_CODE(_DelSTA),
|
2013-08-15 21:11:51 +00:00
|
|
|
GEN_EVT_CODE(_AtimDone),
|
2013-05-19 04:28:07 +00:00
|
|
|
GEN_EVT_CODE(_TX_Report),
|
2013-08-15 21:11:51 +00:00
|
|
|
GEN_EVT_CODE(_CCX_Report), /*15*/
|
2013-05-19 04:28:07 +00:00
|
|
|
GEN_EVT_CODE(_DTM_Report),
|
|
|
|
GEN_EVT_CODE(_TX_Rate_Statistics),
|
|
|
|
GEN_EVT_CODE(_C2HLBK),
|
|
|
|
GEN_EVT_CODE(_FWDBG),
|
2013-08-15 21:11:51 +00:00
|
|
|
GEN_EVT_CODE(_C2HFEEDBACK), /*20*/
|
2013-05-08 21:45:39 +00:00
|
|
|
GEN_EVT_CODE(_ADDBA),
|
|
|
|
GEN_EVT_CODE(_C2HBCN),
|
2013-08-15 21:11:51 +00:00
|
|
|
GEN_EVT_CODE(_ReportPwrState), /* filen: only for PCIE, USB */
|
|
|
|
GEN_EVT_CODE(_CloseRF), /* filen: only for PCIE,
|
|
|
|
* work around ASPM */
|
2013-05-19 04:28:07 +00:00
|
|
|
MAX_C2HEVT
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-05-19 04:28:07 +00:00
|
|
|
#ifdef _RTW_MLME_EXT_C_
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-08-15 21:11:51 +00:00
|
|
|
static struct fwevent wlanevents[] = {
|
2013-05-19 04:28:07 +00:00
|
|
|
{0, rtw_dummy_event_callback}, /*0*/
|
2013-05-08 21:45:39 +00:00
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, &rtw_survey_event_callback}, /*8*/
|
2014-11-28 17:08:37 +00:00
|
|
|
{sizeof (struct surveydone_event), &rtw_surveydone_event_callback},/*9*/
|
2013-05-08 21:45:39 +00:00
|
|
|
{0, &rtw_joinbss_event_callback}, /*10*/
|
|
|
|
{sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
|
2013-05-19 04:28:07 +00:00
|
|
|
{sizeof(struct stadel_event), &rtw_stadel_event_callback},
|
2013-05-08 21:45:39 +00:00
|
|
|
{0, &rtw_atimdone_event_callback},
|
|
|
|
{0, rtw_dummy_event_callback},
|
|
|
|
{0, NULL}, /*15*/
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, NULL},
|
|
|
|
{0, rtw_fwdbg_event_callback},
|
|
|
|
{0, NULL}, /*20*/
|
|
|
|
{0, NULL},
|
2013-05-19 04:28:07 +00:00
|
|
|
{0, NULL},
|
2013-05-08 21:45:39 +00:00
|
|
|
{0, &rtw_cpwm_event_callback},
|
2013-09-07 03:43:40 +00:00
|
|
|
{0, NULL},
|
2013-05-08 21:45:39 +00:00
|
|
|
};
|
|
|
|
|
2013-10-19 17:45:47 +00:00
|
|
|
#endif/* _RTL_MLME_EXT_C_ */
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-10-19 17:45:47 +00:00
|
|
|
#endif /* __RTW_MLME_EXT_H_ */
|