Merge pull request #34 from olerem/rc
authorAdrian Chadd <adrian.chadd@gmail.com>
Thu, 30 May 2013 18:05:21 +0000 (11:05 -0700)
committerAdrian Chadd <adrian.chadd@gmail.com>
Thu, 30 May 2013 18:05:21 +0000 (11:05 -0700)
SImplefy STBC handler v4

target_firmware/wlan/ah.c
target_firmware/wlan/ah.h
target_firmware/wlan/ah_internal.h
target_firmware/wlan/ar5416_hw.c
target_firmware/wlan/if_ath.c
target_firmware/wlan/if_athvar.h
target_firmware/wlan/ratectrl.h
target_firmware/wlan/ratectrl11n.h
target_firmware/wlan/ratectrl_11n_ln.c

index ada5ab2e70389050b1702d971237387a2a28b187..30c959426b33d43cc8d01864b6957df164179e9c 100755 (executable)
@@ -67,12 +67,6 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
                return pCap->halBssIdMaskSupport ? HAL_OK : HAL_ENOTSUPP;
        case HAL_CAP_VEOL:
                return pCap->halVEOLSupport ? HAL_OK : HAL_ENOTSUPP;
-#ifdef MAGPIE_MERLIN
-       case HAL_CAP_RX_STBC:
-               return HAL_ENOTSUPP;
-       case HAL_CAP_TX_STBC:
-               return HAL_ENOTSUPP;
-#endif
        default:
                return HAL_EINVAL;
        }
index 385d1fdecd17308b5f8d24cd7d93c83c406d4b1c..4901097480cfa5de643123d3f53cf39a48ff738f 100755 (executable)
@@ -75,8 +75,6 @@ typedef enum {
        HAL_CAP_VEOL        = 0,
        HAL_CAP_BSSIDMASK   = 1,
        HAL_CAP_TSF_ADJUST  = 2,
-       HAL_CAP_RX_STBC     = 3,
-       HAL_CAP_TX_STBC     = 4,
        HAL_CAP_HT          = 5,
        HAL_CAP_RTS_AGGR_LIMIT = 6,
 } HAL_CAPABILITY_TYPE;
index a43c8eb43da58241c27cd6e2b0a5095cbb2f486c..650604936d8b7911202bee57fc194d38b0f4a969 100755 (executable)
@@ -126,8 +126,6 @@ typedef struct {
                halChanHalfRate         : 1,
                halChanQuarterRate      : 1,
                halHTSupport            : 1,
-               halRxStbcSupport        : 1,
-               halTxStbcSupport        : 1,
                halGTTSupport           : 1,
                halFastCCSupport        : 1,
                halExtChanDfsSupport    : 1,
index 8da2ee636e01ec2f07ba421c7b40828cb1b453ef..5d9b3f3ba246b6b13331b86b7ac66e31e2daacff 100644 (file)
@@ -298,31 +298,7 @@ HAL_STATUS ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
                               a_uint32_t capability, a_uint32_t *result)
 
 {
-        HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
-#ifndef MAGPIE_MERLIN // K2
-        pCap->halRxStbcSupport = 1;  /* K2 supports STBC Rx only */
-        pCap->halTxStbcSupport = 0;
-#else
-        pCap->halRxStbcSupport = 1;  /* number of streams for STBC recieve. */
-        pCap->halTxStbcSupport = 1;
-#endif
-
-       switch (type) {
-#ifdef MAGPIE_MERLIN
-       case HAL_CAP_RX_STBC:
-       {
-               *result = pCap->halRxStbcSupport;
-               return HAL_OK;
-       }
-       case HAL_CAP_TX_STBC:
-       {
-               *result = pCap->halTxStbcSupport;
-               return HAL_OK;
-       }
-#endif
-        default:
-                return ath_hal_getcapability(ah, type, capability, result);
-       }
+       return ath_hal_getcapability(ah, type, capability, result);
 }
 
 /****************/
index b8874bf00ec66fb500137bdda3b83618e6630813..4c9e98b16a63d84ac3bfacaff4ff17ca0fe95738 100755 (executable)
@@ -1146,16 +1146,6 @@ static void ath_init_tgt(void *Context, A_UINT16 Command,
        if (ath_hal_htsupported(ah))
                sc->sc_imask |= HAL_INT_CST;
 
-#ifdef MAGPIE_MERLIN
-       {
-               a_uint32_t stbcsupport;
-               if (ath_hal_txstbcsupport(ah, &stbcsupport))
-                       sc->sc_txstbcsupport = stbcsupport;
-
-               if (ath_hal_rxstbcsupport(ah, &stbcsupport))
-                       sc->sc_rxstbcsupport = stbcsupport;
-       }
-#endif
        adf_os_setup_intr(sc->sc_dev, ath_intr);
        ath_hal_intrset(ah, sc->sc_imask);
 
index f2412c0847c720274a97dc390f51db233214fb35..c3a6fbe534924be24c8d3073e6522e16d4076751 100755 (executable)
@@ -366,8 +366,6 @@ struct ath_softc_tgt
        struct ath_ratectrl    *sc_rc;
 
        a_uint32_t            sc_invalid : 1,
-               sc_txstbcsupport       : 1,
-               sc_rxstbcsupport       : 2,
                sc_tx_draining         : 1,
                sc_enable_coex         : 1;
 
@@ -547,10 +545,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av
     ((*(_ah)->ah_stopPcuReceive)((_ah)))
 #define ath_hal_htsupported(_ah) \
     (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK)
-#define ath_hal_rxstbcsupport(_ah, _rxstbc) \
-    (ath_hal_getcapability(_ah, HAL_CAP_RX_STBC, 0, _rxstbc) == HAL_OK)
-#define ath_hal_txstbcsupport(_ah, _txstbc) \
-    (ath_hal_getcapability(_ah, HAL_CAP_TX_STBC, 0, _txstbc) == HAL_OK)
 #define ath_hal_getrtsaggrlimit(_ah, _pv) \
     (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK)
 #define ath_hal_puttxbuf(_ah, _q, _bufaddr) \
index c832dc12cec2129e9332d423d91320d592607ffe..97ee9a6e0cd4a025414e0a2f6f536a0f1691ec03 100755 (executable)
@@ -159,7 +159,6 @@ typedef struct phy_rate_ctrl {
 struct atheros_node {
        TX_RATE_CTRL txRateCtrl;    /* rate control state proper */
        A_UINT32 lastRateKbps;      /* last rate in Kb/s */
-       A_UINT32 htcap;            /* ht capabilites */
        A_UINT8 singleStream    :1,   /* When TRUE, only single stream Tx possible */
                stbc            :2;   /* Rx stbc capability */
 
index f220819fe10ee820033964a9ae43b04ac4614b31..1123febeab34dfba88adde76f23b64b7d7416d13 100755 (executable)
@@ -157,20 +157,6 @@ typedef struct {
        rc11n_info_t     info[];
 } RATE_TABLE_11N;
 
-/*
- *  Update the SIB's rate control information
- *
- *  This should be called when the supported rates change
- *  (e.g. SME operation, wireless mode change)
- *
- *  It will determine which rates are valid for use.
- */
-void rcSibUpdate_11n(struct ath_softc_tgt *,
-                    struct ath_node_target *,
-                    A_UINT32 capflag, 
-                    A_BOOL keepState,
-                    struct ieee80211_rate *rs);
-
 /*
  * Determines and returns the new Tx rate index.
  */ 
index de8655016d2761327c8b6c63b7771795d40a38a6..57ac34a240bd710cf7b52a64bfbe7ab261b5631f 100755 (executable)
@@ -429,20 +429,7 @@ rcSibUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an,
        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
@@ -1211,29 +1198,12 @@ ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int
                      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);
        }
 }