From: Ajay Singh <ajay.kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
<ganesh.krishna@microchip.com>, <venkateswara.kaja@microchip.com>,
<aditya.shankar@microchip.com>, <claudiu.beznea@microchip.com>,
<adham.abozaeid@microchip.com>,
Ajay Singh <ajay.kathat@microchip.com>
Subject: [PATCH v2 21/26] staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' struct
Date: Tue, 4 Sep 2018 12:09:37 +0530 [thread overview]
Message-ID: <1536043182-19735-22-git-send-email-ajay.kathat@microchip.com> (raw)
In-Reply-To: <1536043182-19735-1-git-send-email-ajay.kathat@microchip.com>
Move the static variable as part of 'wilc' priv struct.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/linux_wlan.c | 1 +
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 +
drivers/staging/wilc1000/wilc_wlan.c | 10 ++++------
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 1300318..8c6b63a 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1066,6 +1066,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
wl->io_type = io_type;
wl->hif_func = ops;
wl->enable_ps = true;
+ wl->chip_ps_state = 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 26b87c4..ede967b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -201,6 +201,7 @@ struct wilc {
bool enable_ps;
int clients_count;
struct workqueue_struct *hif_workqueue;
+ enum chip_ps_states chip_ps_state;
};
struct wilc_wfi_mon_priv {
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4c5a69e..6ff3e58 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -9,8 +9,6 @@
#include "wilc_wfi_netdevice.h"
#include "wilc_wlan_cfg.h"
-static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
-
static inline bool is_wilc1000(u32 id)
{
return ((id & 0xfffff000) == 0x100000 ? true : false);
@@ -444,7 +442,7 @@ void chip_wakeup(struct wilc *wilc)
} while ((clk_status_reg & 0x1) == 0);
}
- if (chip_ps_state == CHIP_SLEEPING_MANUAL) {
+ if (wilc->chip_ps_state == CHIP_SLEEPING_MANUAL) {
if (wilc_get_chipid(wilc, false) < 0x1002b0) {
u32 val32;
@@ -457,19 +455,19 @@ void chip_wakeup(struct wilc *wilc)
wilc->hif_func->hif_write_reg(wilc, 0x1e9c, val32);
}
}
- chip_ps_state = CHIP_WAKEDUP;
+ wilc->chip_ps_state = CHIP_WAKEDUP;
}
void wilc_chip_sleep_manually(struct wilc *wilc)
{
- if (chip_ps_state != CHIP_WAKEDUP)
+ if (wilc->chip_ps_state != CHIP_WAKEDUP)
return;
acquire_bus(wilc, ACQUIRE_ONLY);
chip_allow_sleep(wilc);
wilc->hif_func->hif_write_reg(wilc, 0x10a8, 1);
- chip_ps_state = CHIP_SLEEPING_MANUAL;
+ wilc->chip_ps_state = CHIP_SLEEPING_MANUAL;
release_bus(wilc, RELEASE_ONLY);
}
--
2.7.4
next prev parent reply other threads:[~2018-09-04 11:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 6:39 [PATCH v2 00/26] staging: wilc1000: avoid use of static and global variable Ajay Singh
2018-09-04 6:39 ` [PATCH v2 01/26] staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 02/26] staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 03/26] staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan() Ajay Singh
2018-09-04 6:39 ` [PATCH v2 04/26] staging: wilc1000: remove unnecessary NULL check " Ajay Singh
2018-09-04 6:39 ` [PATCH v2 05/26] staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to wilc_priv struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 06/26] staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 07/26] staging: wilc1000: remove unused variable 'op_ifcs' Ajay Singh
2018-09-04 6:39 ` [PATCH v2 08/26] staging: wilc1000: avoid use of extra 'if' condition in wilc_init() Ajay Singh
2018-09-04 6:39 ` [PATCH v2 09/26] staging: wilc1000: move static variable clients_count to 'wilc' structure Ajay Singh
2018-09-04 6:39 ` [PATCH v2 10/26] staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global Ajay Singh
2018-09-04 6:39 ` [PATCH v2 11/26] staging: wilc1000: move hif_workqueue static variables to 'wilc' structure Ajay Singh
2018-09-04 6:39 ` [PATCH v2 12/26] staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 13/26] staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat' Ajay Singh
2018-09-04 6:39 ` [PATCH v2 14/26] staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drv Ajay Singh
2018-09-04 6:39 ` [PATCH v2 15/26] staging: wilc1000: refactor tcp_process() to avoid extra leading tabs Ajay Singh
2018-09-04 6:39 ` [PATCH v2 16/26] staging: wilc1000: use lowercase for get_BSSID() and HIL variable Ajay Singh
2018-09-04 6:39 ` [PATCH v2 17/26] staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 18/26] staging: wilc1000: avoid line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack() Ajay Singh
2018-09-04 6:39 ` [PATCH v2 19/26] staging: wilc1000: use short names to fix over 80 issue in tcp_process() Ajay Singh
2018-09-04 6:39 ` [PATCH v2 20/26] staging: wilc1000: remove unused code to set and get IP address Ajay Singh
2018-09-04 6:39 ` Ajay Singh [this message]
2018-09-04 6:39 ` [PATCH v2 22/26] staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct Ajay Singh
2018-09-04 6:39 ` [PATCH v2 23/26] staging: wilc1000: remove unnecessary static variable 'p2p_listen_state' Ajay Singh
2018-09-04 6:39 ` [PATCH v2 24/26] staging: wilc1000: refactor code to move initilization in wilc_netdev_init() Ajay Singh
2018-09-04 6:39 ` [PATCH v2 25/26] staging: wilc1000: refactor wilc_netdev_init() to handle memory free in error path Ajay Singh
2018-09-11 9:21 ` Claudiu Beznea
2018-09-10 14:24 ` Ajay Singh
2018-09-04 6:39 ` [PATCH v2 26/26] staging: wilc1000: remove handle_hif_exit_work() function Ajay Singh
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=1536043182-19735-22-git-send-email-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=adham.abozaeid@microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=venkateswara.kaja@microchip.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).