aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2015-01-28 05:12:04 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-01-29 03:20:17 -0500
commit76c504ca1e7de8555cbf18a0ef08d29ee462c8eb (patch)
treee0f107b76c36d6da19d337bf0c6b5465a60b3e6b /drivers/net/wireless/mwifiex
parentcf0523350c6f12bdffb06c7000326edb296ec450 (diff)
mwifiex: handle PS events on AP interface as well
This patch adds support to handle PS events on AP interface as well. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c36
-rw-r--r--drivers/net/wireless/mwifiex/uap_event.c39
2 files changed, 53 insertions, 22 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 00586b22c61a..c5a14ff7eb82 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -315,22 +315,19 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
315 adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++; 315 adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure++;
316 return -1; 316 return -1;
317 } 317 }
318 if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY)) 318
319 == MWIFIEX_BSS_ROLE_STA) { 319 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl))
320 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl)) 320 /* Response is not needed for sleep confirm command */
321 /* Response is not needed for sleep 321 adapter->ps_state = PS_STATE_SLEEP;
322 confirm command */ 322 else
323 adapter->ps_state = PS_STATE_SLEEP; 323 adapter->ps_state = PS_STATE_SLEEP_CFM;
324 else 324
325 adapter->ps_state = PS_STATE_SLEEP_CFM; 325 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl) &&
326 326 (adapter->is_hs_configured &&
327 if (!le16_to_cpu(sleep_cfm_buf->resp_ctrl) && 327 !adapter->sleep_period.period)) {
328 (adapter->is_hs_configured && 328 adapter->pm_wakeup_card_req = true;
329 !adapter->sleep_period.period)) { 329 mwifiex_hs_activated_event(mwifiex_get_priv
330 adapter->pm_wakeup_card_req = true; 330 (adapter, MWIFIEX_BSS_ROLE_ANY), true);
331 mwifiex_hs_activated_event(mwifiex_get_priv
332 (adapter, MWIFIEX_BSS_ROLE_STA), true);
333 }
334 } 331 }
335 332
336 return ret; 333 return ret;
@@ -450,6 +447,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
450 EVENT_GET_BSS_TYPE(eventcause)); 447 EVENT_GET_BSS_TYPE(eventcause));
451 if (!priv) 448 if (!priv)
452 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); 449 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
450
453 /* Clear BSS_NO_BITS from event */ 451 /* Clear BSS_NO_BITS from event */
454 eventcause &= EVENT_ID_MASK; 452 eventcause &= EVENT_ID_MASK;
455 adapter->event_cause = eventcause; 453 adapter->event_cause = eventcause;
@@ -462,12 +460,6 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
462 } 460 }
463 461
464 dev_dbg(adapter->dev, "EVENT: cause: %#x\n", eventcause); 462 dev_dbg(adapter->dev, "EVENT: cause: %#x\n", eventcause);
465 if (eventcause == EVENT_PS_SLEEP || eventcause == EVENT_PS_AWAKE) {
466 /* Handle PS_SLEEP/AWAKE events on STA */
467 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
468 if (!priv)
469 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
470 }
471 463
472 if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) 464 if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
473 ret = mwifiex_process_uap_event(priv); 465 ret = mwifiex_process_uap_event(priv);
diff --git a/drivers/net/wireless/mwifiex/uap_event.c b/drivers/net/wireless/mwifiex/uap_event.c
index 96ff39722f8f..9b4ca6ff7931 100644
--- a/drivers/net/wireless/mwifiex/uap_event.c
+++ b/drivers/net/wireless/mwifiex/uap_event.c
@@ -178,6 +178,45 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
178 dev_dbg(adapter->dev, "event: TX_STATUS Report\n"); 178 dev_dbg(adapter->dev, "event: TX_STATUS Report\n");
179 mwifiex_parse_tx_status_event(priv, adapter->event_body); 179 mwifiex_parse_tx_status_event(priv, adapter->event_body);
180 break; 180 break;
181 case EVENT_PS_SLEEP:
182 dev_dbg(adapter->dev, "info: EVENT: SLEEP\n");
183
184 adapter->ps_state = PS_STATE_PRE_SLEEP;
185
186 mwifiex_check_ps_cond(adapter);
187 break;
188
189 case EVENT_PS_AWAKE:
190 dev_dbg(adapter->dev, "info: EVENT: AWAKE\n");
191 if (!adapter->pps_uapsd_mode &&
192 priv->media_connected && adapter->sleep_period.period) {
193 adapter->pps_uapsd_mode = true;
194 dev_dbg(adapter->dev,
195 "event: PPS/UAPSD mode activated\n");
196 }
197 adapter->tx_lock_flag = false;
198 if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) {
199 if (mwifiex_check_last_packet_indication(priv)) {
200 if (adapter->data_sent) {
201 adapter->ps_state = PS_STATE_AWAKE;
202 adapter->pm_wakeup_card_req = false;
203 adapter->pm_wakeup_fw_try = false;
204 break;
205 }
206 if (!mwifiex_send_null_packet
207 (priv,
208 MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
209 MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET))
210 adapter->ps_state =
211 PS_STATE_SLEEP;
212 return 0;
213 }
214 }
215 adapter->ps_state = PS_STATE_AWAKE;
216 adapter->pm_wakeup_card_req = false;
217 adapter->pm_wakeup_fw_try = false;
218
219 break;
181 default: 220 default:
182 dev_dbg(adapter->dev, "event: unknown event id: %#x\n", 221 dev_dbg(adapter->dev, "event: unknown event id: %#x\n",
183 eventcause); 222 eventcause);