#include <adf_os_atomic.h>
#include <adf_nbuf.h>
#include <adf_net.h>
-#include <adf_net_types.h>
#include <ieee80211_var.h>
#include "ratectrl.h"
#include "ratectrl11n.h"
-INLINE A_RSSI median(A_RSSI a, A_RSSI b, A_RSSI c);
-
static void ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew,
unsigned int capflag, struct ieee80211_rate *rs);
}
-static INLINE A_BOOL
-rcIsValidTxMask(TX_RATE_CTRL *pRc, A_UINT8 index)
-{
- ASSERT(index < pRc->rateTableSize);
- return (pRc->validRateIndex[index]);
-}
-
/* Iterators for validTxRateMask */
static INLINE A_BOOL
rcGetNextValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc,
A_UINT8 i, j, hi = 0;
A_UINT8 singleStream = (capflag & WLAN_RC_DS_FLAG) ? 0 : 1;
A_UINT32 valid;
- struct atheros_node *pSib = ATH_NODE_ATHEROS(an);
/* Use intersection of working rates and valid rates */
for (i = 0; i < pRateSet->rs_nrates; i++) {
for (j = 0; j < pRateTable->rateCount; j++) {
A_UINT32 phy = pRateTable->info[j].phy;
-
#ifdef MAGPIE_MERLIN
+ struct atheros_node *pSib = ATH_NODE_ATHEROS(an);
+
if (pSib->stbc) {
valid = pRateTable->info[j].validSTBC;
} else if (singleStream) {
A_UINT8 i, j, hi = 0;
A_UINT8 singleStream = (capflag & WLAN_RC_DS_FLAG) ? 0 : 1;
A_UINT8 valid;
- struct atheros_node *pSib = ATH_NODE_ATHEROS(an);
/* Use intersection of working rates and valid rates */
for (i = 0; i < ((struct ieee80211_rateset *)pMcsSet)->rs_nrates; i++) {
for (j = 0; j < pRateTable->rateCount; j++) {
A_UINT32 phy = pRateTable->info[j].phy;
-
#ifdef MAGPIE_MERLIN
+ struct atheros_node *pSib = ATH_NODE_ATHEROS(an);
+
if (pSib->stbc) {
valid = pRateTable->info[j].validSTBC;
} else if (singleStream) {
rcSortValidRates(pRateTable, pRc);
}
-void
-rcSibUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *pSib,
- A_UINT32 capflag, A_BOOL keepState, struct ieee80211_rate *pRateSet)
-{
- rcSibUpdate_ht(sc,
- pSib,
- ((capflag & ATH_RC_DS_FLAG) ? WLAN_RC_DS_FLAG : 0) |
- ((capflag & ATH_RC_HT40_SGI_FLAG) ? WLAN_RC_HT40_SGI_FLAG : 0) |
- ((capflag & ATH_RC_HT_FLAG) ? WLAN_RC_HT_FLAG : 0) |
- ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0) |
- ((capflag & ATH_RC_TX_STBC_FLAG) ? WLAN_RC_STBC_FLAG : 0),
- keepState,
- pRateSet);
-}
-
-/*
- * Return the median of three numbers
- */
-INLINE A_RSSI median(A_RSSI a, A_RSSI b, A_RSSI c)
-{
- if (a >= b) {
- if (b >= c) {
- return b;
- } else if (a > c) {
- return c;
- } else {
- return a;
- }
- } else {
- if (a >= c) {
- return a;
- } else if (b >= c) {
- return c;
- } else {
- return b;
- }
- }
-}
-
static A_UINT8
rcRateFind_ht(struct ath_softc_tgt *sc, struct atheros_node *pSib,
const RATE_TABLE_11N *pRateTable, A_BOOL probeAllowed, A_BOOL *isProbing)
unsigned int capflag, struct ieee80211_rate *rs)
{
if (isnew) {
- struct atheros_node *oan = ATH_NODE_ATHEROS(an);
-
- oan->htcap = ((capflag & ATH_RC_DS_FLAG) ? WLAN_RC_DS_FLAG : 0) |
- ((capflag & ATH_RC_HT40_SGI_FLAG) ? WLAN_RC_HT40_SGI_FLAG : 0) |
- ((capflag & ATH_RC_HT_FLAG) ? WLAN_RC_HT_FLAG : 0) |
- ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0) |
- ((capflag & ATH_RC_WEP_TKIP_FLAG) ? WLAN_RC_WEP_TKIP_FLAG : 0);
-
#ifdef MAGPIE_MERLIN
- /* Rx STBC is a 2-bit mask. Needs to convert from ath definition to wlan definition. */
-
- oan->htcap |= (((capflag & ATH_RC_RX_STBC_FLAG) >> ATH_RC_RX_STBC_FLAG_S)
- << WLAN_RC_STBC_FLAG_S);
-
- /* If only one chain is enabled, do not do stbc. */
- if (sc->sc_txstbcsupport) {
- oan->stbc = (capflag & ATH_RC_RX_STBC_FLAG) >> ATH_RC_RX_STBC_FLAG_S;
- } else {
- oan->stbc = 0;
- }
-
+ struct atheros_node *oan = ATH_NODE_ATHEROS(an);
+ /* Only MERLIN can send STBC */
+ oan->stbc = (capflag & ATH_RC_TX_STBC_FLAG) ? 1 : 0;
#endif
- rcSibUpdate_11n(sc, an, oan->htcap, 0, rs);
+ rcSibUpdate_ht(sc, an, capflag, 0, rs);
}
}