staging: vt6656: lock changes: bMgrPrepareBeaconToSend add lock.
authorMalcolm Priestley <tvboxspy@gmail.com>
Thu, 15 May 2014 21:49:17 +0000 (22:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 22:02:19 +0000 (15:02 -0700)
bMgrPrepareBeaconToSend is nolonger atomic

csBeacon_xmit must be locked add spin lock.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/wmgr.c

index 0d69719a74266f41a45c3f3a0011b8cee4f5e3ca..cce67cdad26acfe95e007321bb751d474a48deda 100644 (file)
@@ -4058,6 +4058,7 @@ int bMgrPrepareBeaconToSend(struct vnt_private *pDevice,
        struct vnt_manager *pMgmt)
 {
        struct vnt_tx_mgmt *pTxPacket;
+       unsigned long flags;
 
 //    pDevice->bBeaconBufReady = false;
     if (pDevice->bEncryptionEnable || pDevice->bEnable8021x){
@@ -4084,8 +4085,13 @@ int bMgrPrepareBeaconToSend(struct vnt_private *pDevice,
         (pMgmt->abyCurrBSSID[0] == 0))
         return false;
 
-    csBeacon_xmit(pDevice, pTxPacket);
-    MACvRegBitsOn(pDevice, MAC_REG_TCR, TCR_AUTOBCNTX);
+       spin_lock_irqsave(&pDevice->lock, flags);
+
+       csBeacon_xmit(pDevice, pTxPacket);
+
+       spin_unlock_irqrestore(&pDevice->lock, flags);
+
+       MACvRegBitsOn(pDevice, MAC_REG_TCR, TCR_AUTOBCNTX);
 
     return true;
 }