Commit 88adc104 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: rtl8187se: fix \r\n line ends

Andrew pointed out that I forgot to convert some files to unix format
when adding them originally.  This patch runs dos2unix on the rtl8187se
files that needed them.
Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9c515551
#ifndef __INC_DOT11D_H #ifndef __INC_DOT11D_H
#define __INC_DOT11D_H #define __INC_DOT11D_H
#include "ieee80211.h" #include "ieee80211.h"
//#define ENABLE_DOT11D //#define ENABLE_DOT11D
//#define DOT11D_MAX_CHNL_NUM 83 //#define DOT11D_MAX_CHNL_NUM 83
typedef struct _CHNL_TXPOWER_TRIPLE { typedef struct _CHNL_TXPOWER_TRIPLE {
u8 FirstChnl; u8 FirstChnl;
u8 NumChnls; u8 NumChnls;
u8 MaxTxPowerInDbm; u8 MaxTxPowerInDbm;
}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; }CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
typedef enum _DOT11D_STATE { typedef enum _DOT11D_STATE {
DOT11D_STATE_NONE = 0, DOT11D_STATE_NONE = 0,
DOT11D_STATE_LEARNED, DOT11D_STATE_LEARNED,
DOT11D_STATE_DONE, DOT11D_STATE_DONE,
}DOT11D_STATE; }DOT11D_STATE;
typedef struct _RT_DOT11D_INFO { typedef struct _RT_DOT11D_INFO {
//DECLARE_RT_OBJECT(RT_DOT11D_INFO); //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
bool bEnabled; // dot11MultiDomainCapabilityEnabled bool bEnabled; // dot11MultiDomainCapabilityEnabled
u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
u8 CountryIeBuf[MAX_IE_LEN]; u8 CountryIeBuf[MAX_IE_LEN];
u8 CountryIeSrcAddr[6]; // Source AP of the country IE. u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
u8 CountryIeWatchdog; u8 CountryIeWatchdog;
u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
//u8 ChnlListLen; // #Bytes valid in ChnlList[]. //u8 ChnlListLen; // #Bytes valid in ChnlList[].
//u8 ChnlList[DOT11D_MAX_CHNL_NUM]; //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
DOT11D_STATE State; DOT11D_STATE State;
}RT_DOT11D_INFO, *PRT_DOT11D_INFO; }RT_DOT11D_INFO, *PRT_DOT11D_INFO;
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) #define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) #define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) #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 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 UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
FALSE : \ FALSE : \
(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
#define CIE_WATCHDOG_TH 1 #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 RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
void void
Dot11d_Init( Dot11d_Init(
struct ieee80211_device *dev struct ieee80211_device *dev
); );
void void
Dot11d_Reset( Dot11d_Reset(
struct ieee80211_device *dev struct ieee80211_device *dev
); );
void void
Dot11d_UpdateCountryIe( Dot11d_UpdateCountryIe(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 * pTaddr, u8 * pTaddr,
u16 CoutryIeLen, u16 CoutryIeLen,
u8 * pCoutryIe u8 * pCoutryIe
); );
u8 u8
DOT11D_GetMaxTxPwrInDbm( DOT11D_GetMaxTxPwrInDbm(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 Channel u8 Channel
); );
void void
DOT11D_ScanComplete( DOT11D_ScanComplete(
struct ieee80211_device * dev struct ieee80211_device * dev
); );
int IsLegalChannel( int IsLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
); );
int ToLegalChannel( int ToLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
); );
#endif // #ifndef __INC_DOT11D_H #endif // #ifndef __INC_DOT11D_H
#ifdef ENABLE_DOT11D #ifdef ENABLE_DOT11D
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// File: // File:
// Dot11d.c // Dot11d.c
// //
// Description: // Description:
// Implement 802.11d. // Implement 802.11d.
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "dot11d.h" #include "dot11d.h"
void void
Dot11d_Init(struct ieee80211_device *ieee) Dot11d_Init(struct ieee80211_device *ieee)
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
pDot11dInfo->bEnabled = 0; pDot11dInfo->bEnabled = 0;
pDot11dInfo->State = DOT11D_STATE_NONE; pDot11dInfo->State = DOT11D_STATE_NONE;
pDot11dInfo->CountryIeLen = 0; pDot11dInfo->CountryIeLen = 0;
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
RESET_CIE_WATCHDOG(ieee); RESET_CIE_WATCHDOG(ieee);
printk("Dot11d_Init()\n"); printk("Dot11d_Init()\n");
} }
// //
// Description: // Description:
// Reset to the state as we are just entering a regulatory domain. // Reset to the state as we are just entering a regulatory domain.
// //
void void
Dot11d_Reset(struct ieee80211_device *ieee) Dot11d_Reset(struct ieee80211_device *ieee)
{ {
u32 i; u32 i;
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
// Clear old channel map // Clear old channel map
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
// Set new channel map // Set new channel map
for (i=1; i<=11; i++) { for (i=1; i<=11; i++) {
(pDot11dInfo->channel_map)[i] = 1; (pDot11dInfo->channel_map)[i] = 1;
} }
for (i=12; i<=14; i++) { for (i=12; i<=14; i++) {
(pDot11dInfo->channel_map)[i] = 2; (pDot11dInfo->channel_map)[i] = 2;
} }
pDot11dInfo->State = DOT11D_STATE_NONE; pDot11dInfo->State = DOT11D_STATE_NONE;
pDot11dInfo->CountryIeLen = 0; pDot11dInfo->CountryIeLen = 0;
RESET_CIE_WATCHDOG(ieee); RESET_CIE_WATCHDOG(ieee);
//printk("Dot11d_Reset()\n"); //printk("Dot11d_Reset()\n");
} }
// //
// Description: // Description:
// Update country IE from Beacon or Probe Resopnse // Update country IE from Beacon or Probe Resopnse
// and configure PHY for operation in the regulatory domain. // and configure PHY for operation in the regulatory domain.
// //
// TODO: // TODO:
// Configure Tx power. // Configure Tx power.
// //
// Assumption: // Assumption:
// 1. IS_DOT11D_ENABLE() is TRUE. // 1. IS_DOT11D_ENABLE() is TRUE.
// 2. Input IE is an valid one. // 2. Input IE is an valid one.
// //
void void
Dot11d_UpdateCountryIe( Dot11d_UpdateCountryIe(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 * pTaddr, u8 * pTaddr,
u16 CoutryIeLen, u16 CoutryIeLen,
u8 * pCoutryIe u8 * pCoutryIe
) )
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 i, j, NumTriples, MaxChnlNum; u8 i, j, NumTriples, MaxChnlNum;
PCHNL_TXPOWER_TRIPLE pTriple; PCHNL_TXPOWER_TRIPLE pTriple;
if((CoutryIeLen - 3)%3 != 0) if((CoutryIeLen - 3)%3 != 0)
{ {
printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n"); printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
Dot11d_Reset(dev); Dot11d_Reset(dev);
return; return;
} }
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
MaxChnlNum = 0; MaxChnlNum = 0;
NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string. NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string.
pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3); pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
for(i = 0; i < NumTriples; i++) for(i = 0; i < NumTriples; i++)
{ {
if(MaxChnlNum >= pTriple->FirstChnl) if(MaxChnlNum >= pTriple->FirstChnl)
{ // It is not in a monotonically increasing order, so stop processing. { // It is not in a monotonically increasing order, so stop processing.
printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n"); printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
Dot11d_Reset(dev); Dot11d_Reset(dev);
return; return;
} }
if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls))
{ // It is not a valid set of channel id, so stop processing. { // It is not a valid set of channel id, so stop processing.
printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n"); printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
Dot11d_Reset(dev); Dot11d_Reset(dev);
return; return;
} }
for(j = 0 ; j < pTriple->NumChnls; j++) for(j = 0 ; j < pTriple->NumChnls; j++)
{ {
pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1; pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm; pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm;
MaxChnlNum = pTriple->FirstChnl + j; MaxChnlNum = pTriple->FirstChnl + j;
} }
pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3); pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3);
} }
#if 1 #if 1
//printk("Dot11d_UpdateCountryIe(): Channel List:\n"); //printk("Dot11d_UpdateCountryIe(): Channel List:\n");
printk("Channel List:"); printk("Channel List:");
for(i=1; i<= MAX_CHANNEL_NUMBER; i++) for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
if(pDot11dInfo->channel_map[i] > 0) if(pDot11dInfo->channel_map[i] > 0)
printk(" %d", i); printk(" %d", i);
printk("\n"); printk("\n");
#endif #endif
UPDATE_CIE_SRC(dev, pTaddr); UPDATE_CIE_SRC(dev, pTaddr);
pDot11dInfo->CountryIeLen = CoutryIeLen; pDot11dInfo->CountryIeLen = CoutryIeLen;
memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen); memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen);
pDot11dInfo->State = DOT11D_STATE_LEARNED; pDot11dInfo->State = DOT11D_STATE_LEARNED;
} }
void dump_chnl_map(u8 * channel_map) void dump_chnl_map(u8 * channel_map)
{ {
int i; int i;
printk("Channel List:"); printk("Channel List:");
for(i=1; i<= MAX_CHANNEL_NUMBER; i++) for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
if(channel_map[i] > 0) if(channel_map[i] > 0)
printk(" %d(%d)", i, channel_map[i]); printk(" %d(%d)", i, channel_map[i]);
printk("\n"); printk("\n");
} }
u8 u8
DOT11D_GetMaxTxPwrInDbm( DOT11D_GetMaxTxPwrInDbm(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 Channel u8 Channel
) )
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 MaxTxPwrInDbm = 255; u8 MaxTxPwrInDbm = 255;
if(MAX_CHANNEL_NUMBER < Channel) if(MAX_CHANNEL_NUMBER < Channel)
{ {
printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
return MaxTxPwrInDbm; return MaxTxPwrInDbm;
} }
if(pDot11dInfo->channel_map[Channel]) if(pDot11dInfo->channel_map[Channel])
{ {
MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel]; MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
} }
return MaxTxPwrInDbm; return MaxTxPwrInDbm;
} }
void void
DOT11D_ScanComplete( DOT11D_ScanComplete(
struct ieee80211_device * dev struct ieee80211_device * dev
) )
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
switch(pDot11dInfo->State) switch(pDot11dInfo->State)
{ {
case DOT11D_STATE_LEARNED: case DOT11D_STATE_LEARNED:
pDot11dInfo->State = DOT11D_STATE_DONE; pDot11dInfo->State = DOT11D_STATE_DONE;
break; break;
case DOT11D_STATE_DONE: case DOT11D_STATE_DONE:
if( GET_CIE_WATCHDOG(dev) == 0 ) if( GET_CIE_WATCHDOG(dev) == 0 )
{ // Reset country IE if previous one is gone. { // Reset country IE if previous one is gone.
Dot11d_Reset(dev); Dot11d_Reset(dev);
} }
break; break;
case DOT11D_STATE_NONE: case DOT11D_STATE_NONE:
break; break;
} }
} }
int IsLegalChannel( int IsLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
) )
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
if(MAX_CHANNEL_NUMBER < channel) if(MAX_CHANNEL_NUMBER < channel)
{ {
printk("IsLegalChannel(): Invalid Channel\n"); printk("IsLegalChannel(): Invalid Channel\n");
return 0; return 0;
} }
if(pDot11dInfo->channel_map[channel] > 0) if(pDot11dInfo->channel_map[channel] > 0)
return 1; return 1;
return 0; return 0;
} }
int ToLegalChannel( int ToLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
) )
{ {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 default_chn = 0; u8 default_chn = 0;
u32 i = 0; u32 i = 0;
for (i=1; i<= MAX_CHANNEL_NUMBER; i++) for (i=1; i<= MAX_CHANNEL_NUMBER; i++)
{ {
if(pDot11dInfo->channel_map[i] > 0) if(pDot11dInfo->channel_map[i] > 0)
{ {
default_chn = i; default_chn = i;
break; break;
} }
} }
if(MAX_CHANNEL_NUMBER < channel) if(MAX_CHANNEL_NUMBER < channel)
{ {
printk("IsLegalChannel(): Invalid Channel\n"); printk("IsLegalChannel(): Invalid Channel\n");
return default_chn; return default_chn;
} }
if(pDot11dInfo->channel_map[channel] > 0) if(pDot11dInfo->channel_map[channel] > 0)
return channel; return channel;
return default_chn; return default_chn;
} }
#if 0 #if 0
EXPORT_SYMBOL(Dot11d_Init); EXPORT_SYMBOL(Dot11d_Init);
EXPORT_SYMBOL(Dot11d_Reset); EXPORT_SYMBOL(Dot11d_Reset);
EXPORT_SYMBOL(Dot11d_UpdateCountryIe); EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
EXPORT_SYMBOL(DOT11D_ScanComplete); EXPORT_SYMBOL(DOT11D_ScanComplete);
EXPORT_SYMBOL(IsLegalChannel); EXPORT_SYMBOL(IsLegalChannel);
EXPORT_SYMBOL(ToLegalChannel); EXPORT_SYMBOL(ToLegalChannel);
#endif #endif
#endif #endif
#ifndef __INC_DOT11D_H #ifndef __INC_DOT11D_H
#define __INC_DOT11D_H #define __INC_DOT11D_H
#include "ieee80211.h" #include "ieee80211.h"
//#define ENABLE_DOT11D //#define ENABLE_DOT11D
//#define DOT11D_MAX_CHNL_NUM 83 //#define DOT11D_MAX_CHNL_NUM 83
typedef struct _CHNL_TXPOWER_TRIPLE { typedef struct _CHNL_TXPOWER_TRIPLE {
u8 FirstChnl; u8 FirstChnl;
u8 NumChnls; u8 NumChnls;
u8 MaxTxPowerInDbm; u8 MaxTxPowerInDbm;
}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; }CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
typedef enum _DOT11D_STATE { typedef enum _DOT11D_STATE {
DOT11D_STATE_NONE = 0, DOT11D_STATE_NONE = 0,
DOT11D_STATE_LEARNED, DOT11D_STATE_LEARNED,
DOT11D_STATE_DONE, DOT11D_STATE_DONE,
}DOT11D_STATE; }DOT11D_STATE;
typedef struct _RT_DOT11D_INFO { typedef struct _RT_DOT11D_INFO {
//DECLARE_RT_OBJECT(RT_DOT11D_INFO); //DECLARE_RT_OBJECT(RT_DOT11D_INFO);
bool bEnabled; // dot11MultiDomainCapabilityEnabled bool bEnabled; // dot11MultiDomainCapabilityEnabled
u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element.
u8 CountryIeBuf[MAX_IE_LEN]; u8 CountryIeBuf[MAX_IE_LEN];
u8 CountryIeSrcAddr[6]; // Source AP of the country IE. u8 CountryIeSrcAddr[6]; // Source AP of the country IE.
u8 CountryIeWatchdog; u8 CountryIeWatchdog;
u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan)
//u8 ChnlListLen; // #Bytes valid in ChnlList[]. //u8 ChnlListLen; // #Bytes valid in ChnlList[].
//u8 ChnlList[DOT11D_MAX_CHNL_NUM]; //u8 ChnlList[DOT11D_MAX_CHNL_NUM];
u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
DOT11D_STATE State; DOT11D_STATE State;
}RT_DOT11D_INFO, *PRT_DOT11D_INFO; }RT_DOT11D_INFO, *PRT_DOT11D_INFO;
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) #define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) #define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) #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 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 UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
FALSE : \ FALSE : \
(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
#define CIE_WATCHDOG_TH 1 #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 RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0
#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev)
#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
void void
Dot11d_Init( Dot11d_Init(
struct ieee80211_device *dev struct ieee80211_device *dev
); );
void void
Dot11d_Reset( Dot11d_Reset(
struct ieee80211_device *dev struct ieee80211_device *dev
); );
void void
Dot11d_UpdateCountryIe( Dot11d_UpdateCountryIe(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 * pTaddr, u8 * pTaddr,
u16 CoutryIeLen, u16 CoutryIeLen,
u8 * pCoutryIe u8 * pCoutryIe
); );
u8 u8
DOT11D_GetMaxTxPwrInDbm( DOT11D_GetMaxTxPwrInDbm(
struct ieee80211_device *dev, struct ieee80211_device *dev,
u8 Channel u8 Channel
); );
void void
DOT11D_ScanComplete( DOT11D_ScanComplete(
struct ieee80211_device * dev struct ieee80211_device * dev
); );
int IsLegalChannel( int IsLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
); );
int ToLegalChannel( int ToLegalChannel(
struct ieee80211_device * dev, struct ieee80211_device * dev,
u8 channel u8 channel
); );
void dump_chnl_map(u8 * channel_map); void dump_chnl_map(u8 * channel_map);
#endif // #ifndef __INC_DOT11D_H #endif // #ifndef __INC_DOT11D_H
This source diff could not be displayed because it is too large. You can view the blob instead.
#ifndef R8180_DM_H #ifndef R8180_DM_H
#define R8180_DM_H #define R8180_DM_H
#include "r8180.h" #include "r8180.h"
//#include "r8180_hw.h" //#include "r8180_hw.h"
//#include "r8180_93cx6.h" //#include "r8180_93cx6.h"
void SwAntennaDiversityRxOk8185(struct net_device *dev, u8 SignalStrength); void SwAntennaDiversityRxOk8185(struct net_device *dev, u8 SignalStrength);
bool SetAntenna8185(struct net_device *dev, u8 u1bAntennaIndex); bool SetAntenna8185(struct net_device *dev, u8 u1bAntennaIndex);
bool SwitchAntenna( struct net_device *dev); bool SwitchAntenna( struct net_device *dev);
void SwAntennaDiversity(struct net_device *dev ); void SwAntennaDiversity(struct net_device *dev );
void SwAntennaDiversityTimerCallback(struct net_device *dev); void SwAntennaDiversityTimerCallback(struct net_device *dev);
bool CheckDig(struct net_device *dev); bool CheckDig(struct net_device *dev);
bool CheckHighPower(struct net_device *dev); bool CheckHighPower(struct net_device *dev);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
void rtl8180_hw_dig_wq (struct work_struct *work); void rtl8180_hw_dig_wq (struct work_struct *work);
#else #else
void rtl8180_hw_dig_wq(struct net_device *dev); void rtl8180_hw_dig_wq(struct net_device *dev);
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
void rtl8180_tx_pw_wq (struct work_struct *work); void rtl8180_tx_pw_wq (struct work_struct *work);
#else #else
void rtl8180_tx_pw_wq(struct net_device *dev); void rtl8180_tx_pw_wq(struct net_device *dev);
#endif #endif
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) #if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
void rtl8180_rate_adapter(struct work_struct * work); void rtl8180_rate_adapter(struct work_struct * work);
#else #else
void rtl8180_rate_adapter(struct net_device *dev); void rtl8180_rate_adapter(struct net_device *dev);
#endif #endif
void TxPwrTracking87SE(struct net_device *dev); void TxPwrTracking87SE(struct net_device *dev);
bool CheckTxPwrTracking(struct net_device *dev); bool CheckTxPwrTracking(struct net_device *dev);
#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) #if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
void rtl8180_rate_adapter(struct work_struct * work); void rtl8180_rate_adapter(struct work_struct * work);
#else #else
void rtl8180_rate_adapter(struct net_device *dev); void rtl8180_rate_adapter(struct net_device *dev);
#endif #endif
void timer_rate_adaptive(unsigned long data); void timer_rate_adaptive(unsigned long data);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment