]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - drivers/staging/rtl8192e/dot11d.h
Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[mirror_ubuntu-eoan-kernel.git] / drivers / staging / rtl8192e / dot11d.h
CommitLineData
94a79942
LF
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 <wlanfae@realtek.com>
18******************************************************************************/
19#ifndef __INC_DOT11D_H
20#define __INC_DOT11D_H
21
22#include "rtllib.h"
23
24
25
26struct chnl_txpow_triple {
ecdfa446
GKH
27 u8 FirstChnl;
28 u8 NumChnls;
29 u8 MaxTxPowerInDbm;
45ce3f6f 30};
ecdfa446 31
94a79942 32enum dot11d_state {
ecdfa446
GKH
33 DOT11D_STATE_NONE = 0,
34 DOT11D_STATE_LEARNED,
35 DOT11D_STATE_DONE,
45ce3f6f 36};
789d9dbd
RV
37
38/**
94a79942 39 * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if @CountryIeBuf contains
dc6b15f3 40 * valid country information element.
e0e2615a 41 * @channel_map: holds channel values
789d9dbd
RV
42 * 0 - invalid,
43 * 1 - valid (active scan),
dc6b15f3 44 * 2 - valid (passive scan)
789d9dbd
RV
45 * @CountryIeSrcAddr - Source AP of the country IE
46 */
ecdfa446 47
94a79942
LF
48struct rt_dot11d_info {
49
789d9dbd 50 bool bEnabled;
ecdfa446 51
789d9dbd 52 u16 CountryIeLen;
94a79942
LF
53 u8 CountryIeBuf[MAX_IE_LEN];
54 u8 CountryIeSrcAddr[6];
55 u8 CountryIeWatchdog;
ecdfa446 56
94a79942
LF
57 u8 channel_map[MAX_CHANNEL_NUMBER+1];
58 u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
ecdfa446 59
94a79942 60 enum dot11d_state State;
45ce3f6f 61};
789d9dbd 62
dd184733
MM
63static inline void cpMacAddr(unsigned char *des, unsigned char *src)
64{
65 memcpy(des, src, 6);
66}
789d9dbd 67
94a79942
LF
68#define GET_DOT11D_INFO(__pIeeeDev) \
69 ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
ecdfa446 70
94a79942
LF
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)
ecdfa446 75
94a79942 76#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
35e33b04
MK
77 ether_addr_equal_unaligned( \
78 GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
94a79942
LF
79#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
80 cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
ecdfa446 81
94a79942
LF
82#define GET_CIE_WATCHDOG(__pIeeeDev) \
83 (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
fa7b3d02
HS
84static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
85{
86 GET_CIE_WATCHDOG(__pIeeeDev) = 0;
87}
dc6b15f3 88#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
ecdfa446 89
976d5341 90void dot11d_init(struct rtllib_device *dev);
94a79942
LF
91void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
92void Dot11d_Reset(struct rtllib_device *dev);
93void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
94 u16 CoutryIeLen, u8 *pCoutryIe);
94a79942 95void DOT11D_ScanComplete(struct rtllib_device *dev);
789d9dbd 96
94a79942 97#endif