From f85e81e0da5fb3b86ddd014ac46eae1f19b309e6 Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 16 Jul 2008 10:58:04 +0000 Subject: [PATCH 1/1] Be smarter about TX antenna selection for multicast frames. 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 git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3776 0192ed92-7a03-0410-a25b-9323aeb14dbd --- THANKS | 3 ++- ath/if_ath.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/THANKS b/THANKS index b4fa10d..f3ce80f 100644 --- 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 diff --git a/ath/if_ath.c b/ath/if_ath.c index 9dab821..70d535d 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -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; -- 2.35.1