Be smarter about TX antenna selection for multicast frames.
authorscottr <scottr@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 16 Jul 2008 10:58:04 +0000 (10:58 +0000)
committerscottr <scottr@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 16 Jul 2008 10:58:04 +0000 (10:58 +0000)
Instead of simply alternating antenna, send multicast frames out each antenna
based on the proportion of sucessfully transmitted unicast frames. This helps
in situations where one antenna is significantly better than another.

Signed-off-by: Perry Lorier <perry@cs.waikato.ac.nz>
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3776 0192ed92-7a03-0410-a25b-9323aeb14dbd

THANKS
ath/if_ath.c

diff --git a/THANKS b/THANKS
index b4fa10d637cf1cba8fcab8ac2d4beebda990f874..f3ce80fc9c1780121f25f66c9be73ce79f6cea00 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -132,6 +132,7 @@ Russell Harmon
 Alessandro Erta
 Jason Weber
 Przemyslaw Bruski
+Perry Lorier
 
 Apologies to anyone whose name was unintentionally left off.
 Please let us know if you think your name should be mentioned here!
@@ -143,7 +144,7 @@ We also would like to thank the following individuals and companies
 * Compex Systems Pte Ltd, Singapore - http://www.compex.com.sg
   two donations with a total of 7 MiniPCI cards
 
-* IndraNet Technologies Ltd, New Zealand - http://www.indranet.com.nz
+* IndraNet Technologies Ltd, New Zealand - http://www.indranet.co.nz
   Minstrel rate control module
 
 * Linux-Consulting, USA - http://www.linux-consulting.com
index 9dab821ea661179d73e7ea74363962eeeb7ea2dd..70d535dbc780485a8072e6a0b7cf3e074babd6a1 100644 (file)
@@ -7854,8 +7854,18 @@ ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
         * the first or second antenna port.
         * If the user has set the txantenna, use it for multicast frames too. */
        if (ismcast && !sc->sc_txantenna) {
-               antenna = sc->sc_mcastantenna + 1;
-               sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1;
+               /* Alternating antenna might be the wrong thing to do if we
+                * have one antenna that's significantly better than the other
+                *
+                * Use antenna in the ratio of the successfully sent unicast packets.
+                */
+               if (sc->sc_mcastantenna > 0) {
+                       sc->sc_mcastantenna -= sc->sc_ant_tx[1] + 1;
+                       antenna = 2;
+               } else {
+                       sc->sc_mcastantenna += sc->sc_ant_tx[2] + 1;
+                       antenna = 1;
+               }
        } else
                antenna = sc->sc_txantenna;