diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2011-08-24 04:00:42 +0400 |
---|---|---|
committer | Larry Finger <Larry.Finger@lwfinger.net> | 2011-08-24 04:00:42 +0400 |
commit | 94a799425eee8225a1e3fbe5f473d2ef04002577 (patch) | |
tree | e4d188ca8f652c6b61859472fe9de05ef8ae33b3 /drivers/staging/rtl8192e/dot11d.h | |
parent | 8cfcabf80c875aff5f3dad1ffdf48096f5be1f7f (diff) | |
download | linux-94a799425eee8225a1e3fbe5f473d2ef04002577.tar.xz |
From: wlanfae <wlanfae@realtek.com>
[PATCH 1/8] rtl8192e: Import new version of driver from realtek
Signed-off-by: wlanfae <wlanfae@realtek.com>
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Diffstat (limited to 'drivers/staging/rtl8192e/dot11d.h')
-rw-r--r-- | drivers/staging/rtl8192e/dot11d.h | 113 |
1 files changed, 62 insertions, 51 deletions
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h index 8e644614f21d..032f7004a7f0 100644 --- a/drivers/staging/rtl8192e/dot11d.h +++ b/drivers/staging/rtl8192e/dot11d.h @@ -1,24 +1,42 @@ -#ifndef INC_DOT11D_H -#define INC_DOT11D_H - -#ifdef ENABLE_DOT11D -#include "ieee80211.h" - -struct _CHNL_TXPOWER_TRIPLE { +/****************************************************************************** + * 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. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * The full GNU General Public License is included in this distribution in the + * file called LICENSE. + * + * Contact Information: + * wlanfae <wlanfae@realtek.com> +******************************************************************************/ +#ifndef __INC_DOT11D_H +#define __INC_DOT11D_H + +#include "rtllib.h" + + + +struct chnl_txpow_triple { u8 FirstChnl; u8 NumChnls; u8 MaxTxPowerInDbm; }; -enum _DOT11D_STATE { +enum dot11d_state { DOT11D_STATE_NONE = 0, DOT11D_STATE_LEARNED, DOT11D_STATE_DONE, }; /** - * struct _RT_DOT11D_INFO - * @CountryIeLen: value greater than 0 if @CountryIeBuf contains + * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if @CountryIeBuf contains * valid country information element. * @chanell_map: holds channel values * 0 - invalid, @@ -27,18 +45,19 @@ enum _DOT11D_STATE { * @CountryIeSrcAddr - Source AP of the country IE */ -struct _RT_DOT11D_INFO { +struct rt_dot11d_info { + bool bEnabled; u16 CountryIeLen; - u8 CountryIeBuf[MAX_IE_LEN]; - u8 CountryIeSrcAddr[6]; - u8 CountryIeWatchdog; + u8 CountryIeBuf[MAX_IE_LEN]; + u8 CountryIeSrcAddr[6]; + u8 CountryIeWatchdog; - u8 channel_map[MAX_CHANNEL_NUMBER+1]; - u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; + u8 channel_map[MAX_CHANNEL_NUMBER+1]; + u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; - DOT11D_STATE State; + enum dot11d_state State; }; static inline void cpMacAddr(unsigned char *des, unsigned char *src) @@ -46,49 +65,41 @@ static inline void cpMacAddr(unsigned char *des, unsigned char *src) memcpy(des, src, 6); } -#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO) \ - ((__pIeeeDev)->pDot11dInfo)) +#define GET_DOT11D_INFO(__pIeeeDev) \ + ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo)) -#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->bEnabled) -#define IS_COUNTRY_IE_VALID(__pIeeeDev) \ - (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) +#define IS_DOT11D_ENABLE(__pIeeeDev) \ + (GET_DOT11D_INFO(__pIeeeDev)->bEnabled) +#define IS_COUNTRY_IE_VALID(__pIeeeDev) \ + (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) -#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \ - eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) - -#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \ - cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) +#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \ + eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) +#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \ + cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ - (((__Ie).Length == 0 || (__Ie).Length != \ - GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? FALSE : \ - (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, \ + (((__Ie).Length == 0 || (__Ie).Length != \ + GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ + false : (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, \ (__Ie).Octet, (__Ie).Length))) #define CIE_WATCHDOG_TH 1 -#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)-> \ - CountryIeWatchdog) +#define GET_CIE_WATCHDOG(__pIeeeDev) \ + (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog) #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev)) -#define IS_DOT11D_STATE_DONE(__pIeeeDev) \ - (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) - - -void Dot11d_Init(struct ieee80211_device *dev); - -void Dot11d_Reset(struct ieee80211_device *dev); - -void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr, - u16 CoutryIeLen, u8 *pCoutryIe); - -u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 channel); - -void DOT11D_ScanComplete(struct ieee80211_device *dev); - -int IsLegalChannel(struct ieee80211_device *dev, u8 channel); +#define IS_DOT11D_STATE_DONE(__pIeeeDev) \ + (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) -int ToLegalChannel(struct ieee80211_device *dev, u8 channel); +void Dot11d_Init(struct rtllib_device *dev); +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); +u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel); +void DOT11D_ScanComplete(struct rtllib_device *dev); +int ToLegalChannel(struct rtllib_device *dev, u8 channel); -#endif /* ENABLE_DOT11D */ -#endif /* INC_DOT11D_H */ +#endif |