aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-07-27 16:08:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-27 15:14:12 -0400
commit0bb6408777227fcf5136e28aec29438606d5ac82 (patch)
treecf2d146d310d3d613b2ff3d9bf9cabe1de3d6ece /drivers/net/wireless
parent8196112859a6742b9e25ca5fde972a7f41f06cc3 (diff)
libertas: convert PS_MODE to a direct command
Powersave looks like it got broken at some point but we'll fix that up when the command submission stuff is more understandable, which this series helps to do. That said, this patch should not further break powersave. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/cmd.c139
-rw-r--r--drivers/net/wireless/libertas/cmd.h6
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c13
-rw-r--r--drivers/net/wireless/libertas/defs.h5
-rw-r--r--drivers/net/wireless/libertas/host.h50
-rw-r--r--drivers/net/wireless/libertas/if_usb.c4
-rw-r--r--drivers/net/wireless/libertas/main.c4
7 files changed, 95 insertions, 126 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 2c96cf3400c9..5c7bb3551fb5 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -230,42 +230,49 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
230} 230}
231EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg); 231EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg);
232 232
233static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd, 233/**
234 u16 cmd_action) 234 * @brief Sets the Power Save mode
235 *
236 * @param priv A pointer to struct lbs_private structure
237 * @param cmd_action The Power Save operation (PS_MODE_ACTION_ENTER_PS or
238 * PS_MODE_ACTION_EXIT_PS)
239 * @param block Whether to block on a response or not
240 *
241 * @return 0 on success, error on failure
242 */
243int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block)
235{ 244{
236 struct cmd_ds_802_11_ps_mode *psm = &cmd->params.psmode; 245 struct cmd_ds_802_11_ps_mode cmd;
246 int ret = 0;
237 247
238 lbs_deb_enter(LBS_DEB_CMD); 248 lbs_deb_enter(LBS_DEB_CMD);
239 249
240 cmd->command = cpu_to_le16(CMD_802_11_PS_MODE); 250 memset(&cmd, 0, sizeof(cmd));
241 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + 251 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
242 sizeof(struct cmd_header)); 252 cmd.action = cpu_to_le16(cmd_action);
243 psm->action = cpu_to_le16(cmd_action);
244 psm->multipledtim = 0;
245 switch (cmd_action) {
246 case CMD_SUBCMD_ENTER_PS:
247 lbs_deb_cmd("PS command:" "SubCode- Enter PS\n");
248
249 psm->locallisteninterval = 0;
250 psm->nullpktinterval = 0;
251 psm->multipledtim =
252 cpu_to_le16(MRVDRV_DEFAULT_MULTIPLE_DTIM);
253 break;
254
255 case CMD_SUBCMD_EXIT_PS:
256 lbs_deb_cmd("PS command:" "SubCode- Exit PS\n");
257 break;
258
259 case CMD_SUBCMD_SLEEP_CONFIRMED:
260 lbs_deb_cmd("PS command: SubCode- sleep confirm\n");
261 break;
262 253
263 default: 254 if (cmd_action == PS_MODE_ACTION_ENTER_PS) {
264 break; 255 lbs_deb_cmd("PS_MODE: action ENTER_PS\n");
256 cmd.multipledtim = cpu_to_le16(1); /* Default DTIM multiple */
257 } else if (cmd_action == PS_MODE_ACTION_EXIT_PS) {
258 lbs_deb_cmd("PS_MODE: action EXIT_PS\n");
259 } else {
260 /* We don't handle CONFIRM_SLEEP here because it needs to
261 * be fastpathed to the firmware.
262 */
263 lbs_deb_cmd("PS_MODE: unknown action 0x%X\n", cmd_action);
264 ret = -EOPNOTSUPP;
265 goto out;
265 } 266 }
266 267
267 lbs_deb_leave(LBS_DEB_CMD); 268 if (block)
268 return 0; 269 ret = lbs_cmd_with_response(priv, CMD_802_11_PS_MODE, &cmd);
270 else
271 lbs_cmd_async(priv, CMD_802_11_PS_MODE, &cmd.hdr, sizeof (cmd));
272
273out:
274 lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
275 return ret;
269} 276}
270 277
271int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, 278int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
@@ -950,16 +957,15 @@ static void lbs_queue_cmd(struct lbs_private *priv,
950 957
951 /* Exit_PS command needs to be queued in the header always. */ 958 /* Exit_PS command needs to be queued in the header always. */
952 if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_PS_MODE) { 959 if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_PS_MODE) {
953 struct cmd_ds_802_11_ps_mode *psm = (void *) &cmdnode->cmdbuf[1]; 960 struct cmd_ds_802_11_ps_mode *psm = (void *) &cmdnode->cmdbuf;
954 961
955 if (psm->action == cpu_to_le16(CMD_SUBCMD_EXIT_PS)) { 962 if (psm->action == cpu_to_le16(PS_MODE_ACTION_EXIT_PS)) {
956 if (priv->psstate != PS_STATE_FULL_POWER) 963 if (priv->psstate != PS_STATE_FULL_POWER)
957 addtail = 0; 964 addtail = 0;
958 } 965 }
959 } 966 }
960 967
961 if (le16_to_cpu(cmdnode->cmdbuf->command) == 968 if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_WAKEUP_CONFIRM)
962 CMD_802_11_WAKEUP_CONFIRM)
963 addtail = 0; 969 addtail = 0;
964 970
965 spin_lock_irqsave(&priv->driver_lock, flags); 971 spin_lock_irqsave(&priv->driver_lock, flags);
@@ -1154,7 +1160,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1154{ 1160{
1155 int ret = 0; 1161 int ret = 0;
1156 struct cmd_ctrl_node *cmdnode; 1162 struct cmd_ctrl_node *cmdnode;
1157 struct cmd_ds_command *cmdptr; 1163 struct cmd_header *cmdptr;
1158 unsigned long flags; 1164 unsigned long flags;
1159 1165
1160 lbs_deb_enter(LBS_DEB_HOST); 1166 lbs_deb_enter(LBS_DEB_HOST);
@@ -1190,7 +1196,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1190 cmdnode->callback = NULL; 1196 cmdnode->callback = NULL;
1191 cmdnode->callback_arg = (unsigned long)pdata_buf; 1197 cmdnode->callback_arg = (unsigned long)pdata_buf;
1192 1198
1193 cmdptr = (struct cmd_ds_command *)cmdnode->cmdbuf; 1199 cmdptr = (struct cmd_header *)cmdnode->cmdbuf;
1194 1200
1195 lbs_deb_host("PREP_CMD: command 0x%04x\n", cmd_no); 1201 lbs_deb_host("PREP_CMD: command 0x%04x\n", cmd_no);
1196 1202
@@ -1202,10 +1208,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1202 cmdptr->result = 0; 1208 cmdptr->result = 0;
1203 1209
1204 switch (cmd_no) { 1210 switch (cmd_no) {
1205 case CMD_802_11_PS_MODE:
1206 ret = lbs_cmd_802_11_ps_mode(cmdptr, cmd_action);
1207 break;
1208
1209 case CMD_802_11_DEEP_SLEEP: 1211 case CMD_802_11_DEEP_SLEEP:
1210 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP); 1212 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
1211 cmdptr->size = cpu_to_le16(sizeof(struct cmd_header)); 1213 cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
@@ -1426,10 +1428,10 @@ int lbs_execute_next_command(struct lbs_private *priv)
1426 /* 1428 /*
1427 * 1. Non-PS command: 1429 * 1. Non-PS command:
1428 * Queue it. set needtowakeup to TRUE if current state 1430 * Queue it. set needtowakeup to TRUE if current state
1429 * is SLEEP, otherwise call lbs_ps_wakeup to send Exit_PS. 1431 * is SLEEP, otherwise call send EXIT_PS.
1430 * 2. PS command but not Exit_PS: 1432 * 2. PS command but not EXIT_PS:
1431 * Ignore it. 1433 * Ignore it.
1432 * 3. PS command Exit_PS: 1434 * 3. PS command EXIT_PS:
1433 * Set needtowakeup to TRUE if current state is SLEEP, 1435 * Set needtowakeup to TRUE if current state is SLEEP,
1434 * otherwise send this command down to firmware 1436 * otherwise send this command down to firmware
1435 * immediately. 1437 * immediately.
@@ -1443,8 +1445,11 @@ int lbs_execute_next_command(struct lbs_private *priv)
1443 /* w/ new scheme, it will not reach here. 1445 /* w/ new scheme, it will not reach here.
1444 since it is blocked in main_thread. */ 1446 since it is blocked in main_thread. */
1445 priv->needtowakeup = 1; 1447 priv->needtowakeup = 1;
1446 } else 1448 } else {
1447 lbs_ps_wakeup(priv, 0); 1449 lbs_set_ps_mode(priv,
1450 PS_MODE_ACTION_EXIT_PS,
1451 false);
1452 }
1448 1453
1449 ret = 0; 1454 ret = 0;
1450 goto done; 1455 goto done;
@@ -1459,7 +1464,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
1459 "EXEC_NEXT_CMD: PS cmd, action 0x%02x\n", 1464 "EXEC_NEXT_CMD: PS cmd, action 0x%02x\n",
1460 psm->action); 1465 psm->action);
1461 if (psm->action != 1466 if (psm->action !=
1462 cpu_to_le16(CMD_SUBCMD_EXIT_PS)) { 1467 cpu_to_le16(PS_MODE_ACTION_EXIT_PS)) {
1463 lbs_deb_host( 1468 lbs_deb_host(
1464 "EXEC_NEXT_CMD: ignore ENTER_PS cmd\n"); 1469 "EXEC_NEXT_CMD: ignore ENTER_PS cmd\n");
1465 list_del(&cmdnode->list); 1470 list_del(&cmdnode->list);
@@ -1519,13 +1524,16 @@ int lbs_execute_next_command(struct lbs_private *priv)
1519 lbs_deb_host( 1524 lbs_deb_host(
1520 "EXEC_NEXT_CMD: WPA enabled and GTK_SET" 1525 "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
1521 " go back to PS_SLEEP"); 1526 " go back to PS_SLEEP");
1522 lbs_ps_sleep(priv, 0); 1527 lbs_set_ps_mode(priv,
1528 PS_MODE_ACTION_ENTER_PS,
1529 false);
1523 } 1530 }
1524 } else { 1531 } else {
1525 lbs_deb_host( 1532 lbs_deb_host(
1526 "EXEC_NEXT_CMD: cmdpendingq empty, " 1533 "EXEC_NEXT_CMD: cmdpendingq empty, "
1527 "go back to PS_SLEEP"); 1534 "go back to PS_SLEEP");
1528 lbs_ps_sleep(priv, 0); 1535 lbs_set_ps_mode(priv, PS_MODE_ACTION_ENTER_PS,
1536 false);
1529 } 1537 }
1530 } 1538 }
1531#endif 1539#endif
@@ -1573,43 +1581,6 @@ out:
1573 lbs_deb_leave(LBS_DEB_HOST); 1581 lbs_deb_leave(LBS_DEB_HOST);
1574} 1582}
1575 1583
1576void lbs_ps_sleep(struct lbs_private *priv, int wait_option)
1577{
1578 lbs_deb_enter(LBS_DEB_HOST);
1579
1580 /*
1581 * PS is currently supported only in Infrastructure mode
1582 * Remove this check if it is to be supported in IBSS mode also
1583 */
1584
1585 lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE,
1586 CMD_SUBCMD_ENTER_PS, wait_option, 0, NULL);
1587
1588 lbs_deb_leave(LBS_DEB_HOST);
1589}
1590
1591/**
1592 * @brief This function sends Exit_PS command to firmware.
1593 *
1594 * @param priv A pointer to struct lbs_private structure
1595 * @param wait_option wait response or not
1596 * @return n/a
1597 */
1598void lbs_ps_wakeup(struct lbs_private *priv, int wait_option)
1599{
1600 __le32 Localpsmode;
1601
1602 lbs_deb_enter(LBS_DEB_HOST);
1603
1604 Localpsmode = cpu_to_le32(LBS802_11POWERMODECAM);
1605
1606 lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE,
1607 CMD_SUBCMD_EXIT_PS,
1608 wait_option, 0, &Localpsmode);
1609
1610 lbs_deb_leave(LBS_DEB_HOST);
1611}
1612
1613/** 1584/**
1614 * @brief This function checks condition and prepares to 1585 * @brief This function checks condition and prepares to
1615 * send sleep confirm command to firmware if ok. 1586 * send sleep confirm command to firmware if ok.
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h
index bfb36904fd9f..19b1f210a192 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -94,10 +94,6 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
94int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, 94int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
95 struct sleep_params *sp); 95 struct sleep_params *sp);
96 96
97void lbs_ps_sleep(struct lbs_private *priv, int wait_option);
98
99void lbs_ps_wakeup(struct lbs_private *priv, int wait_option);
100
101void lbs_ps_confirm_sleep(struct lbs_private *priv); 97void lbs_ps_confirm_sleep(struct lbs_private *priv);
102 98
103int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on); 99int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on);
@@ -143,4 +139,6 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value);
143 139
144int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value); 140int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value);
145 141
142int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block);
143
146#endif /* _LBS_CMD_H */ 144#endif /* _LBS_CMD_H */
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index a4e147a11d0c..83283b8efd62 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -49,7 +49,7 @@ void lbs_mac_event_disconnected(struct lbs_private *priv)
49 if (priv->psstate != PS_STATE_FULL_POWER) { 49 if (priv->psstate != PS_STATE_FULL_POWER) {
50 /* make firmware to exit PS mode */ 50 /* make firmware to exit PS mode */
51 lbs_deb_cmd("disconnected, so exit PS mode\n"); 51 lbs_deb_cmd("disconnected, so exit PS mode\n");
52 lbs_ps_wakeup(priv, 0); 52 lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, false);
53 } 53 }
54 lbs_deb_leave(LBS_DEB_ASSOC); 54 lbs_deb_leave(LBS_DEB_ASSOC);
55} 55}
@@ -132,9 +132,9 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
132 * lbs_execute_next_command(). 132 * lbs_execute_next_command().
133 */ 133 */
134 if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR && 134 if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR &&
135 action == CMD_SUBCMD_ENTER_PS) 135 action == PS_MODE_ACTION_ENTER_PS)
136 priv->psmode = LBS802_11POWERMODECAM; 136 priv->psmode = LBS802_11POWERMODECAM;
137 } else if (action == CMD_SUBCMD_ENTER_PS) { 137 } else if (action == PS_MODE_ACTION_ENTER_PS) {
138 priv->needtowakeup = 0; 138 priv->needtowakeup = 0;
139 priv->psstate = PS_STATE_AWAKE; 139 priv->psstate = PS_STATE_AWAKE;
140 140
@@ -149,11 +149,12 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
149 149
150 spin_unlock_irqrestore(&priv->driver_lock, flags); 150 spin_unlock_irqrestore(&priv->driver_lock, flags);
151 mutex_unlock(&priv->lock); 151 mutex_unlock(&priv->lock);
152 lbs_ps_wakeup(priv, 0); 152 lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS,
153 false);
153 mutex_lock(&priv->lock); 154 mutex_lock(&priv->lock);
154 spin_lock_irqsave(&priv->driver_lock, flags); 155 spin_lock_irqsave(&priv->driver_lock, flags);
155 } 156 }
156 } else if (action == CMD_SUBCMD_EXIT_PS) { 157 } else if (action == PS_MODE_ACTION_EXIT_PS) {
157 priv->needtowakeup = 0; 158 priv->needtowakeup = 0;
158 priv->psstate = PS_STATE_FULL_POWER; 159 priv->psstate = PS_STATE_FULL_POWER;
159 lbs_deb_host("CMD_RESP: EXIT_PS command response\n"); 160 lbs_deb_host("CMD_RESP: EXIT_PS command response\n");
@@ -291,7 +292,7 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
291 * in lbs_ps_wakeup() 292 * in lbs_ps_wakeup()
292 */ 293 */
293 lbs_deb_cmd("waking up ...\n"); 294 lbs_deb_cmd("waking up ...\n");
294 lbs_ps_wakeup(priv, 0); 295 lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, false);
295 } 296 }
296 break; 297 break;
297 298
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index da9833f00ee9..d00c728cec47 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -172,11 +172,6 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
172#define MRVDRV_MAX_BSS_DESCRIPTS 16 172#define MRVDRV_MAX_BSS_DESCRIPTS 16
173#define MRVDRV_MAX_REGION_CODE 6 173#define MRVDRV_MAX_REGION_CODE 6
174 174
175#define MRVDRV_IGNORE_MULTIPLE_DTIM 0xfffe
176#define MRVDRV_MIN_MULTIPLE_DTIM 1
177#define MRVDRV_MAX_MULTIPLE_DTIM 5
178#define MRVDRV_DEFAULT_MULTIPLE_DTIM 1
179
180#define MRVDRV_DEFAULT_LISTEN_INTERVAL 10 175#define MRVDRV_DEFAULT_LISTEN_INTERVAL 10
181 176
182#define MRVDRV_CHANNELS_PER_SCAN 4 177#define MRVDRV_CHANNELS_PER_SCAN 4
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index 03d2ae9bdd75..5eac1351a021 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -94,11 +94,9 @@
94#define CMD_802_11_BEACON_CTRL 0x00b0 94#define CMD_802_11_BEACON_CTRL 0x00b0
95 95
96/* For the IEEE Power Save */ 96/* For the IEEE Power Save */
97#define CMD_SUBCMD_ENTER_PS 0x0030 97#define PS_MODE_ACTION_ENTER_PS 0x0030
98#define CMD_SUBCMD_EXIT_PS 0x0031 98#define PS_MODE_ACTION_EXIT_PS 0x0031
99#define CMD_SUBCMD_SLEEP_CONFIRMED 0x0034 99#define PS_MODE_ACTION_SLEEP_CONFIRMED 0x0034
100#define CMD_SUBCMD_FULL_POWERDOWN 0x0035
101#define CMD_SUBCMD_FULL_POWERUP 0x0036
102 100
103#define CMD_ENABLE_RSN 0x0001 101#define CMD_ENABLE_RSN 0x0001
104#define CMD_DISABLE_RSN 0x0000 102#define CMD_DISABLE_RSN 0x0000
@@ -163,11 +161,6 @@
163#define CMD_ACT_SET_TX_FIX_RATE 0x0001 161#define CMD_ACT_SET_TX_FIX_RATE 0x0001
164#define CMD_ACT_GET_TX_RATE 0x0002 162#define CMD_ACT_GET_TX_RATE 0x0002
165 163
166/* Define action or option for CMD_802_11_PS_MODE */
167#define CMD_TYPE_CAM 0x0000
168#define CMD_TYPE_MAX_PSP 0x0001
169#define CMD_TYPE_FAST_PSP 0x0002
170
171/* Options for CMD_802_11_FW_WAKE_METHOD */ 164/* Options for CMD_802_11_FW_WAKE_METHOD */
172#define CMD_WAKE_METHOD_UNCHANGED 0x0000 165#define CMD_WAKE_METHOD_UNCHANGED 0x0000
173#define CMD_WAKE_METHOD_COMMAND_INT 0x0001 166#define CMD_WAKE_METHOD_COMMAND_INT 0x0001
@@ -683,11 +676,35 @@ struct cmd_ds_802_11_fw_wake_method {
683} __packed; 676} __packed;
684 677
685struct cmd_ds_802_11_ps_mode { 678struct cmd_ds_802_11_ps_mode {
679 struct cmd_header hdr;
680
686 __le16 action; 681 __le16 action;
682
683 /* Interval for keepalive in PS mode:
684 * 0x0000 = don't change
685 * 0x001E = firmware default
686 * 0xFFFF = disable
687 */
687 __le16 nullpktinterval; 688 __le16 nullpktinterval;
689
690 /* Number of DTIM intervals to wake up for:
691 * 0 = don't change
692 * 1 = firmware default
693 * 5 = max
694 */
688 __le16 multipledtim; 695 __le16 multipledtim;
696
689 __le16 reserved; 697 __le16 reserved;
690 __le16 locallisteninterval; 698 __le16 locallisteninterval;
699
700 /* AdHoc awake period (FW v9+ only):
701 * 0 = don't change
702 * 1 = always awake (IEEE standard behavior)
703 * 2 - 31 = sleep for (n - 1) periods and awake for 1 period
704 * 32 - 254 = invalid
705 * 255 = sleep at each ATIM
706 */
707 __le16 adhoc_awake_period;
691} __packed; 708} __packed;
692 709
693struct cmd_confirm_sleep { 710struct cmd_confirm_sleep {
@@ -952,17 +969,4 @@ struct cmd_ds_mesh_access {
952 969
953/* Number of stats counters returned by the firmware */ 970/* Number of stats counters returned by the firmware */
954#define MESH_STATS_NUM 8 971#define MESH_STATS_NUM 8
955
956struct cmd_ds_command {
957 /* command header */
958 __le16 command;
959 __le16 size;
960 __le16 seqnum;
961 __le16 result;
962
963 /* command Body */
964 union {
965 struct cmd_ds_802_11_ps_mode psmode;
966 } params;
967} __packed;
968#endif 972#endif
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 3678e532874f..07ece9d26c63 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -433,7 +433,7 @@ static int if_usb_send_fw_pkt(struct if_usb_card *cardp)
433 433
434static int if_usb_reset_device(struct if_usb_card *cardp) 434static int if_usb_reset_device(struct if_usb_card *cardp)
435{ 435{
436 struct cmd_ds_command *cmd = cardp->ep_out_buf + 4; 436 struct cmd_header *cmd = cardp->ep_out_buf + 4;
437 int ret; 437 int ret;
438 438
439 lbs_deb_enter(LBS_DEB_USB); 439 lbs_deb_enter(LBS_DEB_USB);
@@ -441,7 +441,7 @@ static int if_usb_reset_device(struct if_usb_card *cardp)
441 *(__le32 *)cardp->ep_out_buf = cpu_to_le32(CMD_TYPE_REQUEST); 441 *(__le32 *)cardp->ep_out_buf = cpu_to_le32(CMD_TYPE_REQUEST);
442 442
443 cmd->command = cpu_to_le16(CMD_802_11_RESET); 443 cmd->command = cpu_to_le16(CMD_802_11_RESET);
444 cmd->size = cpu_to_le16(sizeof(struct cmd_header)); 444 cmd->size = cpu_to_le16(sizeof(cmd));
445 cmd->result = cpu_to_le16(0); 445 cmd->result = cpu_to_le16(0);
446 cmd->seqnum = cpu_to_le16(0x5a5a); 446 cmd->seqnum = cpu_to_le16(0x5a5a);
447 usb_tx_block(cardp, cardp->ep_out_buf, 4 + sizeof(struct cmd_header)); 447 usb_tx_block(cardp, cardp->ep_out_buf, 4 + sizeof(struct cmd_header));
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index cfd0af6725d4..6c0e814bbe60 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -897,7 +897,7 @@ void lbs_remove_card(struct lbs_private *priv)
897 897
898 if (priv->psmode == LBS802_11POWERMODEMAX_PSP) { 898 if (priv->psmode == LBS802_11POWERMODEMAX_PSP) {
899 priv->psmode = LBS802_11POWERMODECAM; 899 priv->psmode = LBS802_11POWERMODECAM;
900 lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); 900 lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
901 } 901 }
902 902
903 if (priv->is_deep_sleep) { 903 if (priv->is_deep_sleep) {
@@ -1060,7 +1060,7 @@ static int __init lbs_init_module(void)
1060 memset(&confirm_sleep, 0, sizeof(confirm_sleep)); 1060 memset(&confirm_sleep, 0, sizeof(confirm_sleep));
1061 confirm_sleep.hdr.command = cpu_to_le16(CMD_802_11_PS_MODE); 1061 confirm_sleep.hdr.command = cpu_to_le16(CMD_802_11_PS_MODE);
1062 confirm_sleep.hdr.size = cpu_to_le16(sizeof(confirm_sleep)); 1062 confirm_sleep.hdr.size = cpu_to_le16(sizeof(confirm_sleep));
1063 confirm_sleep.action = cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED); 1063 confirm_sleep.action = cpu_to_le16(PS_MODE_ACTION_SLEEP_CONFIRMED);
1064 lbs_debugfs_init(); 1064 lbs_debugfs_init();
1065 lbs_deb_leave(LBS_DEB_MAIN); 1065 lbs_deb_leave(LBS_DEB_MAIN);
1066 return 0; 1066 return 0;