linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: don't break without 802.11 qdisc
@ 2007-05-03 23:41 Jiri Benc
  2007-05-04 17:22 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Benc @ 2007-05-03 23:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: Jan Kiszka, Michael Wu

Jan, could you test if this patch fixes your problems with removing of
802.11 qdisc? (It applies on top of the patch
http://git.kernel.org/?p=linux/kernel/git/linville/wireless-dev.git;a=commitdiff_plain;h=00a908826e778b39a802013729f7826c2d575360 )

Thanks,

 Jiri

---

This patch prevents things from going crazy when the 802.11 qdisc is not
installed (because it is removed using tc or because CONFIG_NET_SCHED is not
set).

Co-author: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Jiri Benc <jbenc@suse.cz>

---
 net/mac80211/ieee80211.c |   30 +++++++++++++++++++++---------
 net/mac80211/wme.h       |    2 +-
 2 files changed, 22 insertions(+), 10 deletions(-)

--- mac80211.orig/net/mac80211/ieee80211.c
+++ mac80211/net/mac80211/ieee80211.c
@@ -1215,6 +1215,11 @@ static int __ieee80211_tx(struct ieee802
 	struct ieee80211_tx_control *control = tx->u.tx.control;
 	int ret, i;
 
+	if (!ieee80211_qdisc_installed(local->mdev) &&
+	    __ieee80211_queue_stopped(local, 0)) {
+		netif_stop_queue(local->mdev);
+		return IEEE80211_TX_AGAIN;
+	}
 	if (skb) {
 		ieee80211_dump_frame(local->mdev->name, "TX to low-level driver", skb);
 		ret = local->ops->tx(local_to_hw(local), skb, control);
@@ -1404,8 +1409,13 @@ static void ieee80211_tx_pending(unsigne
 		}
 	}
 	netif_tx_unlock_bh(dev);
-	if (reschedule)
-		netif_schedule(dev);
+	if (reschedule) {
+		if (!ieee80211_qdisc_installed(dev)) {
+			if (!__ieee80211_queue_stopped(local, 0))
+				netif_wake_queue(dev);
+		} else
+			netif_schedule(dev);
+	}
 }
 
 static void ieee80211_clear_tx_pending(struct ieee80211_local *local)
@@ -2304,12 +2314,6 @@ static int ieee80211_master_open(struct 
 	struct ieee80211_sub_if_data *sdata;
 	int res = -EOPNOTSUPP;
 
-	if (!ieee80211_qdisc_installed(dev)) {
-		printk(KERN_ERR "%s: ieee80211 qdisc not installed\n",
-		       dev->name);
-		return res;
-	}
-
 	read_lock(&local->sub_if_lock);
 	list_for_each_entry(sdata, &local->sub_if_list, list) {
 		if (sdata->dev != dev && netif_running(sdata->dev)) {
@@ -5026,7 +5030,11 @@ void ieee80211_wake_queue(struct ieee802
 			     &local->state[queue]))
 			tasklet_schedule(&local->tx_pending_tasklet);
 		else
-			__netif_schedule(local->mdev);
+			if (!ieee80211_qdisc_installed(local->mdev)) {
+				if (queue == 0)
+					netif_wake_queue(local->mdev);
+			} else
+				__netif_schedule(local->mdev);
 	}
 }
 EXPORT_SYMBOL(ieee80211_wake_queue);
@@ -5035,6 +5043,8 @@ void ieee80211_stop_queue(struct ieee802
 {
 	struct ieee80211_local *local = hw_to_local(hw);
 
+	if (!ieee80211_qdisc_installed(local->mdev) && queue == 0)
+		netif_stop_queue(local->mdev);
 	set_bit(IEEE80211_LINK_STATE_XOFF, &local->state[queue]);
 }
 EXPORT_SYMBOL(ieee80211_stop_queue);
@@ -5046,6 +5056,8 @@ void ieee80211_start_queues(struct ieee8
 
 	for (i = 0; i < local->hw.queues; i++)
 		clear_bit(IEEE80211_LINK_STATE_XOFF, &local->state[i]);
+	if (!ieee80211_qdisc_installed(local->mdev))
+		netif_start_queue(local->mdev);
 }
 EXPORT_SYMBOL(ieee80211_start_queues);
 
--- mac80211.orig/net/mac80211/wme.h
+++ mac80211/net/mac80211/wme.h
@@ -42,7 +42,7 @@ static inline void ieee80211_install_qdi
 }
 static inline int ieee80211_qdisc_installed(struct net_device *dev)
 {
-	return 1;
+	return 0;
 }
 
 static inline int ieee80211_wme_register(void)


-- 
Jiri Benc
SUSE Labs

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

* Re: [PATCH] mac80211: don't break without 802.11 qdisc
  2007-05-03 23:41 [PATCH] mac80211: don't break without 802.11 qdisc Jiri Benc
@ 2007-05-04 17:22 ` Jan Kiszka
  2007-05-04 17:43   ` Michael Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2007-05-04 17:22 UTC (permalink / raw)
  To: Jiri Benc; +Cc: linux-wireless, Michael Wu

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

Jiri Benc wrote:
> Jan, could you test if this patch fixes your problems with removing of
> 802.11 qdisc? (It applies on top of the patch
> http://git.kernel.org/?p=linux/kernel/git/linville/wireless-dev.git;a=commitdiff_plain;h=00a908826e778b39a802013729f7826c2d575360 )

Depends on how we define "fix": I'm still able to tweak the qdisc of
wmaster0 (and so will shorewall). That may or may not lead to some BUG
(WARN_ON) of the 80211 stack later on as it used to, I need to watch a
bit longer.

What should be the effect of the patch? Catch, revert, or even prevent
this qdisc change of a shutdown and/or running wlan device?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

* Re: [PATCH] mac80211: don't break without 802.11 qdisc
  2007-05-04 17:22 ` Jan Kiszka
@ 2007-05-04 17:43   ` Michael Wu
  2007-05-04 19:05     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Wu @ 2007-05-04 17:43 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Jiri Benc, linux-wireless

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

On Friday 04 May 2007 13:22, Jan Kiszka wrote:
> What should be the effect of the patch? Catch, revert, or even prevent
> this qdisc change of a shutdown and/or running wlan device?
>
It merely makes it so that it is safe to not use the ieee80211 qdisc.

-Michael Wu

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] mac80211: don't break without 802.11 qdisc
  2007-05-04 17:43   ` Michael Wu
@ 2007-05-04 19:05     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2007-05-04 19:05 UTC (permalink / raw)
  To: Michael Wu; +Cc: Jiri Benc, linux-wireless

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

Michael Wu wrote:
> On Friday 04 May 2007 13:22, Jan Kiszka wrote:
>> What should be the effect of the patch? Catch, revert, or even prevent
>> this qdisc change of a shutdown and/or running wlan device?
>>
> It merely makes it so that it is safe to not use the ieee80211 qdisc.

So I would just run my device(s) in a suboptimal mode from that point on?

Is it possible to establish the deleted qdisc again? tc tells me
"ieee80211" is an unknown discipline. Well, this still sounds a bit...
suboptimal.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

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

end of thread, other threads:[~2007-05-04 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-03 23:41 [PATCH] mac80211: don't break without 802.11 qdisc Jiri Benc
2007-05-04 17:22 ` Jan Kiszka
2007-05-04 17:43   ` Michael Wu
2007-05-04 19:05     ` Jan Kiszka

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).