From patchwork Thu Jul 14 21:29:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franky Lin X-Patchwork-Id: 976232 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6ELVZ5s020192 for ; Thu, 14 Jul 2011 21:31:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932472Ab1GNVbd (ORCPT ); Thu, 14 Jul 2011 17:31:33 -0400 Received: from mms1.broadcom.com ([216.31.210.17]:4269 "EHLO mms1.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932380Ab1GNV34 (ORCPT ); Thu, 14 Jul 2011 17:29:56 -0400 Received: from [10.9.200.131] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Thu, 14 Jul 2011 14:34:49 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Thu, 14 Jul 2011 14:29:37 -0700 Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com [10.17.16.106]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id D9EBB74D04; Thu, 14 Jul 2011 14:29:36 -0700 (PDT) Received: from lc-sj1-3560.broadcom.com (lc-sj1-3560.sj.broadcom.com [10.17.194.250]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 5BAB320523; Thu, 14 Jul 2011 14:29:34 -0700 (PDT) Received: by lc-sj1-3560.broadcom.com (Postfix, from userid 25250) id 76F8F2C19D27; Thu, 14 Jul 2011 14:29:31 -0700 (PDT) From: "Franky Lin" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org Subject: [PATCH 28/35] staging: brcm80211: brcmfmac: Fixed issues with iscan Date: Thu, 14 Jul 2011 14:29:24 -0700 Message-ID: <1310678971-28952-29-git-send-email-frankyl@broadcom.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> References: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 6201BF733B420695918-03-01 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]); Thu, 14 Jul 2011 21:31:36 +0000 (UTC) From: Sukesh Srikakula Disabling the interface doesn't terminate undergoing iscan in FW. When the interface is enabled immediately, first scan request is returning the stale scan results, which are populated during the earlier iscan. These stale scan results are causing random failures with chromium auto test cases. With this patch, iscan will be terminated in FW whenever iscan thread is terminated by the host driver. Signed-off-by: Sukesh Srikakula Reviewed-by: Arend van Spriel Reviewed-by: Roland Vossen --- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index 8423aad..cf57087 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c @@ -709,10 +709,14 @@ static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv) } brcmf_set_mpc(ndev, 0); cfg_priv->iscan_kickstart = true; - brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START); + err = brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START); + if (err) { + brcmf_set_mpc(ndev, 1); + cfg_priv->iscan_kickstart = false; + return err; + } mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000); iscan->timer_on = 1; - return err; } @@ -3165,12 +3169,17 @@ static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv) static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv) { struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv); + struct brcmf_ssid ssid; if (cfg_priv->iscan_on && iscan->tsk) { iscan->state = WL_ISCAN_STATE_IDLE; send_sig(SIGTERM, iscan->tsk, 1); kthread_stop(iscan->tsk); iscan->tsk = NULL; + + /* Abort iscan running in FW */ + memset(&ssid, 0, sizeof(ssid)); + brcmf_run_iscan(iscan, &ssid, WL_SCAN_ACTION_ABORT); } } @@ -3237,6 +3246,7 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status, WL_SCAN("results->count = %d\n", results->count); WL_SCAN("results->buflen = %d\n", results->buflen); *status = le32_to_cpu(list_buf->status); + WL_SCAN("status = %d\n", *status); *bss_list = results; return err;