Commit 96b3c83d authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rt28x0: run common/*.c files through Lindent

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 66cd8d6e
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -35,16 +35,11 @@
--------- ---------- ----------------------------------------------
*/
#include "../rt_config.h"
char* GetPhyMode(
int Mode)
char *GetPhyMode(int Mode)
{
switch(Mode)
{
switch (Mode) {
case MODE_CCK:
return "CCK";
......@@ -60,12 +55,9 @@ char* GetPhyMode(
}
}
char* GetBW(
int BW)
char *GetBW(int BW)
{
switch(BW)
{
switch (BW) {
case BW_10:
return "10M";
......@@ -78,7 +70,6 @@ char* GetBW(
}
}
/*
==========================================================================
Description:
......@@ -89,46 +80,37 @@ char* GetBW(
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetCountryRegion(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg,
IN INT band)
INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band)
{
LONG region, regionMax;
UCHAR *pCountryRegion;
region = simple_strtol(arg, 0, 10);
if (band == BAND_24G)
{
if (band == BAND_24G) {
pCountryRegion = &pAd->CommonCfg.CountryRegion;
regionMax = REGION_MAXIMUM_BG_BAND;
}
else
{
} else {
pCountryRegion = &pAd->CommonCfg.CountryRegionForABand;
regionMax = REGION_MAXIMUM_A_BAND;
}
// TODO: Is it neccesay for following check???
// Country can be set only when EEPROM not programmed
if (*pCountryRegion & 0x80)
{
DBGPRINT(RT_DEBUG_ERROR, ("CfgSetCountryRegion():CountryRegion in eeprom was programmed\n"));
if (*pCountryRegion & 0x80) {
DBGPRINT(RT_DEBUG_ERROR,
("CfgSetCountryRegion():CountryRegion in eeprom was programmed\n"));
return FALSE;
}
if((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND))
{
*pCountryRegion= (UCHAR) region;
}
else if ((region == REGION_31_BG_BAND) && (band == BAND_24G))
{
if ((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND)) {
*pCountryRegion = (UCHAR) region;
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("CfgSetCountryRegion():region(%ld) out of range!\n", region));
} else if ((region == REGION_31_BG_BAND) && (band == BAND_24G)) {
*pCountryRegion = (UCHAR) region;
} else {
DBGPRINT(RT_DEBUG_ERROR,
("CfgSetCountryRegion():region(%ld) out of range!\n",
region));
return FALSE;
}
......@@ -136,7 +118,6 @@ INT RT_CfgSetCountryRegion(
}
/*
==========================================================================
Description:
......@@ -145,9 +126,7 @@ INT RT_CfgSetCountryRegion(
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWirelessMode(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg)
INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
{
INT MaxPhyMode = PHY_11G;
LONG WirelessMode;
......@@ -155,8 +134,7 @@ INT RT_CfgSetWirelessMode(
MaxPhyMode = PHY_11N_5G;
WirelessMode = simple_strtol(arg, 0, 10);
if (WirelessMode <= MaxPhyMode)
{
if (WirelessMode <= MaxPhyMode) {
pAd->CommonCfg.PhyMode = WirelessMode;
return TRUE;
}
......@@ -165,10 +143,7 @@ INT RT_CfgSetWirelessMode(
}
INT RT_CfgSetShortSlot(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg)
INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
{
LONG ShortSlot;
......@@ -184,7 +159,6 @@ INT RT_CfgSetShortSlot(
return TRUE;
}
/*
==========================================================================
Description:
......@@ -193,11 +167,9 @@ INT RT_CfgSetShortSlot(
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWepKey(
IN PRTMP_ADAPTER pAd,
INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
IN PSTRING keyString,
IN CIPHER_KEY *pSharedKey,
IN INT keyIdx)
IN CIPHER_KEY * pSharedKey, IN INT keyIdx)
{
INT KeyLen;
INT i;
......@@ -207,8 +179,7 @@ INT RT_CfgSetWepKey(
// TODO: Shall we do memset for the original key info??
memset(pSharedKey, 0, sizeof(CIPHER_KEY));
KeyLen = strlen(keyString);
switch (KeyLen)
{
switch (KeyLen) {
case 5: //wep 40 Ascii type
case 13: //wep 104 Ascii type
bKeyIsHex = FALSE;
......@@ -218,29 +189,31 @@ INT RT_CfgSetWepKey(
case 10: //wep 40 Hex type
case 26: //wep 104 Hex type
for(i=0; i < KeyLen; i++)
{
if( !isxdigit(*(keyString+i)) )
for (i = 0; i < KeyLen; i++) {
if (!isxdigit(*(keyString + i)))
return FALSE; //Not Hex value;
}
bKeyIsHex = TRUE;
pSharedKey->KeyLen = KeyLen/2 ;
pSharedKey->KeyLen = KeyLen / 2;
AtoH(keyString, pSharedKey->Key, pSharedKey->KeyLen);
break;
default: //Invalid argument
DBGPRINT(RT_DEBUG_TRACE, ("RT_CfgSetWepKey(keyIdx=%d):Invalid argument (arg=%s)\n", keyIdx, keyString));
DBGPRINT(RT_DEBUG_TRACE,
("RT_CfgSetWepKey(keyIdx=%d):Invalid argument (arg=%s)\n",
keyIdx, keyString));
return FALSE;
}
pSharedKey->CipherAlg = ((KeyLen % 5) ? CIPHER_WEP128 : CIPHER_WEP64);
DBGPRINT(RT_DEBUG_TRACE, ("RT_CfgSetWepKey:(KeyIdx=%d,type=%s, Alg=%s)\n",
keyIdx, (bKeyIsHex == FALSE ? "Ascii" : "Hex"), CipherName[CipherAlg]));
DBGPRINT(RT_DEBUG_TRACE,
("RT_CfgSetWepKey:(KeyIdx=%d,type=%s, Alg=%s)\n", keyIdx,
(bKeyIsHex == FALSE ? "Ascii" : "Hex"),
CipherName[CipherAlg]));
return TRUE;
}
/*
==========================================================================
Description:
......@@ -257,31 +230,26 @@ INT RT_CfgSetWepKey(
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWPAPSKKey(
IN RTMP_ADAPTER *pAd,
INT RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd,
IN PSTRING keyString,
IN UCHAR *pHashStr,
IN INT hashStrLen,
OUT PUCHAR pPMKBuf)
IN UCHAR * pHashStr,
IN INT hashStrLen, OUT PUCHAR pPMKBuf)
{
int keyLen;
UCHAR keyMaterial[40];
keyLen = strlen(keyString);
if ((keyLen < 8) || (keyLen > 64))
{
DBGPRINT(RT_DEBUG_TRACE, ("WPAPSK Key length(%d) error, required 8 ~ 64 characters!(keyStr=%s)\n",
if ((keyLen < 8) || (keyLen > 64)) {
DBGPRINT(RT_DEBUG_TRACE,
("WPAPSK Key length(%d) error, required 8 ~ 64 characters!(keyStr=%s)\n",
keyLen, keyString));
return FALSE;
}
memset(pPMKBuf, 0, 32);
if (keyLen == 64)
{
if (keyLen == 64) {
AtoH(keyString, pPMKBuf, 32);
}
else
{
} else {
PasswordHash(keyString, pHashStr, hashStrLen, keyMaterial);
NdisMoveMemory(pPMKBuf, keyMaterial, 32);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,6 @@
#include "../crypt_hmac.h"
#ifdef HMAC_SHA1_SUPPORT
/*
========================================================================
......@@ -47,13 +46,10 @@ Note:
None
========================================================================
*/
VOID HMAC_SHA1 (
IN const UINT8 Key[],
VOID HMAC_SHA1(IN const UINT8 Key[],
IN UINT KeyLen,
IN const UINT8 Message[],
IN UINT MessageLen,
OUT UINT8 MAC[],
IN UINT MACLen)
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen)
{
SHA1_CTX_STRUC sha_ctx1;
SHA1_CTX_STRUC sha_ctx2;
......@@ -92,7 +88,7 @@ VOID HMAC_SHA1 (
/* Exclusive-Or K0 with opad and remove ipad */
/* opad: Outer pad; the byte x¡¦5c¡¦ repeated B times. */
for (index = 0; index < SHA1_BLOCK_SIZE; index++)
K0[index] ^= 0x36^0x5c;
K0[index] ^= 0x36 ^ 0x5c;
/* End of for */
RT_SHA1_Init(&sha_ctx2);
......@@ -129,13 +125,10 @@ Note:
None
========================================================================
*/
VOID HMAC_MD5(
IN const UINT8 Key[],
VOID HMAC_MD5(IN const UINT8 Key[],
IN UINT KeyLen,
IN const UINT8 Message[],
IN UINT MessageLen,
OUT UINT8 MAC[],
IN UINT MACLen)
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen)
{
MD5_CTX_STRUC md5_ctx1;
MD5_CTX_STRUC md5_ctx2;
......@@ -174,7 +167,7 @@ VOID HMAC_MD5(
/* Exclusive-Or K0 with opad and remove ipad */
/* opad: Outer pad; the byte x¡¦5c¡¦ repeated B times. */
for (index = 0; index < MD5_BLOCK_SIZE; index++)
K0[index] ^= 0x36^0x5c;
K0[index] ^= 0x36 ^ 0x5c;
/* End of for */
MD5_Init(&md5_ctx2);
......
This diff is collapsed.
This diff is collapsed.
......@@ -52,17 +52,13 @@
========================================================================
*/
BOOLEAN RadarChannelCheck(
IN PRTMP_ADAPTER pAd,
IN UCHAR Ch)
BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch)
{
INT i;
BOOLEAN result = FALSE;
for (i=0; i<pAd->ChannelListNum; i++)
{
if (Ch == pAd->ChannelList[i].Channel)
{
for (i = 0; i < pAd->ChannelListNum; i++) {
if (Ch == pAd->ChannelList[i].Channel) {
result = pAd->ChannelList[i].DfsReq;
break;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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