cfg80211.c (3814264481fecba02ba60f2e6c6baea2d43b757b) cfg80211.c (84caf8005b09e0a4a57fce44119489d1b0bbbe94)
1/*
2 * Copyright (c) 2004-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 2489 unchanged lines hidden (view full) ---

2498#ifdef CONFIG_PM
2499
2500/* hif layer decides what suspend mode to use */
2501static int __ath6kl_cfg80211_suspend(struct wiphy *wiphy,
2502 struct cfg80211_wowlan *wow)
2503{
2504 struct ath6kl *ar = wiphy_priv(wiphy);
2505
1/*
2 * Copyright (c) 2004-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 2489 unchanged lines hidden (view full) ---

2498#ifdef CONFIG_PM
2499
2500/* hif layer decides what suspend mode to use */
2501static int __ath6kl_cfg80211_suspend(struct wiphy *wiphy,
2502 struct cfg80211_wowlan *wow)
2503{
2504 struct ath6kl *ar = wiphy_priv(wiphy);
2505
2506 ath6kl_recovery_suspend(ar);
2507
2506 return ath6kl_hif_suspend(ar, wow);
2507}
2508
2509static int __ath6kl_cfg80211_resume(struct wiphy *wiphy)
2510{
2511 struct ath6kl *ar = wiphy_priv(wiphy);
2508 return ath6kl_hif_suspend(ar, wow);
2509}
2510
2511static int __ath6kl_cfg80211_resume(struct wiphy *wiphy)
2512{
2513 struct ath6kl *ar = wiphy_priv(wiphy);
2514 int err;
2512
2515
2513 return ath6kl_hif_resume(ar);
2516 err = ath6kl_hif_resume(ar);
2517 if (err)
2518 return err;
2519
2520 ar->fw_recovery.enable = true;
2521
2522 return 0;
2514}
2515
2516/*
2517 * FIXME: WOW suspend mode is selected if the host sdio controller supports
2518 * both sdio irq wake up and keep power. The target pulls sdio data line to
2519 * wake up the host when WOW pattern matches. This causes sdio irq handler
2520 * is being called in the host side which internally hits ath6kl's RX path.
2521 *

--- 907 unchanged lines hidden (view full) ---

3429 if (test_bit(CONNECTED, &vif->flags) ||
3430 test_bit(CONNECT_PEND, &vif->flags))
3431 ath6kl_wmi_disconnect_cmd(vif->ar->wmi, vif->fw_vif_idx);
3432
3433 vif->sme_state = SME_DISCONNECTED;
3434 clear_bit(CONNECTED, &vif->flags);
3435 clear_bit(CONNECT_PEND, &vif->flags);
3436
2523}
2524
2525/*
2526 * FIXME: WOW suspend mode is selected if the host sdio controller supports
2527 * both sdio irq wake up and keep power. The target pulls sdio data line to
2528 * wake up the host when WOW pattern matches. This causes sdio irq handler
2529 * is being called in the host side which internally hits ath6kl's RX path.
2530 *

--- 907 unchanged lines hidden (view full) ---

3438 if (test_bit(CONNECTED, &vif->flags) ||
3439 test_bit(CONNECT_PEND, &vif->flags))
3440 ath6kl_wmi_disconnect_cmd(vif->ar->wmi, vif->fw_vif_idx);
3441
3442 vif->sme_state = SME_DISCONNECTED;
3443 clear_bit(CONNECTED, &vif->flags);
3444 clear_bit(CONNECT_PEND, &vif->flags);
3445
3446 /* Stop netdev queues, needed during recovery */
3447 netif_stop_queue(vif->ndev);
3448 netif_carrier_off(vif->ndev);
3449
3437 /* disable scanning */
3438 if (ath6kl_wmi_scanparams_cmd(vif->ar->wmi, vif->fw_vif_idx, 0xFFFF,
3439 0, 0, 0, 0, 0, 0, 0, 0, 0) != 0)
3440 ath6kl_warn("failed to disable scan during stop\n");
3441
3442 ath6kl_cfg80211_scan_complete_event(vif, true);
3443}
3444
3445void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
3446{
3447 struct ath6kl_vif *vif;
3448
3449 vif = ath6kl_vif_first(ar);
3450 /* disable scanning */
3451 if (ath6kl_wmi_scanparams_cmd(vif->ar->wmi, vif->fw_vif_idx, 0xFFFF,
3452 0, 0, 0, 0, 0, 0, 0, 0, 0) != 0)
3453 ath6kl_warn("failed to disable scan during stop\n");
3454
3455 ath6kl_cfg80211_scan_complete_event(vif, true);
3456}
3457
3458void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
3459{
3460 struct ath6kl_vif *vif;
3461
3462 vif = ath6kl_vif_first(ar);
3450 if (!vif) {
3463 if (!vif && ar->state != ATH6KL_STATE_RECOVERY) {
3451 /* save the current power mode before enabling power save */
3452 ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
3453
3454 if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
3455 ath6kl_warn("ath6kl_deep_sleep_enable: wmi_powermode_cmd failed\n");
3456 return;
3457 }
3458

--- 332 unchanged lines hidden ---
3464 /* save the current power mode before enabling power save */
3465 ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
3466
3467 if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
3468 ath6kl_warn("ath6kl_deep_sleep_enable: wmi_powermode_cmd failed\n");
3469 return;
3470 }
3471

--- 332 unchanged lines hidden ---