mwifiex: CPU mips optimization with NO_PKT_PRIO_TID
authorMarc Yang <yangyang@marvell.com>
Tue, 17 May 2011 02:17:52 +0000 (19:17 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 May 2011 17:53:57 +0000 (13:53 -0400)
If we go through the entire for loop in
mwifiex_wmm_get_highest_priolist_ptr() and don't find any packets,
set highest_queued_prio to NO_PKT_PRIO_TID (< LOW_PRIO_TID).

Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/wmm.c

index ea3184d1567443f761ba03fbac50a9ed33a135e7..3154b0a31ea6da220e6b655d8747631546901f67 100644 (file)
@@ -202,6 +202,7 @@ struct mwifiex_tid_tbl {
 #define WMM_HIGHEST_PRIORITY           7
 #define HIGH_PRIO_TID                          7
 #define LOW_PRIO_TID                           0
+#define NO_PKT_PRIO_TID                                (-1)
 
 struct mwifiex_wmm_desc {
        struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID];
index 784ad4c00995e90deba7297bda6738342efae0d9..91634daec306c093928a7718c176d734b7bf07aa 100644 (file)
@@ -946,6 +946,12 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
                                } while (ptr != head);
                        }
 
+                       /* No packet at any TID for this priv. Mark as such
+                        * to skip checking TIDs for this priv (until pkt is
+                        * added).
+                        */
+                       atomic_set(hqp, NO_PKT_PRIO_TID);
+
                        /* Get next bss priority node */
                        bssprio_node = list_first_entry(&bssprio_node->list,
                                                struct mwifiex_bss_prio_node,