diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2008-03-26 08:22:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-01 17:13:17 -0400 |
commit | f539f2efe9fdf9e7db2022a757190858576d34fd (patch) | |
tree | 9fa3aafbffe64122a7bcb8c7e2d8ae117ab65b8a /drivers/net/wireless/libertas/cmd.c | |
parent | 7460f5a69055357bf97f1890db547aba0c4bf2fa (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/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 6e7bfb36b49..dbaf8b9e47d 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1802,38 +1802,27 @@ void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str) | |||
1802 | lbs_deb_leave(LBS_DEB_WEXT); | 1802 | lbs_deb_leave(LBS_DEB_WEXT); |
1803 | } | 1803 | } |
1804 | 1804 | ||
1805 | static int sendconfirmsleep(struct lbs_private *priv, u8 *cmdptr, u16 size) | 1805 | static void lbs_send_confirmsleep(struct lbs_private *priv) |
1806 | { | 1806 | { |
1807 | unsigned long flags; | 1807 | unsigned long flags; |
1808 | int ret = 0; | 1808 | int ret; |
1809 | 1809 | ||
1810 | lbs_deb_enter(LBS_DEB_HOST); | 1810 | lbs_deb_enter(LBS_DEB_HOST); |
1811 | lbs_deb_hex(LBS_DEB_HOST, "sleep confirm command", cmdptr, size); | 1811 | lbs_deb_hex(LBS_DEB_HOST, "sleep confirm", (u8 *) &confirm_sleep, |
1812 | 1812 | sizeof(confirm_sleep)); | |
1813 | ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size); | ||
1814 | 1813 | ||
1815 | spin_lock_irqsave(&priv->driver_lock, flags); | 1814 | ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep, |
1816 | if (priv->intcounter || priv->currenttxskb) | 1815 | sizeof(confirm_sleep)); |
1817 | lbs_deb_host("SEND_SLEEPC_CMD: intcounter %d, currenttxskb %p\n", | ||
1818 | priv->intcounter, priv->currenttxskb); | ||
1819 | spin_unlock_irqrestore(&priv->driver_lock, flags); | ||
1820 | 1816 | ||
1821 | if (ret) { | 1817 | if (ret) { |
1822 | lbs_pr_alert( | 1818 | lbs_pr_alert("confirm_sleep failed\n"); |
1823 | "SEND_SLEEPC_CMD: Host to Card failed for Confirm Sleep\n"); | ||
1824 | } else { | 1819 | } else { |
1825 | spin_lock_irqsave(&priv->driver_lock, flags); | 1820 | spin_lock_irqsave(&priv->driver_lock, flags); |
1826 | if (!priv->intcounter) { | 1821 | if (!priv->intcounter) |
1827 | priv->psstate = PS_STATE_SLEEP; | 1822 | priv->psstate = PS_STATE_SLEEP; |
1828 | } else { | ||
1829 | lbs_deb_host("SEND_SLEEPC_CMD: after sent, intcounter %d\n", | ||
1830 | priv->intcounter); | ||
1831 | } | ||
1832 | spin_unlock_irqrestore(&priv->driver_lock, flags); | 1823 | spin_unlock_irqrestore(&priv->driver_lock, flags); |
1833 | } | 1824 | } |
1834 | 1825 | lbs_deb_leave(LBS_DEB_HOST); | |
1835 | lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); | ||
1836 | return ret; | ||
1837 | } | 1826 | } |
1838 | 1827 | ||
1839 | void lbs_ps_sleep(struct lbs_private *priv, int wait_option) | 1828 | void lbs_ps_sleep(struct lbs_private *priv, int wait_option) |
@@ -1906,8 +1895,7 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) | |||
1906 | 1895 | ||
1907 | if (allowed) { | 1896 | if (allowed) { |
1908 | lbs_deb_host("sending lbs_ps_confirm_sleep\n"); | 1897 | lbs_deb_host("sending lbs_ps_confirm_sleep\n"); |
1909 | sendconfirmsleep(priv, (u8 *) & priv->lbs_ps_confirm_sleep, | 1898 | lbs_send_confirmsleep(priv); |
1910 | sizeof(struct PS_CMD_ConfirmSleep)); | ||
1911 | } else { | 1899 | } else { |
1912 | lbs_deb_host("sleep confirm has been delayed\n"); | 1900 | lbs_deb_host("sleep confirm has been delayed\n"); |
1913 | } | 1901 | } |