From patchwork Mon Feb 10 11:47:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 3618221 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4D1FBF418 for ; Mon, 10 Feb 2014 11:47:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 081B62018E for ; Mon, 10 Feb 2014 11:47:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B61320138 for ; Mon, 10 Feb 2014 11:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752468AbaBJLrp (ORCPT ); Mon, 10 Feb 2014 06:47:45 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:46548 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbaBJLro (ORCPT ); Mon, 10 Feb 2014 06:47:44 -0500 Received: by mail-we0-f169.google.com with SMTP id t61so4190939wes.0 for ; Mon, 10 Feb 2014 03:47:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ebgbUsITl/3PAzeRB6iCiuD2962IncpKxc3+Wf6uqMY=; b=PTM4myqeYHqIVujvIs7frqGzt206TPBZ4+EiHdJKN5GfvxhhJO5a0PSOZ9nHBD4/Ev FJs9INL1BDIfgeQXlbfvf0Bf3VKKtWkRtxEgwFGj/cYauQH6i0SYmU53IgsIjE8yfCvy 8etSqLo/B5aYkkVRbXezV27rvud4kzpPwdvvT8f3onvt+78USePrNQlnrisjy/ytA1+Y JBWR+0xuKbZuxX93wZSFHGcRt8FADGYv9kmXCWERAOH/RjXN9V7OK00FnItUiITMfmgU 5zw4DsKDe//yU1vPAMeuuSJQybbBByU2sgmCUT0DdAnLsheH08o8c5A3d1/WyiHyG0Au FqRA== X-Gm-Message-State: ALoCoQlbEpT7HvryckZ1HVnyAVc/I2/BjwPFzB2Eq0YT+JpUT0KYIbc7k5be1lqzUnNFg2pk/9qM X-Received: by 10.180.102.42 with SMTP id fl10mr10200107wib.42.1392032862820; Mon, 10 Feb 2014 03:47:42 -0800 (PST) Received: from muse.amr.corp.intel.com (93-173-177-113.bb.netvision.net.il. [93.173.177.113]) by mx.google.com with ESMTPSA id ju6sm34687484wjc.1.2014.02.10.03.47.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 03:47:42 -0800 (PST) From: Eliad Peller To: "John W. Linville" Cc: Subject: [PATCH 01/18] wlcore: memset wl->rx_filter_enabled to zero after recovery Date: Mon, 10 Feb 2014 13:47:17 +0200 Message-Id: <1392032854-28126-2-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.2.229.g4448466.dirty In-Reply-To: <1392032854-28126-1-git-send-email-eliad@wizery.com> References: <1392032854-28126-1-git-send-email-eliad@wizery.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nadim Zubidat zero rx_filter_enabled array after recovery to avoid cases were the driver will keep trying to clear a filter which is not configured in FW. Such case will cause consecutive recoveries due to command execution failures. While on it, convert rx_filter_enabled to bitmap, to save some memory and make sparse happy (it doesn't like sizeof(bool array)). Signed-off-by: Nadim Zubidat Signed-off-by: Eliad Peller --- drivers/net/wireless/ti/wlcore/main.c | 1 + drivers/net/wireless/ti/wlcore/rx.c | 9 ++++++--- drivers/net/wireless/ti/wlcore/wlcore.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index b46b311..da268e8 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1914,6 +1914,7 @@ static void wlcore_op_stop_locked(struct wl1271 *wl) memset(wl->links_map, 0, sizeof(wl->links_map)); memset(wl->roc_map, 0, sizeof(wl->roc_map)); memset(wl->session_ids, 0, sizeof(wl->session_ids)); + memset(wl->rx_filter_enabled, 0, sizeof(wl->rx_filter_enabled)); wl->active_sta_count = 0; wl->active_link_count = 0; diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index 6791a1a..94ab445 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c @@ -302,7 +302,7 @@ int wl1271_rx_filter_enable(struct wl1271 *wl, { int ret; - if (wl->rx_filter_enabled[index] == enable) { + if (!!test_bit(index, wl->rx_filter_enabled) == enable) { wl1271_warning("Request to enable an already " "enabled rx filter %d", index); return 0; @@ -316,7 +316,10 @@ int wl1271_rx_filter_enable(struct wl1271 *wl, return ret; } - wl->rx_filter_enabled[index] = enable; + if (enable) + __set_bit(index, wl->rx_filter_enabled); + else + __clear_bit(index, wl->rx_filter_enabled); return 0; } @@ -326,7 +329,7 @@ int wl1271_rx_filter_clear_all(struct wl1271 *wl) int i, ret = 0; for (i = 0; i < WL1271_MAX_RX_FILTERS; i++) { - if (!wl->rx_filter_enabled[i]) + if (!test_bit(i, wl->rx_filter_enabled)) continue; ret = wl1271_rx_filter_enable(wl, i, 0, NULL); if (ret) diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 06efc12..a3cc117 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h @@ -451,7 +451,7 @@ struct wl1271 { size_t fw_status_priv_len; /* RX Data filter rule state - enabled/disabled */ - bool rx_filter_enabled[WL1271_MAX_RX_FILTERS]; + unsigned long rx_filter_enabled[BITS_TO_LONGS(WL1271_MAX_RX_FILTERS)]; /* size of the private static data */ size_t static_data_priv_len;