Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread John W. Linville
On Thu, Oct 04, 2007 at 02:31:26PM -0700, Roland Dreier wrote: > > Programming with assertions (and BUG_ON is a form of that) is > > generally a good practice. Almost any book or other source on > The problem with BUG_ON is that it kills the whole system. So every > time you add a BUG_ON into

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Roland Dreier
> Programming with assertions (and BUG_ON is a form of that) is > generally a good practice. Almost any book or other source on > good programming practices will agree. Yes, it can be overdone. > But I don't really think that is the case here, since the check is > relatively inexpensive and

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Wu
On Thursday 04 October 2007 14:15, John W. Linville wrote: > Falling back on bloat as an argument against a BUG_ON in a > configuration path seems a bit weak. :-) > Seems strong to me. Bloat slows me down and distracts me from what code really needs to do. Bloat is an indication that one does not

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread John W. Linville
On Thu, Oct 04, 2007 at 01:11:33PM -0400, Michael Wu wrote: > On Thursday 04 October 2007 11:19, John W. Linville wrote: > > > The reason why BUG_ON exists is to catch bugs that happen, although > > > they Should Never Happen (tm) ;) > > > > Precisely. > No really, this bug will never happen. This

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread John W. Linville
On Thu, Oct 04, 2007 at 12:33:43PM +0100, Daniel Drake wrote: > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. It > will then be reinitialised to the default (ieee80211_subif_start_xmit) in > ieee80211_if_set_type. I think I'd rather fix this by making the check in ieee

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Johannes Berg
On Thu, 2007-10-04 at 10:34 -0400, Michael Wu wrote: > On Thursday 04 October 2007 07:33, Daniel Drake wrote: > > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. > > It will then be reinitialised to the default (ieee80211_subif_start_xmit) > > in ieee80211_if_set_type. > >

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Wu
On Thursday 04 October 2007 11:19, John W. Linville wrote: > > The reason why BUG_ON exists is to catch bugs that happen, although > > they Should Never Happen (tm) ;) > > Precisely. No really, this bug will never happen. This is function is merely a helper function which is called from interface

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Wu
On Thursday 04 October 2007 11:54, Stephen Hemminger wrote: > Playing with the function pointer is a awkward way to do this. Shouldn't > the state management flags be used instead (dormant, running, stop/wake)... > I am concerned about races and dereferencing the NULL ptr. This is all under RTNL a

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Stephen Hemminger
On Thu, 4 Oct 2007 12:33:43 +0100 (BST) Daniel Drake <[EMAIL PROTECTED]> wrote: > This sequence of events causes loss of connectivity: > > > > ifconfig eth7 down > iwconfig eth7 mode monitor > ifconfig eth7 up > ifconfig eth7 down > iwconfig eth7 mode managed > > > At this point you are asso

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread John W. Linville
On Thu, Oct 04, 2007 at 05:06:05PM +0200, Michael Buesch wrote: > On Thursday 04 October 2007 16:34:43 Michael Wu wrote: > > On Thursday 04 October 2007 07:33, Daniel Drake wrote: > > > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. > > > It will then be reinitialised to

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Wu
On Thursday 04 October 2007 11:06, Michael Buesch wrote: > The reason why BUG_ON exists is to catch bugs that happen, although > they Should Never Happen (tm) ;) This is just paranoia. There's plenty of other BUG_ONs which we use to catch bugs caused by drivers doing silly things. We can verify th

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Buesch
On Thursday 04 October 2007 16:34:43 Michael Wu wrote: > On Thursday 04 October 2007 07:33, Daniel Drake wrote: > > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. > > It will then be reinitialised to the default (ieee80211_subif_start_xmit) > > in ieee80211_if_set_type. >

Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Michael Wu
On Thursday 04 October 2007 07:33, Daniel Drake wrote: > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. > It will then be reinitialised to the default (ieee80211_subif_start_xmit) > in ieee80211_if_set_type. > Well.. this kinda sucks, but we can clean up the logic here la

[PATCH] mac80211: Fix TX after monitor interface is converted to managed

2007-10-04 Thread Daniel Drake
This sequence of events causes loss of connectivity: ifconfig eth7 down iwconfig eth7 mode monitor ifconfig eth7 up ifconfig eth7 down iwconfig eth7 mode managed At this point you are associated but TX does not work. This is because the eth7 hard_start_xmit is still ieee80211_monitor_start_xmi