use one ar5416Set11nAggrFirst_20 for merlin and k2
authorOleksij Rempel <linux@rempel-privat.de>
Sat, 11 May 2013 20:28:23 +0000 (22:28 +0200)
committerOleksij Rempel <linux@rempel-privat.de>
Sat, 11 May 2013 20:41:31 +0000 (22:41 +0200)
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
target_firmware/wlan/ah.h
target_firmware/wlan/ar5416_hw.c
target_firmware/wlan/ar5416desc.h
target_firmware/wlan/if_ath.c
target_firmware/wlan/if_owl.c

index 985fc7e5dcc8f87794814c290109d6056673495b..d7a71f128d37e8d627504b4a5e813097a137dbed 100755 (executable)
@@ -397,7 +397,6 @@ struct ath_hal
        void      __ahdecl(*ah_set11nRateScenario)(struct ath_tx_desc *ds,
                                                   a_uint32_t durUpdateEn,
                                                   a_uint32_t rtsctsRate,
-                                                  a_uint32_t rtsctsDuration,
                                                   HAL_11N_RATE_SERIES series[],
                                                   a_uint32_t nseries, a_uint32_t flags);
        void      __ahdecl(*ah_set11nAggrFirst)(struct ath_hal *ah,
index 68933c5d8266996fdb717d995b8baf7c858c268b..be3f22a2e85967975408b93ea98b4c4f34bacd3e 100644 (file)
@@ -809,26 +809,23 @@ void ar5416Set11nTxDesc_20(struct ath_tx_desc *ds,
         ads->ds_ctl6 = SM(keyType, AR_EncrType);
 }
 
-#ifdef MAGPIE_MERLIN
-
 void ar5416Set11nRateScenario_20(struct ath_tx_desc *ds,
                                 a_uint32_t durUpdateEn, a_uint32_t rtsctsRate,
-                                a_uint32_t rtsctsDuration,
                                 HAL_11N_RATE_SERIES series[], a_uint32_t nseries,
                                 a_uint32_t flags)
 {
-        struct ar5416_desc *ads = AR5416DESC(ds);
-        a_uint32_t ds_ctl0;
+       struct ar5416_desc *ads = AR5416DESC(ds);
+       a_uint32_t ds_ctl0;
 
-        HALASSERT(nseries == 4);
-        (void)nseries;
+       HALASSERT(nseries == 4);
+       (void)nseries;
 
-        /*
-         * Rate control settings override
-         */
+       /*
+       * Rate control settings override
+       */
        ds_ctl0 = ads->ds_ctl0;
 
-        if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) {
+       if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) {
                if (flags & HAL_TXDESC_RTSENA) {
                        ds_ctl0 &= ~AR_CTSEnable;
                        ds_ctl0 |= AR_RTSEnable;
@@ -836,93 +833,38 @@ void ar5416Set11nRateScenario_20(struct ath_tx_desc *ds,
                        ds_ctl0 &= ~AR_RTSEnable;
                        ds_ctl0 |= AR_CTSEnable;
                }
-        } else {
+       } else {
+               /* this line is only difference between merlin and k2
+                * Current one is for merlin */
                ds_ctl0 = (ds_ctl0 & ~(AR_RTSEnable | AR_CTSEnable));
-        }
+       }
 
        ads->ds_ctl0 = ds_ctl0;
 
-        ads->ds_ctl2 = set11nTries(series, 0)
-                set11nTries(series, 1)
-                set11nTries(series, 2)
-                set11nTries(series, 3)
-                (durUpdateEn ? AR_DurUpdateEn : 0);
+       ads->ds_ctl2 = set11nTries(series, 0)
+                                  | set11nTries(series, 1)
+                                  | set11nTries(series, 2)
+                                  | set11nTries(series, 3)
+                                  | (durUpdateEn ? AR_DurUpdateEn : 0);
 
-        ads->ds_ctl3 = set11nRate(series, 0)
-                set11nRate(series, 1)
-                set11nRate(series, 2)
-                set11nRate(series, 3);
+       ads->ds_ctl3 = set11nRate(series, 0)
+                                  | set11nRate(series, 1)
+                                  | set11nRate(series, 2)
+                                  | set11nRate(series, 3);
 
-        ads->ds_ctl4 = set11nPktDurRTSCTS(series, 0)
-                set11nPktDurRTSCTS(series, 1);
+       ads->ds_ctl4 = set11nPktDurRTSCTS(series, 0)
+                                  | set11nPktDurRTSCTS(series, 1);
 
-        ads->ds_ctl5 = set11nPktDurRTSCTS(series, 2)
-                set11nPktDurRTSCTS(series, 3);
+       ads->ds_ctl5 = set11nPktDurRTSCTS(series, 2)
+                                  | set11nPktDurRTSCTS(series, 3);
 
-        ads->ds_ctl7 = set11nRateFlags(series, 0)
-                set11nRateFlags(series, 1)
-                set11nRateFlags(series, 2)
-                set11nRateFlags(series, 3)
-               | SM(rtsctsRate, AR_RTSCTSRate);
+       ads->ds_ctl7 = set11nRateFlags(series, 0)
+                                  | set11nRateFlags(series, 1)
+                                  | set11nRateFlags(series, 2)
+                                  | set11nRateFlags(series, 3)
+                                  | SM(rtsctsRate, AR_RTSCTSRate);
 }
 
-#else
-
-void ar5416Set11nRateScenario_20(struct ath_tx_desc *ds,
-                                a_uint32_t durUpdateEn, a_uint32_t rtsctsRate,
-                                a_uint32_t rtsctsDuration,
-                                HAL_11N_RATE_SERIES series[], a_uint32_t nseries,
-                                a_uint32_t flags)
-{
-        struct ar5416_desc *ads = AR5416DESC(ds);
-        a_uint32_t ds_ctl0;
-
-        HALASSERT(nseries == 4);
-        (void)nseries;
-
-        /*
-         * Rate control settings override
-         */
-        if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) {
-               ds_ctl0 = ads->ds_ctl0;
-
-               if (flags & HAL_TXDESC_RTSENA) {
-                       ds_ctl0 &= ~AR_CTSEnable;
-                       ds_ctl0 |= AR_RTSEnable;
-               } else {
-                       ds_ctl0 &= ~AR_RTSEnable;
-                       ds_ctl0 |= AR_CTSEnable;
-               }
-
-               ads->ds_ctl0 = ds_ctl0;
-        }
-
-        ads->ds_ctl2 = set11nTries(series, 0)
-               |  set11nTries(series, 1)
-               |  set11nTries(series, 2)
-               |  set11nTries(series, 3)
-               |  (durUpdateEn ? AR_DurUpdateEn : 0);
-
-        ads->ds_ctl3 = set11nRate(series, 0)
-               |  set11nRate(series, 1)
-               |  set11nRate(series, 2)
-               |  set11nRate(series, 3);
-
-        ads->ds_ctl4 = set11nPktDurRTSCTS(series, 0)
-               |  set11nPktDurRTSCTS(series, 1);
-
-        ads->ds_ctl5 = set11nPktDurRTSCTS(series, 2)
-               |  set11nPktDurRTSCTS(series, 3);
-
-        ads->ds_ctl7 = set11nRateFlags(series, 0)
-               |  set11nRateFlags(series, 1)
-               |  set11nRateFlags(series, 2)
-               |  set11nRateFlags(series, 3)
-               | SM(rtsctsRate, AR_RTSCTSRate);
-}
-
-#endif
-
 void ar5416Set11nAggrFirst_20(struct ath_hal *ah, struct ath_tx_desc *ds, a_uint32_t aggrLen,
                              a_uint32_t numDelims)
 {
index 6b5fb1633f0f10fe77a5bd622be87b38b4884956..429f26d71c39faef45fa356460acfd01f44634b9 100755 (executable)
@@ -473,7 +473,7 @@ extern void ar5416Set11nTxDesc_20(struct ath_tx_desc *ds,
        a_uint32_t pktLen, HAL_PKT_TYPE type, a_uint32_t txPower,
        a_uint32_t keyIx, HAL_KEY_TYPE keyType, a_uint32_t flags);
 extern void ar5416Set11nRateScenario_20(struct ath_tx_desc *ds,
-       a_uint32_t durUpdateEn, a_uint32_t rtsctsRate, a_uint32_t rtsctsDuration, HAL_11N_RATE_SERIES series[], 
+       a_uint32_t durUpdateEn, a_uint32_t rtsctsRate, HAL_11N_RATE_SERIES series[], 
        a_uint32_t nseries, a_uint32_t flags);
 extern void ar5416Set11nAggrFirst_20(struct ath_hal *ah, struct ath_tx_desc *ds,
        a_uint32_t aggrLen, a_uint32_t numDelims);
index 0cf6b753535c48e10bfd5b6cefa46def409ac9b1..fcbe9c3cd3631a3800ecf9f24a623fc528f43567 100755 (executable)
@@ -563,7 +563,7 @@ static void ath_beacon_setup(struct ath_softc_tgt *sc,
        series[0].Rate = rate;
        series[0].ChSel = sc->sc_ic.ic_tx_chainmask;
        series[0].RateFlags = 0;
-       ah->ah_set11nRateScenario(ds, 0, 0, 0, series, 4, 0);
+       ah->ah_set11nRateScenario(ds, 0, 0, series, 4, 0);
 }
 
 static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
index 5d9f540d7af54314c8415fb98428ce53e7e5f16a..9e983d56db1943f12979dd6daa5aa45d261b34e4 100755 (executable)
@@ -372,7 +372,6 @@ static void ath_buf_set_rate(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
     HAL_11N_RATE_SERIES series[4];
     a_int32_t i, flags;
     a_uint8_t rix, cix, rtsctsrate;
-    a_uint32_t ctsduration = 0;
     a_int32_t prot_mode = AH_FALSE;
 
     rt = sc->sc_currates;
@@ -445,7 +444,7 @@ static void ath_buf_set_rate(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
            (bf->bf_shpream ? rt->info[cix].shortPreamble : 0);
 
     ah->ah_set11nRateScenario(ds, 1,
-                               rtsctsrate, ctsduration,
+                               rtsctsrate,
                                series, 4,
                                flags);
 }
@@ -1230,7 +1229,7 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb,
                series[i].ChSel = sc->sc_ic.ic_tx_chainmask;
                series[i].RateFlags = 0;
        }
-       ah->ah_set11nRateScenario(ds, 0, ctsrate, ctsduration, series, 4, 0);
+       ah->ah_set11nRateScenario(ds, 0, ctsrate, series, 4, 0);
        ath_tgt_txqaddbuf(sc, txq, bf, bf->bf_lastds);
 
        return;
@@ -2153,6 +2152,6 @@ static void ath_bar_tx(struct ath_softc_tgt *sc,
                series[i].ChSel = sc->sc_ic.ic_tx_chainmask;
        }
 
-       ah->ah_set11nRateScenario(bf->bf_desc, 0, 0, 0, series, 4, 4);
+       ah->ah_set11nRateScenario(bf->bf_desc, 0, 0, series, 4, 4);
        ath_tgt_txq_add_ucast(sc, bf);
 }