提交 d82adcab 编写于 作者: J Joe Perches 提交者: Greg Kroah-Hartman

staging:vt6655:key: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6da16f96
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG; //static int msglevel =MSG_LEVEL_DEBUG;
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
...@@ -59,18 +59,18 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -59,18 +59,18 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
static void static void
s_vCheckKeyTableValid (PSKeyManagement pTable, unsigned long dwIoBase) s_vCheckKeyTableValid(PSKeyManagement pTable, unsigned long dwIoBase)
{ {
int i; int i;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
(pTable->KeyTable[i].PairwiseKey.bKeyValid == false) && (pTable->KeyTable[i].PairwiseKey.bKeyValid == false) &&
(pTable->KeyTable[i].GroupKey[0].bKeyValid == false) && (pTable->KeyTable[i].GroupKey[0].bKeyValid == false) &&
(pTable->KeyTable[i].GroupKey[1].bKeyValid == false) && (pTable->KeyTable[i].GroupKey[1].bKeyValid == false) &&
(pTable->KeyTable[i].GroupKey[2].bKeyValid == false) && (pTable->KeyTable[i].GroupKey[2].bKeyValid == false) &&
(pTable->KeyTable[i].GroupKey[3].bKeyValid == false) (pTable->KeyTable[i].GroupKey[3].bKeyValid == false)
) { ) {
pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].bInUse = false;
pTable->KeyTable[i].wKeyCtl = 0; pTable->KeyTable[i].wKeyCtl = 0;
...@@ -96,16 +96,16 @@ s_vCheckKeyTableValid (PSKeyManagement pTable, unsigned long dwIoBase) ...@@ -96,16 +96,16 @@ s_vCheckKeyTableValid (PSKeyManagement pTable, unsigned long dwIoBase)
* Return Value: none * Return Value: none
* *
*/ */
void KeyvInitTable (PSKeyManagement pTable, unsigned long dwIoBase) void KeyvInitTable(PSKeyManagement pTable, unsigned long dwIoBase)
{ {
int i; int i;
int jj; int jj;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].bInUse = false;
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
pTable->KeyTable[i].PairwiseKey.pvKeyTable = (void *)&pTable->KeyTable[i]; pTable->KeyTable[i].PairwiseKey.pvKeyTable = (void *)&pTable->KeyTable[i];
for (jj=0; jj < MAX_GROUP_KEY; jj++) { for (jj = 0; jj < MAX_GROUP_KEY; jj++) {
pTable->KeyTable[i].GroupKey[jj].bKeyValid = false; pTable->KeyTable[i].GroupKey[jj].bKeyValid = false;
pTable->KeyTable[i].GroupKey[jj].pvKeyTable = (void *)&pTable->KeyTable[i]; pTable->KeyTable[i].GroupKey[jj].pvKeyTable = (void *)&pTable->KeyTable[i];
} }
...@@ -131,19 +131,19 @@ void KeyvInitTable (PSKeyManagement pTable, unsigned long dwIoBase) ...@@ -131,19 +131,19 @@ void KeyvInitTable (PSKeyManagement pTable, unsigned long dwIoBase)
* Return Value: true if found otherwise false * Return Value: true if found otherwise false
* *
*/ */
bool KeybGetKey ( bool KeybGetKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
PSKeyItem *pKey PSKeyItem *pKey
) )
{ {
int i; int i;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybGetKey() \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetKey() \n");
*pKey = NULL; *pKey = NULL;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
!compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
if (dwKeyIndex == 0xFFFFFFFF) { if (dwKeyIndex == 0xFFFFFFFF) {
...@@ -189,7 +189,7 @@ bool KeybGetKey ( ...@@ -189,7 +189,7 @@ bool KeybGetKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
bool KeybSetKey ( bool KeybSetKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
...@@ -199,17 +199,17 @@ bool KeybSetKey ( ...@@ -199,17 +199,17 @@ bool KeybSetKey (
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
) )
{ {
int i,j; int i, j;
unsigned int ii; unsigned int ii;
PSKeyItem pKey; PSKeyItem pKey;
unsigned int uKeyIdx; unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetKey: %lX\n", dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetKey: %lX\n", dwKeyIndex);
j = (MAX_KEY_TABLE-1); j = (MAX_KEY_TABLE-1);
for (i=0;i<(MAX_KEY_TABLE-1);i++) { for (i = 0; i < (MAX_KEY_TABLE - 1); i++) {
if ((pTable->KeyTable[i].bInUse == false) && if ((pTable->KeyTable[i].bInUse == false) &&
(j == (MAX_KEY_TABLE-1))) { (j == (MAX_KEY_TABLE-1))) {
// found empty table // found empty table
...@@ -232,7 +232,7 @@ bool KeybSetKey ( ...@@ -232,7 +232,7 @@ bool KeybSetKey (
if ((dwKeyIndex & TRANSMIT_KEY) != 0) { if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
// Group transmit key // Group transmit key
pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
} }
pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed
pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4); pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4);
...@@ -264,24 +264,24 @@ bool KeybSetKey ( ...@@ -264,24 +264,24 @@ bool KeybSetKey (
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybSetKey(R): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->uKeyLength: %d\n ", pKey->uKeyLength); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
return (true); return (true);
} }
} }
if (j < (MAX_KEY_TABLE-1)) { if (j < (MAX_KEY_TABLE-1)) {
memcpy(pTable->KeyTable[j].abyBSSID,pbyBSSID,ETH_ALEN); memcpy(pTable->KeyTable[j].abyBSSID, pbyBSSID, ETH_ALEN);
pTable->KeyTable[j].bInUse = true; pTable->KeyTable[j].bInUse = true;
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
// Pairwise key // Pairwise key
...@@ -297,7 +297,7 @@ bool KeybSetKey ( ...@@ -297,7 +297,7 @@ bool KeybSetKey (
if ((dwKeyIndex & TRANSMIT_KEY) != 0) { if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
// Group transmit key // Group transmit key
pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex; pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j);
} }
pTable->KeyTable[j].wKeyCtl &= 0xFF0F; // clear group key control filed pTable->KeyTable[j].wKeyCtl &= 0xFF0F; // clear group key control filed
pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4); pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4);
...@@ -329,18 +329,18 @@ bool KeybSetKey ( ...@@ -329,18 +329,18 @@ bool KeybSetKey (
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybSetKey(N): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(N): \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
return (true); return (true);
} }
...@@ -362,26 +362,26 @@ bool KeybSetKey ( ...@@ -362,26 +362,26 @@ bool KeybSetKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
bool KeybRemoveKey ( bool KeybRemoveKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long dwIoBase unsigned long dwIoBase
) )
{ {
int i; int i;
if (is_broadcast_ether_addr(pbyBSSID)) { if (is_broadcast_ether_addr(pbyBSSID)) {
// delete all keys // delete all keys
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
} }
s_vCheckKeyTableValid(pTable, dwIoBase); s_vCheckKeyTableValid(pTable, dwIoBase);
return true; return true;
} }
else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false; pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false;
if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) { if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) {
// remove Group transmit key // remove Group transmit key
...@@ -396,7 +396,7 @@ bool KeybRemoveKey ( ...@@ -396,7 +396,7 @@ bool KeybRemoveKey (
} }
} }
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
!compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
...@@ -435,19 +435,19 @@ bool KeybRemoveKey ( ...@@ -435,19 +435,19 @@ bool KeybRemoveKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
bool KeybRemoveAllKey ( bool KeybRemoveAllKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwIoBase unsigned long dwIoBase
) )
{ {
int i,u; int i, u;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
!compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
for(u=0;u<MAX_GROUP_KEY;u++) { for (u = 0; u < MAX_GROUP_KEY; u++) {
pTable->KeyTable[i].GroupKey[u].bKeyValid = false; pTable->KeyTable[i].GroupKey[u].bKeyValid = false;
} }
pTable->KeyTable[i].dwGTKeyIndex = 0; pTable->KeyTable[i].dwGTKeyIndex = 0;
...@@ -470,11 +470,11 @@ bool KeybRemoveAllKey ( ...@@ -470,11 +470,11 @@ bool KeybRemoveAllKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
void KeyvRemoveWEPKey ( void KeyvRemoveWEPKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long dwIoBase unsigned long dwIoBase
) )
{ {
if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
...@@ -492,14 +492,14 @@ void KeyvRemoveWEPKey ( ...@@ -492,14 +492,14 @@ void KeyvRemoveWEPKey (
return; return;
} }
void KeyvRemoveAllWEPKey ( void KeyvRemoveAllWEPKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwIoBase unsigned long dwIoBase
) )
{ {
int i; int i;
for(i=0;i<MAX_GROUP_KEY;i++) { for (i = 0; i < MAX_GROUP_KEY; i++) {
KeyvRemoveWEPKey(pTable, i, dwIoBase); KeyvRemoveWEPKey(pTable, i, dwIoBase);
} }
} }
...@@ -517,17 +517,17 @@ void KeyvRemoveAllWEPKey ( ...@@ -517,17 +517,17 @@ void KeyvRemoveAllWEPKey (
* Return Value: true if found otherwise false * Return Value: true if found otherwise false
* *
*/ */
bool KeybGetTransmitKey ( bool KeybGetTransmitKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyType, unsigned long dwKeyType,
PSKeyItem *pKey PSKeyItem *pKey
) )
{ {
int i, ii; int i, ii;
*pKey = NULL; *pKey = NULL;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
!compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
...@@ -536,51 +536,51 @@ bool KeybGetTransmitKey ( ...@@ -536,51 +536,51 @@ bool KeybGetTransmitKey (
if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) {
*pKey = &(pTable->KeyTable[i].PairwiseKey); *pKey = &(pTable->KeyTable[i].PairwiseKey);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"PAIRWISE_KEY: KeyTable.abyBSSID: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PAIRWISE_KEY: KeyTable.abyBSSID: ");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
return (true); return (true);
} }
else { else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"PairwiseKey.bKeyValid == false\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PairwiseKey.bKeyValid == false\n");
return (false); return (false);
} }
} // End of Type == PAIRWISE } // End of Type == PAIRWISE
else { else {
if (pTable->KeyTable[i].dwGTKeyIndex == 0) { if (pTable->KeyTable[i].dwGTKeyIndex == 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ERROR: dwGTKeyIndex == 0 !!!\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: dwGTKeyIndex == 0 !!!\n");
return false; return false;
} }
if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid == true) { if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid == true) {
*pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]); *pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GROUP_KEY: KeyTable.abyBSSID\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP_KEY: KeyTable.abyBSSID\n");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x ", pTable->KeyTable[i].abyBSSID[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex);
return (true); return (true);
} }
else { else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GroupKey.bKeyValid == false\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GroupKey.bKeyValid == false\n");
return (false); return (false);
} }
} // End of Type = GROUP } // End of Type = GROUP
} // BSSID match } // BSSID match
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ERROR: NO Match BSSID !!! "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: NO Match BSSID !!! ");
for (ii = 0; ii < 6; ii++) { for (ii = 0; ii < 6; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *(pbyBSSID+ii)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", *(pbyBSSID+ii));
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
return (false); return (false);
} }
...@@ -597,15 +597,15 @@ bool KeybGetTransmitKey ( ...@@ -597,15 +597,15 @@ bool KeybGetTransmitKey (
* Return Value: true if found otherwise false * Return Value: true if found otherwise false
* *
*/ */
bool KeybCheckPairewiseKey ( bool KeybCheckPairewiseKey(
PSKeyManagement pTable, PSKeyManagement pTable,
PSKeyItem *pKey PSKeyItem *pKey
) )
{ {
int i; int i;
*pKey = NULL; *pKey = NULL;
for (i=0;i<MAX_KEY_TABLE;i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if ((pTable->KeyTable[i].bInUse == true) &&
(pTable->KeyTable[i].PairwiseKey.bKeyValid == true)) { (pTable->KeyTable[i].PairwiseKey.bKeyValid == true)) {
*pKey = &(pTable->KeyTable[i].PairwiseKey); *pKey = &(pTable->KeyTable[i].PairwiseKey);
...@@ -631,7 +631,7 @@ bool KeybCheckPairewiseKey ( ...@@ -631,7 +631,7 @@ bool KeybCheckPairewiseKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
bool KeybSetDefaultKey ( bool KeybSetDefaultKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long uKeyLength, unsigned long uKeyLength,
...@@ -640,13 +640,13 @@ bool KeybSetDefaultKey ( ...@@ -640,13 +640,13 @@ bool KeybSetDefaultKey (
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
) )
{ {
unsigned int ii; unsigned int ii;
PSKeyItem pKey; PSKeyItem pKey;
unsigned int uKeyIdx; unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength);
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key
...@@ -658,16 +658,16 @@ bool KeybSetDefaultKey ( ...@@ -658,16 +658,16 @@ bool KeybSetDefaultKey (
if (uKeyLength > MAX_KEY_LEN) if (uKeyLength > MAX_KEY_LEN)
return false; return false;
pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true; pTable->KeyTable[MAX_KEY_TABLE - 1].bInUse = true;
for(ii=0;ii<ETH_ALEN;ii++) for (ii = 0; ii < ETH_ALEN; ii++)
pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; pTable->KeyTable[MAX_KEY_TABLE - 1].abyBSSID[ii] = 0xFF;
// Group key // Group key
pKey = &(pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF]); pKey = &(pTable->KeyTable[MAX_KEY_TABLE - 1].GroupKey[dwKeyIndex & 0x000000FF]);
if ((dwKeyIndex & TRANSMIT_KEY) != 0) { if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
// Group transmit key // Group transmit key
pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex; pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1);
} }
pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00; // clear all key control filed pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00; // clear all key control filed
...@@ -708,18 +708,18 @@ bool KeybSetDefaultKey ( ...@@ -708,18 +708,18 @@ bool KeybSetDefaultKey (
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybSetKey(R): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->bKeyValid: %d\n", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->uKeyLength: %d\n", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->abyKey: \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: \n");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%x", pKey->abyKey[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->wTSC15_0: %x\n", pKey->wTSC15_0);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex);
return (true); return (true);
} }
...@@ -741,7 +741,7 @@ bool KeybSetDefaultKey ( ...@@ -741,7 +741,7 @@ bool KeybSetDefaultKey (
* Return Value: true if success otherwise false * Return Value: true if success otherwise false
* *
*/ */
bool KeybSetAllGroupKey ( bool KeybSetAllGroupKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long uKeyLength, unsigned long uKeyLength,
...@@ -750,14 +750,14 @@ bool KeybSetAllGroupKey ( ...@@ -750,14 +750,14 @@ bool KeybSetAllGroupKey (
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
) )
{ {
int i; int i;
unsigned int ii; unsigned int ii;
PSKeyItem pKey; PSKeyItem pKey;
unsigned int uKeyIdx; unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex);
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key
...@@ -766,7 +766,7 @@ bool KeybSetAllGroupKey ( ...@@ -766,7 +766,7 @@ bool KeybSetAllGroupKey (
return (false); return (false);
} }
for (i=0; i < MAX_KEY_TABLE-1; i++) { for (i = 0; i < MAX_KEY_TABLE - 1; i++) {
if (pTable->KeyTable[i].bInUse == true) { if (pTable->KeyTable[i].bInUse == true) {
// found table already exist // found table already exist
// Group key // Group key
...@@ -774,7 +774,7 @@ bool KeybSetAllGroupKey ( ...@@ -774,7 +774,7 @@ bool KeybSetAllGroupKey (
if ((dwKeyIndex & TRANSMIT_KEY) != 0) { if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
// Group transmit key // Group transmit key
pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
} }
pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed
...@@ -807,14 +807,14 @@ bool KeybSetAllGroupKey ( ...@@ -807,14 +807,14 @@ bool KeybSetAllGroupKey (
pKey->dwTSC47_16 = 0; pKey->dwTSC47_16 = 0;
pKey->wTSC15_0 = 0; pKey->wTSC15_0 = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybSetKey(R): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->bKeyValid: %d\n ", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n ", pKey->bKeyValid);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n ", (int)pKey->uKeyLength);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->abyKey: "); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->abyKey: ");
for (ii = 0; ii < pKey->uKeyLength; ii++) { for (ii = 0; ii < pKey->uKeyLength; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", pKey->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pKey->abyKey[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n");
//DBG_PRN_GRP12(("pKey->dwTSC47_16: %lX\n ", pKey->dwTSC47_16)); //DBG_PRN_GRP12(("pKey->dwTSC47_16: %lX\n ", pKey->dwTSC47_16));
//DBG_PRN_GRP12(("pKey->wTSC15_0: %X\n ", pKey->wTSC15_0)); //DBG_PRN_GRP12(("pKey->wTSC15_0: %X\n ", pKey->wTSC15_0));
......
...@@ -89,7 +89,7 @@ typedef struct tagSKeyTable ...@@ -89,7 +89,7 @@ typedef struct tagSKeyTable
typedef struct tagSKeyManagement typedef struct tagSKeyManagement
{ {
SKeyTable KeyTable[MAX_KEY_TABLE]; SKeyTable KeyTable[MAX_KEY_TABLE];
} SKeyManagement, * PSKeyManagement; } SKeyManagement, *PSKeyManagement;
/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Types ------------------------------*/
...@@ -108,7 +108,7 @@ bool KeybGetKey( ...@@ -108,7 +108,7 @@ bool KeybGetKey(
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
PSKeyItem *pKey PSKeyItem *pKey
); );
bool KeybSetKey( bool KeybSetKey(
PSKeyManagement pTable, PSKeyManagement pTable,
...@@ -120,7 +120,7 @@ bool KeybSetKey( ...@@ -120,7 +120,7 @@ bool KeybSetKey(
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
); );
bool KeybSetDefaultKey( bool KeybSetDefaultKey(
PSKeyManagement pTable, PSKeyManagement pTable,
...@@ -131,45 +131,45 @@ bool KeybSetDefaultKey( ...@@ -131,45 +131,45 @@ bool KeybSetDefaultKey(
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
); );
bool KeybRemoveKey( bool KeybRemoveKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long dwIoBase unsigned long dwIoBase
); );
bool KeybGetTransmitKey( bool KeybGetTransmitKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwKeyType, unsigned long dwKeyType,
PSKeyItem *pKey PSKeyItem *pKey
); );
bool KeybCheckPairewiseKey( bool KeybCheckPairewiseKey(
PSKeyManagement pTable, PSKeyManagement pTable,
PSKeyItem *pKey PSKeyItem *pKey
); );
bool KeybRemoveAllKey( bool KeybRemoveAllKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned char *pbyBSSID, unsigned char *pbyBSSID,
unsigned long dwIoBase unsigned long dwIoBase
); );
void KeyvRemoveWEPKey( void KeyvRemoveWEPKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long dwIoBase unsigned long dwIoBase
); );
void KeyvRemoveAllWEPKey( void KeyvRemoveAllWEPKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwIoBase unsigned long dwIoBase
); );
bool KeybSetAllGroupKey ( bool KeybSetAllGroupKey(
PSKeyManagement pTable, PSKeyManagement pTable,
unsigned long dwKeyIndex, unsigned long dwKeyIndex,
unsigned long uKeyLength, unsigned long uKeyLength,
...@@ -178,7 +178,7 @@ bool KeybSetAllGroupKey ( ...@@ -178,7 +178,7 @@ bool KeybSetAllGroupKey (
unsigned char byKeyDecMode, unsigned char byKeyDecMode,
unsigned long dwIoBase, unsigned long dwIoBase,
unsigned char byLocalID unsigned char byLocalID
); );
#endif // __KEY_H__ #endif // __KEY_H__
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册