wl12xx: move last_tx_hlid into wlvif
authorEliad Peller <eliad@wizery.com>
Mon, 10 Oct 2011 08:12:50 +0000 (10:12 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 11 Oct 2011 12:04:21 +0000 (15:04 +0300)
move last_tx_hlid into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/debugfs.c
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/tx.c
drivers/net/wireless/wl12xx/wl12xx.h

index f0398d0..bbc8004 100644 (file)
@@ -355,7 +355,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
        DRIVER_STATE_PRINT_INT(sg_enabled);
        DRIVER_STATE_PRINT_INT(enable_11a);
        DRIVER_STATE_PRINT_INT(noise);
-       DRIVER_STATE_PRINT_INT(last_tx_hlid);
        DRIVER_STATE_PRINT_HEX(ap_fw_ps_map);
        DRIVER_STATE_PRINT_LHEX(ap_ps_map);
        DRIVER_STATE_PRINT_HEX(quirks);
index 3667acf..0606b0d 100644 (file)
@@ -4901,7 +4901,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
        wl->flags = 0;
        wl->sg_enabled = true;
        wl->hw_pg_ver = -1;
-       wl->last_tx_hlid = 0;
        wl->ap_ps_map = 0;
        wl->ap_fw_ps_map = 0;
        wl->quirks = 0;
index 1b3d8e3..951ff03 100644 (file)
@@ -570,7 +570,7 @@ static struct sk_buff *wl1271_ap_skb_dequeue(struct wl1271 *wl,
        struct sk_buff_head *queue;
 
        /* start from the link after the last one */
-       start_hlid = (wl->last_tx_hlid + 1) % WL12XX_MAX_LINKS;
+       start_hlid = (wlvif->last_tx_hlid + 1) % WL12XX_MAX_LINKS;
 
        /* dequeue according to AC, round robin on each link */
        for (i = 0; i < WL12XX_MAX_LINKS; i++) {
@@ -591,12 +591,12 @@ static struct sk_buff *wl1271_ap_skb_dequeue(struct wl1271 *wl,
 
        if (skb) {
                int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb));
-               wl->last_tx_hlid = h;
+               wlvif->last_tx_hlid = h;
                spin_lock_irqsave(&wl->wl_lock, flags);
                wl->tx_queue_count[q]--;
                spin_unlock_irqrestore(&wl->wl_lock, flags);
        } else {
-               wl->last_tx_hlid = 0;
+               wlvif->last_tx_hlid = 0;
        }
 
        return skb;
@@ -641,7 +641,7 @@ static void wl1271_skb_queue_head(struct wl1271 *wl, struct ieee80211_vif *vif,
                skb_queue_head(&wl->links[hlid].tx_queue[q], skb);
 
                /* make sure we dequeue the same packet next time */
-               wl->last_tx_hlid = (hlid + WL12XX_MAX_LINKS - 1) %
+               wlvif->last_tx_hlid = (hlid + WL12XX_MAX_LINKS - 1) %
                                   WL12XX_MAX_LINKS;
        } else {
                skb_queue_head(&wl->tx_queue[q], skb);
@@ -924,7 +924,7 @@ void wl1271_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
                        wl->links[i].prev_freed_pkts = 0;
                }
 
-               wl->last_tx_hlid = 0;
+               wlvif->last_tx_hlid = 0;
        } else {
                for (i = 0; i < NUM_TX_QUEUES; i++) {
                        while ((skb = skb_dequeue(&wl->tx_queue[i]))) {
index 074de4e..b350f0b 100644 (file)
@@ -542,9 +542,6 @@ struct wl1271 {
         */
        struct wl1271_link links[WL12XX_MAX_LINKS];
 
-       /* the hlid of the link where the last transmitted skb came from */
-       int last_tx_hlid;
-
        /* AP-mode - a bitmap of links currently in PS mode according to FW */
        u32 ap_fw_ps_map;
 
@@ -596,6 +593,9 @@ struct wl12xx_vif {
                } ap;
        };
 
+       /* the hlid of the last transmitted skb */
+       int last_tx_hlid;
+
        unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)];
 
        u8 ssid[IEEE80211_MAX_SSID_LEN + 1];