Commit 4cf13399 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct

Instead of having 'wilc_enable_ps' as global variable moved it to 'wilc'
structure. Rename 'wilc_enable_ps' to 'enable_ps' as its already part of
'wilc' structure
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d5c69c96
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include "wilc_wfi_cfgoperations.h" #include "wilc_wfi_cfgoperations.h"
bool wilc_enable_ps = true;
static int dev_state_ev_handler(struct notifier_block *this, static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr) unsigned long event, void *ptr)
{ {
...@@ -54,7 +52,7 @@ static int dev_state_ev_handler(struct notifier_block *this, ...@@ -54,7 +52,7 @@ static int dev_state_ev_handler(struct notifier_block *this,
del_timer(&wilc_during_ip_timer); del_timer(&wilc_during_ip_timer);
} }
if (wilc_enable_ps) if (vif->wilc->enable_ps)
wilc_set_power_mgmt(vif, 1, 0); wilc_set_power_mgmt(vif, 1, 0);
netdev_dbg(dev, "[%s] Up IP\n", dev_iface->ifa_label); netdev_dbg(dev, "[%s] Up IP\n", dev_iface->ifa_label);
...@@ -1066,6 +1064,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, ...@@ -1066,6 +1064,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
*wilc = wl; *wilc = wl;
wl->io_type = io_type; wl->io_type = io_type;
wl->hif_func = ops; wl->hif_func = ops;
wl->enable_ps = true;
INIT_LIST_HEAD(&wl->txq_head.list); INIT_LIST_HEAD(&wl->txq_head.list);
INIT_LIST_HEAD(&wl->rxq_head.list); INIT_LIST_HEAD(&wl->rxq_head.list);
......
...@@ -1732,7 +1732,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -1732,7 +1732,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
if (!priv->hif_drv) if (!priv->hif_drv)
return -EIO; return -EIO;
if (wilc_enable_ps) if (vif->wilc->enable_ps)
wilc_set_power_mgmt(vif, enabled, timeout); wilc_set_power_mgmt(vif, enabled, timeout);
return 0; return 0;
...@@ -1764,7 +1764,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -1764,7 +1764,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
memset(priv->assoc_stainfo.sta_associated_bss, 0, memset(priv->assoc_stainfo.sta_associated_bss, 0,
MAX_NUM_STA * ETH_ALEN); MAX_NUM_STA * ETH_ALEN);
wilc_enable_ps = true; wl->enable_ps = true;
wilc_set_power_mgmt(vif, 1, 0); wilc_set_power_mgmt(vif, 1, 0);
break; break;
...@@ -1776,12 +1776,12 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -1776,12 +1776,12 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
vif->iftype = CLIENT_MODE; vif->iftype = CLIENT_MODE;
wilc_set_operation_mode(vif, STATION_MODE); wilc_set_operation_mode(vif, STATION_MODE);
wilc_enable_ps = false; wl->enable_ps = false;
wilc_set_power_mgmt(vif, 0, 0); wilc_set_power_mgmt(vif, 0, 0);
break; break;
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
wilc_enable_ps = false; wl->enable_ps = false;
dev->ieee80211_ptr->iftype = type; dev->ieee80211_ptr->iftype = type;
priv->wdev->iftype = type; priv->wdev->iftype = type;
vif->iftype = AP_MODE; vif->iftype = AP_MODE;
...@@ -1803,7 +1803,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -1803,7 +1803,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
priv->wdev->iftype = type; priv->wdev->iftype = type;
vif->iftype = GO_MODE; vif->iftype = GO_MODE;
wilc_enable_ps = false; wl->enable_ps = false;
wilc_set_power_mgmt(vif, 0, 0); wilc_set_power_mgmt(vif, 0, 0);
break; break;
......
...@@ -166,6 +166,7 @@ struct wilc { ...@@ -166,6 +166,7 @@ struct wilc {
bool suspend_event; bool suspend_event;
struct rf_info dummy_statistics; struct rf_info dummy_statistics;
bool enable_ps;
}; };
struct wilc_wfi_mon_priv { struct wilc_wfi_mon_priv {
......
...@@ -289,7 +289,6 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev); ...@@ -289,7 +289,6 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev);
void wilc_wfi_p2p_rx(struct net_device *dev, u8 *buff, u32 size); void wilc_wfi_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
void host_wakeup_notify(struct wilc *wilc); void host_wakeup_notify(struct wilc *wilc);
void host_sleep_notify(struct wilc *wilc); void host_sleep_notify(struct wilc *wilc);
extern bool wilc_enable_ps;
void chip_allow_sleep(struct wilc *wilc); void chip_allow_sleep(struct wilc *wilc);
void chip_wakeup(struct wilc *wilc); void chip_wakeup(struct wilc *wilc);
int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment