* zd1211 config operation problem
@ 2007-09-23 14:48 Michael Buesch
2007-09-23 15:47 ` Ulrich Kunitz
2007-09-23 17:48 ` Michael Wu
0 siblings, 2 replies; 11+ messages in thread
From: Michael Buesch @ 2007-09-23 14:48 UTC (permalink / raw)
To: Ulrich Kunitz, Daniel Drake; +Cc: linux-wireless, John Linville
The zd1211 driver has a bug in the ieee80211 config callback.
It currently unconditionally calls the set_channel() function,
whether the device is running or not. This causes a failed
bus access, if we set some config while the device is down.
The driver must check if the device is running before setting
any config on it (usb->initialized?).
I tried to fix this, but I failed to find the correct condition
to check for.
I'm also wondering why we only set the channel in the config
callback. Is the rest all unsupported by the device, like
setting of TX power and so on?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-23 14:48 zd1211 config operation problem Michael Buesch
@ 2007-09-23 15:47 ` Ulrich Kunitz
2007-09-23 17:48 ` Michael Wu
1 sibling, 0 replies; 11+ messages in thread
From: Ulrich Kunitz @ 2007-09-23 15:47 UTC (permalink / raw)
To: Michael Buesch; +Cc: Daniel Drake, linux-wireless, John Linville
Michael Buesch wrote:
> The zd1211 driver has a bug in the ieee80211 config callback.
> It currently unconditionally calls the set_channel() function,
> whether the device is running or not. This causes a failed
> bus access, if we set some config while the device is down.
> The driver must check if the device is running before setting
> any config on it (usb->initialized?).
> I tried to fix this, but I failed to find the correct condition
> to check for.
Thank you for highlighting this. My MAC address patch introduced a
flag mac->open, which could be useful here. We would need to
store the channel and set it, when the device is opened. One could
ask why the MAC stack is not handling this.
> I'm also wondering why we only set the channel in the config
> callback. Is the rest all unsupported by the device, like
> setting of TX power and so on?
We don't know how to do it; we are missing good documentation
about the hardware registers. The different RFs will also be a
factor.
--
Uli Kunitz
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-23 14:48 zd1211 config operation problem Michael Buesch
2007-09-23 15:47 ` Ulrich Kunitz
@ 2007-09-23 17:48 ` Michael Wu
2007-09-24 16:41 ` Michael Buesch
1 sibling, 1 reply; 11+ messages in thread
From: Michael Wu @ 2007-09-23 17:48 UTC (permalink / raw)
To: Michael Buesch; +Cc: Ulrich Kunitz, Daniel Drake, linux-wireless, John Linville
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
On Sunday 23 September 2007 10:48, Michael Buesch wrote:
> The zd1211 driver has a bug in the ieee80211 config callback.
> It currently unconditionally calls the set_channel() function,
> whether the device is running or not. This causes a failed
> bus access, if we set some config while the device is down.
> The driver must check if the device is running before setting
> any config on it (usb->initialized?).
Hm, that sounds pretty terrible. mac80211 should check if the device was
started before trying to run any configure callbacks.
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-23 17:48 ` Michael Wu
@ 2007-09-24 16:41 ` Michael Buesch
2007-09-24 17:20 ` Johannes Berg
0 siblings, 1 reply; 11+ messages in thread
From: Michael Buesch @ 2007-09-24 16:41 UTC (permalink / raw)
To: Michael Wu; +Cc: Ulrich Kunitz, Daniel Drake, linux-wireless, John Linville
On Sunday 23 September 2007, Michael Wu wrote:
> On Sunday 23 September 2007 10:48, Michael Buesch wrote:
> > The zd1211 driver has a bug in the ieee80211 config callback.
> > It currently unconditionally calls the set_channel() function,
> > whether the device is running or not. This causes a failed
> > bus access, if we set some config while the device is down.
> > The driver must check if the device is running before setting
> > any config on it (usb->initialized?).
> Hm, that sounds pretty terrible. mac80211 should check if the device was
> started before trying to run any configure callbacks.
Something like that?
Subject: mac80211: Check open_count before calling config callback.
Also remove the check for ops->config!=NULL, as it can never be NULL.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-dev/net/mac80211/ieee80211.c
===================================================================
--- wireless-dev.orig/net/mac80211/ieee80211.c 2007-09-24 18:29:54.000000000 +0200
+++ wireless-dev/net/mac80211/ieee80211.c 2007-09-24 18:36:11.000000000 +0200
@@ -722,7 +722,7 @@ int ieee80211_hw_config(struct ieee80211
local->hw.conf.phymode);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
- if (local->ops->config)
+ if (local->open_count)
ret = local->ops->config(local_to_hw(local), &local->hw.conf);
return ret;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 16:41 ` Michael Buesch
@ 2007-09-24 17:20 ` Johannes Berg
2007-09-24 17:21 ` Johannes Berg
2007-09-24 19:20 ` Michael Wu
0 siblings, 2 replies; 11+ messages in thread
From: Johannes Berg @ 2007-09-24 17:20 UTC (permalink / raw)
To: Michael Buesch
Cc: Michael Wu, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 218 bytes --]
On Mon, 2007-09-24 at 18:41 +0200, Michael Buesch wrote:
> - if (local->ops->config)
> + if (local->open_count)
> ret = local->ops->config(local_to_hw(local), &local->hw.conf);
Isn't this racy?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 17:20 ` Johannes Berg
@ 2007-09-24 17:21 ` Johannes Berg
2007-09-24 19:22 ` Michael Wu
2007-09-24 19:58 ` Michael Buesch
2007-09-24 19:20 ` Michael Wu
1 sibling, 2 replies; 11+ messages in thread
From: Johannes Berg @ 2007-09-24 17:21 UTC (permalink / raw)
To: Michael Buesch
Cc: Michael Wu, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
On Mon, 2007-09-24 at 19:20 +0200, Johannes Berg wrote:
> On Mon, 2007-09-24 at 18:41 +0200, Michael Buesch wrote:
>
> > - if (local->ops->config)
> > + if (local->open_count)
> > ret = local->ops->config(local_to_hw(local), &local->hw.conf);
>
> Isn't this racy?
Also, shouldn't we then call ->config when the first interface is
brought up or something?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 17:20 ` Johannes Berg
2007-09-24 17:21 ` Johannes Berg
@ 2007-09-24 19:20 ` Michael Wu
2007-09-24 19:26 ` Johannes Berg
1 sibling, 1 reply; 11+ messages in thread
From: Michael Wu @ 2007-09-24 19:20 UTC (permalink / raw)
To: Johannes Berg
Cc: Michael Buesch, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
On Monday 24 September 2007 13:20, Johannes Berg wrote:
> On Mon, 2007-09-24 at 18:41 +0200, Michael Buesch wrote:
> > - if (local->ops->config)
> > + if (local->open_count)
> > ret = local->ops->config(local_to_hw(local), &local->hw.conf);
> Isn't this racy?
>
Shouldn't be. Some callers are holding rtnl (ieee80211_open,
ieee80211_ioctl*). Other callers (in ieee80211_sta.c) cannot run if the
device is down.
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 17:21 ` Johannes Berg
@ 2007-09-24 19:22 ` Michael Wu
2007-09-24 19:29 ` Johannes Berg
2007-09-24 19:58 ` Michael Buesch
1 sibling, 1 reply; 11+ messages in thread
From: Michael Wu @ 2007-09-24 19:22 UTC (permalink / raw)
To: Johannes Berg
Cc: Michael Buesch, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 291 bytes --]
On Monday 24 September 2007 13:21, Johannes Berg wrote:
> Also, shouldn't we then call ->config when the first interface is
> brought up or something?
>
I'm pretty sure that was done for all cases at some point. When did it get
switched to being done for just monitor?
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 19:20 ` Michael Wu
@ 2007-09-24 19:26 ` Johannes Berg
0 siblings, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2007-09-24 19:26 UTC (permalink / raw)
To: Michael Wu
Cc: Michael Buesch, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
On Mon, 2007-09-24 at 15:20 -0400, Michael Wu wrote:
> On Monday 24 September 2007 13:20, Johannes Berg wrote:
> > On Mon, 2007-09-24 at 18:41 +0200, Michael Buesch wrote:
> > > - if (local->ops->config)
> > > + if (local->open_count)
> > > ret = local->ops->config(local_to_hw(local), &local->hw.conf);
> > Isn't this racy?
> >
> Shouldn't be. Some callers are holding rtnl (ieee80211_open,
> ieee80211_ioctl*). Other callers (in ieee80211_sta.c) cannot run if the
> device is down.
Good point. I guess the patch is fine then.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 19:22 ` Michael Wu
@ 2007-09-24 19:29 ` Johannes Berg
0 siblings, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2007-09-24 19:29 UTC (permalink / raw)
To: Michael Wu
Cc: Michael Buesch, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
On Mon, 2007-09-24 at 15:22 -0400, Michael Wu wrote:
> I'm pretty sure that was done for all cases at some point. When did it get
> switched to being done for just monitor?
Looks like an oversight in the filter flags patch. I'll take a look
tomorrow.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: zd1211 config operation problem
2007-09-24 17:21 ` Johannes Berg
2007-09-24 19:22 ` Michael Wu
@ 2007-09-24 19:58 ` Michael Buesch
1 sibling, 0 replies; 11+ messages in thread
From: Michael Buesch @ 2007-09-24 19:58 UTC (permalink / raw)
To: Johannes Berg
Cc: Michael Wu, Ulrich Kunitz, Daniel Drake, linux-wireless,
John Linville
On Monday 24 September 2007, Johannes Berg wrote:
> On Mon, 2007-09-24 at 19:20 +0200, Johannes Berg wrote:
> > On Mon, 2007-09-24 at 18:41 +0200, Michael Buesch wrote:
> >
> > > - if (local->ops->config)
> > > + if (local->open_count)
> > > ret = local->ops->config(local_to_hw(local), &local->hw.conf);
> >
> > Isn't this racy?
>
> Also, shouldn't we then call ->config when the first interface is
> brought up or something?
I don't know. You are the one who knows the code. ;)
I'm just pointing at problems that I'm not able to fix,
because I don't know the code.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-09-24 19:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-23 14:48 zd1211 config operation problem Michael Buesch
2007-09-23 15:47 ` Ulrich Kunitz
2007-09-23 17:48 ` Michael Wu
2007-09-24 16:41 ` Michael Buesch
2007-09-24 17:20 ` Johannes Berg
2007-09-24 17:21 ` Johannes Berg
2007-09-24 19:22 ` Michael Wu
2007-09-24 19:29 ` Johannes Berg
2007-09-24 19:58 ` Michael Buesch
2007-09-24 19:20 ` Michael Wu
2007-09-24 19:26 ` 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).