Full support for Ginger Console
[linux-ginger.git] / drivers / staging / rtl8192su / ieee80211 / dot11d.h
blob913ac5d97e753b583aef1467a72f8fd5d6f304aa
1 #ifndef __INC_DOT11D_H
2 #define __INC_DOT11D_H
4 #include "ieee80211.h"
6 //#define DOT11D_MAX_CHNL_NUM 83
8 typedef struct _CHNL_TXPOWER_TRIPLE {
9 u8 FirstChnl;
10 u8 NumChnls;
11 u8 MaxTxPowerInDbm;
12 }CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
14 typedef enum _DOT11D_STATE {
15 DOT11D_STATE_NONE = 0,
16 DOT11D_STATE_LEARNED,
17 DOT11D_STATE_DONE,
18 }DOT11D_STATE;
20 typedef struct _RT_DOT11D_INFO {
21 //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
23 bool bEnabled; // dot11MultiDomainCapabilityEnabled
25 u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
26 u8 CountryIeBuf[MAX_IE_LEN];
27 u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
28 u8 CountryIeWatchdog;
30 u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
31 //u8 ChnlListLen; // #Bytes valid in ChnlList[].
32 //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
33 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
35 DOT11D_STATE State;
36 }RT_DOT11D_INFO, *PRT_DOT11D_INFO;
37 #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 )
38 #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])
39 #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
41 #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
42 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
44 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
45 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
47 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
48 (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
49 FALSE : \
50 (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
52 #define CIE_WATCHDOG_TH 1
53 #define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog
54 #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
55 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
57 #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
60 void
61 Dot11d_Init(
62 struct ieee80211_device *dev
65 void
66 Dot11d_Reset(
67 struct ieee80211_device *dev
70 void
71 Dot11d_UpdateCountryIe(
72 struct ieee80211_device *dev,
73 u8 * pTaddr,
74 u16 CoutryIeLen,
75 u8 * pCoutryIe
79 DOT11D_GetMaxTxPwrInDbm(
80 struct ieee80211_device *dev,
81 u8 Channel
84 void
85 DOT11D_ScanComplete(
86 struct ieee80211_device * dev
89 int IsLegalChannel(
90 struct ieee80211_device * dev,
91 u8 channel
94 int ToLegalChannel(
95 struct ieee80211_device * dev,
96 u8 channel
98 #endif // #ifndef __INC_DOT11D_H