Problem description by Daniel Drake <[email protected]>:
"This sequence of events causes loss of connectivity:
<plug in>
<associate as normal in managed mode>
ifconfig eth7 down
iwconfig eth7 mode monitor
ifconfig eth7 up
ifconfig eth7 down
iwconfig eth7 mode managed
<associate as normal>
At this point you are associated but TX does not work. This is because
the eth7 hard_start_xmit is still ieee80211_monitor_start_xmit."
The problem is caused by ieee80211_if_set_type checking for a non-zero
hard_start_xmit pointer value in order to avoid changing that value for
master devices. The fix is to make that check more explicitly linked to
master devices rather than simply checking if the value has been
previously set.
CC: Daniel Drake <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
net/mac80211/ieee80211_iface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/ieee80211_iface.c b/net/mac80211/ieee80211_iface.c
index be7e77f..6607b80 100644
--- a/net/mac80211/ieee80211_iface.c
+++ b/net/mac80211/ieee80211_iface.c
@@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
* which already has a hard_start_xmit routine assigned
* which must not be changed.
*/
- if (!dev->hard_start_xmit)
+ if (dev->type != ARPHRD_IEEE80211)
dev->hard_start_xmit = ieee80211_subif_start_xmit;
/*
--
1.5.2.4
--
John W. Linville
[email protected]
On Thu, 2007-10-04 at 15:13 -0400, John W. Linville wrote:
> > That should work as well although I think you should update the comment
> > above :)
>
> The comment still seem applicable. How would you word it?
Whoops, you're right, I misremembered explaining the use of the pointer.
johannes
On Thursday 04 October 2007 14:09, John W. Linville wrote:
> diff --git a/net/mac80211/ieee80211_iface.c
> b/net/mac80211/ieee80211_iface.c index be7e77f..6607b80 100644
> --- a/net/mac80211/ieee80211_iface.c
> +++ b/net/mac80211/ieee80211_iface.c
> @@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int
> type) * which already has a hard_start_xmit routine assigned
> * which must not be changed.
> */
> - if (!dev->hard_start_xmit)
> + if (dev->type != ARPHRD_IEEE80211)
The standard way of checking for the master device is
dev == sdata->local->mdev
wme.c doesn't quite follow this but that code needs to die anyway.
This does look nicer than the other patch.
-Michael Wu
On Thu, 2007-10-04 at 14:09 -0400, John W. Linville wrote:
> --- a/net/mac80211/ieee80211_iface.c
> +++ b/net/mac80211/ieee80211_iface.c
> @@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
> * which already has a hard_start_xmit routine assigned
> * which must not be changed.
> */
> - if (!dev->hard_start_xmit)
> + if (dev->type != ARPHRD_IEEE80211)
> dev->hard_start_xmit = ieee80211_subif_start_xmit;
That should work as well although I think you should update the comment
above :)
johannes
On Thu, Oct 04, 2007 at 08:44:48PM +0200, Johannes Berg wrote:
> On Thu, 2007-10-04 at 14:09 -0400, John W. Linville wrote:
>
> > --- a/net/mac80211/ieee80211_iface.c
> > +++ b/net/mac80211/ieee80211_iface.c
> > @@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
> > * which already has a hard_start_xmit routine assigned
> > * which must not be changed.
> > */
> > - if (!dev->hard_start_xmit)
> > + if (dev->type != ARPHRD_IEEE80211)
> > dev->hard_start_xmit = ieee80211_subif_start_xmit;
>
> That should work as well although I think you should update the comment
> above :)
The comment still seem applicable. How would you word it?
--
John W. Linville
[email protected]
On Thu, Oct 04, 2007 at 05:26:11PM -0400, Michael Wu wrote:
> On Thursday 04 October 2007 14:09, John W. Linville wrote:
> > diff --git a/net/mac80211/ieee80211_iface.c
> > b/net/mac80211/ieee80211_iface.c index be7e77f..6607b80 100644
> > --- a/net/mac80211/ieee80211_iface.c
> > +++ b/net/mac80211/ieee80211_iface.c
> > @@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int
> > type) * which already has a hard_start_xmit routine assigned
> > * which must not be changed.
> > */
> > - if (!dev->hard_start_xmit)
> > + if (dev->type != ARPHRD_IEEE80211)
> The standard way of checking for the master device is
> dev == sdata->local->mdev
>
> wme.c doesn't quite follow this but that code needs to die anyway.
>
> This does look nicer than the other patch.
Alright...better?
---
From: John W. Linville <[email protected]>
Subject: [PATCH] ieee80211_if_set_type: make check for master dev more explicit
Problem description by Daniel Drake <[email protected]>:
"This sequence of events causes loss of connectivity:
<plug in>
<associate as normal in managed mode>
ifconfig eth7 down
iwconfig eth7 mode monitor
ifconfig eth7 up
ifconfig eth7 down
iwconfig eth7 mode managed
<associate as normal>
At this point you are associated but TX does not work. This is because
the eth7 hard_start_xmit is still ieee80211_monitor_start_xmit."
The problem is caused by ieee80211_if_set_type checking for a non-zero
hard_start_xmit pointer value in order to avoid changing that value for
master devices. The fix is to make that check more explicitly linked to
master devices rather than simply checking if the value has been
previously set.
CC: Daniel Drake <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
---
net/mac80211/ieee80211_iface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/ieee80211_iface.c b/net/mac80211/ieee80211_iface.c
index be7e77f..43e505d 100644
--- a/net/mac80211/ieee80211_iface.c
+++ b/net/mac80211/ieee80211_iface.c
@@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
* which already has a hard_start_xmit routine assigned
* which must not be changed.
*/
- if (!dev->hard_start_xmit)
+ if (dev != sdata->local->mdev)
dev->hard_start_xmit = ieee80211_subif_start_xmit;
/*
--
1.5.2.4
--
John W. Linville
[email protected]
On Thursday 04 October 2007 19:02, John W. Linville wrote:
> Alright...better?
>
Yup, thanks.
> The problem is caused by ieee80211_if_set_type checking for a non-zero
> hard_start_xmit pointer value in order to avoid changing that value for
> master devices. The fix is to make that check more explicitly linked to
> master devices rather than simply checking if the value has been
> previously set.
>
> CC: Daniel Drake <[email protected]>
> Signed-off-by: John W. Linville <[email protected]>
Acked-by: Michael Wu <[email protected]>
-Michael Wu