1 #ifndef __INC_DOT11D_H
\r
2 #define __INC_DOT11D_H
\r
4 #include "ieee80211.h"
\r
6 //#define ENABLE_DOT11D
\r
8 //#define DOT11D_MAX_CHNL_NUM 83
\r
10 typedef struct _CHNL_TXPOWER_TRIPLE {
\r
14 }CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
\r
16 typedef enum _DOT11D_STATE {
\r
17 DOT11D_STATE_NONE = 0,
\r
18 DOT11D_STATE_LEARNED,
\r
22 typedef struct _RT_DOT11D_INFO {
\r
23 //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
\r
25 bool bEnabled; // dot11MultiDomainCapabilityEnabled
\r
27 u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
\r
28 u8 CountryIeBuf[MAX_IE_LEN];
\r
29 u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
\r
30 u8 CountryIeWatchdog;
\r
32 u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
\r
33 //u8 ChnlListLen; // #Bytes valid in ChnlList[].
\r
34 //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
\r
35 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
\r
38 }RT_DOT11D_INFO, *PRT_DOT11D_INFO;
\r
39 #define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
\r
40 #define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
\r
41 #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
\r
43 #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
\r
44 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
\r
46 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
\r
47 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
\r
49 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
\r
50 (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
\r
52 (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
\r
54 #define CIE_WATCHDOG_TH 1
\r
55 #define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
\r
56 #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
\r
57 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
\r
59 #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
\r
64 struct ieee80211_device *dev
\r
69 struct ieee80211_device *dev
\r
73 Dot11d_UpdateCountryIe(
\r
74 struct ieee80211_device *dev,
\r
81 DOT11D_GetMaxTxPwrInDbm(
\r
82 struct ieee80211_device *dev,
\r
87 DOT11D_ScanComplete(
\r
88 struct ieee80211_device * dev
\r
92 struct ieee80211_device * dev,
\r
97 struct ieee80211_device * dev,
\r
101 void dump_chnl_map(u8 * channel_map);
\r
102 #endif // #ifndef __INC_DOT11D_H
\r