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 /******************************************************************************
2  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3  *
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
7  * more details.
8  *
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
12  *
13  * The full GNU General Public License is included in this distribution in the
14  * file called LICENSE.
15  *
16  * Contact Information:
17  * wlanfae <[email protected]>
18 ******************************************************************************/
19 #ifndef __INC_DOT11D_H
20 #define __INC_DOT11D_H
21 
22 #include "rtllib.h"
23 
24 
25 
30 };
31 
36 };
37 
49 
50  bool bEnabled;
51 
56 
59 
61 };
62 
63 static inline void cpMacAddr(unsigned char *des, unsigned char *src)
64 {
65  memcpy(des, src, 6);
66 }
67 
68 #define GET_DOT11D_INFO(__pIeeeDev) \
69  ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
70 
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)
75 
76 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
77  eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
78 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
79  cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
80 
81 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
82  (((__Ie).Length == 0 || (__Ie).Length != \
83  GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
84  false : (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, \
85  (__Ie).Octet, (__Ie).Length)))
86 
87 #define CIE_WATCHDOG_TH 1
88 #define GET_CIE_WATCHDOG(__pIeeeDev) \
89  (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
90 #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
91 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
92 
93 #define IS_DOT11D_STATE_DONE(__pIeeeDev) \
94  (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
95 
96 void dot11d_init(struct rtllib_device *dev);
98 void Dot11d_Reset(struct rtllib_device *dev);
99 void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
100  u16 CoutryIeLen, u8 *pCoutryIe);
104 
105 #endif