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

staging: vt6656: lock changes: Remove spin locks.

Remove atomic paths to usbpipe.c PIPEnsControlOut and PIPEnsControlIn

Remove from
PIPEnsControlOut
PIPEnsControlIn
BSSvSecondCallBack
vt6656_hostap_ioctl
iwctl_siwmode
iwctl_siwencode
iwctl_siwpower
iwctl_siwencodeext
KeyvInitTable
device_init_registers
device_open
device_close
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 30a05b39
...@@ -818,8 +818,6 @@ void BSSvSecondCallBack(struct work_struct *work) ...@@ -818,8 +818,6 @@ void BSSvSecondCallBack(struct work_struct *work)
if (pDevice->Flags & fMP_DISCONNECTED) if (pDevice->Flags & fMP_DISCONNECTED)
return; return;
spin_lock_irq(&pDevice->lock);
pDevice->uAssocCount = 0; pDevice->uAssocCount = 0;
/* Power Saving Mode Tx Burst */ /* Power Saving Mode Tx Burst */
...@@ -1158,8 +1156,6 @@ void BSSvSecondCallBack(struct work_struct *work) ...@@ -1158,8 +1156,6 @@ void BSSvSecondCallBack(struct work_struct *work)
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
} }
spin_unlock_irq(&pDevice->lock);
schedule_delayed_work(&pDevice->second_callback_work, HZ); schedule_delayed_work(&pDevice->second_callback_work, HZ);
} }
......
...@@ -44,7 +44,7 @@ static int msglevel = MSG_LEVEL_INFO; ...@@ -44,7 +44,7 @@ static int msglevel = MSG_LEVEL_INFO;
#define FIRMWARE_CHUNK_SIZE 0x400 #define FIRMWARE_CHUNK_SIZE 0x400
int FIRMWAREbDownload(struct vnt_private *pDevice) __must_hold(&pDevice->lock) int FIRMWAREbDownload(struct vnt_private *pDevice)
{ {
struct device *dev = &pDevice->usb->dev; struct device *dev = &pDevice->usb->dev;
const struct firmware *fw; const struct firmware *fw;
......
...@@ -698,9 +698,9 @@ int vt6656_hostap_ioctl(struct vnt_private *pDevice, struct iw_point *p) ...@@ -698,9 +698,9 @@ int vt6656_hostap_ioctl(struct vnt_private *pDevice, struct iw_point *p)
switch (param->cmd) { switch (param->cmd) {
case VIAWGET_HOSTAPD_SET_ENCRYPTION: case VIAWGET_HOSTAPD_SET_ENCRYPTION:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ENCRYPTION \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ENCRYPTION \n");
spin_lock_irq(&pDevice->lock);
ret = hostap_set_encryption(pDevice, param, p->length); ret = hostap_set_encryption(pDevice, param, p->length);
spin_unlock_irq(&pDevice->lock);
break; break;
case VIAWGET_HOSTAPD_GET_ENCRYPTION: case VIAWGET_HOSTAPD_GET_ENCRYPTION:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_ENCRYPTION \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_GET_ENCRYPTION \n");
......
...@@ -441,8 +441,6 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info, ...@@ -441,8 +441,6 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Commit the settings\n"); "Commit the settings\n");
spin_lock_irq(&pDevice->lock);
if (pDevice->bLinkPass && if (pDevice->bLinkPass &&
memcmp(pMgmt->abyCurrSSID, memcmp(pMgmt->abyCurrSSID,
pMgmt->abyDesireSSID, pMgmt->abyDesireSSID,
...@@ -471,8 +469,6 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info, ...@@ -471,8 +469,6 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
bScheduleCommand((void *) pDevice, bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID, WLAN_CMD_SSID,
NULL); NULL);
spin_unlock_irq(&pDevice->lock);
} }
pDevice->bCommit = false; pDevice->bCommit = false;
} }
...@@ -1212,14 +1208,12 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info, ...@@ -1212,14 +1208,12 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pDevice->abyKey[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pDevice->abyKey[ii]);
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED) {
spin_lock_irq(&pDevice->lock);
KeybSetDefaultKey(pDevice, KeybSetDefaultKey(pDevice,
&(pDevice->sKey), &(pDevice->sKey),
dwKeyIndex | (1 << 31), dwKeyIndex | (1 << 31),
wrq->length, NULL, wrq->length, NULL,
pDevice->abyKey, pDevice->abyKey,
KEY_CTL_WEP); KEY_CTL_WEP);
spin_unlock_irq(&pDevice->lock);
} }
pDevice->byKeyIndex = (u8)dwKeyIndex; pDevice->byKeyIndex = (u8)dwKeyIndex;
pDevice->uKeyLength = wrq->length; pDevice->uKeyLength = wrq->length;
...@@ -1242,10 +1236,8 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info, ...@@ -1242,10 +1236,8 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info,
pDevice->bEncryptionEnable = false; pDevice->bEncryptionEnable = false;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED) {
spin_lock_irq(&pDevice->lock);
for (uu = 0; uu < MAX_KEY_TABLE; uu++) for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice, uu); MACvDisableKeyEntry(pDevice, uu);
spin_unlock_irq(&pDevice->lock);
} }
} }
if (wrq->flags & IW_ENCODE_RESTRICTED) { if (wrq->flags & IW_ENCODE_RESTRICTED) {
...@@ -1342,12 +1334,9 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info, ...@@ -1342,12 +1334,9 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info,
return rc; return rc;
} }
spin_lock_irq(&pDevice->lock);
if (wrq->disabled) { if (wrq->disabled) {
pDevice->ePSMode = WMAC_POWER_CAM; pDevice->ePSMode = WMAC_POWER_CAM;
PSvDisablePowerSaving(pDevice); PSvDisablePowerSaving(pDevice);
spin_unlock_irq(&pDevice->lock);
return rc; return rc;
} }
if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) {
...@@ -1359,8 +1348,6 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info, ...@@ -1359,8 +1348,6 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info,
PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval); PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval);
} }
spin_unlock_irq(&pDevice->lock);
switch (wrq->flags & IW_POWER_MODE) { switch (wrq->flags & IW_POWER_MODE) {
case IW_POWER_UNICAST_R: case IW_POWER_UNICAST_R:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWPOWER: IW_POWER_UNICAST_R\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWPOWER: IW_POWER_UNICAST_R\n");
...@@ -1723,9 +1710,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, ...@@ -1723,9 +1710,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info,
KeyvInitTable(pDevice, &pDevice->sKey); KeyvInitTable(pDevice, &pDevice->sKey);
} }
/*******/ /*******/
spin_lock_irq(&pDevice->lock);
ret = wpa_set_keys(pDevice, param); ret = wpa_set_keys(pDevice, param);
spin_unlock_irq(&pDevice->lock);
error: error:
kfree(buf); kfree(buf);
......
...@@ -97,7 +97,6 @@ void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable) ...@@ -97,7 +97,6 @@ void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable)
int i, jj; int i, jj;
u8 pbyData[MAX_KEY_TABLE+1]; u8 pbyData[MAX_KEY_TABLE+1];
spin_lock_irq(&pDevice->lock);
for (i=0;i<MAX_KEY_TABLE;i++) { for (i=0;i<MAX_KEY_TABLE;i++) {
pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].bInUse = false;
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
...@@ -122,8 +121,6 @@ void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable) ...@@ -122,8 +121,6 @@ void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable)
pbyData pbyData
); );
spin_unlock_irq(&pDevice->lock);
return; return;
} }
......
...@@ -312,22 +312,15 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -312,22 +312,15 @@ static int device_init_registers(struct vnt_private *pDevice)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "---->INIbInitAdapter. [%d][%d]\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "---->INIbInitAdapter. [%d][%d]\n",
DEVICE_INIT_COLD, pDevice->byPacketType); DEVICE_INIT_COLD, pDevice->byPacketType);
spin_lock_irq(&pDevice->lock);
memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN); memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN); memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN);
memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN); memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
if (!FIRMWAREbCheckVersion(pDevice)) { if (!FIRMWAREbCheckVersion(pDevice)) {
spin_unlock_irq(&pDevice->lock);
if (FIRMWAREbDownload(pDevice) == true) { if (FIRMWAREbDownload(pDevice) == true) {
spin_lock_irq(&pDevice->lock);
if (FIRMWAREbBrach2Sram(pDevice) == false) { if (FIRMWAREbBrach2Sram(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" FIRMWAREbBrach2Sram fail\n"); " FIRMWAREbBrach2Sram fail\n");
spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
} else { } else {
...@@ -339,7 +332,6 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -339,7 +332,6 @@ static int device_init_registers(struct vnt_private *pDevice)
if (!BBbVT3184Init(pDevice)) { if (!BBbVT3184Init(pDevice)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail\n");
spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
...@@ -356,7 +348,6 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -356,7 +348,6 @@ static int device_init_registers(struct vnt_private *pDevice)
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd); sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
if (ntStatus != STATUS_SUCCESS) { if (ntStatus != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n");
spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
...@@ -365,7 +356,6 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -365,7 +356,6 @@ static int device_init_registers(struct vnt_private *pDevice)
if (ntStatus != STATUS_SUCCESS) { if (ntStatus != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Cardinit request in status fail!\n"); "Cardinit request in status fail!\n");
spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
...@@ -373,10 +363,8 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -373,10 +363,8 @@ static int device_init_registers(struct vnt_private *pDevice)
ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ, ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
MAC_REG_LOCALID, MESSAGE_REQUEST_MACREG, 1, MAC_REG_LOCALID, MESSAGE_REQUEST_MACREG, 1,
&pDevice->byLocalID); &pDevice->byLocalID);
if (ntStatus != STATUS_SUCCESS) { if (ntStatus != STATUS_SUCCESS)
spin_unlock_irq(&pDevice->lock);
return false; return false;
}
/* do MACbSoftwareReset in MACvInitialize */ /* do MACbSoftwareReset in MACvInitialize */
...@@ -607,10 +595,8 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -607,10 +595,8 @@ static int device_init_registers(struct vnt_private *pDevice)
ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ, ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &byTmp); MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &byTmp);
if (ntStatus != STATUS_SUCCESS) { if (ntStatus != STATUS_SUCCESS)
spin_unlock_irq(&pDevice->lock);
return false; return false;
}
if ((byTmp & GPIO3_DATA) == 0) { if ((byTmp & GPIO3_DATA) == 0) {
pDevice->bHWRadioOff = true; pDevice->bHWRadioOff = true;
...@@ -637,9 +623,6 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -637,9 +623,6 @@ static int device_init_registers(struct vnt_private *pDevice)
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
} }
spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n");
return true; return true;
...@@ -1028,7 +1011,6 @@ static int device_open(struct net_device *dev) ...@@ -1028,7 +1011,6 @@ static int device_open(struct net_device *dev)
/* if WEP key already set by iwconfig but device not yet open */ /* if WEP key already set by iwconfig but device not yet open */
if ((pDevice->bEncryptionEnable == true) && (pDevice->bTransmitKey == true)) { if ((pDevice->bEncryptionEnable == true) && (pDevice->bTransmitKey == true)) {
spin_lock_irq(&pDevice->lock);
KeybSetDefaultKey( pDevice, KeybSetDefaultKey( pDevice,
&(pDevice->sKey), &(pDevice->sKey),
pDevice->byKeyIndex | (1 << 31), pDevice->byKeyIndex | (1 << 31),
...@@ -1037,7 +1019,7 @@ static int device_open(struct net_device *dev) ...@@ -1037,7 +1019,7 @@ static int device_open(struct net_device *dev)
pDevice->abyKey, pDevice->abyKey,
KEY_CTL_WEP KEY_CTL_WEP
); );
spin_unlock_irq(&pDevice->lock);
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
} }
...@@ -1084,10 +1066,9 @@ static int device_close(struct net_device *dev) ...@@ -1084,10 +1066,9 @@ static int device_close(struct net_device *dev)
pMgmt->bShareKeyAlgorithm = false; pMgmt->bShareKeyAlgorithm = false;
pDevice->bEncryptionEnable = false; pDevice->bEncryptionEnable = false;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
spin_lock_irq(&pDevice->lock);
for (uu = 0; uu < MAX_KEY_TABLE; uu++) for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice,uu); MACvDisableKeyEntry(pDevice,uu);
spin_unlock_irq(&pDevice->lock);
if ((pDevice->flags & DEVICE_FLAGS_UNPLUG) == false) { if ((pDevice->flags & DEVICE_FLAGS_UNPLUG) == false) {
MACbShutdown(pDevice); MACbShutdown(pDevice);
......
...@@ -146,7 +146,6 @@ int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue, ...@@ -146,7 +146,6 @@ int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
return STATUS_FAILURE; return STATUS_FAILURE;
} }
spin_unlock_irq(&pDevice->lock);
for (ii = 0; ii <= USB_CTL_WAIT; ii ++) { for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
if (pDevice->Flags & fMP_CONTROL_WRITES) if (pDevice->Flags & fMP_CONTROL_WRITES)
...@@ -157,12 +156,10 @@ int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue, ...@@ -157,12 +156,10 @@ int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
if (ii >= USB_CTL_WAIT) { if (ii >= USB_CTL_WAIT) {
DBG_PRT(MSG_LEVEL_DEBUG, DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control send request submission timeout\n"); KERN_INFO "control send request submission timeout\n");
spin_lock_irq(&pDevice->lock);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES); MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
return STATUS_FAILURE; return STATUS_FAILURE;
} }
} }
spin_lock_irq(&pDevice->lock);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -208,7 +205,6 @@ int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue, ...@@ -208,7 +205,6 @@ int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
return STATUS_FAILURE; return STATUS_FAILURE;
} }
spin_unlock_irq(&pDevice->lock);
for (ii = 0; ii <= USB_CTL_WAIT; ii ++) { for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
if (pDevice->Flags & fMP_CONTROL_READS) if (pDevice->Flags & fMP_CONTROL_READS)
...@@ -219,12 +215,10 @@ int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue, ...@@ -219,12 +215,10 @@ int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
if (ii >= USB_CTL_WAIT) { if (ii >= USB_CTL_WAIT) {
DBG_PRT(MSG_LEVEL_DEBUG, DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control rcv request submission timeout\n"); KERN_INFO "control rcv request submission timeout\n");
spin_lock_irq(&pDevice->lock);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS); MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
return STATUS_FAILURE; return STATUS_FAILURE;
} }
} }
spin_lock_irq(&pDevice->lock);
return ntStatus; return ntStatus;
} }
......
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