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,
187 LED_CTL_STOP_WPS_FAIL
= 12,
188 LED_CTL_STOP_WPS_FAIL_OVERLAP
= 13,
191 typedef union _frameqos
{
203 static inline u8
Frame_QoSTID(u8
*buf
)
205 struct ieee80211_hdr_3addr
*hdr
= (struct ieee80211_hdr_3addr
*)buf
;
206 u16 fc
= le16_to_cpu(hdr
->frame_control
);
208 return (u8
)((frameqos
*)(buf
+
209 (((fc
& IEEE80211_FCTL_TODS
) &&
210 (fc
& IEEE80211_FCTL_FROMDS
)) ? 30 : 24)))->field
.tid
;
214 ERP_NonERPpresent
= 1,
215 ERP_UseProtection
= 2,
216 ERP_BarkerPreambleMode
= 4,
219 struct bandwidth_autoswitch
{
220 long threshold_20Mhzto40Mhz
;
221 long threshold_40Mhzto20Mhz
;
222 bool bforced_tx20Mhz
;
223 bool bautoswitch_enable
;
226 #define REORDER_WIN_SIZE 128
227 #define REORDER_ENTRY_NUM 128
228 typedef struct _RX_REORDER_ENTRY
{
229 struct list_head List
;
231 struct ieee80211_rxb
*prxb
;
232 } RX_REORDER_ENTRY
, *PRX_REORDER_ENTRY
;
234 typedef enum _Fsync_State
{
240 /* Power save mode configured. */
241 typedef enum _RT_PS_MODE
{
242 eActive
, /* Active/Continuous access. */
243 eMaxPs
, /* Max power save mode. */
244 eFastPs
/* Fast power save mode. */
247 typedef enum _IPS_CALLBACK_FUNCION
{
248 IPS_CALLBACK_NONE
= 0,
249 IPS_CALLBACK_MGNT_LINK_REQUEST
= 1,
250 IPS_CALLBACK_JOIN_REQUEST
= 2,
251 } IPS_CALLBACK_FUNCION
;
253 typedef enum _RT_JOIN_ACTION
{
264 /* Max num of support rates element: 8, Max num of ext. support rate: 255. */
265 #define MAX_NUM_RATES 264
267 typedef enum _RT_RF_POWER_STATE
{
273 struct rt_power_save_control
{
274 /* Inactive Power Save (IPS): disable RF when disconnected */
277 bool bHaltAdapterClkRQ
;
278 bool bSwRfProcessing
;
279 RT_RF_POWER_STATE eInactivePowerState
;
280 struct work_struct InactivePsWorkItem
;
281 struct timer_list InactivePsTimer
;
283 /* return point for join action */
284 IPS_CALLBACK_FUNCION ReturnPoint
;
286 /* Recored Parameters for rescheduled JoinRequest */
288 RT_JOIN_ACTION tmpJoinAction
;
289 struct ieee80211_network tmpBssDesc
;
291 /* Recored Parameters for rescheduled MgntLinkRequest */
294 bool bTmpFilterHiddenAP
;
295 bool bTmpUpdateParms
;
297 OCTET_STRING tmpSsid2Scan
;
304 OCTET_STRING tmpSuppRateSet
;
305 u8 tmpSuppRateBuf
[MAX_NUM_RATES
];
307 struct ibss_parms tmpIbpm
;
310 /* Leisre Poswer Save: disable RF if connected but traffic isn't busy */
314 u8 RegMaxLPSAwakeIntvl
;
325 /* Record if there is a link request in IPS RF off progress. */
326 bool LinkReqInIPSRFOffPgs
;
328 * To make sure that connect info should be executed, so we set the
329 * bit to filter the link info which comes after the connect info.
331 bool BufConnectinfoBefore
;
335 RF_CHANGE_BY_SW
= BIT31
,
336 RF_CHANGE_BY_HW
= BIT30
,
337 RF_CHANGE_BY_PS
= BIT29
,
338 RF_CHANGE_BY_IPS
= BIT28
,
341 /* Firmware related CMD IO. */
342 typedef enum _FW_CMD_IO_TYPE
{
343 FW_CMD_DIG_ENABLE
= 0, /* for DIG DM */
344 FW_CMD_DIG_DISABLE
= 1,
346 FW_CMD_DIG_RESUME
= 3,
347 FW_CMD_HIGH_PWR_ENABLE
= 4, /* for DIG DM */
348 FW_CMD_HIGH_PWR_DISABLE
= 5,
349 FW_CMD_RA_RESET
= 6, /* for DIG DM */
351 FW_CMD_RA_REFRESH_N
= 8,
352 FW_CMD_RA_REFRESH_BG
= 9,
353 FW_CMD_RA_INIT
= 10, /* for FW supported IQK */
354 FW_CMD_IQK_ENABLE
= 11, /* Tx power tracking switch */
355 FW_CMD_TXPWR_TRACK_ENABLE
= 12, /* Tx power tracking switch */
356 FW_CMD_TXPWR_TRACK_DISABLE
= 13,
357 FW_CMD_TXPWR_TRACK_THERMAL
= 14,
358 FW_CMD_PAUSE_DM_BY_SCAN
= 15,
359 /* indicate firmware that driver enters LPS, for PS-Poll hardware bug */
360 FW_CMD_RESUME_DM_BY_SCAN
= 16,
361 /* indicate firmware that driver leave LPS */
362 FW_CMD_RA_REFRESH_N_COMB
= 17,
363 FW_CMD_RA_REFRESH_BG_COMB
= 18,
364 FW_CMD_ANTENNA_SW_ENABLE
= 19,
365 FW_CMD_ANTENNA_SW_DISABLE
= 20,
366 FW_CMD_TX_FEEDBACK_CCX_ENABLE
= 21,
367 FW_CMD_LPS_ENTER
= 22,
368 FW_CMD_LPS_LEAVE
= 23,
369 FW_CMD_DIG_MODE_SS
= 24,
370 FW_CMD_DIG_MODE_FA
= 25,
371 FW_CMD_ADD_A2_ENTRY
= 26,
372 FW_CMD_CTRL_DM_BY_DRIVER
= 27,
373 FW_CMD_CTRL_DM_BY_DRIVER_NEW
= 28,
374 }FW_CMD_IO_TYPE
,*PFW_CMD_IO_TYPE
;
376 #define RT_MAX_LD_SLOT_NUM 10
377 struct rt_link_detect
{
378 u32 NumRecvBcnInPeriod
;
379 u32 NumRecvDataInPeriod
;
381 /* number of Rx beacon / CheckForHang_period to determine link status */
382 u32 RxBcnNum
[RT_MAX_LD_SLOT_NUM
];
383 /* number of Rx data / CheckForHang_period to determine link status */
384 u32 RxDataNum
[RT_MAX_LD_SLOT_NUM
];
385 /* number of CheckForHang period to determine link status */
395 #define MAX_RECEIVE_BUFFER_SIZE 9100
396 extern void HTDebugHTCapability(u8
*CapIE
, u8
*TitleString
);
397 extern void HTDebugHTInfo(u8
*InfoIE
, u8
*TitleString
);
399 extern void HTSetConnectBwMode(struct ieee80211_device
*ieee
,
400 HT_CHANNEL_WIDTH Bandwidth
,
401 HT_EXTCHNL_OFFSET Offset
);
402 extern void HTUpdateDefaultSetting(struct ieee80211_device
*ieee
);
403 extern void HTConstructCapabilityElement(struct ieee80211_device
*ieee
,
404 u8
*posHTCap
, u8
*len
, u8 isEncrypt
);
405 extern void HTConstructInfoElement(struct ieee80211_device
*ieee
,
406 u8
*posHTInfo
, u8
*len
, u8 isEncrypt
);
407 extern void HTConstructRT2RTAggElement(struct ieee80211_device
*ieee
,
408 u8
*posRT2RTAgg
, u8
*len
);
409 extern void HTOnAssocRsp(struct ieee80211_device
*ieee
);
410 extern void HTInitializeHTInfo(struct ieee80211_device
*ieee
);
411 extern void HTInitializeBssDesc(PBSS_HT pBssHT
);
412 extern void HTResetSelfAndSavePeerSetting(struct ieee80211_device
*ieee
,
413 struct ieee80211_network
*pNetwork
);
414 extern void HTUpdateSelfAndPeerSetting(struct ieee80211_device
*ieee
,
415 struct ieee80211_network
*pNetwork
);
416 extern u8
HTGetHighestMCSRate(struct ieee80211_device
*ieee
, u8
*pMCSRateSet
,
418 extern u8 MCS_FILTER_ALL
[];
419 extern u16 MCS_DATA_RATE
[2][2][77] ;
420 extern u8
HTCCheck(struct ieee80211_device
*ieee
, u8
*pFrame
);
421 extern void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo
);
422 extern bool IsHTHalfNmodeAPs(struct ieee80211_device
*ieee
);
423 extern u16
HTHalfMcsToDataRate(struct ieee80211_device
*ieee
, u8 nMcsRate
);
424 extern u16
HTMcsToDataRate(struct ieee80211_device
*ieee
, u8 nMcsRate
);
425 extern u16
TxCountToDataRate(struct ieee80211_device
*ieee
, u8 nDataRate
);
426 extern int ieee80211_rx_ADDBAReq(struct ieee80211_device
*ieee
,
427 struct sk_buff
*skb
);
428 extern int ieee80211_rx_ADDBARsp(struct ieee80211_device
*ieee
,
429 struct sk_buff
*skb
);
430 extern int ieee80211_rx_DELBA(struct ieee80211_device
*ieee
,
431 struct sk_buff
*skb
);
432 extern void TsInitAddBA(struct ieee80211_device
*ieee
, PTX_TS_RECORD pTS
,
433 u8 Policy
, u8 bOverwritePending
);
434 extern void TsInitDelBA(struct ieee80211_device
*ieee
,
435 PTS_COMMON_INFO pTsCommonInfo
, TR_SELECT TxRxSelect
);
436 extern void BaSetupTimeOut(unsigned long data
);
437 extern void TxBaInactTimeout(unsigned long data
);
438 extern void RxBaInactTimeout(unsigned long data
);
439 extern void ResetBaEntry(PBA_RECORD pBA
);
440 extern bool GetTs(struct ieee80211_device
*ieee
, PTS_COMMON_INFO
*ppTS
,
441 u8
*Addr
, u8 TID
, TR_SELECT TxRxSelect
, /* Rx:1, Tx:0 */
443 extern void TSInitialize(struct ieee80211_device
*ieee
);
444 extern void TsStartAddBaProcess(struct ieee80211_device
*ieee
,
445 PTX_TS_RECORD pTxTS
);
446 extern void RemovePeerTS(struct ieee80211_device
*ieee
, u8
*Addr
);
447 extern void RemoveAllTS(struct ieee80211_device
*ieee
);
449 #endif /* __IEEE80211_R8192S_H */