ath9k_htc: Fix beacon distribution in IBSS mode
authorRajkumar Manoharan <rmanoharan@atheros.com>
Tue, 21 Sep 2010 07:28:09 +0000 (12:58 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 24 Sep 2010 19:54:32 +0000 (15:54 -0400)
This patch ensures fair beacon distribution in IBSS mode
by configuring proper CWmin based on slot time.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c

index bd1506e69105d77ad77396e4cef62da89fb75ced..1b72aa482ac742aeaf7705929ea3cdbadf718232 100644 (file)
@@ -235,7 +235,14 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
        ath9k_hw_get_txq_props(ah, qnum, &qi_be);
 
        qi.tqi_aifs = qi_be.tqi_aifs;
-       qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
+       /* For WIFI Beacon Distribution
+        * Long slot time  : 2x cwmin
+        * Short slot time : 4x cwmin
+        */
+       if (ah->slottime == ATH9K_SLOT_TIME_20)
+               qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
+       else
+               qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
        qi.tqi_cwmax = qi_be.tqi_cwmax;
 
        if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {