From patchwork Sun Jan 16 06:19:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 481841 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0G6KmTv017923 for ; Sun, 16 Jan 2011 06:20:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750920Ab1APGUm (ORCPT ); Sun, 16 Jan 2011 01:20:42 -0500 Received: from mail.atheros.com ([12.19.149.2]:65317 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822Ab1APGUm (ORCPT ); Sun, 16 Jan 2011 01:20:42 -0500 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Sat, 15 Jan 2011 22:20:24 -0800 Received: from mail.atheros.com (10.12.4.12) by SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.2.213.0; Sat, 15 Jan 2011 22:20:39 -0800 Received: by mail.atheros.com (sSMTP sendmail emulation); Sun, 16 Jan 2011 11:49:55 +0530 From: Rajkumar Manoharan To: CC: Rajkumar Manoharan Subject: [PATCH] ath9k_htc: abort tx/rx on fast channel change Date: Sun, 16 Jan 2011 11:49:54 +0530 Message-ID: <1295158794-3088-1-git-send-email-rmanoharan@atheros.com> X-Mailer: git-send-email 1.7.3.5 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 16 Jan 2011 06:20:49 +0000 (UTC) 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,