1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * This program is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9 * The full GNU General Public License is included in this distribution in the
10 * file called LICENSE.
12 * Contact Information:
13 * wlanfae <wlanfae@realtek.com>
14 ******************************************************************************/
15 #ifndef __INC_DOT11D_H
16 #define __INC_DOT11D_H
22 struct chnl_txpow_triple {
29 DOT11D_STATE_NONE = 0,
35 * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if @CountryIeBuf contains
36 * valid country information element.
37 * @channel_map: holds channel values
39 * 1 - valid (active scan),
40 * 2 - valid (passive scan)
41 * @CountryIeSrcAddr - Source AP of the country IE
44 struct rt_dot11d_info {
49 u8 CountryIeBuf[MAX_IE_LEN];
50 u8 CountryIeSrcAddr[6];
53 u8 channel_map[MAX_CHANNEL_NUMBER+1];
54 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
56 enum dot11d_state State;
59 static inline void cpMacAddr(unsigned char *des, unsigned char *src)
64 #define GET_DOT11D_INFO(__pIeeeDev) \
65 ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
67 #define IS_DOT11D_ENABLE(__pIeeeDev) \
68 (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
69 #define IS_COUNTRY_IE_VALID(__pIeeeDev) \
70 (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
72 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
73 ether_addr_equal_unaligned( \
74 GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
75 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
76 cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
78 #define GET_CIE_WATCHDOG(__pIeeeDev) \
79 (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
80 static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
82 GET_CIE_WATCHDOG(__pIeeeDev) = 0;
84 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
86 void dot11d_init(struct rtllib_device *dev);
87 void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
88 void Dot11d_Reset(struct rtllib_device *dev);
89 void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
90 u16 CoutryIeLen, u8 *pCoutryIe);
91 void DOT11D_ScanComplete(struct rtllib_device *dev);