1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
15 #ifndef __RTW_MLME_EXT_H_
16 #define __RTW_MLME_EXT_H_
18 #include <osdep_service.h>
19 #include <drv_types.h>
20 #include <wlan_bssdef.h>
23 /* Commented by Albert 20101105 */
24 /* Increase the SURVEY_TO value from 100 to 150 ( 100ms to 150ms ) */
25 /* The Realtek 8188CE SoftAP will spend around 100ms to send the probe response after receiving the probe request. */
26 /* So, this driver tried to extend the dwell time for each scanning channel. */
27 /* This will increase the chance to receive the probe response from SoftAP. */
29 #define SURVEY_TO (100)
30 #define REAUTH_TO (300) /* 50) */
31 #define REASSOC_TO (300) /* 50) */
32 /* define DISCONNECT_TO (3000) */
33 #define ADDBA_TO (2000)
35 #define LINKED_TO (1) /* unit:2 sec, 1x2=2 sec */
37 #define REAUTH_LIMIT (4)
38 #define REASSOC_LIMIT (4)
39 #define READDBA_LIMIT (2)
41 #define ROAMING_LIMIT 8
43 #define DYNAMIC_FUNC_DISABLE (0x0)
45 /* ====== enum odm_ability ======== */
46 /* BB ODM section BIT 0-15 */
47 #define DYNAMIC_BB_DIG BIT(0)
48 #define DYNAMIC_BB_RA_MASK BIT(1)
49 #define DYNAMIC_BB_DYNAMIC_TXPWR BIT(2)
50 #define DYNAMIC_BB_BB_FA_CNT BIT(3)
52 #define DYNAMIC_BB_RSSI_MONITOR BIT(4)
53 #define DYNAMIC_BB_CCK_PD BIT(5)
54 #define DYNAMIC_BB_ANT_DIV BIT(6)
55 #define DYNAMIC_BB_PWR_SAVE BIT(7)
56 #define DYNAMIC_BB_PWR_TRAIN BIT(8)
57 #define DYNAMIC_BB_RATE_ADAPTIVE BIT(9)
58 #define DYNAMIC_BB_PATH_DIV BIT(10)
59 #define DYNAMIC_BB_PSD BIT(11)
61 /* MAC DM section BIT 16-23 */
62 #define DYNAMIC_MAC_struct edca_turboURBO BIT(16)
63 #define DYNAMIC_MAC_EARLY_MODE BIT(17)
65 /* RF ODM section BIT 24-31 */
66 #define DYNAMIC_RF_TX_PWR_TRACK BIT(24)
67 #define DYNAMIC_RF_RX_GAIN_TRACK BIT(25)
68 #define DYNAMIC_RF_CALIBRATION BIT(26)
70 #define DYNAMIC_ALL_FUNC_ENABLE 0xFFFFFFF
72 #define _HW_STATE_NOLINK_ 0x00
73 #define _HW_STATE_ADHOC_ 0x01
74 #define _HW_STATE_STATION_ 0x02
75 #define _HW_STATE_AP_ 0x03
92 extern unsigned char WMM_OUI23A
[];
93 extern unsigned char WPS_OUI23A
[];
94 extern unsigned char WFD_OUI23A
[];
95 extern unsigned char P2P_OUI23A
[];
97 extern unsigned char WMM_INFO_OUI23A
[];
98 extern unsigned char WMM_PARA_OUI23A
[];
102 /* Channel Plan Type. */
104 /* We just add new channel plan when the new channel plan is different from any of the following */
106 /* If you just want to customize the actions(scan period or join actions) about one of the channel plan, */
107 /* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */
109 enum { /* _RT_CHANNEL_DOMAIN */
110 /* old channel plan mapping ===== */
111 RT_CHANNEL_DOMAIN_FCC
= 0x00,
112 RT_CHANNEL_DOMAIN_IC
= 0x01,
113 RT_CHANNEL_DOMAIN_ETSI
= 0x02,
114 RT_CHANNEL_DOMAIN_SPAIN
= 0x03,
115 RT_CHANNEL_DOMAIN_FRANCE
= 0x04,
116 RT_CHANNEL_DOMAIN_MKK
= 0x05,
117 RT_CHANNEL_DOMAIN_MKK1
= 0x06,
118 RT_CHANNEL_DOMAIN_ISRAEL
= 0x07,
119 RT_CHANNEL_DOMAIN_TELEC
= 0x08,
120 RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN
= 0x09,
121 RT_CHANNEL_DOMAIN_WORLD_WIDE_13
= 0x0A,
122 RT_CHANNEL_DOMAIN_TAIWAN
= 0x0B,
123 RT_CHANNEL_DOMAIN_CHINA
= 0x0C,
124 RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO
= 0x0D,
125 RT_CHANNEL_DOMAIN_KOREA
= 0x0E,
126 RT_CHANNEL_DOMAIN_TURKEY
= 0x0F,
127 RT_CHANNEL_DOMAIN_JAPAN
= 0x10,
128 RT_CHANNEL_DOMAIN_FCC_NO_DFS
= 0x11,
129 RT_CHANNEL_DOMAIN_JAPAN_NO_DFS
= 0x12,
130 RT_CHANNEL_DOMAIN_WORLD_WIDE_5G
= 0x13,
131 RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS
= 0x14,
133 /* new channel plan mapping, (2GDOMAIN_5GDOMAIN) ===== */
134 RT_CHANNEL_DOMAIN_WORLD_NULL
= 0x20,
135 RT_CHANNEL_DOMAIN_ETSI1_NULL
= 0x21,
136 RT_CHANNEL_DOMAIN_FCC1_NULL
= 0x22,
137 RT_CHANNEL_DOMAIN_MKK1_NULL
= 0x23,
138 RT_CHANNEL_DOMAIN_ETSI2_NULL
= 0x24,
139 RT_CHANNEL_DOMAIN_FCC1_FCC1
= 0x25,
140 RT_CHANNEL_DOMAIN_WORLD_ETSI1
= 0x26,
141 RT_CHANNEL_DOMAIN_MKK1_MKK1
= 0x27,
142 RT_CHANNEL_DOMAIN_WORLD_KCC1
= 0x28,
143 RT_CHANNEL_DOMAIN_WORLD_FCC2
= 0x29,
144 RT_CHANNEL_DOMAIN_WORLD_FCC3
= 0x30,
145 RT_CHANNEL_DOMAIN_WORLD_FCC4
= 0x31,
146 RT_CHANNEL_DOMAIN_WORLD_FCC5
= 0x32,
147 RT_CHANNEL_DOMAIN_WORLD_FCC6
= 0x33,
148 RT_CHANNEL_DOMAIN_FCC1_FCC7
= 0x34,
149 RT_CHANNEL_DOMAIN_WORLD_ETSI2
= 0x35,
150 RT_CHANNEL_DOMAIN_WORLD_ETSI3
= 0x36,
151 RT_CHANNEL_DOMAIN_MKK1_MKK2
= 0x37,
152 RT_CHANNEL_DOMAIN_MKK1_MKK3
= 0x38,
153 RT_CHANNEL_DOMAIN_FCC1_NCC1
= 0x39,
154 RT_CHANNEL_DOMAIN_FCC1_NCC2
= 0x40,
155 RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G
= 0x41,
156 /* Add new channel plan above this line=============== */
157 RT_CHANNEL_DOMAIN_MAX
,
158 RT_CHANNEL_DOMAIN_REALTEK_DEFINE
= 0x7F,
161 enum { /* _RT_CHANNEL_DOMAIN_2G */
162 RT_CHANNEL_DOMAIN_2G_WORLD
= 0x00, /* Worldwird 13 */
163 RT_CHANNEL_DOMAIN_2G_ETSI1
= 0x01, /* Europe */
164 RT_CHANNEL_DOMAIN_2G_FCC1
= 0x02, /* US */
165 RT_CHANNEL_DOMAIN_2G_MKK1
= 0x03, /* Japan */
166 RT_CHANNEL_DOMAIN_2G_ETSI2
= 0x04, /* France */
167 RT_CHANNEL_DOMAIN_2G_NULL
= 0x05,
168 /* Add new channel plan above this line=============== */
169 RT_CHANNEL_DOMAIN_2G_MAX
,
172 enum { /* _RT_CHANNEL_DOMAIN_5G */
173 RT_CHANNEL_DOMAIN_5G_NULL
= 0x00,
174 RT_CHANNEL_DOMAIN_5G_ETSI1
= 0x01, /* Europe */
175 RT_CHANNEL_DOMAIN_5G_ETSI2
= 0x02, /* Australia, New Zealand */
176 RT_CHANNEL_DOMAIN_5G_ETSI3
= 0x03, /* Russia */
177 RT_CHANNEL_DOMAIN_5G_FCC1
= 0x04, /* US */
178 RT_CHANNEL_DOMAIN_5G_FCC2
= 0x05, /* FCC o/w DFS Channels */
179 RT_CHANNEL_DOMAIN_5G_FCC3
= 0x06, /* India, Mexico */
180 RT_CHANNEL_DOMAIN_5G_FCC4
= 0x07, /* Venezuela */
181 RT_CHANNEL_DOMAIN_5G_FCC5
= 0x08, /* China */
182 RT_CHANNEL_DOMAIN_5G_FCC6
= 0x09, /* Israel */
183 RT_CHANNEL_DOMAIN_5G_FCC7_IC1
= 0x0A, /* US, Canada */
184 RT_CHANNEL_DOMAIN_5G_KCC1
= 0x0B, /* Korea */
185 RT_CHANNEL_DOMAIN_5G_MKK1
= 0x0C, /* Japan */
186 RT_CHANNEL_DOMAIN_5G_MKK2
= 0x0D, /* Japan (W52, W53) */
187 RT_CHANNEL_DOMAIN_5G_MKK3
= 0x0E, /* Japan (W56) */
188 RT_CHANNEL_DOMAIN_5G_NCC1
= 0x0F, /* Taiwan */
189 RT_CHANNEL_DOMAIN_5G_NCC2
= 0x10, /* Taiwan o/w DFS */
190 /* Add new channel plan above this line=============== */
191 /* Driver Self Defined ===== */
192 RT_CHANNEL_DOMAIN_5G_FCC
= 0x11,
193 RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS
= 0x12,
194 RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS
= 0x13,
195 RT_CHANNEL_DOMAIN_5G_MAX
,
198 #define rtw_is_channel_plan_valid(chplan) (chplan<RT_CHANNEL_DOMAIN_MAX || chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
200 struct rt_channel_plan
{
201 unsigned char Channel
[MAX_CHANNEL_NUM
];
205 struct rt_channel_plan_2g
{
206 unsigned char Channel
[MAX_CHANNEL_NUM_2G
];
210 struct rt_channel_plan_5g
{
211 unsigned char Channel
[MAX_CHANNEL_NUM_5G
];
215 struct rt_channel_plan_map
{
216 unsigned char Index2G
;
217 unsigned char Index5G
;
232 enum { /* HT_IOT_PEER_E */
233 HT_IOT_PEER_UNKNOWN
= 0,
234 HT_IOT_PEER_REALTEK
= 1,
235 HT_IOT_PEER_REALTEK_92SE
= 2,
236 HT_IOT_PEER_BROADCOM
= 3,
237 HT_IOT_PEER_RALINK
= 4,
238 HT_IOT_PEER_ATHEROS
= 5,
239 HT_IOT_PEER_CISCO
= 6,
240 HT_IOT_PEER_MERU
= 7,
241 HT_IOT_PEER_MARVELL
= 8,
242 HT_IOT_PEER_REALTEK_SOFTAP
= 9,/* peer is RealTek SOFT_AP, by Bohn, 2009.12.17 */
243 HT_IOT_PEER_SELF_SOFTAP
= 10, /* Self is SoftAP */
244 HT_IOT_PEER_AIRGO
= 11,
245 HT_IOT_PEER_INTEL
= 12,
246 HT_IOT_PEER_RTK_APCLIENT
= 13,
247 HT_IOT_PEER_REALTEK_81XX
= 14,
248 HT_IOT_PEER_REALTEK_WOW
= 15,
249 HT_IOT_PEER_TENDA
= 16,
262 struct mlme_handler
{
264 int (*func
)(struct rtw_adapter
*padapter
, struct recv_frame
*precv_frame
);
267 struct action_handler
{
270 int (*func
)(struct rtw_adapter
*padapter
, struct recv_frame
*precv_frame
);
280 struct cfg80211_ssid ssid
[RTW_SSID_SCAN_AMOUNT
];
281 struct rtw_ieee80211_channel ch
[RTW_CHANNEL_SCAN_AMOUNT
];
284 #define WIFI_FW_AUTH_NULL 0x00000100
285 #define WIFI_FW_AUTH_STATE 0x00000200
286 #define WIFI_FW_AUTH_SUCCESS 0x00000400
288 #define WIFI_FW_ASSOC_STATE 0x00002000
289 #define WIFI_FW_ASSOC_SUCCESS 0x00004000
291 #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE)
294 struct sta_info
*psta
;
298 unsigned char SupportedRates
[NDIS_802_11_LENGTH_RATES_EX
];
303 * When one iface acted as AP mode and the other iface is STA mode and scanning,
304 * it should switch back to AP's operating channel periodically.
306 * When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to AP's operating channel for
307 * RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds.
309 * For chip supports 2.4G + 5GHz and AP mode is operating in channel 1,
310 * RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MILLISECOND is 3 and SURVEY_TO is 100.
311 * When it's STA mode gets set_scan command,
313 * 1. Doing the scan on channel 1.2.3.4.5.6.7.8
314 * 2. Back to channel 1 for 300 milliseconds
315 * 3. Go through doing site survey on channel 9.10.11.36.40.44.48.52
316 * 4. Back to channel 1 for 300 milliseconds
317 * 5. ... and so on, till survey done.
320 struct mlme_ext_info
{
326 u32 auth_algo
; /* 802.11 auth, could be open, shared, auto */
328 u32 enc_algo
;/* encrypt algorithm; */
329 u32 key_index
; /* this is only valid for legendary wep, 0~3 for key id. */
345 u8 turboMode_cts2self
;
348 u8 ADDBA_retry_count
;
350 /* Accept ADDBA Request */
351 bool bAcceptAddbaReq
;
355 struct ADDBA_request ADDBA_req
;
356 struct WMM_para_element WMM_param
;
357 struct ieee80211_ht_cap ht_cap
;
358 struct ieee80211_ht_operation HT_info
;
359 struct wlan_bssid_ex network
;/* join network or bss_network, if in ap mode, it is the same to cur_network.network */
360 struct FW_Sta_Info FW_sta_info
[NUM_STA
];
363 /* The channel information about this channel including joining, scanning, and power constraints. */
364 struct rt_channel_info
{
365 u8 ChannelNum
; /* The channel number. */
366 enum rt_scan_type ScanType
; /* Scan type such as passive or active scan. */
369 int rtw_ch_set_search_ch23a(struct rt_channel_info
*ch_set
, const u32 ch
);
371 /* P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */
372 #define P2P_MAX_REG_CLASSES 10
374 /* P2P_MAX_REG_CLASS_CHANNELS - Maximum number of channels per regulatory class */
375 #define P2P_MAX_REG_CLASS_CHANNELS 20
377 /* struct p2p_channels - List of supported channels */
378 struct p2p_channels
{
379 /* struct p2p_reg_class - Supported regulatory class */
380 struct p2p_reg_class
{
381 /* reg_class - Regulatory class (IEEE 802.11-2007, Annex J) */
384 /* channel - Supported channels */
385 u8 channel
[P2P_MAX_REG_CLASS_CHANNELS
];
387 /* channels - Number of channel entries in use */
389 } reg_class
[P2P_MAX_REG_CLASSES
];
391 /* reg_classes - Number of reg_class entries in use */
395 struct p2p_oper_class_map
{
396 enum hw_mode
{IEEE80211G
, IEEE80211A
} mode
;
402 BW20
, BW40PLUS
, BW40MINUS
406 struct mlme_ext_priv
{
407 struct rtw_adapter
*padapter
;
412 /* struct fw_priv fwpriv; */
414 unsigned char cur_channel
;
415 unsigned char cur_bwmode
;
416 unsigned char cur_ch_offset
;/* PRIME_CHNL_OFFSET */
417 unsigned char cur_wireless_mode
; /* NETWORK_TYPE */
419 unsigned char max_chan_nums
;
420 struct rt_channel_info channel_set
[MAX_CHANNEL_NUM
];
421 struct p2p_channels channel_list
;
422 unsigned char basicrate
[NumRates
];
423 unsigned char datarate
[NumRates
];
425 struct ss_res sitesurvey_res
;
426 struct mlme_ext_info mlmext_info
;/* for sta/adhoc mode, including current scanning/connecting/connected related info. */
427 /* for ap mode, network includes ap's cap_info */
428 struct timer_list survey_timer
;
429 struct timer_list link_timer
;
433 u8 tx_rate
; /* TXRATE when USERATE is set. */
435 u32 retry
; /* retry for issue probereq */
439 unsigned char bstart_bss
;
440 u8 update_channel_plan_by_ap_done
;
441 /* recv_decache check for Action_public frame */
442 u8 action_public_dialog_token
;
443 u16 action_public_rxseq
;
444 u8 active_keep_alive_check
;
447 int init_mlme_ext_priv23a(struct rtw_adapter
*padapter
);
448 int init_hw_mlme_ext23a(struct rtw_adapter
*padapter
);
449 void free_mlme_ext_priv23a (struct mlme_ext_priv
*pmlmeext
);
450 void init_mlme_ext_timer23a(struct rtw_adapter
*padapter
);
451 void init_addba_retry_timer23a(struct sta_info
*psta
);
452 struct xmit_frame
*alloc_mgtxmitframe23a(struct xmit_priv
*pxmitpriv
);
454 unsigned char networktype_to_raid23a(unsigned char network_type
);
455 u8
judge_network_type23a(struct rtw_adapter
*padapter
, unsigned char *rate
,
457 void get_rate_set23a(struct rtw_adapter
*padapter
, unsigned char *pbssrate
,
459 void UpdateBrateTbl23a(struct rtw_adapter
*padapter
, u8
*mBratesOS
);
460 void Update23aTblForSoftAP(u8
*bssrateset
, u32 bssratelen
);
462 u8
rtw_get_oper_ch23a(struct rtw_adapter
*adapter
);
463 void rtw_set_oper_ch23a(struct rtw_adapter
*adapter
, u8 ch
);
464 void rtw_set_oper_bw23a(struct rtw_adapter
*adapter
, u8 bw
);
465 void rtw_set_oper_ch23aoffset23a(struct rtw_adapter
*adapter
, u8 offset
);
467 void set_channel_bwmode23a(struct rtw_adapter
*padapter
, unsigned char channel
,
468 unsigned char channel_offset
, unsigned short bwmode
);
469 void SelectChannel23a(struct rtw_adapter
*padapter
, unsigned char channel
);
471 unsigned int decide_wait_for_beacon_timeout23a(unsigned int bcn_interval
);
473 void clear_cam_entry23a(struct rtw_adapter
*padapter
, u8 entry
);
475 void invalidate_cam_all23a(struct rtw_adapter
*padapter
);
477 int allocate_fw_sta_entry23a(struct rtw_adapter
*padapter
);
478 void flush_all_cam_entry23a(struct rtw_adapter
*padapter
);
480 bool IsLegal5GChannel(struct rtw_adapter
*Adapter
, u8 channel
);
482 void update_network23a(struct wlan_bssid_ex
*dst
, struct wlan_bssid_ex
*src
,
483 struct rtw_adapter
*padapter
, bool update_ie
);
485 u8
*get_my_bssid23a(struct wlan_bssid_ex
*pnetwork
);
487 bool is_client_associated_to_ap23a(struct rtw_adapter
*padapter
);
488 bool is_client_associated_to_ibss23a(struct rtw_adapter
*padapter
);
489 bool is_IBSS_empty23a(struct rtw_adapter
*padapter
);
491 unsigned char check_assoc_AP23a(u8
*pframe
, uint len
);
493 int WMM_param_handler23a(struct rtw_adapter
*padapter
, const u8
*p
);
494 void WMMOnAssocRsp23a(struct rtw_adapter
*padapter
);
496 void HT_caps_handler23a(struct rtw_adapter
*padapter
, const u8
*p
);
497 void HT_info_handler23a(struct rtw_adapter
*padapter
, const u8
*p
);
498 void HTOnAssocRsp23a(struct rtw_adapter
*padapter
);
500 void ERP_IE_handler23a(struct rtw_adapter
*padapter
, const u8
*p
);
501 void VCS_update23a(struct rtw_adapter
*padapter
, struct sta_info
*psta
);
503 void update_beacon23a_info(struct rtw_adapter
*padapter
,
504 struct ieee80211_mgmt
*mgmt
, uint len
,
505 struct sta_info
*psta
);
506 int rtw_check_bcn_info23a(struct rtw_adapter
*Adapter
,
507 struct ieee80211_mgmt
*mgmt
, u32 packet_len
);
508 void update_IOT_info23a(struct rtw_adapter
*padapter
);
509 void update_capinfo23a(struct rtw_adapter
*Adapter
, u16 updateCap
);
510 void update_wireless_mode23a(struct rtw_adapter
*padapter
);
511 void update_tx_basic_rate23a(struct rtw_adapter
*padapter
, u8 modulation
);
512 void update_bmc_sta_support_rate23a(struct rtw_adapter
*padapter
, u32 mac_id
);
513 int update_sta_support_rate23a(struct rtw_adapter
*padapter
, u8
*pvar_ie
,
514 uint var_ie_len
, int cam_idx
);
516 /* for sta/adhoc mode */
517 void update_sta_info23a(struct rtw_adapter
*padapter
, struct sta_info
*psta
);
518 unsigned int update_basic_rate23a(unsigned char *ptn
, unsigned int ptn_sz
);
519 unsigned int update_supported_rate23a(unsigned char *ptn
, unsigned int ptn_sz
);
520 unsigned int update_MSC_rate23a(struct ieee80211_ht_cap
*ht_cap
);
521 void Update_RA_Entry23a(struct rtw_adapter
*padapter
, struct sta_info
*psta
);
522 void set_sta_rate23a(struct rtw_adapter
*padapter
, struct sta_info
*psta
);
524 int receive_disconnect23a(struct rtw_adapter
*padapter
,
525 unsigned char *MacAddr
, unsigned short reason
);
527 unsigned char get_highest_rate_idx23a(u32 mask
);
528 int support_short_GI23a(struct rtw_adapter
*padapter
,
529 struct ieee80211_ht_cap
*ht_cap
);
530 bool is_ap_in_tkip23a(struct rtw_adapter
*padapter
);
531 bool is_ap_in_wep23a(struct rtw_adapter
*padapter
);
532 bool should_forbid_n_rate23a(struct rtw_adapter
*padapter
);
534 void report_join_res23a(struct rtw_adapter
*padapter
, int res
);
535 void report_survey_event23a(struct rtw_adapter
*padapter
,
536 struct recv_frame
*precv_frame
);
537 void report_surveydone_event23a(struct rtw_adapter
*padapter
);
538 void report_del_sta_event23a(struct rtw_adapter
*padapter
,
539 unsigned char *MacAddr
, unsigned short reason
);
540 void report_add_sta_event23a(struct rtw_adapter
*padapter
,
541 unsigned char *MacAddr
, int cam_idx
);
543 int set_tx_beacon_cmd23a(struct rtw_adapter
*padapter
);
544 unsigned int setup_beacon_frame(struct rtw_adapter
*padapter
,
545 unsigned char *beacon_frame
);
546 void update_mgnt_tx_rate23a(struct rtw_adapter
*padapter
, u8 rate
);
547 void update_mgntframe_attrib23a(struct rtw_adapter
*padapter
,
548 struct pkt_attrib
*pattrib
);
549 void dump_mgntframe23a(struct rtw_adapter
*padapter
,
550 struct xmit_frame
*pmgntframe
);
551 s32
dump_mgntframe23a_and_wait(struct rtw_adapter
*padapter
,
552 struct xmit_frame
*pmgntframe
, int timeout_ms
);
553 s32
dump_mgntframe23a_and_wait_ack23a(struct rtw_adapter
*padapter
,
554 struct xmit_frame
*pmgntframe
);
556 void issue_beacon23a(struct rtw_adapter
*padapter
, int timeout_ms
);
557 int issue_nulldata23a(struct rtw_adapter
*padapter
, unsigned char *da
,
558 unsigned int power_mode
, int try_cnt
, int wait_ms
);
559 int issue_qos_nulldata23a(struct rtw_adapter
*padapter
, unsigned char *da
, u16 tid
,
560 int try_cnt
, int wait_ms
);
561 int issue_deauth23a(struct rtw_adapter
*padapter
, unsigned char *da
,
562 unsigned short reason
);
563 void issue_action_spct_ch_switch23a(struct rtw_adapter
*padapter
, u8
*ra
,
564 u8 new_ch
, u8 ch_offset
);
565 void issue_action_BA23a(struct rtw_adapter
*padapter
,
566 const unsigned char *raddr
,
567 unsigned char action
, unsigned short status
);
568 int send_delba23a(struct rtw_adapter
*padapter
, u8 initiator
, u8
*addr
);
569 int send_beacon23a(struct rtw_adapter
*padapter
);
571 void mlmeext_joinbss_event_callback23a(struct rtw_adapter
*padapter
, int join_res
);
572 void mlmeext_sta_del_event_callback23a(struct rtw_adapter
*padapter
);
573 void mlmeext_sta_add_event_callback23a(struct rtw_adapter
*padapter
, struct sta_info
*psta
);
575 void linked_status_chk23a(struct rtw_adapter
*padapter
);
577 #define set_survey_timer(mlmeext, ms) \
578 /*DBG_8723A("%s set_survey_timer(%p, %d)\n", __func__, (mlmeext), (ms));*/ \
579 mod_timer(&mlmeext->survey_timer, jiffies + msecs_to_jiffies(ms));
581 #define set_link_timer(mlmeext, ms) \
582 /*DBG_8723A("%s set_link_timer(%p, %d)\n", __func__, (mlmeext), (ms));*/ \
583 mod_timer(&mlmeext->link_timer, jiffies + msecs_to_jiffies(ms));
585 int cckrates_included23a(unsigned char *rate
, int ratelen
);
586 int cckratesonly_included23a(unsigned char *rate
, int ratelen
);
588 void process_addba_req23a(struct rtw_adapter
*padapter
, u8
*paddba_req
, u8
*addr
);
590 void correct_TSF23a(struct rtw_adapter
*padapter
, struct mlme_ext_priv
*pmlmeext
);
594 int (*h2cfuns
)(struct rtw_adapter
*padapter
, const u8
*pbuf
);
598 int read_macreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
599 int write_macreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
600 int read_bbreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
601 int write_bbreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
602 int read_rfreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
603 int write_rfreg_hdl(struct rtw_adapter
*padapter
, u8
*pbuf
);
606 int NULL_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
607 int join_cmd_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
608 int disconnect_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
609 int createbss_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
610 int setopmode_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
611 int sitesurvey_cmd_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
612 int setauth_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
613 int setkey_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
614 int set_stakey_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
615 int set_assocsta_hdl(struct rtw_adapter
*padapter
, const u8
*pbuf
);
616 int del_assocsta_hdl(struct rtw_adapter
*padapter
, const u8
*pbuf
);
617 int add_ba_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
619 int mlme_evt_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
620 int h2c_msg_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
621 int tx_beacon_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
622 int set_ch_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
623 int set_chplan_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
624 int led_blink_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
625 int set_csa_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
); /* Kurt: Handling DFS channel switch announcement ie. */
626 int tdls_hdl23a(struct rtw_adapter
*padapter
, const u8
*pbuf
);
628 #define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl23a},
629 #define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd},
631 struct C2HEvent_Header
{
632 #ifdef __LITTLE_ENDIAN
638 #elif defined(__BIG_ENDIAN)
646 # error "Must be LITTLE or BIG Endian"
654 GEN_EVT_CODE(_Read_MACREG
) = 0, /*0*/
655 GEN_EVT_CODE(_Read_BBREG
),
656 GEN_EVT_CODE(_Read_RFREG
),
657 GEN_EVT_CODE(_Read_EEPROM
),
658 GEN_EVT_CODE(_Read_EFUSE
),
659 GEN_EVT_CODE(_Read_CAM
), /*5*/
660 GEN_EVT_CODE(_Get_BasicRate
),
661 GEN_EVT_CODE(_Get_DataRate
),
662 GEN_EVT_CODE(_Survey
), /*8*/
663 GEN_EVT_CODE(_SurveyDone
), /*9*/
665 GEN_EVT_CODE(_JoinBss
) , /*10*/
666 GEN_EVT_CODE(_AddSTA
),
667 GEN_EVT_CODE(_DelSTA
),
668 GEN_EVT_CODE(_AtimDone
) ,
669 GEN_EVT_CODE(_TX_Report
),
670 GEN_EVT_CODE(_CCX_Report
), /*15*/
671 GEN_EVT_CODE(_DTM_Report
),
672 GEN_EVT_CODE(_TX_Rate_Statistics
),
673 GEN_EVT_CODE(_C2HLBK
),
674 GEN_EVT_CODE(_FWDBG
),
675 GEN_EVT_CODE(_C2HFEEDBACK
), /*20*/
676 GEN_EVT_CODE(_ADDBA
),
677 GEN_EVT_CODE(_C2HBCN
),
678 GEN_EVT_CODE(_ReportPwrState
), /* filen: only for PCIE, USB */
679 GEN_EVT_CODE(_CloseRF
), /* filen: only for PCIE, work around ASPM */