diff options
Diffstat (limited to 'drivers/staging/vt6656/wpactl.c')
-rw-r--r-- | drivers/staging/vt6656/wpactl.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c index 53629b2..9f1b413 100644 --- a/drivers/staging/vt6656/wpactl.c +++ b/drivers/staging/vt6656/wpactl.c @@ -42,18 +42,8 @@ #include "rndis.h" #include "rf.h" -/*--------------------- Static Definitions -------------------------*/ - -/*--------------------- Static Classes ----------------------------*/ - -/*--------------------- Static Variables --------------------------*/ static int msglevel = MSG_LEVEL_INFO; -/*--------------------- Static Functions --------------------------*/ - -/*--------------------- Export Variables --------------------------*/ - - /* * Description: * Set WPA algorithm & keys @@ -71,11 +61,11 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) { struct viawget_wpa_param *param = ctx; struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; - DWORD dwKeyIndex = 0; - BYTE abyKey[MAX_KEY_LEN]; - BYTE abySeq[MAX_KEY_LEN]; + u32 dwKeyIndex = 0; + u8 abyKey[MAX_KEY_LEN]; + u8 abySeq[MAX_KEY_LEN]; u64 KeyRSC; - BYTE byKeyDecMode = KEY_CTL_WEP; + u8 byKeyDecMode = KEY_CTL_WEP; int ret = 0; int uu; int ii; @@ -101,14 +91,14 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len); - dwKeyIndex = (DWORD)(param->u.wpa_key.key_index); + dwKeyIndex = (u32)(param->u.wpa_key.key_index); if (param->u.wpa_key.alg_name == WPA_ALG_WEP) { if (dwKeyIndex > 3) { return -EINVAL; } else { if (param->u.wpa_key.set_tx) { - pDevice->byKeyIndex = (BYTE)dwKeyIndex; + pDevice->byKeyIndex = (u8)dwKeyIndex; pDevice->bTransmitKey = true; dwKeyIndex |= (1 << 31); } @@ -127,7 +117,6 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) return ret; } - if (param->u.wpa_key.seq && param->u.wpa_key.seq_len > sizeof(abySeq)) return -EINVAL; @@ -159,7 +148,6 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) if (param->u.wpa_key.set_tx) dwKeyIndex |= (1 << 31); - if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) byKeyDecMode = KEY_CTL_CCMP; else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) @@ -204,7 +192,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) if ((KeybSetAllGroupKey(pDevice, &(pDevice->sKey), dwKeyIndex, param->u.wpa_key.key_len, &KeyRSC, - (PBYTE)abyKey, + (u8 *)abyKey, byKeyDecMode ) == true) && (KeybSetDefaultKey(pDevice, @@ -212,7 +200,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) dwKeyIndex, param->u.wpa_key.key_len, &KeyRSC, - (PBYTE)abyKey, + (u8 *)abyKey, byKeyDecMode ) == true) ) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n"); @@ -234,7 +222,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) } if (KeybSetKey(pDevice, &(pDevice->sKey), ¶m->addr[0], dwKeyIndex, param->u.wpa_key.key_len, - &KeyRSC, (PBYTE)abyKey, byKeyDecMode + &KeyRSC, (u8 *)abyKey, byKeyDecMode ) == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Pairwise Key Set\n"); } else { @@ -250,7 +238,7 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) } } // BSSID not 0xffffffffffff if ((ret == 0) && ((param->u.wpa_key.set_tx) != 0)) { - pDevice->byKeyIndex = (BYTE)param->u.wpa_key.key_index; + pDevice->byKeyIndex = (u8)param->u.wpa_key.key_index; pDevice->bTransmitKey = true; } pDevice->bEncryptionEnable = true; @@ -258,4 +246,3 @@ int wpa_set_keys(struct vnt_private *pDevice, void *ctx) return ret; } - |