public inbox for linux-wireless@vger.kernel.org
 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 7/7] wl12xx: check the actual vif operstate in wl1271_dev_notify
Date: Sun, 18 Dec 2011 20:25:45 +0200	[thread overview]
Message-ID: <1324232745-22928-8-git-send-email-eliad@wizery.com> (raw)
In-Reply-To: <1324232745-22928-1-git-send-email-eliad@wizery.com>

The current wl1271_dev_notify implementation sets the
new operstate to all associated stations (while only
a specific vif was changed).

Until we'll have a method to get the actual vif from
the given dev, check the current operstate of each vif.

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

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 4b68b2a..59d3c55 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -450,7 +450,16 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
 	if (wl->state == WL1271_STATE_OFF)
 		goto out;
 
+	if (dev->operstate != IF_OPER_UP)
+		goto out;
+	/*
+	 * The correct behavior should be just getting the appropriate wlvif
+	 * from the given dev, but currently we don't have a mac80211
+	 * interface for it.
+	 */
 	wl12xx_for_each_wlvif_sta(wl, wlvif) {
+		struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
+
 		if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
 			continue;
 
@@ -458,7 +467,8 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
 		if (ret < 0)
 			goto out;
 
-		wl1271_check_operstate(wl, wlvif, dev->operstate);
+		wl1271_check_operstate(wl, wlvif,
+				       ieee80211_get_operstate(vif));
 
 		wl1271_ps_elp_sleep(wl);
 	}
-- 
1.7.6.401.g6a319


  parent reply	other threads:[~2011-12-18 18:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 18:25 [PATCH 0/7] wl12xx: various (multi-vif) fixes Eliad Peller
2011-12-18 18:25 ` [PATCH 1/7] wl12xx: implement change_interface Eliad Peller
2011-12-18 18:37   ` Arik Nemtsov
2011-12-18 22:16     ` Eliad Peller
2011-12-18 18:25 ` [PATCH 2/7] wl12xx: remove redundant code from wl1271_op_conf_tx Eliad Peller
2011-12-18 18:25 ` [PATCH 3/7] wl12xx: make WL1271_FLAG_IDLE flag per-vif Eliad Peller
2011-12-18 18:25 ` [PATCH 4/7] wl12xx: flush packets before stopping dev role Eliad Peller
2011-12-18 18:25 ` [PATCH 5/7] wl12xx: fix checking of started " Eliad Peller
2011-12-18 18:25 ` [PATCH 6/7] wl12xx: stop device role on remove_interface Eliad Peller
2011-12-18 18:25 ` Eliad Peller [this message]
2011-12-20 20:50 ` [PATCH 0/7] wl12xx: various (multi-vif) fixes 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=1324232745-22928-8-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