linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, Raja Mani <rmani@qca.qualcomm.com>
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	[thread overview]
Message-ID: <1311313324-6766-28-git-send-email-kvalo@qca.qualcomm.com> (raw)
In-Reply-To: <1311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com>

From: Raja Mani <rmani@qca.qualcomm.com>

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 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);
-- 
1.7.1


  parent reply	other threads:[~2011-07-22  5:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22  5:41 [PATCH 00/31] ath6kl: pending patches from ath6kl-cleanup Kalle Valo
2011-07-22  5:41 ` [PATCH 00/31] *** SUBJECT HERE *** Kalle Valo
2011-07-22  5:53   ` Kalle Valo
2011-07-22 13:40     ` John W. Linville
2011-07-22  5:41 ` [PATCH 01/31] ath6kl: cleanup callbacks for different scatter gather method Kalle Valo
2011-07-22  5:41 ` [PATCH 02/31] ath6kl: Move ath6kl_sdio_async_rw_scatter() down to other hif_ops functions Kalle Valo
2011-07-22  5:41 ` [PATCH 03/31] ath6kl: Remove struct hif_scatter_req_priv Kalle Valo
2011-07-22  5:41 ` [PATCH 04/31] ath6kl: Remove useless flags in hif_scatter_req Kalle Valo
2011-07-22  5:41 ` [PATCH 05/31] ath6kl: Remove endpoint reference from hif_scatter_req Kalle Valo
2011-07-22  5:41 ` [PATCH 06/31] ath6kl: Refactor refactor ath6kl_sdio_setup_scat_resource() Kalle Valo
2011-07-22  5:41 ` [PATCH 07/31] ath6kl: Cleanup ath6kl_sdio_enable_scatter() Kalle Valo
2011-07-22  5:41 ` [PATCH 08/31] ath6kl: Cleanup ath6kl_sdio_cleanup_scatter() Kalle Valo
2011-07-22  5:41 ` [PATCH 09/31] ath6kl: Move down scatter enable and cleanup functions Kalle Valo
2011-07-22  5:41 ` [PATCH 10/31] ath6kl: Merge scatter gather setup functions for two method Kalle Valo
2011-07-22  5:41 ` [PATCH 11/31] ath6kl: Moe virt_scat from hif_dev_scat_sup_info to hif_scatter_req Kalle Valo
2011-07-22  5:41 ` [PATCH 12/31] ath6kl: Refactor ath6kl_sdio_read_write_sync() Kalle Valo
2011-07-22  5:41 ` [PATCH 13/31] ath6kl: Merge scatter rw request functions into one Kalle Valo
2011-07-22  5:41 ` [PATCH 14/31] ath6kl: Remove ath6kldev_setup_msg_bndl() Kalle Valo
2011-07-22  5:41 ` [PATCH 15/31] ath6kl: Minor cleanup in ath6kldev_submit_scat_req() Kalle Valo
2011-07-22  5:41 ` [PATCH 16/31] ath6kl: Remove callback msg_pending() and used the function directly Kalle Valo
2011-07-22  5:41 ` [PATCH 17/31] ath6kl: Move bundle size from ath6kl_device to htc_target Kalle Valo
2011-07-22  5:41 ` [PATCH 18/31] ath6kl: Move block_sz and block_mask " Kalle Valo
2011-07-22  5:41 ` [PATCH 19/31] ath6kl: Move scatter information " Kalle Valo
2011-07-22  5:41 ` [PATCH 20/31] ath6kl: Bypass reading irq status based on chk_irq_status_cnt Kalle Valo
2011-07-22  5:41 ` [PATCH 21/31] ath6kl: Move chk_irq_status_cnt from ath6kl_device to htc_target Kalle Valo
2011-07-22  5:41 ` [PATCH 22/31] ath6kl: Remove unused struct ath6kl_async_reg_io_buffer Kalle Valo
2011-07-22  5:41 ` [PATCH 23/31] ath6kl: Print bad trailer data only when htc fails to parse trailer info Kalle Valo
2011-07-22  5:41 ` [PATCH 24/31] ath6kl: Rearrange the variable and the value position in IF condition Kalle Valo
2011-07-22  5:41 ` [PATCH 25/31] ath6kl: Avoid two memset to clear src and desr mac addr variable memory in ath6kl_wmi_dot11_hdr_remove() Kalle Valo
2011-07-22  5:41 ` Kalle Valo [this message]
2011-07-22  5:42 ` [PATCH 27/31] ath6kl: don't force foreground scan when connected Kalle Valo
2011-07-22  5:42 ` [PATCH 28/31] ath6kl: fix atomicity in ath6kl_cfg80211_scan_node() Kalle Valo
2011-07-22  5:42 ` [PATCH 29/31] ath6kl: fix crash when interface is closed but scan is ongoing Kalle Valo
2011-07-22  5:42 ` [PATCH 30/31] ath6kl: remove dependency to wireless extensions Kalle Valo
2011-07-22  5:42 ` [PATCH 31/31] ath6kl: change aggreation timeout message from an error to a debug message Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311313324-6766-28-git-send-email-kvalo@qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rmani@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).