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 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
13 * The full GNU General Public License is included in this distribution in the
14 * file called LICENSE.
16 * Contact Information:
18 ******************************************************************************/
19 #ifndef __INC_DOT11D_H
20 #define __INC_DOT11D_H
26 struct chnl_txpow_triple {
33 DOT11D_STATE_NONE = 0,
39 * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if @CountryIeBuf contains
40 * valid country information element.
41 * @channel_map: holds channel values
43 * 1 - valid (active scan),
44 * 2 - valid (passive scan)
45 * @CountryIeSrcAddr - Source AP of the country IE
48 struct rt_dot11d_info {
53 u8 CountryIeBuf[MAX_IE_LEN];
54 u8 CountryIeSrcAddr[6];
57 u8 channel_map[MAX_CHANNEL_NUMBER+1];
58 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
60 enum dot11d_state State;
63 static inline void cpMacAddr(unsigned char *des, unsigned char *src)
68 #define GET_DOT11D_INFO(__pIeeeDev) \
69 ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
71 #define IS_DOT11D_ENABLE(__pIeeeDev) \
72 (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
73 #define IS_COUNTRY_IE_VALID(__pIeeeDev) \
74 (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
76 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
77 ether_addr_equal_unaligned( \
78 GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
79 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
80 cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
82 #define GET_CIE_WATCHDOG(__pIeeeDev) \
83 (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
84 static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
86 GET_CIE_WATCHDOG(__pIeeeDev) = 0;
88 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
90 void dot11d_init(struct rtllib_device *dev);
91 void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
92 void Dot11d_Reset(struct rtllib_device *dev);
93 void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
94 u16 CoutryIeLen, u8 *pCoutryIe);
95 void DOT11D_ScanComplete(struct rtllib_device *dev);