* [PATCH 1/6] staging: wilc1000: remove inetaddr notifier
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 2/6] staging: wilc1000: remove ip timeout timer Adham.Abozaeid
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
Driver registers an inetaddr notifier to disable powersave while the ip
address is being obtained which should be controlled only by cfg80211.
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_netdev.c | 65 --------------------------
1 file changed, 65 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c
index 8d8b7e4399f7..68129a0ba55f 100644
--- a/drivers/staging/wilc1000/wilc_netdev.c
+++ b/drivers/staging/wilc1000/wilc_netdev.c
@@ -504,12 +504,6 @@ static int wlan_initialize_threads(struct net_device *dev)
return 0;
}
-static int dev_state_ev_handler(struct notifier_block *this,
- unsigned long event, void *ptr);
-static struct notifier_block g_dev_notifier = {
- .notifier_call = dev_state_ev_handler
-};
-
static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
{
int ret = 0;
@@ -575,7 +569,6 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
ret = -EIO;
goto fail_fw_start;
}
- register_inetaddr_notifier(&g_dev_notifier);
wl->initialized = true;
return 0;
@@ -781,7 +774,6 @@ static int wilc_mac_close(struct net_device *ndev)
if (wl->open_ifcs == 0) {
netdev_dbg(ndev, "Deinitializing wilc1000\n");
wl->close = 1;
- unregister_inetaddr_notifier(&g_dev_notifier);
wilc_wlan_deinitialize(ndev);
}
@@ -864,63 +856,6 @@ static const struct net_device_ops wilc_netdev_ops = {
.ndo_set_rx_mode = wilc_set_multicast_list,
};
-static int dev_state_ev_handler(struct notifier_block *this,
- unsigned long event, void *ptr)
-{
- struct in_ifaddr *dev_iface = ptr;
- struct wilc_priv *priv;
- struct host_if_drv *hif_drv;
- struct net_device *dev;
- struct wilc_vif *vif;
-
- if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
- return NOTIFY_DONE;
-
- dev = (struct net_device *)dev_iface->ifa_dev->dev;
- if (dev->netdev_ops != &wilc_netdev_ops)
- return NOTIFY_DONE;
-
- if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
- return NOTIFY_DONE;
-
- vif = netdev_priv(dev);
- priv = &vif->priv;
-
- hif_drv = (struct host_if_drv *)priv->hif_drv;
-
- switch (event) {
- case NETDEV_UP:
- if (vif->iftype == WILC_STATION_MODE ||
- vif->iftype == WILC_CLIENT_MODE) {
- hif_drv->ifc_up = 1;
- vif->obtaining_ip = false;
- del_timer(&vif->during_ip_timer);
- }
-
- if (vif->wilc->enable_ps)
- wilc_set_power_mgmt(vif, 1, 0);
-
- break;
-
- case NETDEV_DOWN:
- if (vif->iftype == WILC_STATION_MODE ||
- vif->iftype == WILC_CLIENT_MODE) {
- hif_drv->ifc_up = 0;
- vif->obtaining_ip = false;
- wilc_set_power_mgmt(vif, 0, 0);
- }
-
- wilc_resolve_disconnect_aberration(vif);
-
- break;
-
- default:
- break;
- }
-
- return NOTIFY_DONE;
-}
-
void wilc_netdev_cleanup(struct wilc *wilc)
{
int i;
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/6] staging: wilc1000: remove ip timeout timer
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 1/6] staging: wilc1000: remove inetaddr notifier Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 3/6] staging: wilc1000: remove unused members Adham.Abozaeid
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
during_ip_timer is not required after removing the code that disables
powersave while the ip is being obtained.
Its handler clear_during_ip is also removed
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_hif.c | 2 --
.../staging/wilc1000/wilc_wfi_cfgoperations.c | 16 ----------------
2 files changed, 18 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c
index 9345cabe3c93..9bd2d14ad610 100644
--- a/drivers/staging/wilc1000/wilc_hif.c
+++ b/drivers/staging/wilc1000/wilc_hif.c
@@ -684,8 +684,6 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
hif_drv->hif_state = HOST_IF_CONNECTED;
vif->obtaining_ip = true;
- mod_timer(&vif->during_ip_timer,
- jiffies + msecs_to_jiffies(10000));
} else {
hif_drv->hif_state = HOST_IF_IDLE;
}
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 736eedef23b6..5559f27c8e24 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -70,15 +70,6 @@ struct wilc_p2p_mgmt_data {
static const u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09};
static const u8 p2p_vendor_spec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03};
-#define WILC_IP_TIMEOUT_MS 15000
-
-static void clear_during_ip(struct timer_list *t)
-{
- struct wilc_vif *vif = from_timer(vif, t, during_ip_timer);
-
- vif->obtaining_ip = false;
-}
-
static void cfg_scan_result(enum scan_event scan_event,
struct wilc_rcvd_net_info *info, void *user_void)
{
@@ -1422,7 +1413,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
priv->p2p.recv_random = 0x00;
priv->p2p.is_wilc_ie = false;
vif->obtaining_ip = false;
- del_timer(&vif->during_ip_timer);
switch (type) {
case NL80211_IFTYPE_STATION:
@@ -1470,8 +1460,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
case NL80211_IFTYPE_P2P_GO:
vif->obtaining_ip = true;
- mod_timer(&vif->during_ip_timer,
- jiffies + msecs_to_jiffies(WILC_IP_TIMEOUT_MS));
wilc_set_operation_mode(vif, WILC_AP_MODE);
dev->ieee80211_ptr->iftype = type;
priv->wdev.iftype = type;
@@ -1949,8 +1937,6 @@ int wilc_init_host_int(struct net_device *net)
struct wilc_vif *vif = netdev_priv(net);
struct wilc_priv *priv = &vif->priv;
- timer_setup(&vif->during_ip_timer, clear_during_ip, 0);
-
priv->p2p_listen_state = false;
mutex_init(&priv->scan_req_lock);
@@ -1973,8 +1959,6 @@ void wilc_deinit_host_int(struct net_device *net)
mutex_destroy(&priv->scan_req_lock);
ret = wilc_deinit(vif);
- del_timer_sync(&vif->during_ip_timer);
-
if (ret)
netdev_err(net, "Error while deinitializing host interface\n");
}
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/6] staging: wilc1000: remove unused members
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 1/6] staging: wilc1000: remove inetaddr notifier Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 2/6] staging: wilc1000: remove ip timeout timer Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
2019-08-06 12:46 ` Dan Carpenter
2019-07-25 21:31 ` [PATCH 4/6] staging: wilc1000: avoid overriding powersave state Adham.Abozaeid
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
remove obtaining_ip from struct wilc_vif
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_hif.c | 9 ++-------
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
3 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c
index 9bd2d14ad610..611f842d2836 100644
--- a/drivers/staging/wilc1000/wilc_hif.c
+++ b/drivers/staging/wilc1000/wilc_hif.c
@@ -248,7 +248,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
goto error;
}
- if (vif->obtaining_ip || vif->connecting) {
+ if (vif->connecting) {
netdev_err(vif->ndev, "Don't do obss scan\n");
result = -EBUSY;
goto error;
@@ -682,8 +682,6 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
wilc_set_power_mgmt(vif, 0, 0);
hif_drv->hif_state = HOST_IF_CONNECTED;
-
- vif->obtaining_ip = true;
} else {
hif_drv->hif_state = HOST_IF_IDLE;
}
@@ -707,7 +705,6 @@ static inline void host_int_handle_disconnect(struct wilc_vif *vif)
}
if (hif_drv->conn_info.conn_result) {
- vif->obtaining_ip = false;
wilc_set_power_mgmt(vif, 0, 0);
hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
@@ -770,7 +767,6 @@ int wilc_disconnect(struct wilc_vif *vif)
wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);
- vif->obtaining_ip = false;
wilc_set_power_mgmt(vif, 0, 0);
result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
@@ -922,7 +918,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP)
return -EBUSY;
- if (vif->obtaining_ip || vif->connecting)
+ if (vif->connecting)
return -EBUSY;
remain_on_chan_flag = true;
@@ -1608,7 +1604,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
*hif_drv_handler = hif_drv;
vif->hif_drv = hif_drv;
- vif->obtaining_ip = false;
if (wilc->clients_count == 0)
mutex_init(&wilc->deinit_lock);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 5559f27c8e24..6ac0fe58ceed 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -167,7 +167,6 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
} else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
u16 reason = 0;
- vif->obtaining_ip = false;
priv->p2p.local_random = 0x01;
priv->p2p.recv_random = 0x00;
priv->p2p.is_wilc_ie = false;
@@ -1412,7 +1411,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
priv->p2p.local_random = 0x01;
priv->p2p.recv_random = 0x00;
priv->p2p.is_wilc_ie = false;
- vif->obtaining_ip = false;
switch (type) {
case NL80211_IFTYPE_STATION:
@@ -1459,7 +1457,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
break;
case NL80211_IFTYPE_P2P_GO:
- vif->obtaining_ip = true;
wilc_set_operation_mode(vif, WILC_AP_MODE);
dev->ieee80211_ptr->iftype = type;
priv->wdev.iftype = type;
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 1e74a08e7cf1..704e4d572695 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -203,7 +203,6 @@ struct wilc_vif {
struct net_device *ndev;
u8 mode;
struct timer_list during_ip_timer;
- bool obtaining_ip;
struct timer_list periodic_rssi;
struct rf_info periodic_stat;
struct tcp_ack_filter ack_filter;
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] staging: wilc1000: remove unused members
2019-07-25 21:31 ` [PATCH 3/6] staging: wilc1000: remove unused members Adham.Abozaeid
@ 2019-08-06 12:46 ` Dan Carpenter
2019-08-06 19:32 ` Adham.Abozaeid
0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2019-08-06 12:46 UTC (permalink / raw)
To: Adham.Abozaeid; +Cc: linux-wireless, devel, gregkh, johannes, Ajay.Kathat
On Thu, Jul 25, 2019 at 09:31:34PM +0000, Adham.Abozaeid@microchip.com wrote:
> From: Adham Abozaeid <adham.abozaeid@microchip.com>
>
> remove obtaining_ip from struct wilc_vif
>
How is this "unused"? It looks like it is used to me.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] staging: wilc1000: remove unused members
2019-08-06 12:46 ` Dan Carpenter
@ 2019-08-06 19:32 ` Adham.Abozaeid
2019-08-07 11:03 ` Dan Carpenter
0 siblings, 1 reply; 12+ messages in thread
From: Adham.Abozaeid @ 2019-08-06 19:32 UTC (permalink / raw)
To: dan.carpenter; +Cc: linux-wireless, devel, gregkh, johannes, Ajay.Kathat
Hi Dan
On 8/6/19 5:46 AM, Dan Carpenter wrote:
> External E-Mail
>
>
> On Thu, Jul 25, 2019 at 09:31:34PM +0000, Adham.Abozaeid@microchip.com wrote:
>> From: Adham Abozaeid <adham.abozaeid@microchip.com>
>>
>> remove obtaining_ip from struct wilc_vif
>>
> How is this "unused"? It looks like it is used to me.
The main usage of obtaining_ip was to track the inetadd_notifier status.
After removing the notifier and ip address timeout timer in the first and second patch,
the remaining usage became meaningless, and could be removed.
> regards,
> dan carpenter
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] staging: wilc1000: remove unused members
2019-08-06 19:32 ` Adham.Abozaeid
@ 2019-08-07 11:03 ` Dan Carpenter
2019-08-08 18:14 ` Adham.Abozaeid
2019-08-08 18:16 ` Adham.Abozaeid
0 siblings, 2 replies; 12+ messages in thread
From: Dan Carpenter @ 2019-08-07 11:03 UTC (permalink / raw)
To: Adham.Abozaeid; +Cc: devel, gregkh, johannes, linux-wireless, Ajay.Kathat
On Tue, Aug 06, 2019 at 07:32:08PM +0000, Adham.Abozaeid@microchip.com wrote:
> Hi Dan
>
> On 8/6/19 5:46 AM, Dan Carpenter wrote:
> > External E-Mail
> >
> >
> > On Thu, Jul 25, 2019 at 09:31:34PM +0000, Adham.Abozaeid@microchip.com wrote:
> >> From: Adham Abozaeid <adham.abozaeid@microchip.com>
> >>
> >> remove obtaining_ip from struct wilc_vif
> >>
> > How is this "unused"? It looks like it is used to me.
> The main usage of obtaining_ip was to track the inetadd_notifier status.
> After removing the notifier and ip address timeout timer in the first and second patch,
> the remaining usage became meaningless, and could be removed.
This is exactly the level of detail that I would like in a commit
description.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] staging: wilc1000: remove unused members
2019-08-07 11:03 ` Dan Carpenter
@ 2019-08-08 18:14 ` Adham.Abozaeid
2019-08-08 18:16 ` Adham.Abozaeid
1 sibling, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-08-08 18:14 UTC (permalink / raw)
To: dan.carpenter; +Cc: devel, gregkh, johannes, linux-wireless, Ajay.Kathat
Hi Dan
On 8/7/19 4:03 AM, Dan Carpenter wrote:
> External E-Mail
>
>
> On Tue, Aug 06, 2019 at 07:32:08PM +0000, Adham.Abozaeid@microchip.com wrote:
>> Hi Dan
>>
>> On 8/6/19 5:46 AM, Dan Carpenter wrote:
>>> External E-Mail
>>>
>>>
>>> On Thu, Jul 25, 2019 at 09:31:34PM +0000, Adham.Abozaeid@microchip.com wrote:
>>>> From: Adham Abozaeid <adham.abozaeid@microchip.com>
>>>>
>>>> remove obtaining_ip from struct wilc_vif
>>>>
>>> How is this "unused"? It looks like it is used to me.
>> The main usage of obtaining_ip was to track the inetadd_notifier status.
>> After removing the notifier and ip address timeout timer in the first and second patch,
>> the remaining usage became meaningless, and could be removed.
> This is exactly the level of detail that I would like in a commit
> description.
Sure. Will do my best in the future to add more details in the commit description.
Thanks,
Adham
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] staging: wilc1000: remove unused members
2019-08-07 11:03 ` Dan Carpenter
2019-08-08 18:14 ` Adham.Abozaeid
@ 2019-08-08 18:16 ` Adham.Abozaeid
1 sibling, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-08-08 18:16 UTC (permalink / raw)
To: dan.carpenter; +Cc: devel, gregkh, johannes, linux-wireless, Ajay.Kathat
On 8/7/19 4:03 AM, Dan Carpenter wrote:
> External E-Mail
>
>
> On Tue, Aug 06, 2019 at 07:32:08PM +0000, Adham.Abozaeid@microchip.com wrote:
>> Hi Dan
>>
>> On 8/6/19 5:46 AM, Dan Carpenter wrote:
>>> External E-Mail
>>>
>>>
>>> On Thu, Jul 25, 2019 at 09:31:34PM +0000, Adham.Abozaeid@microchip.com wrote:
>>>> From: Adham Abozaeid <adham.abozaeid@microchip.com>
>>>>
>>>> remove obtaining_ip from struct wilc_vif
>>>>
>>> How is this "unused"? It looks like it is used to me.
>> The main usage of obtaining_ip was to track the inetadd_notifier status.
>> After removing the notifier and ip address timeout timer in the first and second patch,
>> the remaining usage became meaningless, and could be removed.
> This is exactly the level of detail that I would like in a commit
> description.
>
> regards,
> dan carpenter
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/6] staging: wilc1000: avoid overriding powersave state
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
` (2 preceding siblings ...)
2019-07-25 21:31 ` [PATCH 3/6] staging: wilc1000: remove unused members Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 5/6] staging: wilc1000: apply power management regardless of open interfaces Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 6/6] staging: wilc1000: remove manual sleep mode Adham.Abozaeid
5 siblings, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
Don't override powersave state with respect to the open interfaces and
let the firmware take care of when it's appropriate to do so
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_hif.c | 11 ++---------
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 +--------------
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c
index 611f842d2836..16ff610c6a5b 100644
--- a/drivers/staging/wilc1000/wilc_hif.c
+++ b/drivers/staging/wilc1000/wilc_hif.c
@@ -679,8 +679,6 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
if (mac_status == WILC_MAC_STATUS_CONNECTED &&
conn_info->status == WLAN_STATUS_SUCCESS) {
ether_addr_copy(hif_drv->assoc_bssid, conn_info->bssid);
- wilc_set_power_mgmt(vif, 0, 0);
-
hif_drv->hif_state = HOST_IF_CONNECTED;
} else {
hif_drv->hif_state = HOST_IF_IDLE;
@@ -704,14 +702,11 @@ static inline void host_int_handle_disconnect(struct wilc_vif *vif)
handle_scan_done(vif, SCAN_EVENT_ABORTED);
}
- if (hif_drv->conn_info.conn_result) {
- wilc_set_power_mgmt(vif, 0, 0);
-
+ if (hif_drv->conn_info.conn_result)
hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
0, hif_drv->conn_info.arg);
- } else {
+ else
netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
- }
eth_zero_addr(hif_drv->assoc_bssid);
@@ -767,8 +762,6 @@ int wilc_disconnect(struct wilc_vif *vif)
wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);
- wilc_set_power_mgmt(vif, 0, 0);
-
result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
if (result) {
netdev_err(vif->ndev, "Failed to send disconnect\n");
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 6ac0fe58ceed..716c60d0f962 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1394,8 +1394,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
if (!priv->hif_drv)
return -EIO;
- if (vif->wilc->enable_ps)
- wilc_set_power_mgmt(vif, enabled, timeout);
+ wilc_set_power_mgmt(vif, enabled, timeout);
return 0;
}
@@ -1425,9 +1424,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
memset(priv->assoc_stainfo.sta_associated_bss, 0,
WILC_MAX_NUM_STA * ETH_ALEN);
-
- wl->enable_ps = true;
- wilc_set_power_mgmt(vif, 1, 0);
break;
case NL80211_IFTYPE_P2P_CLIENT:
@@ -1438,12 +1434,9 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
vif->iftype = WILC_CLIENT_MODE;
wilc_set_operation_mode(vif, WILC_STATION_MODE);
- wl->enable_ps = false;
- wilc_set_power_mgmt(vif, 0, 0);
break;
case NL80211_IFTYPE_AP:
- wl->enable_ps = false;
dev->ieee80211_ptr->iftype = type;
priv->wdev.iftype = type;
vif->iftype = WILC_AP_MODE;
@@ -1452,7 +1445,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif),
0, vif->idx);
wilc_set_operation_mode(vif, WILC_AP_MODE);
- wilc_set_power_mgmt(vif, 0, 0);
}
break;
@@ -1461,9 +1453,6 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
dev->ieee80211_ptr->iftype = type;
priv->wdev.iftype = type;
vif->iftype = WILC_GO_MODE;
-
- wl->enable_ps = false;
- wilc_set_power_mgmt(vif, 0, 0);
break;
default:
@@ -1485,7 +1474,6 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
netdev_err(dev, "Error in setting channel\n");
wilc_wlan_set_bssid(dev, dev->dev_addr, WILC_AP_MODE);
- wilc_set_power_mgmt(vif, 0, 0);
return wilc_add_beacon(vif, settings->beacon_interval,
settings->dtim_period, &settings->beacon);
@@ -1836,7 +1824,6 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
*wilc = wl;
wl->io_type = io_type;
wl->hif_func = ops;
- wl->enable_ps = false;
wl->chip_ps_state = WILC_CHIP_WAKEDUP;
INIT_LIST_HEAD(&wl->txq_head.list);
INIT_LIST_HEAD(&wl->rxq_head.list);
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 704e4d572695..7e7ce9471f67 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -261,7 +261,6 @@ struct wilc {
struct device *dev;
bool suspend_event;
- bool enable_ps;
int clients_count;
struct workqueue_struct *hif_workqueue;
enum chip_ps_states chip_ps_state;
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/6] staging: wilc1000: apply power management regardless of open interfaces
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
` (3 preceding siblings ...)
2019-07-25 21:31 ` [PATCH 4/6] staging: wilc1000: avoid overriding powersave state Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
2019-07-25 21:31 ` [PATCH 6/6] staging: wilc1000: remove manual sleep mode Adham.Abozaeid
5 siblings, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
Don't ignore power management if 2 interfaces are open
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_hif.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c
index 16ff610c6a5b..75a6931aa147 100644
--- a/drivers/staging/wilc1000/wilc_hif.c
+++ b/drivers/staging/wilc1000/wilc_hif.c
@@ -2010,9 +2010,6 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout)
int result;
s8 power_mode;
- if (wilc_wlan_get_num_conn_ifcs(vif->wilc) == 2 && enabled)
- return 0;
-
if (enabled)
power_mode = WILC_FW_MIN_FAST_PS;
else
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/6] staging: wilc1000: remove manual sleep mode
2019-07-25 21:31 [PATCH 0/6] staging: wilc1000: don't override user power management selection Adham.Abozaeid
` (4 preceding siblings ...)
2019-07-25 21:31 ` [PATCH 5/6] staging: wilc1000: apply power management regardless of open interfaces Adham.Abozaeid
@ 2019-07-25 21:31 ` Adham.Abozaeid
5 siblings, 0 replies; 12+ messages in thread
From: Adham.Abozaeid @ 2019-07-25 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat, Adham.Abozaeid
From: Adham Abozaeid <adham.abozaeid@microchip.com>
manual sleep mode was used to put the wilc1000 chip in sleep while in
disconnected state. This is taken care of in the firmware
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
drivers/staging/wilc1000/wilc_hif.c | 4 ----
drivers/staging/wilc1000/wilc_sdio.c | 4 +---
drivers/staging/wilc1000/wilc_wlan.c | 14 --------------
drivers/staging/wilc1000/wilc_wlan.h | 2 --
4 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c
index 75a6931aa147..f8646ea3b0c4 100644
--- a/drivers/staging/wilc1000/wilc_hif.c
+++ b/drivers/staging/wilc1000/wilc_hif.c
@@ -1056,13 +1056,9 @@ static void handle_scan_timer(struct work_struct *work)
static void handle_scan_complete(struct work_struct *work)
{
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
- struct wilc *wilc = msg->vif->wilc;
del_timer(&msg->vif->hif_drv->scan_timer);
- if (!wilc_wlan_get_num_conn_ifcs(wilc))
- wilc_chip_sleep_manually(wilc);
-
handle_scan_done(msg->vif, SCAN_EVENT_DONE);
kfree(msg);
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index 4c1c81fed11f..2f9aa36e0114 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -193,9 +193,7 @@ static int wilc_sdio_suspend(struct device *dev)
dev_info(dev, "sdio suspend\n");
chip_wakeup(wilc);
- if (!wilc->suspend_event) {
- wilc_chip_sleep_manually(wilc);
- } else {
+ if (wilc->suspend_event) {
host_sleep_notify(wilc);
chip_allow_sleep(wilc);
}
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 2cbdbf0090e4..8caa3f4bcdd7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -455,20 +455,6 @@ void chip_wakeup(struct wilc *wilc)
}
EXPORT_SYMBOL_GPL(chip_wakeup);
-void wilc_chip_sleep_manually(struct wilc *wilc)
-{
- if (wilc->chip_ps_state != WILC_CHIP_WAKEDUP)
- return;
- acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY);
-
- chip_allow_sleep(wilc);
- wilc->hif_func->hif_write_reg(wilc, 0x10a8, 1);
-
- wilc->chip_ps_state = WILC_CHIP_SLEEPING_MANUAL;
- release_bus(wilc, WILC_BUS_RELEASE_ONLY);
-}
-EXPORT_SYMBOL_GPL(wilc_chip_sleep_manually);
-
void host_wakeup_notify(struct wilc *wilc)
{
acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY);
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index b70014142686..802f11807659 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -293,8 +293,6 @@ int wilc_wlan_cfg_get(struct wilc_vif *vif, int start, u16 wid, int commit,
u32 drv_handler);
int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, void (*func)(void *, int));
-void wilc_chip_sleep_manually(struct wilc *wilc);
-
void wilc_enable_tcp_ack_filter(struct wilc_vif *vif, bool value);
int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc);
netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev);
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread