Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / ks7010 / ks_hostif.c
index a8822fe2bd60295ded9a8dfc15d5ee75556bd406..e09df36016ad32569cf92698043c9a678bb0b906 100644 (file)
@@ -69,16 +69,20 @@ inline u32 get_DWORD(struct ks_wlan_private *priv)
        return data;
 }
 
-void ks_wlan_hw_wakeup_task(struct work_struct *work)
+static void ks_wlan_hw_wakeup_task(struct work_struct *work)
 {
        struct ks_wlan_private *priv =
            container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);
        int ps_status = atomic_read(&priv->psstatus.status);
+       long time_left;
 
        if (ps_status == PS_SNOOZE) {
                ks_wlan_hw_wakeup_request(priv);
-               if (!wait_for_completion_interruptible_timeout(&priv->psstatus.wakeup_wait, HZ / 50)) { /* 20ms timeout */
-                       DPRINTK(1, "wake up timeout !!!\n");
+               time_left = wait_for_completion_interruptible_timeout(
+                               &priv->psstatus.wakeup_wait,
+                               msecs_to_jiffies(20));
+               if (time_left <= 0) {
+                       DPRINTK(1, "wake up timeout or interrupted !!!\n");
                        schedule_work(&priv->ks_wlan_wakeup_task);
                        return;
                }
@@ -481,8 +485,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
                        netif_rx(skb);
                } else {
                        printk(KERN_WARNING
-                              "%s: Memory squeeze, dropping packet.\n",
-                              skb->dev->name);
+                              "ks_wlan: Memory squeeze, dropping packet.\n");
                        priv->nstats.rx_dropped++;
                }
                break;
@@ -517,8 +520,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
                        netif_rx(skb);
                } else {
                        printk(KERN_WARNING
-                              "%s: Memory squeeze, dropping packet.\n",
-                              skb->dev->name);
+                              "ks_wlan: Memory squeeze, dropping packet.\n");
                        priv->nstats.rx_dropped++;
                }
                break;
@@ -1194,6 +1196,8 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet)
                DPRINTK(1, "ethernet->h_source=%02X:%02X:%02X:%02X:%02X:%02X\n",
                        eth->h_source[0], eth->h_source[1], eth->h_source[2],
                        eth->h_source[3], eth->h_source[4], eth->h_source[5]);
+               dev_kfree_skb(packet);
+               kfree(pp);
                return -3;
        }
 
@@ -1505,7 +1509,7 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv)
        ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp)), NULL, NULL, NULL);
 }
 
-void hostif_infrastructure_set2_request(struct ks_wlan_private *priv)
+static void hostif_infrastructure_set2_request(struct ks_wlan_private *priv)
 {
        struct hostif_infrastructure_set2_request_t *pp;
        uint16_t capability;
This page took 0.02441 seconds and 5 git commands to generate.