aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/libertas/cmd.c8
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/if_usb.c7
-rw-r--r--drivers/net/wireless/libertas/main.c3
4 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 70745928f3f8..78c4da150a74 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -177,6 +177,14 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
177 struct cmd_ds_host_sleep cmd_config; 177 struct cmd_ds_host_sleep cmd_config;
178 int ret; 178 int ret;
179 179
180 /*
181 * Certain firmware versions do not support EHS_REMOVE_WAKEUP command
182 * and the card will return a failure. Since we need to be
183 * able to reset the mask, in those cases we set a 0 mask instead.
184 */
185 if (criteria == EHS_REMOVE_WAKEUP && !priv->ehs_remove_supported)
186 criteria = 0;
187
180 cmd_config.hdr.size = cpu_to_le16(sizeof(cmd_config)); 188 cmd_config.hdr.size = cpu_to_le16(sizeof(cmd_config));
181 cmd_config.criteria = cpu_to_le32(criteria); 189 cmd_config.criteria = cpu_to_le32(criteria);
182 cmd_config.gpio = priv->wol_gpio; 190 cmd_config.gpio = priv->wol_gpio;
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index f062ed583901..f5a9851fc7ee 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -137,6 +137,7 @@ struct lbs_private {
137 uint32_t wol_criteria; 137 uint32_t wol_criteria;
138 uint8_t wol_gpio; 138 uint8_t wol_gpio;
139 uint8_t wol_gap; 139 uint8_t wol_gap;
140 bool ehs_remove_supported;
140 141
141 /* Transmitting */ 142 /* Transmitting */
142 int tx_pending_len; /* -1 while building packet */ 143 int tx_pending_len; /* -1 while building packet */
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 35931cf4d6db..6524c70363d9 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -345,6 +345,13 @@ static int if_usb_probe(struct usb_interface *intf,
345 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2)) 345 if (device_create_file(&priv->dev->dev, &dev_attr_lbs_flash_boot2))
346 lbs_pr_err("cannot register lbs_flash_boot2 attribute\n"); 346 lbs_pr_err("cannot register lbs_flash_boot2 attribute\n");
347 347
348 /*
349 * EHS_REMOVE_WAKEUP is not supported on all versions of the firmware.
350 */
351 priv->wol_criteria = EHS_REMOVE_WAKEUP;
352 if (lbs_host_sleep_cfg(priv, priv->wol_criteria, NULL))
353 priv->ehs_remove_supported = false;
354
348 return 0; 355 return 0;
349 356
350err_start_card: 357err_start_card:
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 47ce5a6ba120..6d7af91d52c2 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -844,9 +844,10 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
844 priv->work_thread = create_singlethread_workqueue("lbs_worker"); 844 priv->work_thread = create_singlethread_workqueue("lbs_worker");
845 INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker); 845 INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
846 846
847 priv->wol_criteria = 0xffffffff; 847 priv->wol_criteria = EHS_REMOVE_WAKEUP;
848 priv->wol_gpio = 0xff; 848 priv->wol_gpio = 0xff;
849 priv->wol_gap = 20; 849 priv->wol_gap = 20;
850 priv->ehs_remove_supported = true;
850 851
851 goto done; 852 goto done;
852 853