提交 575b5f34 编写于 作者: R Raja Mani 提交者: Kalle Valo

ath6kl: Use bit field macros to maintain wlan enabled and disabled status

Signed-off-by: NRaja Mani <rmani@qca.qualcomm.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 c8790cba
...@@ -223,7 +223,7 @@ static bool ath6kl_cfg80211_ready(struct ath6kl *ar) ...@@ -223,7 +223,7 @@ static bool ath6kl_cfg80211_ready(struct ath6kl *ar)
return false; return false;
} }
if (ar->wlan_state == WLAN_DISABLED) { if (!test_bit(WLAN_ENABLED, &ar->flag)) {
ath6kl_err("wlan disabled\n"); ath6kl_err("wlan disabled\n");
return false; return false;
} }
......
...@@ -134,11 +134,6 @@ enum sme_state { ...@@ -134,11 +134,6 @@ enum sme_state {
SME_CONNECTED SME_CONNECTED
}; };
enum ath6kl_wlan_state {
WLAN_DISABLED,
WLAN_ENABLED
};
struct skb_hold_q { struct skb_hold_q {
struct sk_buff *skb; struct sk_buff *skb;
bool is_amsdu; bool is_amsdu;
...@@ -365,6 +360,7 @@ struct ath6kl_req_key { ...@@ -365,6 +360,7 @@ struct ath6kl_req_key {
#define DESTROY_IN_PROGRESS 9 #define DESTROY_IN_PROGRESS 9
#define NETDEV_REGISTERED 10 #define NETDEV_REGISTERED 10
#define SKIP_SCAN 11 #define SKIP_SCAN 11
#define WLAN_ENABLED 12
struct ath6kl { struct ath6kl {
struct device *dev; struct device *dev;
...@@ -401,7 +397,6 @@ struct ath6kl { ...@@ -401,7 +397,6 @@ struct ath6kl {
u8 tx_pwr; u8 tx_pwr;
struct net_device_stats net_stats; struct net_device_stats net_stats;
struct target_stats target_stats; struct target_stats target_stats;
enum ath6kl_wlan_state wlan_state;
struct ath6kl_node_mapping node_map[MAX_NODE_NUM]; struct ath6kl_node_mapping node_map[MAX_NODE_NUM];
u8 ibss_ps_enable; u8 ibss_ps_enable;
u8 node_num; u8 node_num;
......
...@@ -584,7 +584,7 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev) ...@@ -584,7 +584,7 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev)
init_netdev(dev); init_netdev(dev);
ar->net_dev = dev; ar->net_dev = dev;
ar->wlan_state = WLAN_ENABLED; set_bit(WLAN_ENABLED, &ar->flag);
ar->wlan_pwr_state = WLAN_POWER_STATE_ON; ar->wlan_pwr_state = WLAN_POWER_STATE_ON;
...@@ -1239,7 +1239,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar) ...@@ -1239,7 +1239,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
if (ar->wlan_pwr_state != WLAN_POWER_STATE_CUT_PWR) if (ar->wlan_pwr_state != WLAN_POWER_STATE_CUT_PWR)
ath6kl_stop_endpoint(ndev, false, true); ath6kl_stop_endpoint(ndev, false, true);
ar->wlan_state = WLAN_DISABLED; clear_bit(WLAN_ENABLED, &ar->flag);
} }
/* /*
......
...@@ -1275,7 +1275,7 @@ static int ath6kl_open(struct net_device *dev) ...@@ -1275,7 +1275,7 @@ static int ath6kl_open(struct net_device *dev)
spin_lock_irqsave(&ar->lock, flags); spin_lock_irqsave(&ar->lock, flags);
ar->wlan_state = WLAN_ENABLED; set_bit(WLAN_ENABLED, &ar->flag);
if (test_bit(CONNECTED, &ar->flag)) { if (test_bit(CONNECTED, &ar->flag)) {
netif_carrier_on(dev); netif_carrier_on(dev);
...@@ -1301,7 +1301,7 @@ static int ath6kl_close(struct net_device *dev) ...@@ -1301,7 +1301,7 @@ static int ath6kl_close(struct net_device *dev)
0, 0, 0)) 0, 0, 0))
return -EIO; return -EIO;
ar->wlan_state = WLAN_DISABLED; clear_bit(WLAN_ENABLED, &ar->flag);
} }
ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED); ath6kl_cfg80211_scan_complete_event(ar, -ECANCELED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册