Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278099
b: refs/heads/master
c: 76a9fbe
h: refs/heads/master
i:
  278097: 7392e9a
  278095: 51ce76e
v: v3
  • Loading branch information
Kalle Valo committed Nov 11, 2011
1 parent 2334371 commit 14dec19
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52d81a6883fb36c4304fb5619bfa5f61eb7986ef
refs/heads/master: 76a9fbe27ec04420844ddf49b9e7a2f872222983
28 changes: 23 additions & 5 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,8 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
ret);
}

ar->state = ATH6KL_STATE_DEEPSLEEP;

break;
}

Expand All @@ -1679,11 +1681,25 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,

int ath6kl_cfg80211_resume(struct ath6kl *ar)
{
if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
if (ath6kl_wmi_powermode_cmd(ar->wmi, 0,
ar->wmi->saved_pwr_mode) != 0)
ath6kl_warn("ath6kl_sdio_resume: "
"wmi_powermode_cmd failed\n");
int ret;

switch (ar->state) {
case ATH6KL_STATE_DEEPSLEEP:
if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0,
ar->wmi->saved_pwr_mode);
if (ret) {
ath6kl_warn("wmi powermode command failed during resume: %d\n",
ret);
}
}

ar->state = ATH6KL_STATE_ON;

break;

default:
break;
}

return 0;
Expand Down Expand Up @@ -2254,6 +2270,8 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev)
ar->sc_params.scan_ctrl_flags = DEFAULT_SCAN_CTRL_FLAGS;
ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;

ar->state = ATH6KL_STATE_OFF;

memset((u8 *)ar->sta_list, 0,
AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));

Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,18 @@ enum ath6kl_dev_state {
FIRST_BOOT,
};

enum ath6kl_state {
ATH6KL_STATE_OFF,
ATH6KL_STATE_ON,
ATH6KL_STATE_DEEPSLEEP,
};

struct ath6kl {
struct device *dev;
struct wiphy *wiphy;

enum ath6kl_state state;

struct ath6kl_bmi bmi;
const struct ath6kl_hif_ops *hif_ops;
struct wmi *wmi;
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,8 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
goto err_htc_stop;
}

ar->state = ATH6KL_STATE_ON;

return 0;

err_htc_stop:
Expand Down Expand Up @@ -1480,6 +1482,8 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
if (ret)
ath6kl_warn("failed to power off hif: %d\n", ret);

ar->state = ATH6KL_STATE_OFF;

return 0;
}

Expand Down

0 comments on commit 14dec19

Please sign in to comment.