Commit da033bfd authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78f41c91
This diff is collapsed.
...@@ -60,13 +60,12 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -60,13 +60,12 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
static void s_vCheckKeyTableValid(void *pDeviceHandler, static void s_vCheckKeyTableValid(struct vnt_private *pDevice,
PSKeyManagement pTable) PSKeyManagement pTable)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int i;
int i; u16 wLength = 0;
WORD wLength = 0; u8 pbyData[MAX_KEY_TABLE];
BYTE pbyData[MAX_KEY_TABLE];
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) &&
...@@ -112,12 +111,10 @@ static void s_vCheckKeyTableValid(void *pDeviceHandler, ...@@ -112,12 +111,10 @@ static void s_vCheckKeyTableValid(void *pDeviceHandler,
* Return Value: none * Return Value: none
* *
*/ */
void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable) void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int i, jj;
int i; u8 pbyData[MAX_KEY_TABLE+1];
int jj;
BYTE pbyData[MAX_KEY_TABLE+1];
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
for (i=0;i<MAX_KEY_TABLE;i++) { for (i=0;i<MAX_KEY_TABLE;i++) {
...@@ -164,12 +161,12 @@ void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable) ...@@ -164,12 +161,12 @@ void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable)
* Return Value: TRUE if found otherwise FALSE * Return Value: TRUE if found otherwise FALSE
* *
*/ */
BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex, int KeybGetKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 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++) {
...@@ -218,22 +215,13 @@ BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex, ...@@ -218,22 +215,13 @@ BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex,
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
BOOL KeybSetKey( int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
void *pDeviceHandler, u8 *pbyBSSID, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
PSKeyManagement pTable, u8 byKeyDecMode)
PBYTE pbyBSSID,
DWORD dwKeyIndex,
u32 uKeyLength,
u64 *KeyRSC,
PBYTE pbyKey,
BYTE byKeyDecMode
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; PSKeyItem pKey;
int i,j; int i, j, ii;
unsigned int ii; u32 uKeyIdx;
PSKeyItem pKey;
unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Enter KeybSetKey: %X\n", dwKeyIndex); "Enter KeybSetKey: %X\n", dwKeyIndex);
...@@ -397,16 +385,12 @@ BOOL KeybSetKey( ...@@ -397,16 +385,12 @@ BOOL KeybSetKey(
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
BOOL KeybRemoveKey(
void *pDeviceHandler, int KeybRemoveKey(struct vnt_private *pDevice, PSKeyManagement pTable,
PSKeyManagement pTable, u8 *pbyBSSID, u32 dwKeyIndex)
PBYTE pbyBSSID,
DWORD dwKeyIndex
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int i;
int i; int bReturnValue = FALSE;
BOOL bReturnValue = FALSE;
if (is_broadcast_ether_addr(pbyBSSID)) { if (is_broadcast_ether_addr(pbyBSSID)) {
// delete all keys // delete all keys
...@@ -478,14 +462,10 @@ BOOL KeybRemoveKey( ...@@ -478,14 +462,10 @@ BOOL KeybRemoveKey(
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
BOOL KeybRemoveAllKey( int KeybRemoveAllKey(struct vnt_private *pDevice, PSKeyManagement pTable,
void *pDeviceHandler, u8 *pbyBSSID)
PSKeyManagement pTable,
PBYTE pbyBSSID
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; 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) &&
...@@ -514,13 +494,9 @@ BOOL KeybRemoveAllKey( ...@@ -514,13 +494,9 @@ BOOL KeybRemoveAllKey(
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
void KeyvRemoveWEPKey( void KeyvRemoveWEPKey(struct vnt_private *pDevice, PSKeyManagement pTable,
void *pDeviceHandler, u32 dwKeyIndex)
PSKeyManagement pTable,
DWORD dwKeyIndex
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler;
if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == TRUE) { if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == TRUE) {
...@@ -537,9 +513,8 @@ void KeyvRemoveWEPKey( ...@@ -537,9 +513,8 @@ void KeyvRemoveWEPKey(
return; return;
} }
void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable) void KeyvRemoveAllWEPKey(struct vnt_private *pDevice, PSKeyManagement pTable)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler;
int i; int i;
for (i = 0; i < MAX_GROUP_KEY; i++) for (i = 0; i < MAX_GROUP_KEY; i++)
...@@ -559,12 +534,13 @@ void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable) ...@@ -559,12 +534,13 @@ void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable)
* Return Value: TRUE if found otherwise FALSE * Return Value: TRUE if found otherwise FALSE
* *
*/ */
BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType, int KeybGetTransmitKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 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)) {
...@@ -636,11 +612,12 @@ BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType, ...@@ -636,11 +612,12 @@ BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType,
* Return Value: TRUE if found otherwise FALSE * 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++) { 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)) {
...@@ -667,20 +644,14 @@ BOOL KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey) ...@@ -667,20 +644,14 @@ BOOL KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey)
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
BOOL KeybSetDefaultKey(
void *pDeviceHandler, int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable,
PSKeyManagement pTable, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
DWORD dwKeyIndex, u8 byKeyDecMode)
u32 uKeyLength,
u64 *KeyRSC,
PBYTE pbyKey,
BYTE byKeyDecMode
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int ii;
unsigned int ii; PSKeyItem pKey;
PSKeyItem pKey; u32 uKeyIdx;
unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d\n",
(int) dwKeyIndex, (int) uKeyLength); (int) dwKeyIndex, (int) uKeyLength);
...@@ -783,21 +754,14 @@ BOOL KeybSetDefaultKey( ...@@ -783,21 +754,14 @@ BOOL KeybSetDefaultKey(
* Return Value: TRUE if success otherwise FALSE * Return Value: TRUE if success otherwise FALSE
* *
*/ */
BOOL KeybSetAllGroupKey(
void *pDeviceHandler, int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable,
PSKeyManagement pTable, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
DWORD dwKeyIndex, u8 byKeyDecMode)
u32 uKeyLength,
u64 *KeyRSC,
PBYTE pbyKey,
BYTE byKeyDecMode
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int i, ii;
int i; PSKeyItem pKey;
unsigned int ii; u32 uKeyIdx;
PSKeyItem pKey;
unsigned int uKeyIdx;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n",
dwKeyIndex); dwKeyIndex);
......
...@@ -97,69 +97,37 @@ typedef struct tagSKeyManagement ...@@ -97,69 +97,37 @@ typedef struct tagSKeyManagement
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void KeyvInitTable(void *pDeviceHandler, PSKeyManagement pTable); void KeyvInitTable(struct vnt_private *, PSKeyManagement pTable);
BOOL KeybGetKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyIndex, int KeybGetKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 dwKeyIndex,
PSKeyItem *pKey); PSKeyItem *pKey);
BOOL KeybSetKey( int KeybSetKey(struct vnt_private *, PSKeyManagement pTable, u8 *pbyBSSID,
void *pDeviceHandler, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
PSKeyManagement pTable, u8 byKeyDecMode);
PBYTE pbyBSSID,
DWORD dwKeyIndex, int KeybRemoveKey(struct vnt_private *, PSKeyManagement pTable,
u32 uKeyLength, u8 *pbyBSSID, u32 dwKeyIndex);
u64 *KeyRSC,
PBYTE pbyKey, int KeybRemoveAllKey(struct vnt_private *, PSKeyManagement pTable,
BYTE byKeyDecMode u8 *pbyBSSID);
);
void KeyvRemoveWEPKey(struct vnt_private *, PSKeyManagement pTable,
BOOL KeybRemoveKey( u32 dwKeyIndex);
void *pDeviceHandler,
PSKeyManagement pTable, void KeyvRemoveAllWEPKey(struct vnt_private *, PSKeyManagement pTable);
PBYTE pbyBSSID,
DWORD dwKeyIndex int KeybGetTransmitKey(PSKeyManagement pTable, u8 *pbyBSSID, u32 dwKeyType,
); PSKeyItem *pKey);
BOOL KeybRemoveAllKey( int KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey);
void *pDeviceHandler,
PSKeyManagement pTable, int KeybSetDefaultKey(struct vnt_private *, PSKeyManagement pTable,
PBYTE pbyBSSID u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
); u8 byKeyDecMode);
void KeyvRemoveWEPKey( int KeybSetAllGroupKey(struct vnt_private *, PSKeyManagement pTable,
void *pDeviceHandler, u32 dwKeyIndex, u32 uKeyLength, u64 *KeyRSC, u8 *pbyKey,
PSKeyManagement pTable, u8 byKeyDecMode);
DWORD dwKeyIndex
);
void KeyvRemoveAllWEPKey(
void *pDeviceHandler,
PSKeyManagement pTable
);
BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType,
PSKeyItem *pKey);
BOOL KeybCheckPairewiseKey(PSKeyManagement pTable, PSKeyItem *pKey);
BOOL KeybSetDefaultKey(
void *pDeviceHandler,
PSKeyManagement pTable,
DWORD dwKeyIndex,
u32 uKeyLength,
u64 *KeyRSC,
PBYTE pbyKey,
BYTE byKeyDecMode
);
BOOL KeybSetAllGroupKey(
void *pDeviceHandler,
PSKeyManagement pTable,
DWORD dwKeyIndex,
u32 uKeyLength,
u64 *KeyRSC,
PBYTE pbyKey,
BYTE byKeyDecMode
);
#endif /* __KEY_H__ */ #endif /* __KEY_H__ */
This diff is collapsed.
...@@ -60,25 +60,15 @@ ...@@ -60,25 +60,15 @@
/*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
extern const BYTE RFaby11aChannelIndex[200]; extern const u8 RFaby11aChannelIndex[200];
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
BOOL IFRFbWriteEmbedded(PSDevice pDevice, DWORD dwData); int IFRFbWriteEmbedded(struct vnt_private *, u32 dwData);
BOOL RFbSetPower(PSDevice pDevice, unsigned int uRATE, unsigned int uCH); int RFbSetPower(struct vnt_private *, u32 uRATE, u32 uCH);
int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
BOOL RFbRawSetPower( void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
PSDevice pDevice, void RFbRFTableDownload(struct vnt_private *pDevice);
BYTE byPwr, int s_bVT3226D0_11bLoCurrentAdjust(struct vnt_private *, u8 byChannel,
unsigned int uRATE int b11bMode);
);
void RFvRSSITodBm(PSDevice pDevice, BYTE byCurrRSSI, long *pldBm);
void RFbRFTableDownload(PSDevice pDevice);
BOOL s_bVT3226D0_11bLoCurrentAdjust(
PSDevice pDevice,
BYTE byChannel,
BOOL b11bMode
);
#endif /* __RF_H__ */ #endif /* __RF_H__ */
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