Commit a01f5450 authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville

libertas: fix sleep confirmation

This fixes an issus that made "iwconfig eth1 power on" non-working.
When we get a "PS sleep" event, we have to confirm this to the firmware.
The confirm happens with a command, but this command is special: the
firmware won't send us a response. if_cs_host_to_card() is setting
priv->dnld_sent anyway, so this variable stayed at DNLD_DATA_SENT and
was never cleared back.

Now I put the special knowledge that the CMD_802_11_PS_MODE with
CMD_SUBCMD_SLEEP_CONFIRMED doesn't need to need a response by directly
clearing the dnld_sent state in lbs_send_confirmsleep().
Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 507b06d0
...@@ -1842,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) ...@@ -1842,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
/* We don't get a response on the sleep-confirmation */
priv->dnld_sent = DNLD_RES_RECEIVED;
/* If nothing to do, go back to sleep (?) */ /* If nothing to do, go back to sleep (?) */
if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx]) if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx])
priv->psstate = PS_STATE_SLEEP; priv->psstate = PS_STATE_SLEEP;
...@@ -1904,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) ...@@ -1904,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
lbs_deb_enter(LBS_DEB_HOST); lbs_deb_enter(LBS_DEB_HOST);
spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->dnld_sent) { if (priv->dnld_sent) {
allowed = 0; allowed = 0;
lbs_deb_host("dnld_sent was set\n"); lbs_deb_host("dnld_sent was set\n");
} }
spin_lock_irqsave(&priv->driver_lock, flags);
/* In-progress command? */ /* In-progress command? */
if (priv->cur_cmd) { if (priv->cur_cmd) {
allowed = 0; allowed = 0;
......
...@@ -732,8 +732,8 @@ static int lbs_thread(void *data) ...@@ -732,8 +732,8 @@ static int lbs_thread(void *data)
lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n", lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n",
priv->currenttxskb, priv->dnld_sent); priv->currenttxskb, priv->dnld_sent);
spin_lock_irq(&priv->driver_lock);
/* Process any pending command response */ /* Process any pending command response */
spin_lock_irq(&priv->driver_lock);
resp_idx = priv->resp_idx; resp_idx = priv->resp_idx;
if (priv->resp_len[resp_idx]) { if (priv->resp_len[resp_idx]) {
spin_unlock_irq(&priv->driver_lock); spin_unlock_irq(&priv->driver_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment