1 #ifndef __IEEE80211_R8192S_H
2 #define __IEEE80211_R8192S_H
4 /* added for rtl819x tx procedure */
5 #define MAX_QUEUE_SIZE 0x10
7 /* 8190 queue mapping */
20 NORMAL_QUEUE = MGNT_QUEUE
23 #define SWRF_TIMEOUT 50
26 /* Flag byte: byte 8, numbered from 0. */
27 #define IE_CISCO_FLAG_POSITION 0x08
28 #define SUPPORT_CKIP_MIC 0x08 /* bit3 */
29 #define SUPPORT_CKIP_PK 0x10 /* bit4 */
31 /* defined for skb cb field, at most 28 byte */
32 typedef struct cb_desc {
33 /* Tx Desc Related flags (8-9) */
39 u8 bTxDisableRateFallBack:1;
40 u8 bTxUseDriverAssingedRate:1;
41 u8 bHwSec:1; /* indicate whether use Hw security */
45 /* Tx Firmware Relaged flags (10-11) */
49 u8 bUseShortPreamble:1;
50 u8 bTxEnableFwCalcDur:1;
57 u8 bRTSUseShortPreamble:1;
64 /* Tx Desc related element(12-19) */
73 /* Tx firmware related element(20-27) */
133 #define FC_QOS_BIT BIT7
135 #define IsDataFrame(pdu) (((pdu[0] & 0x0C) == 0x08) ? true : false)
136 #define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0] & FC_QOS_BIT)))
137 #define IsQoSDataFrame(pframe) \
138 ((*(u16 *)pframe & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) \
139 == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))
141 #define Frame_Order(pframe) (*(u16 *)pframe & IEEE80211_FCTL_ORDER)
143 #define SN_LESS(a, b) (((a - b) & 0x800) != 0)
144 #define SN_EQUAL(a, b) (a == b)
146 #define MAX_DEV_ADDR_SIZE 8
168 /* InitialGainOpType */
175 typedef enum _LED_CTL_MODE {
176 LED_CTL_POWER_ON = 1,
181 LED_CTL_SITE_SURVEY = 6,
182 LED_CTL_POWER_OFF = 7,
183 LED_CTL_START_TO_LINK = 8,
184 LED_CTL_START_WPS = 9,
185 LED_CTL_STOP_WPS = 10,
186 LED_CTL_START_WPS_BOTTON = 11,
189 typedef union _frameqos {
201 static inline u8 Frame_QoSTID(u8 *buf)
203 struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr *)buf;
204 u16 fc = le16_to_cpu(hdr->frame_ctl);
206 return (u8)((frameqos *)(buf +
207 (((fc & IEEE80211_FCTL_TODS) &&
208 (fc & IEEE80211_FCTL_FROMDS)) ? 30 : 24)))->field.tid;
212 ERP_NonERPpresent = 1,
213 ERP_UseProtection = 2,
214 ERP_BarkerPreambleMode = 4,
217 struct bandwidth_autoswitch {
218 long threshold_20Mhzto40Mhz;
219 long threshold_40Mhzto20Mhz;
220 bool bforced_tx20Mhz;
221 bool bautoswitch_enable;
224 #define REORDER_WIN_SIZE 128
225 #define REORDER_ENTRY_NUM 128
226 typedef struct _RX_REORDER_ENTRY {
227 struct list_head List;
229 struct ieee80211_rxb *prxb;
230 } RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
232 typedef enum _Fsync_State{
238 /* Power save mode configured. */
239 typedef enum _RT_PS_MODE {
240 eActive, /* Active/Continuous access. */
241 eMaxPs, /* Max power save mode. */
242 eFastPs /* Fast power save mode. */
245 typedef enum _IPS_CALLBACK_FUNCION {
246 IPS_CALLBACK_NONE = 0,
247 IPS_CALLBACK_MGNT_LINK_REQUEST = 1,
248 IPS_CALLBACK_JOIN_REQUEST = 2,
249 } IPS_CALLBACK_FUNCION;
251 typedef enum _RT_JOIN_ACTION {
262 /* Max num of support rates element: 8, Max num of ext. support rate: 255. */
263 #define MAX_NUM_RATES 264
265 typedef enum _RT_RF_POWER_STATE {
271 struct rt_power_save_control {
272 /* Inactive Power Save (IPS): disable RF when disconnected */
275 bool bHaltAdapterClkRQ;
276 bool bSwRfProcessing;
277 RT_RF_POWER_STATE eInactivePowerState;
278 struct work_struct InactivePsWorkItem;
279 struct timer_list InactivePsTimer;
281 /* return point for join action */
282 IPS_CALLBACK_FUNCION ReturnPoint;
284 /* Recored Parameters for rescheduled JoinRequest */
286 RT_JOIN_ACTION tmpJoinAction;
287 struct ieee80211_network tmpBssDesc;
289 /* Recored Parameters for rescheduled MgntLinkRequest */
292 bool bTmpFilterHiddenAP;
293 bool bTmpUpdateParms;
295 OCTET_STRING tmpSsid2Scan;
302 OCTET_STRING tmpSuppRateSet;
303 u8 tmpSuppRateBuf[MAX_NUM_RATES];
305 struct ibss_parms tmpIbpm;
308 /* Leisre Poswer Save: disable RF if connected but traffic isn't busy */
312 u8 RegMaxLPSAwakeIntvl;
323 /* Record if there is a link request in IPS RF off progress. */
324 bool LinkReqInIPSRFOffPgs;
326 * To make sure that connect info should be executed, so we set the
327 * bit to filter the link info which comes after the connect info.
329 bool BufConnectinfoBefore;
333 RF_CHANGE_BY_SW = BIT31,
334 RF_CHANGE_BY_HW = BIT30,
335 RF_CHANGE_BY_PS = BIT29,
336 RF_CHANGE_BY_IPS = BIT28,
339 /* Firmware related CMD IO. */
340 typedef enum _FW_CMD_IO_TYPE {
341 FW_CMD_DIG_ENABLE = 0, /* for DIG DM */
342 FW_CMD_DIG_DISABLE = 1,
344 FW_CMD_DIG_RESUME = 3,
345 FW_CMD_HIGH_PWR_ENABLE = 4, /* for High Power DM */
346 FW_CMD_HIGH_PWR_DISABLE = 5,
347 FW_CMD_RA_RESET = 6, /* for Rate adaptive DM */
348 FW_CMD_RA_ACTIVE = 7,
349 FW_CMD_RA_REFRESH_N = 8,
350 FW_CMD_RA_REFRESH_BG = 9,
351 FW_CMD_IQK_ENABLE = 10, /* for FW supported IQK */
352 FW_CMD_TXPWR_TRACK_ENABLE = 11, /* Tx power tracking switch */
353 FW_CMD_TXPWR_TRACK_DISABLE = 12,/* Tx power tracking switch */
354 FW_CMD_PAUSE_DM_BY_SCAN = 13,
355 FW_CMD_RESUME_DM_BY_SCAN = 14,
356 FW_CMD_MID_HIGH_PWR_ENABLE = 15,
357 /* indicate firmware that driver enters LPS, for PS-Poll hardware bug */
358 FW_CMD_LPS_ENTER = 16,
359 /* indicate firmware that driver leave LPS */
360 FW_CMD_LPS_LEAVE = 17,
363 #define RT_MAX_LD_SLOT_NUM 10
364 struct rt_link_detect {
365 u32 NumRecvBcnInPeriod;
366 u32 NumRecvDataInPeriod;
368 /* number of Rx beacon / CheckForHang_period to determine link status */
369 u32 RxBcnNum[RT_MAX_LD_SLOT_NUM];
370 /* number of Rx data / CheckForHang_period to determine link status */
371 u32 RxDataNum[RT_MAX_LD_SLOT_NUM];
372 /* number of CheckForHang period to determine link status */
382 #define MAX_RECEIVE_BUFFER_SIZE 9100
383 extern void HTDebugHTCapability(u8 *CapIE, u8 *TitleString);
384 extern void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString);
386 extern void HTSetConnectBwMode(struct ieee80211_device *ieee,
387 HT_CHANNEL_WIDTH Bandwidth,
388 HT_EXTCHNL_OFFSET Offset);
389 extern void HTUpdateDefaultSetting(struct ieee80211_device *ieee);
390 extern void HTConstructCapabilityElement(struct ieee80211_device *ieee,
391 u8 *posHTCap, u8 *len, u8 isEncrypt);
392 extern void HTConstructInfoElement(struct ieee80211_device *ieee,
393 u8 *posHTInfo, u8 *len, u8 isEncrypt);
394 extern void HTConstructRT2RTAggElement(struct ieee80211_device *ieee,
395 u8 *posRT2RTAgg, u8 *len);
396 extern void HTOnAssocRsp(struct ieee80211_device *ieee);
397 extern void HTInitializeHTInfo(struct ieee80211_device *ieee);
398 extern void HTInitializeBssDesc(PBSS_HT pBssHT);
399 extern void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee,
400 struct ieee80211_network *pNetwork);
401 extern void HTUpdateSelfAndPeerSetting(struct ieee80211_device *ieee,
402 struct ieee80211_network *pNetwork);
403 extern u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, u8 *pMCSRateSet,
405 extern u8 MCS_FILTER_ALL[];
406 extern u16 MCS_DATA_RATE[2][2][77] ;
407 extern u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame);
408 extern void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo);
409 extern bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee);
410 extern u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate);
411 extern u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate);
412 extern u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate);
413 extern int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee,
414 struct sk_buff *skb);
415 extern int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee,
416 struct sk_buff *skb);
417 extern int ieee80211_rx_DELBA(struct ieee80211_device *ieee,
418 struct sk_buff *skb);
419 extern void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS,
420 u8 Policy, u8 bOverwritePending);
421 extern void TsInitDelBA(struct ieee80211_device *ieee,
422 PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect);
423 extern void BaSetupTimeOut(unsigned long data);
424 extern void TxBaInactTimeout(unsigned long data);
425 extern void RxBaInactTimeout(unsigned long data);
426 extern void ResetBaEntry(PBA_RECORD pBA);
427 extern bool GetTs(struct ieee80211_device *ieee, PTS_COMMON_INFO *ppTS,
428 u8 *Addr, u8 TID, TR_SELECT TxRxSelect, /* Rx:1, Tx:0 */
430 extern void TSInitialize(struct ieee80211_device *ieee);
431 extern void TsStartAddBaProcess(struct ieee80211_device *ieee,
432 PTX_TS_RECORD pTxTS);
433 extern void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr);
434 extern void RemoveAllTS(struct ieee80211_device *ieee);
436 #endif /* __IEEE80211_R8192S_H */