Linux wireless drivers development
 help / color / mirror / Atom feed
From: Eliad Peller <eliad@wizery.com>
To: Luciano Coelho <coelho@ti.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 3/4] wl12xx: enter forced-psm on fw change
Date: Mon,  6 Feb 2012 12:47:56 +0200	[thread overview]
Message-ID: <1328525277-25334-4-git-send-email-eliad@wizery.com> (raw)
In-Reply-To: <1328525277-25334-1-git-send-email-eliad@wizery.com>

Enter forced psm when changing fw, in order to make the
sta a bit more disconnection-persistent.
(DPM doesn't know about the incoming recovery, so it
won't enter psm by itself)

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a3c464f..eeb80f5 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2127,6 +2127,19 @@ static bool wl12xx_need_fw_change(struct wl1271 *wl,
 	return false;
 }
 
+/*
+ * Enter "forced psm". Make sure the sta is in psm against the ap,
+ * to make the fw switch a bit more disconnection-persistent.
+ */
+static void wl12xx_force_active_psm(struct wl1271 *wl)
+{
+	struct wl12xx_vif *wlvif;
+
+	wl12xx_for_each_wlvif_sta(wl, wlvif) {
+		wl1271_ps_set_mode(wl, wlvif, STATION_POWER_SAVE_MODE);
+	}
+}
+
 static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 				   struct ieee80211_vif *vif)
 {
@@ -2178,6 +2191,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 	}
 
 	if (wl12xx_need_fw_change(wl, vif_count, true)) {
+		wl12xx_force_active_psm(wl);
 		mutex_unlock(&wl->mutex);
 		wl1271_recovery_work(&wl->recovery_work);
 		return 0;
@@ -2370,6 +2384,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
 	}
 	WARN_ON(iter != wlvif);
 	if (wl12xx_need_fw_change(wl, vif_count, false)) {
+		wl12xx_force_active_psm(wl);
 		wl12xx_queue_recovery_work(wl);
 		cancel_recovery = false;
 	}
-- 
1.7.6.401.g6a319


  parent reply	other threads:[~2012-02-06 10:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 10:47 [PATCH 0/4] wl12xx: support multiple vifs Eliad Peller
2012-02-06 10:47 ` [PATCH 1/4] wl12xx: Use a dedicated fw for PLT Eliad Peller
2012-02-06 10:47 ` [PATCH 2/4] wl12xx: dynamically change fw according to number of active roles Eliad Peller
2012-02-06 10:47 ` Eliad Peller [this message]
2012-02-06 10:47 ` [PATCH 4/4] wl12xx: delete wl->vif (and allow multiple vifs) Eliad Peller
2012-02-15 10:22 ` [PATCH 0/4] wl12xx: support multiple vifs Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328525277-25334-4-git-send-email-eliad@wizery.com \
    --to=eliad@wizery.com \
    --cc=coelho@ti.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox