From patchwork Fri Jul 22 05:41:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 998212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6M5hgPH010091 for ; Fri, 22 Jul 2011 05:43:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386Ab1GVFni (ORCPT ); Fri, 22 Jul 2011 01:43:38 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:16110 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753379Ab1GVFnh (ORCPT ); Fri, 22 Jul 2011 01:43:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=kvalo@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1311313417; x=1342849417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; z=From:=20Kalle=20Valo=20|To:=20|CC:=20,=20Raja=20Mani=20|Subject: =20[PATCH=2026/31]=20ath6kl:=20Use=20bit=20field=20macros =20to=20maintain=20wlan=20enabled=20and=20disabled=20stat us|Date:=20Fri,=2022=20Jul=202011=2008:41:59=20+0300 |Message-ID:=20<1311313324-6766-28-git-send-email-kvalo@q ca.qualcomm.com>|In-Reply-To:=20<1311313324-6766-1-git-se nd-email-kvalo@qca.qualcomm.com>|References:=20<131131332 4-6766-1-git-send-email-kvalo@qca.qualcomm.com> |MIME-Version:=201.0; bh=OtUHTc1Z7pkhoKg44I3xPT8R8LjFbp1UK+Sy9LqWWh8=; b=NEKRJdhAcdNh1RxBYBx7Swx78z8wV7EbWwW7oSFkk7S0VY/759Kk0Rpe sJaQPmvNu4D8g8TE+IoNRfF4kNwPqM8XzPLBI/Pst1ErqnFS8gn5VwHhC +Bbr6DXRO2VYBy6iS/LlMmbBI/p2eARHHxANn46fhE+m2EvKOFPJRidUk 0=; X-IronPort-AV: E=McAfee;i="5400,1158,6414"; a="104991782" Received: from ironmsg02-l.qualcomm.com ([172.30.48.16]) by wolverine02.qualcomm.com with ESMTP; 21 Jul 2011 22:43:37 -0700 X-IronPort-AV: E=Sophos;i="4.67,244,1309762800"; d="scan'208";a="118405788" Received: from nasanexhub01.na.qualcomm.com ([10.46.93.121]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-MD5; 21 Jul 2011 22:43:37 -0700 Received: from NASANEXHC14.na.qualcomm.com (172.30.48.23) by nasanexhub01.na.qualcomm.com (10.46.93.121) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 21 Jul 2011 22:43:37 -0700 Received: from NASJOEXHC01.na.qualcomm.com (10.234.56.15) by nasanexhc14.na.qualcomm.com (172.30.48.23) with Microsoft SMTP Server (TLS) id 14.1.323.0; Thu, 21 Jul 2011 22:43:37 -0700 Received: from localhost.localdomain (10.234.11.69) by qcamail1.atheros.com (10.234.56.15) with Microsoft SMTP Server (TLS) id 14.1.323.0; Thu, 21 Jul 2011 22:43:33 -0700 From: Kalle Valo To: CC: , Raja Mani Subject: [PATCH 26/31] ath6kl: Use bit field macros to maintain wlan enabled and disabled status Date: Fri, 22 Jul 2011 08:41:59 +0300 Message-ID: <1311313324-6766-28-git-send-email-kvalo@qca.qualcomm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com> References: <1311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.234.11.69] 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 (demeter2.kernel.org [140.211.167.43]); Fri, 22 Jul 2011 05:43:42 +0000 (UTC) From: Raja Mani Signed-off-by: Raja Mani Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +- drivers/net/wireless/ath/ath6kl/core.h | 7 +------ drivers/net/wireless/ath/ath6kl/init.c | 4 ++-- drivers/net/wireless/ath/ath6kl/main.c | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 4284a41..a70d2ac 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -223,7 +223,7 @@ static bool ath6kl_cfg80211_ready(struct ath6kl *ar) return false; } - if (ar->wlan_state == WLAN_DISABLED) { + if (!test_bit(WLAN_ENABLED, &ar->flag)) { ath6kl_err("wlan disabled\n"); return false; } diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 86177f0..6778475 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h @@ -134,11 +134,6 @@ enum sme_state { SME_CONNECTED }; -enum ath6kl_wlan_state { - WLAN_DISABLED, - WLAN_ENABLED -}; - struct skb_hold_q { struct sk_buff *skb; bool is_amsdu; @@ -365,6 +360,7 @@ struct ath6kl_req_key { #define DESTROY_IN_PROGRESS 9 #define NETDEV_REGISTERED 10 #define SKIP_SCAN 11 +#define WLAN_ENABLED 12 struct ath6kl { struct device *dev; @@ -401,7 +397,6 @@ struct ath6kl { u8 tx_pwr; struct net_device_stats net_stats; struct target_stats target_stats; - enum ath6kl_wlan_state wlan_state; struct ath6kl_node_mapping node_map[MAX_NODE_NUM]; u8 ibss_ps_enable; u8 node_num; diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index fe61871..d574d08 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -584,7 +584,7 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev) init_netdev(dev); ar->net_dev = dev; - ar->wlan_state = WLAN_ENABLED; + set_bit(WLAN_ENABLED, &ar->flag); ar->wlan_pwr_state = WLAN_POWER_STATE_ON; @@ -1239,7 +1239,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar) if (ar->wlan_pwr_state != WLAN_POWER_STATE_CUT_PWR) ath6kl_stop_endpoint(ndev, false, true); - ar->wlan_state = WLAN_DISABLED; + clear_bit(WLAN_ENABLED, &ar->flag); } /* diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index f325a23..284e3e9 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -1275,7 +1275,7 @@ static int ath6kl_open(struct net_device *dev) spin_lock_irqsave(&ar->lock, flags); - ar->wlan_state = WLAN_ENABLED; + set_bit(WLAN_ENABLED, &ar->flag); if (test_bit(CONNECTED, &ar->flag)) { netif_carrier_on(dev); @@ -1301,7 +1301,7 @@ static int ath6kl_close(struct net_device *dev) 0, 0, 0)) return -EIO; - ar->wlan_state = WLAN_DISABLED; + clear_bit(WLAN_ENABLED, &ar->flag); } ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED);