@@ -1172,6 +1172,7 @@ u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan)
11721172static inline void ath9k_hw_set_dma (struct ath_hw * ah )
11731173{
11741174 struct ath_common * common = ath9k_hw_common (ah );
1175+ int txbuf_size ;
11751176
11761177 ENABLE_REGWRITE_BUFFER (ah );
11771178
@@ -1225,13 +1226,17 @@ static inline void ath9k_hw_set_dma(struct ath_hw *ah)
12251226 * So set the usable tx buf size also to half to
12261227 * avoid data/delimiter underruns
12271228 */
1228- REG_WRITE (ah , AR_PCU_TXBUF_CTRL ,
1229- AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE );
1230- } else if (!AR_SREV_9271 (ah )) {
1231- REG_WRITE (ah , AR_PCU_TXBUF_CTRL ,
1232- AR_PCU_TXBUF_CTRL_USABLE_SIZE );
1229+ txbuf_size = AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE ;
1230+ } else if (AR_SREV_9340_13_OR_LATER (ah )) {
1231+ /* Uses fewer entries for AR934x v1.3+ to prevent rx overruns */
1232+ txbuf_size = AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE ;
1233+ } else {
1234+ txbuf_size = AR_PCU_TXBUF_CTRL_USABLE_SIZE ;
12331235 }
12341236
1237+ if (!AR_SREV_9271 (ah ))
1238+ REG_WRITE (ah , AR_PCU_TXBUF_CTRL , txbuf_size );
1239+
12351240 REGWRITE_BUFFER_FLUSH (ah );
12361241
12371242 if (AR_SREV_9300_20_OR_LATER (ah ))
@@ -1306,9 +1311,13 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type)
13061311 AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET ;
13071312 } else {
13081313 tmpReg = REG_READ (ah , AR_INTR_SYNC_CAUSE );
1309- if (tmpReg &
1310- (AR_INTR_SYNC_LOCAL_TIMEOUT |
1311- AR_INTR_SYNC_RADM_CPL_TIMEOUT )) {
1314+ if (AR_SREV_9340 (ah ))
1315+ tmpReg &= AR9340_INTR_SYNC_LOCAL_TIMEOUT ;
1316+ else
1317+ tmpReg &= AR_INTR_SYNC_LOCAL_TIMEOUT |
1318+ AR_INTR_SYNC_RADM_CPL_TIMEOUT ;
1319+
1320+ if (tmpReg ) {
13121321 u32 val ;
13131322 REG_WRITE (ah , AR_INTR_SYNC_ENABLE , 0 );
13141323
0 commit comments