X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fstaging%2Fvt6656%2Fhostap.c;h=c699a3058b39920a34daf1a6f63524be990e29cb;hb=9f1b2556c57f1fd861313902311275e89f7d9fba;hp=bc5e9da475862bff35d321897a247234e66d5ac0;hpb=69df2ac1288b456a95aceadafbf88cd891a577c8;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c index bc5e9da47586..c699a3058b39 100644 --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c @@ -133,7 +133,7 @@ static int hostap_disable_hostapd(struct vnt_private *pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", pDevice->dev->name, pDevice->apdev->name); } - kfree(pDevice->apdev); + free_netdev(pDevice->apdev); pDevice->apdev = NULL; pDevice->bEnable8021x = false; pDevice->bEnableHostWEP = false; @@ -142,7 +142,6 @@ static int hostap_disable_hostapd(struct vnt_private *pDevice, int rtnl_locked) return 0; } - /* * Description: * Set enable/disable hostapd mode @@ -174,7 +173,6 @@ int vt6656_hostap_set_hostapd(struct vnt_private *pDevice, return hostap_disable_hostapd(pDevice, rtnl_locked); } - /* * Description: * remove station function supported for hostap daemon @@ -193,7 +191,6 @@ static int hostap_remove_sta(struct vnt_private *pDevice, { unsigned int uNodeIndex; - if (BSSbIsSTAInNodeDB(pDevice, param->sta_addr, &uNodeIndex)) { BSSvRemoveOneNode(pDevice, uNodeIndex); } @@ -242,7 +239,7 @@ static int hostap_add_sta(struct vnt_private *pDevice, pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(pMgmt->sNodeDBTable[uNodeIndex].wCapInfo); - pMgmt->sNodeDBTable[uNodeIndex].wAID = (WORD)param->u.add_sta.aid; + pMgmt->sNodeDBTable[uNodeIndex].wAID = (u16)param->u.add_sta.aid; pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer = jiffies; @@ -294,7 +291,6 @@ static int hostap_get_info_sta(struct vnt_private *pDevice, return 0; } - /* * Description: * set station flag @@ -327,8 +323,6 @@ static int hostap_set_flags_sta(struct vnt_private *pDevice, return 0; } - - /* * Description: * set generic element (wpa ie) @@ -347,8 +341,6 @@ static int hostap_set_generic_element(struct vnt_private *pDevice, { struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; - - memcpy( pMgmt->abyWPAIE, param->u.generic_elem.data, param->u.generic_elem.len @@ -425,13 +417,11 @@ static int hostap_set_encryption(struct vnt_private *pDevice, int bKeyTableFull = false; u16 wKeyCtl = 0; - param->u.crypt.err = 0; if (param->u.crypt.alg > WPA_ALG_CCMP) return -EINVAL; - if ((param->u.crypt.idx > 3) || (param->u.crypt.key_len > MAX_KEY_LEN)) { param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_KEY_SET_FAILED\n"); @@ -489,9 +479,9 @@ static int hostap_set_encryption(struct vnt_private *pDevice, param->u.crypt.key_len ); - dwKeyIndex = (DWORD)(param->u.crypt.idx); + dwKeyIndex = (u32)(param->u.crypt.idx); if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) { - pDevice->byKeyIndex = (BYTE)dwKeyIndex; + pDevice->byKeyIndex = (u8)dwKeyIndex; pDevice->bTransmitKey = true; dwKeyIndex |= (1 << 31); } @@ -515,11 +505,10 @@ static int hostap_set_encryption(struct vnt_private *pDevice, ¶m->sta_addr[0], dwKeyIndex & ~(USE_KEYRSC), param->u.crypt.key_len, - &KeyRSC, (PBYTE)abyKey, + &KeyRSC, (u8 *)abyKey, KEY_CTL_WEP ) == true) { - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { @@ -565,7 +554,6 @@ static int hostap_set_encryption(struct vnt_private *pDevice, pMgmt->byCSSGK = KEY_CTL_CCMP; } - if (iNodeIndex == 0) { KeybSetDefaultKey( pDevice, &(pDevice->sKey), @@ -585,7 +573,7 @@ static int hostap_set_encryption(struct vnt_private *pDevice, dwKeyIndex, param->u.crypt.key_len, &KeyRSC, - (PBYTE)abyKey, + (u8 *)abyKey, byKeyDecMode ) == true) { @@ -631,8 +619,6 @@ static int hostap_set_encryption(struct vnt_private *pDevice, return ret; } - - /* * Description: * get each stations encryption key @@ -655,7 +641,6 @@ static int hostap_get_encryption(struct vnt_private *pDevice, int ii; s32 iNodeIndex = 0; - param->u.crypt.err = 0; if (is_broadcast_ether_addr(param->sta_addr)) { @@ -670,13 +655,12 @@ static int hostap_get_encryption(struct vnt_private *pDevice, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex); memset(param->u.crypt.seq, 0, 8); for (ii = 0 ; ii < 8 ; ii++) { - param->u.crypt.seq[ii] = (BYTE)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8); + param->u.crypt.seq[ii] = (u8)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8); } return ret; } - /* * Description: * vt6656_hostap_ioctl main function supported for hostap daemon. @@ -779,7 +763,6 @@ int vt6656_hostap_ioctl(struct vnt_private *pDevice, struct iw_point *p) goto out; } - if ((ret == 0) && ap_ioctl) { if (copy_to_user(p->pointer, param, p->length)) { ret = -EFAULT;