diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2012-12-10 22:12:07 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-07 11:13:32 -0800 |
commit | da033bfd7a016c0a143db0a2345c4312a35ed896 (patch) | |
tree | 1e12205367d7ac3a212a936f0a11e69fe1251190 /drivers/staging/vt6656/key.c | |
parent | 78f41c913e31ed498d463e77301df3408bf9ba08 (diff) |
staging: vt6656: iwctl/key/rf use new structures.
This patch cleans up function declarations, definitions and local variables
were appropriate replacing types defined in "ttype.h" with linux/types.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/key.c')
-rw-r--r-- | drivers/staging/vt6656/key.c | 140 |
1 files changed, 52 insertions, 88 deletions
diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c index 6f6a2197aca1..87eab91293c1 100644 --- a/drivers/staging/vt6656/key.c +++ b/drivers/staging/vt6656/key.c @@ -60,13 +60,12 @@ static int msglevel =MSG_LEVEL_INFO; /*--------------------- Static Variables --------------------------*/ /*--------------------- Static Functions --------------------------*/ -static void s_vCheckKeyTableValid(void *pDeviceHandler, - PSKeyManagement pTable) +static void s_vCheckKeyTableValid(struct vnt_private *pDevice, + PSKeyManagement pTable) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i; - WORD wLength = 0; - BYTE pbyData[MAX_KEY_TABLE]; + int i; + u16 wLength = 0; + u8 pbyData[MAX_KEY_TABLE]; for (i=0;i<MAX_KEY_TABLE;i++) { if ((pTable->KeyTable[i].bInUse == TRUE) && @@ -112,12 +111,10 @@ static void s_vCheckKeyTableValid(void *pDeviceHandler, * Return Value: none * */ -void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable) +void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i; - int jj; - BYTE pbyData[MAX_KEY_TABLE+1]; + int i, jj; + u8 pbyData[MAX_KEY_TABLE+1]; spin_lock_irq(&pDevice->lock); for (i=0;i<MAX_KEY_TABLE;i++) { @@ -164,12 +161,12 @@ void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable) * Return Value: TRUE if found otherwise FALSE * */ -BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex, - PSKeyItem *pKey) +int KeybGetKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 dwKeyIndex, + 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; for (i=0;i<MAX_KEY_TABLE;i++) { @@ -218,22 +215,13 @@ BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex, * Return Value: TRUE if success otherwise FALSE * */ -BOOL KeybSetKey( - void *pDeviceHandler, - PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, - u32 uKeyLength, - u64 *KeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode - ) +int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u8 *pbyBSSID, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey, + u8 byKeyDecMode) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i,j; - unsigned int ii; - PSKeyItem pKey; - unsigned int uKeyIdx; + PSKeyItem pKey; + int i, j, ii; + u32 uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetKey: %X\n", dwKeyIndex); @@ -397,16 +385,12 @@ BOOL KeybSetKey( * Return Value: TRUE if success otherwise FALSE * */ -BOOL KeybRemoveKey( - void *pDeviceHandler, - PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex - ) + +int KeybRemoveKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u8 *pbyBSSID, u32 dwKeyIndex) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i; - BOOL bReturnValue = FALSE; + int i; + int bReturnValue = FALSE; if (is_broadcast_ether_addr(pbyBSSID)) { // delete all keys @@ -478,14 +462,10 @@ BOOL KeybRemoveKey( * Return Value: TRUE if success otherwise FALSE * */ -BOOL KeybRemoveAllKey( - void *pDeviceHandler, - PSKeyManagement pTable, - PBYTE pbyBSSID - ) +int KeybRemoveAllKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u8 *pbyBSSID) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i,u; + int i, u; for (i=0;i<MAX_KEY_TABLE;i++) { if ((pTable->KeyTable[i].bInUse == TRUE) && @@ -514,13 +494,9 @@ BOOL KeybRemoveAllKey( * Return Value: TRUE if success otherwise FALSE * */ -void KeyvRemoveWEPKey( - void *pDeviceHandler, - PSKeyManagement pTable, - DWORD dwKeyIndex - ) +void KeyvRemoveWEPKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u32 dwKeyIndex) { - PSDevice pDevice = (PSDevice) pDeviceHandler; if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == TRUE) { @@ -537,9 +513,8 @@ void KeyvRemoveWEPKey( return; } -void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable) +void KeyvRemoveAllWEPKey(struct vnt_private *pDevice, PSKeyManagement pTable) { - PSDevice pDevice = (PSDevice) pDeviceHandler; int i; for (i = 0; i < MAX_GROUP_KEY; i++) @@ -559,12 +534,13 @@ void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable) * Return Value: TRUE if found otherwise FALSE * */ -BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType, - PSKeyItem *pKey) +int KeybGetTransmitKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 dwKeyType, + PSKeyItem *pKey) { - int i, ii; + int i, ii; + + *pKey = NULL; - *pKey = NULL; for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == TRUE) && !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { @@ -636,11 +612,12 @@ BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType, * Return Value: TRUE if found otherwise FALSE * */ -BOOL KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey) +int KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey) { - int i; + int i; + + *pKey = NULL; - *pKey = NULL; for (i=0;i<MAX_KEY_TABLE;i++) { if ((pTable->KeyTable[i].bInUse == TRUE) && (pTable->KeyTable[i].PairwiseKey.bKeyValid == TRUE)) { @@ -667,20 +644,14 @@ BOOL KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey) * Return Value: TRUE if success otherwise FALSE * */ -BOOL KeybSetDefaultKey( - void *pDeviceHandler, - PSKeyManagement pTable, - DWORD dwKeyIndex, - u32 uKeyLength, - u64 *KeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode - ) + +int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey, + u8 byKeyDecMode) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - unsigned int ii; - PSKeyItem pKey; - unsigned int uKeyIdx; + int ii; + PSKeyItem pKey; + u32 uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d\n", (int) dwKeyIndex, (int) uKeyLength); @@ -783,21 +754,14 @@ BOOL KeybSetDefaultKey( * Return Value: TRUE if success otherwise FALSE * */ -BOOL KeybSetAllGroupKey( - void *pDeviceHandler, - PSKeyManagement pTable, - DWORD dwKeyIndex, - u32 uKeyLength, - u64 *KeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode - ) + +int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable, + u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey, + u8 byKeyDecMode) { - PSDevice pDevice = (PSDevice) pDeviceHandler; - int i; - unsigned int ii; - PSKeyItem pKey; - unsigned int uKeyIdx; + int i, ii; + PSKeyItem pKey; + u32 uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n", dwKeyIndex); |