Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dot11d.h
Go to the documentation of this file.
1 #ifndef __INC_DOT11D_H
2 #define __INC_DOT11D_H
3 
4 #include "ieee80211.h"
5 
6 //#define ENABLE_DOT11D
7 
8 //#define DOT11D_MAX_CHNL_NUM 83
9 
10 typedef struct _CHNL_TXPOWER_TRIPLE {
15 
16 typedef enum _DOT11D_STATE {
21 
22 typedef struct _RT_DOT11D_INFO {
23  //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
24 
25  bool bEnabled; // dot11MultiDomainCapabilityEnabled
26 
27  u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
29  u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
31 
33  //u8 ChnlListLen; // #Bytes valid in ChnlList[].
34  //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
36 
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 )
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])
41 #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
42 
43 #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
44 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
45 
46 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
47 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
48 
49 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
50  (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
51  FALSE : \
52  (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
53 
54 #define CIE_WATCHDOG_TH 1
55 #define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
56 #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
57 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
58 
59 #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
60 
61 
62 void
64  struct ieee80211_device *dev
65  );
66 
67 void
69  struct ieee80211_device *dev
70  );
71 
72 void
74  struct ieee80211_device *dev,
75  u8 * pTaddr,
76  u16 CoutryIeLen,
77  u8 * pCoutryIe
78  );
79 
80 u8
82  struct ieee80211_device *dev,
83  u8 Channel
84  );
85 
86 void
88  struct ieee80211_device * dev
89  );
90 
91 int IsLegalChannel(
92  struct ieee80211_device * dev,
93  u8 channel
94 );
95 
96 int ToLegalChannel(
97  struct ieee80211_device * dev,
98  u8 channel
99 );
100 #endif // #ifndef __INC_DOT11D_H