aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-17 13:26:42 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:42 -0500
commitb47ef2438dea2ddad4561152aa8007a2d95e8157 (patch)
treea896e84893677dcc9eda54bedaeda5fdd87f5896 /drivers/net/wireless
parent24dba5f39194c57f98090d1ee504be5740dc521c (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')
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c30
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/host.h1
3 files changed, 31 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
776static 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
776int lbs_process_event(struct lbs_private *priv) 800int 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(
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 465080fd0607..fe5045757356 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -263,6 +263,7 @@ struct lbs_private {
263 u8 needtowakeup; 263 u8 needtowakeup;
264 264
265 struct PS_CMD_ConfirmSleep lbs_ps_confirm_sleep; 265 struct PS_CMD_ConfirmSleep lbs_ps_confirm_sleep;
266 struct cmd_header lbs_ps_confirm_wake;
266 267
267 struct assoc_request * pending_assoc_req; 268 struct assoc_request * pending_assoc_req;
268 struct assoc_request * in_progress_assoc_req; 269 struct assoc_request * in_progress_assoc_req;
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index bdf9017a173a..4c03e12fd6a3 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -74,6 +74,7 @@
74#define CMD_802_11_GET_AFC 0x003d 74#define CMD_802_11_GET_AFC 0x003d
75#define CMD_802_11_AD_HOC_STOP 0x0040 75#define CMD_802_11_AD_HOC_STOP 0x0040
76#define CMD_802_11_HOST_SLEEP_CFG 0x0043 76#define CMD_802_11_HOST_SLEEP_CFG 0x0043
77#define CMD_802_11_WAKEUP_CONFIRM 0x0044
77#define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045 78#define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045
78#define CMD_802_11_BEACON_STOP 0x0049 79#define CMD_802_11_BEACON_STOP 0x0049
79#define CMD_802_11_MAC_ADDRESS 0x004d 80#define CMD_802_11_MAC_ADDRESS 0x004d