Release 4.7 drivers/staging/rtl8192u/ieee80211/dot11d.c
/* Implement 802.11d. */
#include "dot11d.h"
void Dot11d_Init(struct ieee80211_device *ieee)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
pDot11dInfo->bEnabled = false;
pDot11dInfo->State = DOT11D_STATE_NONE;
pDot11dInfo->CountryIeLen = 0;
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
RESET_CIE_WATCHDOG(ieee);
netdev_info(ieee->dev, "Dot11d_Init()\n");
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 69 | 90.79% | 1 | 25.00% |
ana rey botello | ana rey botello | 6 | 7.89% | 2 | 50.00% |
cristina opriceana | cristina opriceana | 1 | 1.32% | 1 | 25.00% |
| Total | 76 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(Dot11d_Init);
/* Reset to the state as we are just entering a regulatory domain. */
void Dot11d_Reset(struct ieee80211_device *ieee)
{
u32 i;
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
/* Clear old channel map */
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
/* Set new channel map */
for (i = 1; i <= 11; i++)
(pDot11dInfo->channel_map)[i] = 1;
for (i = 12; i <= 14; i++)
(pDot11dInfo->channel_map)[i] = 2;
pDot11dInfo->State = DOT11D_STATE_NONE;
pDot11dInfo->CountryIeLen = 0;
RESET_CIE_WATCHDOG(ieee);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 111 | 97.37% | 1 | 33.33% |
ana rey botello | ana rey botello | 3 | 2.63% | 2 | 66.67% |
| Total | 114 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(Dot11d_Reset);
/*
* Update country IE from Beacon or Probe Resopnse and configure PHY for
* operation in the regulatory domain.
*
* TODO: Configure Tx power.
* Assumption:
* 1. IS_DOT11D_ENABLE() is TRUE.
* 2. Input IE is an valid one.
*/
void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
u16 CoutryIeLen, u8 *pCoutryIe)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 i, j, NumTriples, MaxChnlNum;
PCHNL_TXPOWER_TRIPLE pTriple;
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
MaxChnlNum = 0;
NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */
pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
for (i = 0; i < NumTriples; i++) {
if (MaxChnlNum >= pTriple->FirstChnl) {
/* It is not in a monotonically increasing order, so
* stop processing.
*/
netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
return;
}
if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) {
/* It is not a valid set of channel id, so stop
* processing.
*/
netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
return;
}
for (j = 0; j < pTriple->NumChnls; j++) {
pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm;
MaxChnlNum = pTriple->FirstChnl + j;
}
pTriple = (PCHNL_TXPOWER_TRIPLE)((u8 *)pTriple + 3);
}
netdev_info(dev->dev, "Channel List:");
for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
if (pDot11dInfo->channel_map[i] > 0)
netdev_info(dev->dev, " %d", i);
netdev_info(dev->dev, "\n");
UPDATE_CIE_SRC(dev, pTaddr);
pDot11dInfo->CountryIeLen = CoutryIeLen;
memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe, CoutryIeLen);
pDot11dInfo->State = DOT11D_STATE_LEARNED;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 278 | 90.55% | 1 | 25.00% |
ana rey botello | ana rey botello | 29 | 9.45% | 3 | 75.00% |
| Total | 307 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 MaxTxPwrInDbm = 255;
if (Channel > MAX_CHANNEL_NUMBER) {
netdev_err(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
return MaxTxPwrInDbm;
}
if (pDot11dInfo->channel_map[Channel])
MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
return MaxTxPwrInDbm;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 59 | 88.06% | 1 | 25.00% |
ana rey botello | ana rey botello | 6 | 8.96% | 2 | 50.00% |
sandhya bankar | sandhya bankar | 2 | 2.99% | 1 | 25.00% |
| Total | 67 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
void DOT11D_ScanComplete(struct ieee80211_device *dev)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
switch (pDot11dInfo->State) {
case DOT11D_STATE_LEARNED:
pDot11dInfo->State = DOT11D_STATE_DONE;
break;
case DOT11D_STATE_DONE:
if (GET_CIE_WATCHDOG(dev) == 0) {
/* Reset country IE if previous one is gone. */
Dot11d_Reset(dev);
}
break;
case DOT11D_STATE_NONE:
break;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 59 | 96.72% | 1 | 33.33% |
ana rey botello | ana rey botello | 2 | 3.28% | 2 | 66.67% |
| Total | 61 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(DOT11D_ScanComplete);
int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
if (channel > MAX_CHANNEL_NUMBER) {
netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
return 0;
}
if (pDot11dInfo->channel_map[channel] > 0)
return 1;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 51 | 87.93% | 1 | 33.33% |
ana rey botello | ana rey botello | 5 | 8.62% | 1 | 33.33% |
sandhya bankar | sandhya bankar | 2 | 3.45% | 1 | 33.33% |
| Total | 58 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(IsLegalChannel);
int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
{
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 default_chn = 0;
u32 i = 0;
for (i = 1; i <= MAX_CHANNEL_NUMBER; i++) {
if (pDot11dInfo->channel_map[i] > 0) {
default_chn = i;
break;
}
}
if (channel > MAX_CHANNEL_NUMBER) {
netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
return default_chn;
}
if (pDot11dInfo->channel_map[channel] > 0)
return channel;
return default_chn;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 94 | 93.07% | 1 | 33.33% |
ana rey botello | ana rey botello | 5 | 4.95% | 1 | 33.33% |
sandhya bankar | sandhya bankar | 2 | 1.98% | 1 | 33.33% |
| Total | 101 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(ToLegalChannel);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jerry chuang | jerry chuang | 729 | 88.36% | 1 | 14.29% |
ana rey botello | ana rey botello | 89 | 10.79% | 4 | 57.14% |
sandhya bankar | sandhya bankar | 6 | 0.73% | 1 | 14.29% |
cristina opriceana | cristina opriceana | 1 | 0.12% | 1 | 14.29% |
| Total | 825 | 100.00% | 7 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.