[Madwifi-cvs] madwifi/ath if_ath.c,1.10,1.11 if_athvar.h,1.7,1.8
Status: Beta
Brought to you by:
otaku
From: Sam L. <sam...@us...> - 2004-09-20 21:30:17
|
Update of /cvsroot/madwifi/madwifi/ath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6965 Modified Files: if_ath.c if_athvar.h Log Message: Redo/fix tx antenna handling. Default to using the hardware's "omni ap/sta" algorithm for selecting a transmit antenna. In this mode the antenna used for the last succesful transmit to a station is used with retry attempts done in the pattern AABBAA... Previously we were tracking the antenna for the last good tx but specifying the antenna explicitly in the tx descriptor. This was wrong because: a) it caused the hardware to not try alternate antennae, and b) was possibly the wrong choice since the antenna in the descriptor was likely based on out-of-date data. While here add a sysctl to override the use of the default tx antenna; this is mainly for testing. Eventually this will be replaced with a net80211 mechanism. Education by: Michael Wong Index: if_ath.c =================================================================== RCS file: /cvsroot/madwifi/madwifi/ath/if_ath.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** if_ath.c 17 Sep 2004 17:36:07 -0000 1.10 --- if_ath.c 20 Sep 2004 21:30:07 -0000 1.11 *************** *** 2681,2685 **** */ an = ATH_NODE(ni); - an->an_rx_antenna = ds->ds_rxstat.rs_antenna; /* XXX monitor stats to identify packet type */ --- 2681,2684 ---- *************** *** 2781,2785 **** struct ath_txq *txq; struct ieee80211_frame *wh; ! u_int subtype, flags, ctsduration, antenna; HAL_PKT_TYPE atype; const HAL_RATE_TABLE *rt; --- 2780,2784 ---- struct ath_txq *txq; struct ieee80211_frame *wh; ! u_int subtype, flags, ctsduration; HAL_PKT_TYPE atype; const HAL_RATE_TABLE *rt; *************** *** 3028,3042 **** ctsrate = 0; - /* - * For now use the antenna on which the last good - * frame was received on. We assume this field is - * initialized to 0 which gives us ``auto'' or the - * ``default'' antenna. - */ - if (an->an_tx_antenna) - antenna = an->an_tx_antenna; - else - antenna = an->an_rx_antenna; - if (IFF_DUMPPKTS(ic, ATH_DEBUG_XMIT)) ieee80211_dump_pkt(skb->data, skb->len, --- 3027,3030 ---- *************** *** 3054,3058 **** , txrate, try0 /* series 0 rate/tries */ , keyix /* key cache index */ ! , antenna /* antenna mode */ , flags /* flags */ , ctsrate /* rts/cts rate */ --- 3042,3046 ---- , txrate, try0 /* series 0 rate/tries */ , keyix /* key cache index */ ! , sc->sc_txantenna /* antenna mode */ , flags /* flags */ , ctsrate /* rts/cts rate */ *************** *** 3156,3160 **** if (ds->ds_txstat.ts_status == 0) { an->an_tx_ok++; - an->an_tx_antenna = ds->ds_txstat.ts_antenna; if (ds->ds_txstat.ts_rate & HAL_TXSTAT_ALTRATE) sc->sc_stats.ast_tx_altrate++; --- 3144,3147 ---- *************** *** 3171,3175 **** if (ds->ds_txstat.ts_status & HAL_TXERR_FILT) sc->sc_stats.ast_tx_filtered++; - an->an_tx_antenna = 0; /* invalidate */ } sr = ds->ds_txstat.ts_shortretry; --- 3158,3161 ---- *************** *** 4606,4609 **** --- 4592,4596 ---- ATH_SOFTLED = 4, ATH_LEDPIN = 5, + ATH_ANTENNA = 9, }; *************** *** 4647,4650 **** --- 4634,4641 ---- sc->sc_ledpin = val; break; + case ATH_ANTENNA: + /* XXX validate? force rx antenna too? */ + sc->sc_txantenna = val; + break; default: return -EINVAL; *************** *** 4668,4671 **** --- 4659,4665 ---- val = sc->sc_ledpin; break; + case ATH_ANTENNA: + val = sc->sc_txantenna; + break; default: return -EINVAL; *************** *** 4711,4714 **** --- 4705,4713 ---- .proc_handler = ath_sysctl_halparam }, + { .ctl_name = ATH_ANTENNA, + .procname = "antenna", + .mode = 0644, + .proc_handler = ath_sysctl_halparam + }, { 0 } }; Index: if_athvar.h =================================================================== RCS file: /cvsroot/madwifi/madwifi/ath/if_athvar.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** if_athvar.h 15 Sep 2004 16:35:42 -0000 1.7 --- if_athvar.h 20 Sep 2004 21:30:07 -0000 1.8 *************** *** 112,117 **** u_int an_tx_retr; /* tx retry count */ int an_tx_upper; /* tx upper rate req cnt */ - u_int8_t an_tx_antenna; /* antenna for last good tx */ - u_int8_t an_rx_antenna; /* antenna for last good rx */ u_int8_t an_tx_rix0; /* series 0 rate index */ u_int8_t an_tx_try0; /* series 0 try count */ --- 112,115 ---- *************** *** 211,214 **** --- 209,213 ---- u_int8_t sc_hwmap[32]; /* h/w rate ix to IEEE table */ u_int8_t sc_protrix; /* protection rate index */ + u_int8_t sc_txantenna; /* tx antenna (fixed or auto) */ HAL_INT sc_imask; /* interrupt mask copy */ u_int sc_keymax; /* size of key cache */ |