net: wireless: bcmdhd: Decrease event wake_lock timeout to 1500 ms
Dmitry Shmidt [Tue, 13 Dec 2011 20:27:49 +0000 (12:27 -0800)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/dhd.h
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_iw.c

index 4ad5ad0..420e6e4 100644 (file)
@@ -314,8 +314,8 @@ inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
 #define DHD_OS_WAKE_LOCK_TIMEOUT(pub)          dhd_os_wake_lock_timeout(pub)
 #define DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(pub, val)      dhd_os_wake_lock_timeout_enable(pub, val)
 
-#define DHD_PACKET_TIMEOUT     1
-#define DHD_EVENT_TIMEOUT      2
+#define DHD_PACKET_TIMEOUT_MS  1000
+#define DHD_EVENT_TIMEOUT_MS   1500
 
 /* interface operations (register, remove) should be atomic, use this lock to prevent race
  * condition among wifi on/off and interface operation functions
index 7afd0b8..f41a284 100644 (file)
@@ -1398,7 +1398,7 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
        int i;
        dhd_if_t *ifp;
        wl_event_msg_t event;
-       int tout = DHD_PACKET_TIMEOUT;
+       int tout = DHD_PACKET_TIMEOUT_MS;
 
        DHD_TRACE(("%s: Enter\n", __FUNCTION__));
 
@@ -1502,7 +1502,7 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
                        if (event.event_type == WLC_E_BTA_HCI_EVENT) {
                                dhd_bta_doevt(dhdp, data, event.datalen);
                        }
-                       tout = DHD_EVENT_TIMEOUT;
+                       tout = DHD_EVENT_TIMEOUT_MS;
                }
 
                ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
@@ -2030,7 +2030,7 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
        /* send to dongle only if we are not waiting for reload already */
        if (dhd->pub.hang_was_sent) {
                DHD_ERROR(("%s: HANG was sent up earlier\n", __FUNCTION__));
-               DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT);
+               DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT_MS);
                DHD_OS_WAKE_UNLOCK(&dhd->pub);
                return OSL_ERROR(BCME_DONGLE_DOWN);
        }
@@ -4426,7 +4426,7 @@ int dhd_os_wake_lock_timeout(dhd_pub_t *pub)
 #ifdef CONFIG_HAS_WAKELOCK
                if (dhd->wakelock_timeout_enable)
                        wake_lock_timeout(&dhd->wl_rxwake,
-                               dhd->wakelock_timeout_enable * HZ);
+                               msecs_to_jiffies(dhd->wakelock_timeout_enable));
 #endif
                dhd->wakelock_timeout_enable = 0;
                spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
index 457372b..d6aa56f 100644 (file)
@@ -1626,7 +1626,7 @@ wl_iw_send_priv_event(
        strcpy(extra, flag);
        wrqu.data.length = strlen(extra);
        wireless_send_event(dev, cmd, &wrqu, extra);
-       net_os_wake_lock_timeout_enable(dev, DHD_EVENT_TIMEOUT);
+       net_os_wake_lock_timeout_enable(dev, DHD_EVENT_TIMEOUT_MS);
        WL_TRACE(("Send IWEVCUSTOM Event as %s\n", extra));
 
        return 0;