diff mbox

ath9k_htc: abort tx/rx on fast channel change

Message ID 1295158794-3088-1-git-send-email-rmanoharan@atheros.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Rajkumar Manoharan Jan. 16, 2011, 6:19 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 187af5b..d374867 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -193,8 +193,6 @@  static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
 	ath9k_htc_ps_wakeup(priv);
 	htc_stop(priv->htc);
 	WMI_CMD(WMI_DISABLE_INTR_CMDID);
-	WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID);
-	WMI_CMD(WMI_STOP_RECV_CMDID);
 
 	ath_dbg(common, ATH_DBG_CONFIG,
 		"(%u MHz) -> (%u MHz), HT: %d, HT40: %d fastcc: %d\n",
@@ -202,8 +200,21 @@  static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
 		channel->center_freq, conf_is_ht(conf), conf_is_ht40(conf),
 		fastcc);
 
-	if (!fastcc)
+	if (fastcc) {
+		/* abort pending tx frames */
+		WMI_CMD(WMI_ABORT_TX_DMA_CMDID);
+		WMI_CMD(WMI_ABORT_TXQ_CMDID);
+
+		/* Clear receive filter */
+		ath9k_hw_setrxfilter(ah, 0);
+
+		WMI_CMD(WMI_STOP_DMA_RECV_CMDID);
+		WMI_CMD(WMI_RX_LINK_CMDID);
+	} else {
+		WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID);
+		WMI_CMD(WMI_STOP_RECV_CMDID);
 		caldata = &priv->caldata;
+	}
 	ret = ath9k_hw_reset(ah, hchan, caldata, fastcc);
 	if (ret) {
 		ath_err(common,