2011-08-24 02:00:42 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* The full GNU General Public License is included in this distribution in the
|
|
|
|
* file called LICENSE.
|
|
|
|
*
|
|
|
|
* Contact Information:
|
|
|
|
* wlanfae <wlanfae@realtek.com>
|
2017-02-01 20:19:42 +01:00
|
|
|
******************************************************************************/
|
2011-08-24 02:00:42 +02:00
|
|
|
#ifndef __INC_DOT11D_H
|
|
|
|
#define __INC_DOT11D_H
|
|
|
|
|
|
|
|
#include "rtllib.h"
|
|
|
|
|
|
|
|
struct chnl_txpow_triple {
|
2009-08-05 00:57:55 +02:00
|
|
|
u8 FirstChnl;
|
|
|
|
u8 NumChnls;
|
|
|
|
u8 MaxTxPowerInDbm;
|
2011-06-05 19:24:33 +02:00
|
|
|
};
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
enum dot11d_state {
|
2009-08-05 00:57:55 +02:00
|
|
|
DOT11D_STATE_NONE = 0,
|
|
|
|
DOT11D_STATE_LEARNED,
|
|
|
|
DOT11D_STATE_DONE,
|
2011-06-05 19:24:33 +02:00
|
|
|
};
|
2009-12-05 05:42:53 +01:00
|
|
|
|
|
|
|
/**
|
2017-06-03 04:40:33 +02:00
|
|
|
* struct rt_dot11d_info * @CountryIeLen: value greater than 0 if
|
|
|
|
* @CountryIeBuf contains valid country information element.
|
2013-09-16 02:58:07 +02:00
|
|
|
* @channel_map: holds channel values
|
2009-12-05 05:42:53 +01:00
|
|
|
* 0 - invalid,
|
|
|
|
* 1 - valid (active scan),
|
2011-06-05 19:24:32 +02:00
|
|
|
* 2 - valid (passive scan)
|
2009-12-05 05:42:53 +01:00
|
|
|
* @CountryIeSrcAddr - Source AP of the country IE
|
|
|
|
*/
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
struct rt_dot11d_info {
|
2009-12-05 05:42:53 +01:00
|
|
|
bool bEnabled;
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2009-12-05 05:42:53 +01:00
|
|
|
u16 CountryIeLen;
|
2011-08-24 02:00:42 +02:00
|
|
|
u8 CountryIeBuf[MAX_IE_LEN];
|
|
|
|
u8 CountryIeSrcAddr[6];
|
|
|
|
u8 CountryIeWatchdog;
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2016-09-19 16:57:46 +02:00
|
|
|
u8 channel_map[MAX_CHANNEL_NUMBER + 1];
|
|
|
|
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER + 1];
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
enum dot11d_state State;
|
2011-06-05 19:24:33 +02:00
|
|
|
};
|
2009-12-05 05:42:53 +01:00
|
|
|
|
2010-12-27 13:49:49 +01:00
|
|
|
static inline void cpMacAddr(unsigned char *des, unsigned char *src)
|
|
|
|
{
|
|
|
|
memcpy(des, src, 6);
|
|
|
|
}
|
2009-12-05 05:42:53 +01:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
#define GET_DOT11D_INFO(__pIeeeDev) \
|
|
|
|
((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
#define IS_DOT11D_ENABLE(__pIeeeDev) \
|
|
|
|
(GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
|
|
|
|
#define IS_COUNTRY_IE_VALID(__pIeeeDev) \
|
|
|
|
(GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
|
2015-05-31 20:19:40 +02:00
|
|
|
ether_addr_equal_unaligned( \
|
|
|
|
GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
|
2011-08-24 02:00:42 +02:00
|
|
|
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
|
|
|
|
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
#define GET_CIE_WATCHDOG(__pIeeeDev) \
|
|
|
|
(GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
|
2013-11-09 22:34:54 +01:00
|
|
|
static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
|
|
|
|
{
|
|
|
|
GET_CIE_WATCHDOG(__pIeeeDev) = 0;
|
|
|
|
}
|
2016-09-19 16:57:56 +02:00
|
|
|
|
2011-06-05 19:24:32 +02:00
|
|
|
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
|
2009-08-05 00:57:55 +02:00
|
|
|
|
2011-11-30 21:18:52 +01:00
|
|
|
void dot11d_init(struct rtllib_device *dev);
|
2011-08-24 02:00:42 +02:00
|
|
|
void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
|
|
|
|
void Dot11d_Reset(struct rtllib_device *dev);
|
|
|
|
void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
|
|
|
|
u16 CoutryIeLen, u8 *pCoutryIe);
|
|
|
|
void DOT11D_ScanComplete(struct rtllib_device *dev);
|
2009-12-05 05:42:53 +01:00
|
|
|
|
2011-08-24 02:00:42 +02:00
|
|
|
#endif
|