aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/cfg.c1
-rw-r--r--drivers/net/wireless/libertas/cmd.c1
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c1
-rw-r--r--drivers/net/wireless/libertas/debugfs.c1
-rw-r--r--drivers/net/wireless/libertas/ethtool.c1
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c34
-rw-r--r--drivers/net/wireless/libertas/if_spi.c8
-rw-r--r--drivers/net/wireless/libertas/main.c1
-rw-r--r--drivers/net/wireless/libertas/mesh.c1
-rw-r--r--drivers/net/wireless/libertas/rx.c1
-rw-r--r--drivers/net/wireless/libertas/tx.c1
11 files changed, 48 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 5d637af2d7c3..b456a53b64b1 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -8,6 +8,7 @@
8 8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10 10
11#include <linux/hardirq.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/wait.h> 13#include <linux/wait.h>
13#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 71c8f3fccfa1..9dcf967e1ee4 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -3,6 +3,7 @@
3 * It prepares command and sends it to firmware when it is ready. 3 * It prepares command and sends it to firmware when it is ready.
4 */ 4 */
5 5
6#include <linux/hardirq.h>
6#include <linux/kfifo.h> 7#include <linux/kfifo.h>
7#include <linux/sched.h> 8#include <linux/sched.h>
8#include <linux/slab.h> 9#include <linux/slab.h>
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 207fc361db84..2ffe5a1ff003 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -3,6 +3,7 @@
3 * responses as well as events generated by firmware. 3 * responses as well as events generated by firmware.
4 */ 4 */
5 5
6#include <linux/hardirq.h>
6#include <linux/slab.h> 7#include <linux/slab.h>
7#include <linux/delay.h> 8#include <linux/delay.h>
8#include <linux/sched.h> 9#include <linux/sched.h>
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 23250f621761..1af182778844 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1,6 +1,7 @@
1#include <linux/dcache.h> 1#include <linux/dcache.h>
2#include <linux/debugfs.h> 2#include <linux/debugfs.h>
3#include <linux/delay.h> 3#include <linux/delay.h>
4#include <linux/hardirq.h>
4#include <linux/mm.h> 5#include <linux/mm.h>
5#include <linux/string.h> 6#include <linux/string.h>
6#include <linux/slab.h> 7#include <linux/slab.h>
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 29dbce4a9f86..4dfb3bfd2cf3 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -1,3 +1,4 @@
1#include <linux/hardirq.h>
1#include <linux/netdevice.h> 2#include <linux/netdevice.h>
2#include <linux/ethtool.h> 3#include <linux/ethtool.h>
3#include <linux/delay.h> 4#include <linux/delay.h>
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 224e9853c480..387786e1b394 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -892,6 +892,37 @@ static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv)
892 892
893} 893}
894 894
895static struct mmc_host *reset_host;
896
897static void if_sdio_reset_card_worker(struct work_struct *work)
898{
899 /*
900 * The actual reset operation must be run outside of lbs_thread. This
901 * is because mmc_remove_host() will cause the device to be instantly
902 * destroyed, and the libertas driver then needs to end lbs_thread,
903 * leading to a deadlock.
904 *
905 * We run it in a workqueue totally independent from the if_sdio_card
906 * instance for that reason.
907 */
908
909 pr_info("Resetting card...");
910 mmc_remove_host(reset_host);
911 mmc_add_host(reset_host);
912}
913static DECLARE_WORK(card_reset_work, if_sdio_reset_card_worker);
914
915static void if_sdio_reset_card(struct lbs_private *priv)
916{
917 struct if_sdio_card *card = priv->card;
918
919 if (work_pending(&card_reset_work))
920 return;
921
922 reset_host = card->func->card->host;
923 schedule_work(&card_reset_work);
924}
925
895/*******************************************************************/ 926/*******************************************************************/
896/* SDIO callbacks */ 927/* SDIO callbacks */
897/*******************************************************************/ 928/*******************************************************************/
@@ -1065,6 +1096,7 @@ static int if_sdio_probe(struct sdio_func *func,
1065 priv->enter_deep_sleep = if_sdio_enter_deep_sleep; 1096 priv->enter_deep_sleep = if_sdio_enter_deep_sleep;
1066 priv->exit_deep_sleep = if_sdio_exit_deep_sleep; 1097 priv->exit_deep_sleep = if_sdio_exit_deep_sleep;
1067 priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup; 1098 priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup;
1099 priv->reset_card = if_sdio_reset_card;
1068 1100
1069 sdio_claim_host(func); 1101 sdio_claim_host(func);
1070 1102
@@ -1301,6 +1333,8 @@ static void __exit if_sdio_exit_module(void)
1301 /* Set the flag as user is removing this module. */ 1333 /* Set the flag as user is removing this module. */
1302 user_rmmod = 1; 1334 user_rmmod = 1;
1303 1335
1336 cancel_work_sync(&card_reset_work);
1337
1304 sdio_unregister_driver(&if_sdio_driver); 1338 sdio_unregister_driver(&if_sdio_driver);
1305 1339
1306 lbs_deb_leave(LBS_DEB_SDIO); 1340 lbs_deb_leave(LBS_DEB_SDIO);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 463352c890d7..e0286cfbc91d 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -19,6 +19,8 @@
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21 21
22#include <linux/hardirq.h>
23#include <linux/interrupt.h>
22#include <linux/moduleparam.h> 24#include <linux/moduleparam.h>
23#include <linux/firmware.h> 25#include <linux/firmware.h>
24#include <linux/jiffies.h> 26#include <linux/jiffies.h>
@@ -1032,7 +1034,6 @@ static irqreturn_t if_spi_host_interrupt(int irq, void *dev_id)
1032static int if_spi_init_card(struct if_spi_card *card) 1034static int if_spi_init_card(struct if_spi_card *card)
1033{ 1035{
1034 struct lbs_private *priv = card->priv; 1036 struct lbs_private *priv = card->priv;
1035 struct spi_device *spi = card->spi;
1036 int err, i; 1037 int err, i;
1037 u32 scratch; 1038 u32 scratch;
1038 const struct firmware *helper = NULL; 1039 const struct firmware *helper = NULL;
@@ -1080,8 +1081,9 @@ static int if_spi_init_card(struct if_spi_card *card)
1080 "attached to SPI bus_num %d, chip_select %d. " 1081 "attached to SPI bus_num %d, chip_select %d. "
1081 "spi->max_speed_hz=%d\n", 1082 "spi->max_speed_hz=%d\n",
1082 card->card_id, card->card_rev, 1083 card->card_id, card->card_rev,
1083 spi->master->bus_num, spi->chip_select, 1084 card->spi->master->bus_num,
1084 spi->max_speed_hz); 1085 card->spi->chip_select,
1086 card->spi->max_speed_hz);
1085 err = if_spi_prog_helper_firmware(card, helper); 1087 err = if_spi_prog_helper_firmware(card, helper);
1086 if (err) 1088 if (err)
1087 goto out; 1089 goto out;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8c40949cb076..cf3d2c8e1969 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -9,6 +9,7 @@
9#include <linux/moduleparam.h> 9#include <linux/moduleparam.h>
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <linux/etherdevice.h> 11#include <linux/etherdevice.h>
12#include <linux/hardirq.h>
12#include <linux/netdevice.h> 13#include <linux/netdevice.h>
13#include <linux/if_arp.h> 14#include <linux/if_arp.h>
14#include <linux/kthread.h> 15#include <linux/kthread.h>
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index 24cf06680c6b..7969d104189d 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -2,6 +2,7 @@
2 2
3#include <linux/delay.h> 3#include <linux/delay.h>
4#include <linux/etherdevice.h> 4#include <linux/etherdevice.h>
5#include <linux/hardirq.h>
5#include <linux/netdevice.h> 6#include <linux/netdevice.h>
6#include <linux/if_ether.h> 7#include <linux/if_ether.h>
7#include <linux/if_arp.h> 8#include <linux/if_arp.h>
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index fdb0448301a0..bfb8898ae518 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -5,6 +5,7 @@
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6 6
7#include <linux/etherdevice.h> 7#include <linux/etherdevice.h>
8#include <linux/hardirq.h>
8#include <linux/slab.h> 9#include <linux/slab.h>
9#include <linux/types.h> 10#include <linux/types.h>
10#include <net/cfg80211.h> 11#include <net/cfg80211.h>
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index bbb95f88dc01..f19495b178f6 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * This file contains the handling of TX in wlan driver. 2 * This file contains the handling of TX in wlan driver.
3 */ 3 */
4#include <linux/hardirq.h>
4#include <linux/netdevice.h> 5#include <linux/netdevice.h>
5#include <linux/etherdevice.h> 6#include <linux/etherdevice.h>
6#include <linux/sched.h> 7#include <linux/sched.h>