2009-11-03 09:17:11 +00:00
|
|
|
#ifndef __INC_DOT11D_H
|
|
|
|
#define __INC_DOT11D_H
|
|
|
|
|
|
|
|
#ifdef ENABLE_DOT11D
|
|
|
|
#include "ieee80211.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _CHNL_TXPOWER_TRIPLE {
|
|
|
|
u8 FirstChnl;
|
|
|
|
u8 NumChnls;
|
|
|
|
u8 MaxTxPowerInDbm;
|
2010-04-11 10:39:47 +00:00
|
|
|
} CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
|
2009-11-03 09:17:11 +00:00
|
|
|
|
|
|
|
typedef enum _DOT11D_STATE {
|
|
|
|
DOT11D_STATE_NONE = 0,
|
|
|
|
DOT11D_STATE_LEARNED,
|
|
|
|
DOT11D_STATE_DONE,
|
2010-04-11 10:39:47 +00:00
|
|
|
} DOT11D_STATE;
|
2009-11-03 09:17:11 +00:00
|
|
|
|
|
|
|
typedef struct _RT_DOT11D_INFO {
|
2010-04-11 10:39:47 +00:00
|
|
|
/* DECLARE_RT_OBJECT(RT_DOT11D_INFO); */
|
2009-11-03 09:17:11 +00:00
|
|
|
|
2010-04-11 10:39:47 +00:00
|
|
|
bool bEnabled; /* dot11MultiDomainCapabilityEnabled */
|
2009-11-03 09:17:11 +00:00
|
|
|
|
2010-04-11 10:39:47 +00:00
|
|
|
u16 CountryIeLen; /* > 0 if CountryIeBuf[] contains valid country information element. */
|
2009-11-03 09:17:11 +00:00
|
|
|
u8 CountryIeBuf[MAX_IE_LEN];
|
2010-04-11 10:39:47 +00:00
|
|
|
u8 CountryIeSrcAddr[6]; /* Source AP of the country IE. */
|
2009-11-03 09:17:11 +00:00
|
|
|
u8 CountryIeWatchdog;
|
|
|
|
|
2010-04-11 10:39:47 +00:00
|
|
|
u8 channel_map[MAX_CHANNEL_NUMBER+1]; /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
|
2009-11-03 09:17:11 +00:00
|
|
|
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
|
|
|
|
|
|
|
|
DOT11D_STATE State;
|
2010-04-11 10:39:47 +00:00
|
|
|
} RT_DOT11D_INFO, *PRT_DOT11D_INFO;
|
|
|
|
#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)
|
|
|
|
#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])
|
2009-11-03 09:17:11 +00:00
|
|
|
#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
|
|
|
|
|
2010-04-11 10:39:47 +00:00
|
|
|
#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
|
2009-11-03 09:17:11 +00:00
|
|
|
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
|
|
|
|
|
|
|
|
#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
|
|
|
|
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
|
|
|
|
|
|
|
|
#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
|
|
|
|
(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
|
|
|
|
FALSE : \
|
|
|
|
(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
|
|
|
|
|
|
|
|
#define CIE_WATCHDOG_TH 1
|
2010-04-11 10:39:47 +00:00
|
|
|
#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
|
2009-11-03 09:17:11 +00:00
|
|
|
#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
|
2010-04-11 10:39:47 +00:00
|
|
|
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
|
2009-11-03 09:17:11 +00:00
|
|
|
|
|
|
|
#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
Dot11d_Init(
|
|
|
|
struct ieee80211_device *dev
|
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
Dot11d_Reset(
|
|
|
|
struct ieee80211_device *dev
|
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
Dot11d_UpdateCountryIe(
|
|
|
|
struct ieee80211_device *dev,
|
2010-04-11 10:39:47 +00:00
|
|
|
u8 *pTaddr,
|
|
|
|
u16 CoutryIeLen,
|
|
|
|
u8 *pCoutryIe
|
2009-11-03 09:17:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
u8
|
|
|
|
DOT11D_GetMaxTxPwrInDbm(
|
|
|
|
struct ieee80211_device *dev,
|
|
|
|
u8 Channel
|
|
|
|
);
|
|
|
|
|
|
|
|
void
|
|
|
|
DOT11D_ScanComplete(
|
2010-04-11 10:39:47 +00:00
|
|
|
struct ieee80211_device *dev
|
2009-11-03 09:17:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
int IsLegalChannel(
|
2010-04-11 10:39:47 +00:00
|
|
|
struct ieee80211_device *dev,
|
2009-11-03 09:17:11 +00:00
|
|
|
u8 channel
|
|
|
|
);
|
|
|
|
|
|
|
|
int ToLegalChannel(
|
2010-04-11 10:39:47 +00:00
|
|
|
struct ieee80211_device *dev,
|
2009-11-03 09:17:11 +00:00
|
|
|
u8 channel
|
|
|
|
);
|
2010-04-11 10:39:47 +00:00
|
|
|
#endif /* ENABLE_DOT11D */
|
|
|
|
#endif /* #ifndef __INC_DOT11D_H */
|