mac80211: Fix loading of rsi_sdio module
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 971-rsi-move-rsi_sdio_reinit_device-out-of-CONFIG_PM.patch
1 From 39f1332c526cd9d6de59a72520e8334e54b62cda Mon Sep 17 00:00:00 2001
2 From: Amitkumar Karwar <amit.karwar@redpinesignals.com>
3 Date: Wed, 1 Nov 2017 17:42:44 +0530
4 Subject: rsi: move rsi_sdio_reinit_device() out of CONFIG_PM
5
6 This function is generic. It doesn't contain wowlan specific code.
7 It should not be under CONFIG_PM. This patch resolves compilation
8 errors observed when CONFIG_PM flag is disabled.
9
10 Reported-by: kbuild test robot <fengguang.wu@intel.com>
11 Fixes: ef71ed0608c ("rsi: sdio: Add WOWLAN support for S5 shutdown state")
12 Fixes: a24e35fcee0 ("rsi: sdio: Add WOWLAN support for S4 hibernate state")
13 Fixes: e1ced6422a3 ("rsi: sdio: add WOWLAN support for S3 suspend state")
14 Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
15 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
16 ---
17 drivers/net/wireless/rsi/rsi_91x_sdio.c | 52 ++++++++++++++++-----------------
18 drivers/net/wireless/rsi/rsi_sdio.h | 1 -
19 2 files changed, 26 insertions(+), 27 deletions(-)
20
21 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
22 +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
23 @@ -871,6 +871,32 @@ fail:
24 return status;
25 }
26
27 +static int rsi_sdio_reinit_device(struct rsi_hw *adapter)
28 +{
29 + struct rsi_91x_sdiodev *sdev = adapter->rsi_dev;
30 + struct sdio_func *pfunction = sdev->pfunction;
31 + int ii;
32 +
33 + for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
34 + skb_queue_purge(&adapter->priv->tx_queue[ii]);
35 +
36 + /* Initialize device again */
37 + sdio_claim_host(pfunction);
38 +
39 + sdio_release_irq(pfunction);
40 + rsi_reset_card(pfunction);
41 +
42 + sdio_enable_func(pfunction);
43 + rsi_setupcard(adapter);
44 + rsi_init_sdio_slave_regs(adapter);
45 + sdio_claim_irq(pfunction, rsi_handle_interrupt);
46 + rsi_hal_device_init(adapter);
47 +
48 + sdio_release_host(pfunction);
49 +
50 + return 0;
51 +}
52 +
53 static struct rsi_host_intf_ops sdio_host_intf_ops = {
54 .write_pkt = rsi_sdio_host_intf_write_pkt,
55 .read_pkt = rsi_sdio_host_intf_read_pkt,
56 @@ -1281,32 +1307,6 @@ static void rsi_shutdown(struct device *
57 rsi_dbg(INFO_ZONE, "***** RSI module shut down *****\n");
58 }
59
60 -int rsi_sdio_reinit_device(struct rsi_hw *adapter)
61 -{
62 - struct rsi_91x_sdiodev *sdev = adapter->rsi_dev;
63 - struct sdio_func *pfunction = sdev->pfunction;
64 - int ii;
65 -
66 - for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
67 - skb_queue_purge(&adapter->priv->tx_queue[ii]);
68 -
69 - /* Initialize device again */
70 - sdio_claim_host(pfunction);
71 -
72 - sdio_release_irq(pfunction);
73 - rsi_reset_card(pfunction);
74 -
75 - sdio_enable_func(pfunction);
76 - rsi_setupcard(adapter);
77 - rsi_init_sdio_slave_regs(adapter);
78 - sdio_claim_irq(pfunction, rsi_handle_interrupt);
79 - rsi_hal_device_init(adapter);
80 -
81 - sdio_release_host(pfunction);
82 -
83 - return 0;
84 -}
85 -
86 static int rsi_restore(struct device *dev)
87 {
88 struct sdio_func *pfunction = dev_to_sdio_func(dev);
89 --- a/drivers/net/wireless/rsi/rsi_sdio.h
90 +++ b/drivers/net/wireless/rsi/rsi_sdio.h
91 @@ -131,5 +131,4 @@ int rsi_sdio_master_access_msword(struct
92 void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit);
93 int rsi_sdio_determine_event_timeout(struct rsi_hw *adapter);
94 int rsi_sdio_check_buffer_status(struct rsi_hw *adapter, u8 q_num);
95 -int rsi_sdio_reinit_device(struct rsi_hw *adapter);
96 #endif