/* If bool is set this will kill any frame which is currently being transferred between the MAC and baseband and also prevent any new frames from getting started.  */
bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set)
/* If bool is set this will kill any frame which is currently being transferred between the MAC and baseband and also prevent any new frames from getting started.  */
bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set)
{
	u32 reg;
	if (set) {
		REG_SET_BIT(ah, AR_DIAG_SW,
			    (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
		if (!ath9k_hw_wait(ah, AR_OBS_BUS_1, AR_OBS_BUS_1_RX_STATE,
				   0, AH_WAIT_TIMEOUT)) {
			REG_CLR_BIT(ah, AR_DIAG_SW,
				    (AR_DIAG_RX_DIS |
				     AR_DIAG_RX_ABORT));
			reg = REG_READ(ah, AR_OBS_BUS_1);
			ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
				  "RX failed to go idle in 10 ms RXSM=0x%x\n",
				  reg);
			return false;
		}
	} else {
		REG_CLR_BIT(ah, AR_DIAG_SW,
			    (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
	}
	return true;
}