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