aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-03-26 08:22:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-01 17:13:17 -0400
commitf539f2efe9fdf9e7db2022a757190858576d34fd (patch)
tree9fa3aafbffe64122a7bcb8c7e2d8ae117ab65b8a /drivers/net/wireless/libertas/main.c
parent7460f5a69055357bf97f1890db547aba0c4bf2fa (diff)
libertas: convert sleep/wake config direct commands
Confirm sleep event: they come very regularly, eventually several times per second. Therefore we want to send the config command as fast as possible. The old code pre-set the command in priv->lbs_ps_confirm_sleep. However, the byte sequence to be sent to the hardware is the same for all interfaces. So this patch make this an extern structure, initialized at module load time. Config wake event: normal conversion to a direct command. However, I don't know how to trigger a "HOST AWAKE" event from the firmware, so this part is untested. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index d0e4c3b6deaa..efff63fb6b66 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -37,6 +37,11 @@ EXPORT_SYMBOL_GPL(lbs_debug);
37module_param_named(libertas_debug, lbs_debug, int, 0644); 37module_param_named(libertas_debug, lbs_debug, int, 0644);
38 38
39 39
40/* This global structure is used to send the confirm_sleep command as
41 * fast as possible down to the firmware. */
42struct cmd_confirm_sleep confirm_sleep;
43
44
40#define LBS_TX_PWR_DEFAULT 20 /*100mW */ 45#define LBS_TX_PWR_DEFAULT 20 /*100mW */
41#define LBS_TX_PWR_US_DEFAULT 20 /*100mW */ 46#define LBS_TX_PWR_US_DEFAULT 20 /*100mW */
42#define LBS_TX_PWR_JP_DEFAULT 16 /*50mW */ 47#define LBS_TX_PWR_JP_DEFAULT 16 /*50mW */
@@ -1013,14 +1018,6 @@ static int lbs_init_adapter(struct lbs_private *priv)
1013 &priv->network_free_list); 1018 &priv->network_free_list);
1014 } 1019 }
1015 1020
1016 priv->lbs_ps_confirm_sleep.seqnum = cpu_to_le16(++priv->seqnum);
1017 priv->lbs_ps_confirm_sleep.command =
1018 cpu_to_le16(CMD_802_11_PS_MODE);
1019 priv->lbs_ps_confirm_sleep.size =
1020 cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep));
1021 priv->lbs_ps_confirm_sleep.action =
1022 cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED);
1023
1024 memset(priv->current_addr, 0xff, ETH_ALEN); 1021 memset(priv->current_addr, 0xff, ETH_ALEN);
1025 1022
1026 priv->connect_status = LBS_DISCONNECTED; 1023 priv->connect_status = LBS_DISCONNECTED;
@@ -1462,6 +1459,10 @@ EXPORT_SYMBOL_GPL(lbs_interrupt);
1462static int __init lbs_init_module(void) 1459static int __init lbs_init_module(void)
1463{ 1460{
1464 lbs_deb_enter(LBS_DEB_MAIN); 1461 lbs_deb_enter(LBS_DEB_MAIN);
1462 memset(&confirm_sleep, 0, sizeof(confirm_sleep));
1463 confirm_sleep.hdr.command = cpu_to_le16(CMD_802_11_PS_MODE);
1464 confirm_sleep.hdr.size = cpu_to_le16(sizeof(confirm_sleep));
1465 confirm_sleep.action = cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED);
1465 lbs_debugfs_init(); 1466 lbs_debugfs_init();
1466 lbs_deb_leave(LBS_DEB_MAIN); 1467 lbs_deb_leave(LBS_DEB_MAIN);
1467 return 0; 1468 return 0;