staging: vt6656: Remove 10 second timer and move to BSSvSecondCallBack
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 14 Oct 2013 18:46:52 +0000 (19:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Oct 2013 16:42:12 +0000 (09:42 -0700)
Remove sTimerTxData 10 second timer which triggers PSbSendNullPacket
every 40 seconds when bLinkPass == true.

Move the 40 second timer to the existing BSSvSecondCallBack
one second delayed workqueue and trigger every 40 seconds when
bLinkPass == true.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/bssdb.c
drivers/staging/vt6656/device.h
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/power.c
drivers/staging/vt6656/usbpipe.c
drivers/staging/vt6656/wcmd.c
drivers/staging/vt6656/wcmd.h
drivers/staging/vt6656/wmgr.c

index e120eb2f47e9151f7f3c085f7b503a415094dc4b..dad3f8c78e21d196540c62741af4fbbbe305819b 100644 (file)
@@ -57,6 +57,7 @@
 #include "control.h"
 #include "rndis.h"
 #include "iowpa.h"
+#include "power.h"
 
 static int          msglevel                =MSG_LEVEL_INFO;
 //static int          msglevel                =MSG_LEVEL_DEBUG;
@@ -1124,10 +1125,22 @@ else {
         }
     }
 
-    if (pDevice->bLinkPass == true) {
-        if (netif_queue_stopped(pDevice->dev))
-            netif_wake_queue(pDevice->dev);
-    }
+       if (pDevice->bLinkPass == true) {
+               if (pMgmt->eAuthenMode < WMAC_AUTH_WPA ||
+                       pDevice->fWPA_Authened == true) {
+                       if (++pDevice->tx_data_time_out > 40) {
+                               pDevice->tx_trigger = true;
+
+                               PSbSendNullPacket(pDevice);
+
+                               pDevice->tx_trigger = false;
+                               pDevice->tx_data_time_out = 0;
+                       }
+               }
+
+               if (netif_queue_stopped(pDevice->dev))
+                       netif_wake_queue(pDevice->dev);
+       }
 
     spin_unlock_irq(&pDevice->lock);
 
index fa1cefb2f2af9c1268ad8c7f217453426ce977e3..95b181d6c5b83428e5a082887c32e57b6e129a6d 100644 (file)
@@ -711,11 +711,8 @@ struct vnt_private {
        /* One second callback */
        struct delayed_work second_callback_work;
 
-       struct timer_list sTimerTxData;
-       unsigned long nTxDataTimeCout;
-       int fTxDataInSleep;
-       int IsTxDataTrigger;
-
+       u8 tx_data_time_out;
+       bool tx_trigger;
        int fWPA_Authened; /*is WPA/WPA-PSK or WPA2/WPA2-PSK authen?? */
        u8 byReAssocCount;
        u8 byLinkWaitCount;
index a4fdd3a73ee154f51d4cdf11f8a408e8a5d96357..5e4a5d0988d7ed9544a17a9274b7b777b2a8e0f5 100644 (file)
@@ -1081,8 +1081,6 @@ static int device_close(struct net_device *dev)
        cancel_delayed_work_sync(&pDevice->run_command_work);
        cancel_delayed_work_sync(&pDevice->second_callback_work);
 
-    del_timer(&pDevice->sTimerTxData);
-
     if (pDevice->bDiversityRegCtlON) {
         del_timer(&pDevice->TimerSQ3Tmax1);
         del_timer(&pDevice->TimerSQ3Tmax2);
index edc8975b2e2a0ceae17aabea15813285cd8c3846..6334315807bb43844848e50e5173cb93f21cda82 100644 (file)
@@ -257,10 +257,8 @@ int PSbSendNullPacket(struct vnt_private *pDevice)
        if (pDevice->bLinkPass == false)
                return false;
 
-       if ((pDevice->bEnablePSMode == false) &&
-               (pDevice->fTxDataInSleep == false)) {
-                       return false;
-       }
+       if (pDevice->bEnablePSMode == false && pDevice->tx_trigger == false)
+               return false;
 
        memset(pMgmt->pbyPSPacketPool, 0, sizeof(struct vnt_tx_mgmt)
                + WLAN_NULLDATA_FR_MAXLEN);
index 3a03f1d5b6856c3c948b33253dfc4e06d5f2928a..fc9b6ee4849ca80082f3134fa93f24b31f7f2ddc 100644 (file)
@@ -656,8 +656,6 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Write %d bytes\n",(int)ulBufLen);
         pDevice->ulBulkOutBytesWrite += ulBufLen;
         pDevice->ulBulkOutContCRCError = 0;
-       pDevice->nTxDataTimeCout = 0;
-
     } else {
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BULK Out failed %d\n", status);
         pDevice->ulBulkOutError++;
index 95d2960bd1a1719723a77a70ce23eb65afd455dc..2f8e2a87533182a8f9bfa4fd3f62857067d8a731 100644 (file)
@@ -657,22 +657,6 @@ void vRunCommand(struct work_struct *work)
                     netif_wake_queue(pDevice->dev);
                 }
 
-                if(pDevice->IsTxDataTrigger != false)   {    //TxDataTimer is not triggered at the first time
-                     // printk("Re-initial TxDataTimer****\n");
-                   del_timer(&pDevice->sTimerTxData);
-                      init_timer(&pDevice->sTimerTxData);
-                       pDevice->sTimerTxData.data = (unsigned long) pDevice;
-                      pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData;
-                      pDevice->sTimerTxData.expires = RUN_AT(10*HZ);      //10s callback
-                      pDevice->fTxDataInSleep = false;
-                      pDevice->nTxDataTimeCout = 0;
-                }
-                else {
-                  // printk("mike:-->First time trigger TimerTxData InSleep\n");
-                }
-               pDevice->IsTxDataTrigger = true;
-                add_timer(&pDevice->sTimerTxData);
-
             }
           else if(pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
                printk("WLAN_ASSOCIATE_WAIT:Association Fail???\n");
@@ -684,7 +668,6 @@ void vRunCommand(struct work_struct *work)
               vCommandTimerWait((void *) pDevice, ASSOCIATE_TIMEOUT/2);
               return;
           }
-                 pDevice->byLinkWaitCount = 0;
 
             s_bCommandComplete(pDevice);
             break;
@@ -1162,33 +1145,3 @@ void vResetCommandTimer(struct vnt_private *pDevice)
        pDevice->bCmdRunning = false;
        pDevice->bCmdClear = false;
 }
-
-void BSSvSecondTxData(struct vnt_private *pDevice)
-{
-       struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
-
-       pDevice->nTxDataTimeCout++;
-
-       if (pDevice->nTxDataTimeCout < 4) {   //don't tx data if timer less than 40s
-               // printk("mike:%s-->no data Tx not exceed the desired Time as %d\n",__FUNCTION__,
-               //      (int)pDevice->nTxDataTimeCout);
-               pDevice->sTimerTxData.expires = RUN_AT(10 * HZ);      //10s callback
-               add_timer(&pDevice->sTimerTxData);
-               return;
-       }
-
-       spin_lock_irq(&pDevice->lock);
-       //is wap_supplicant running successful OR only open && sharekey mode!
-       if (((pDevice->bLinkPass == true) &&
-               (pMgmt->eAuthenMode < WMAC_AUTH_WPA)) ||  //open && sharekey linking
-               (pDevice->fWPA_Authened == true)) {   //wpa linking
-               //   printk("mike:%s-->InSleep Tx Data Procedure\n",__FUNCTION__);
-               pDevice->fTxDataInSleep = true;
-               PSbSendNullPacket(pDevice);      //send null packet
-               pDevice->fTxDataInSleep = false;
-       }
-       spin_unlock_irq(&pDevice->lock);
-
-       pDevice->sTimerTxData.expires = RUN_AT(10 * HZ);      //10s callback
-       add_timer(&pDevice->sTimerTxData);
-}
index cd12558d5d3f2d7fecac80d41a74bc96be790d07..caf2684ce9151f34961d5d203e4e7949c5d5b9da 100644 (file)
@@ -107,6 +107,4 @@ int bScheduleCommand(struct vnt_private *, CMD_CODE eCommand, u8 *pbyItem0);
 
 void vRunCommand(struct work_struct *work);
 
-void BSSvSecondTxData(struct vnt_private *);
-
 #endif /* __WCMD_H__ */
index 7bb3cee8046945b4a935042a5c7c61e5491ff818..e26c41519b156dbc04bef2d3ae6e91b0cf0bc017 100644 (file)
@@ -213,14 +213,6 @@ void vMgrObjectInit(struct vnt_private *pDevice)
     pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI;
     BSSvClearBSSList((void *) pDevice, false);
 
-    init_timer(&pDevice->sTimerTxData);
-    pDevice->sTimerTxData.data = (unsigned long)pDevice;
-    pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData;
-    pDevice->sTimerTxData.expires = RUN_AT(10*HZ);      //10s callback
-    pDevice->fTxDataInSleep = false;
-    pDevice->IsTxDataTrigger = false;
-    pDevice->nTxDataTimeCout = 0;
-
     pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
     pDevice->uCmdDequeueIdx = 0;
     pDevice->uCmdEnqueueIdx = 0;
This page took 0.053489 seconds and 5 git commands to generate.