diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-17 13:26:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:42 -0500 |
commit | b47ef2438dea2ddad4561152aa8007a2d95e8157 (patch) | |
tree | a896e84893677dcc9eda54bedaeda5fdd87f5896 /drivers/net/wireless/libertas/cmdresp.c | |
parent | 24dba5f39194c57f98090d1ee504be5740dc521c (diff) |
libertas: handle HOST_AWAKE event by sending WAKEUP_CONFIRM command
lbs_send_confirmwake() is a bit ugly but matches the way we confirm
sleep. We'll deal with that whole thing later.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index c05fef04c432..8f9eda4d1be1 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -773,6 +773,30 @@ done: | |||
773 | return ret; | 773 | return ret; |
774 | } | 774 | } |
775 | 775 | ||
776 | static int lbs_send_confirmwake(struct lbs_private *priv) | ||
777 | { | ||
778 | struct cmd_header *cmd = &priv->lbs_ps_confirm_wake; | ||
779 | int ret = 0; | ||
780 | |||
781 | lbs_deb_enter(LBS_DEB_HOST); | ||
782 | |||
783 | cmd->command = cpu_to_le16(CMD_802_11_WAKEUP_CONFIRM); | ||
784 | cmd->size = cpu_to_le16(sizeof(*cmd)); | ||
785 | cmd->seqnum = cpu_to_le16(++priv->seqnum); | ||
786 | cmd->result = 0; | ||
787 | |||
788 | lbs_deb_host("SEND_WAKEC_CMD: before download\n"); | ||
789 | |||
790 | lbs_deb_hex(LBS_DEB_HOST, "wake confirm command", (void *)cmd, sizeof(*cmd)); | ||
791 | |||
792 | ret = priv->hw_host_to_card(priv, MVMS_CMD, (void *)cmd, sizeof(*cmd)); | ||
793 | if (ret) | ||
794 | lbs_pr_alert("SEND_WAKEC_CMD: Host to Card failed for Confirm Wake\n"); | ||
795 | |||
796 | lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); | ||
797 | return ret; | ||
798 | } | ||
799 | |||
776 | int lbs_process_event(struct lbs_private *priv) | 800 | int lbs_process_event(struct lbs_private *priv) |
777 | { | 801 | { |
778 | int ret = 0; | 802 | int ret = 0; |
@@ -821,9 +845,13 @@ int lbs_process_event(struct lbs_private *priv) | |||
821 | 845 | ||
822 | break; | 846 | break; |
823 | 847 | ||
848 | case MACREG_INT_CODE_HOST_AWAKE: | ||
849 | lbs_deb_cmd("EVENT: HOST_AWAKE\n"); | ||
850 | lbs_send_confirmwake(priv); | ||
851 | break; | ||
852 | |||
824 | case MACREG_INT_CODE_PS_AWAKE: | 853 | case MACREG_INT_CODE_PS_AWAKE: |
825 | lbs_deb_cmd("EVENT: awake\n"); | 854 | lbs_deb_cmd("EVENT: awake\n"); |
826 | |||
827 | /* handle unexpected PS AWAKE event */ | 855 | /* handle unexpected PS AWAKE event */ |
828 | if (priv->psstate == PS_STATE_FULL_POWER) { | 856 | if (priv->psstate == PS_STATE_FULL_POWER) { |
829 | lbs_deb_cmd( | 857 | lbs_deb_cmd( |