linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fix initial hardware configuration
@ 2008-02-10 13:16 Michael Buesch
  2008-02-11 12:25 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Buesch @ 2008-02-10 13:16 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Johannes Berg

On the initial device-open we need to defer the hardware reconfiguration
after we incremented the open_count, because the hw_config checks this flag
and won't call the lowlevel driver in case it is zero.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

John, this should also go to -stable once you applied it to the tree.
Do you take care of this?


Index: wireless-2.6/net/mac80211/ieee80211.c
===================================================================
--- wireless-2.6.orig/net/mac80211/ieee80211.c	2008-02-08 22:54:22.000000000 +0100
+++ wireless-2.6/net/mac80211/ieee80211.c	2008-02-10 14:07:23.000000000 +0100
@@ -172,12 +172,13 @@ static inline int identical_mac_addr_all
 static int ieee80211_open(struct net_device *dev)
 {
 	struct ieee80211_sub_if_data *sdata, *nsdata;
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_if_init_conf conf;
 	int res;
+	bool need_hw_reconfig = 0;
 
 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
 	/* we hold the RTNL here so can safely walk the list */
 	list_for_each_entry(nsdata, &local->interfaces, list) {
 		struct net_device *ndev = nsdata->dev;
@@ -225,13 +226,13 @@ static int ieee80211_open(struct net_dev
 	if (local->open_count == 0) {
 		res = 0;
 		if (local->ops->start)
 			res = local->ops->start(local_to_hw(local));
 		if (res)
 			return res;
-		ieee80211_hw_config(local);
+		need_hw_reconfig = 1;
 		ieee80211_led_radio(local, local->hw.conf.radio_enabled);
 	}
 
 	switch (sdata->vif.type) {
 	case IEEE80211_IF_TYPE_VLAN:
 		list_add(&sdata->u.vlan.list, &sdata->u.vlan.ap->u.ap.vlans);
@@ -302,12 +303,14 @@ static int ieee80211_open(struct net_dev
 		atomic_inc(&local->iff_allmultis);
 
 	if (sdata->flags & IEEE80211_SDATA_PROMISC)
 		atomic_inc(&local->iff_promiscs);
 
 	local->open_count++;
+	if (need_hw_reconfig)
+		ieee80211_hw_config(local);
 
 	netif_start_queue(dev);
 
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Fix initial hardware configuration
  2008-02-10 13:16 [PATCH] mac80211: Fix initial hardware configuration Michael Buesch
@ 2008-02-11 12:25 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-02-11 12:25 UTC (permalink / raw)
  To: Michael Buesch; +Cc: John Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]


On Sun, 2008-02-10 at 14:16 +0100, Michael Buesch wrote:
> On the initial device-open we need to defer the hardware reconfiguration
> after we incremented the open_count, because the hw_config checks this flag
> and won't call the lowlevel driver in case it is zero.

Good catch.

> Signed-off-by: Michael Buesch <mb@bu3sch.de>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-11 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-10 13:16 [PATCH] mac80211: Fix initial hardware configuration Michael Buesch
2008-02-11 12:25 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).