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

staging: vt6656: wpa_set_keys remove fcpfkernel

Only TRUE is ever called, remove FALSE code.

Since copy_from_user has been removed, the unlock..lock spin locks have been removed.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0fdb56da
...@@ -1724,7 +1724,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, ...@@ -1724,7 +1724,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info,
} }
/*******/ /*******/
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
ret = wpa_set_keys(pDevice, param, TRUE); ret = wpa_set_keys(pDevice, param);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
error: error:
......
...@@ -67,7 +67,7 @@ static int msglevel = MSG_LEVEL_INFO; ...@@ -67,7 +67,7 @@ static int msglevel = MSG_LEVEL_INFO;
* Return Value: * Return Value:
* *
*/ */
int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel) int wpa_set_keys(PSDevice pDevice, void *ctx)
{ {
struct viawget_wpa_param *param = ctx; struct viawget_wpa_param *param = ctx;
PSMgmtObject pMgmt = &pDevice->sMgmtObj; PSMgmtObject pMgmt = &pDevice->sMgmtObj;
...@@ -99,18 +99,7 @@ static int msglevel = MSG_LEVEL_INFO; ...@@ -99,18 +99,7 @@ static int msglevel = MSG_LEVEL_INFO;
if (param->u.wpa_key.key && param->u.wpa_key.key_len > sizeof(abyKey)) if (param->u.wpa_key.key && param->u.wpa_key.key_len > sizeof(abyKey))
return -EINVAL; return -EINVAL;
spin_unlock_irq(&pDevice->lock); memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
if (param->u.wpa_key.key && fcpfkernel) {
memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
} else {
if (param->u.wpa_key.key &&
copy_from_user(&abyKey[0], param->u.wpa_key.key,
param->u.wpa_key.key_len)) {
spin_lock_irq(&pDevice->lock);
return -EINVAL;
}
}
spin_lock_irq(&pDevice->lock);
dwKeyIndex = (DWORD)(param->u.wpa_key.key_index); dwKeyIndex = (DWORD)(param->u.wpa_key.key_index);
...@@ -142,18 +131,7 @@ static int msglevel = MSG_LEVEL_INFO; ...@@ -142,18 +131,7 @@ static int msglevel = MSG_LEVEL_INFO;
if (param->u.wpa_key.seq && param->u.wpa_key.seq_len > sizeof(abySeq)) if (param->u.wpa_key.seq && param->u.wpa_key.seq_len > sizeof(abySeq))
return -EINVAL; return -EINVAL;
spin_unlock_irq(&pDevice->lock); memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len);
if (param->u.wpa_key.seq && fcpfkernel) {
memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len);
} else {
if (param->u.wpa_key.seq &&
copy_from_user(&abySeq[0], param->u.wpa_key.seq,
param->u.wpa_key.seq_len)) {
spin_lock_irq(&pDevice->lock);
return -EINVAL;
}
}
spin_lock_irq(&pDevice->lock);
if (param->u.wpa_key.seq_len > 0) { if (param->u.wpa_key.seq_len > 0) {
for (ii = 0 ; ii < param->u.wpa_key.seq_len ; ii++) { for (ii = 0 ; ii < param->u.wpa_key.seq_len ; ii++) {
......
...@@ -52,6 +52,6 @@ typedef unsigned long long NDIS_802_11_KEY_RSC; ...@@ -52,6 +52,6 @@ typedef unsigned long long NDIS_802_11_KEY_RSC;
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel); int wpa_set_keys(PSDevice pDevice, void *ctx);
#endif /* __WPACL_H__ */ #endif /* __WPACL_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