linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: convert to net_device_ops
@ 2009-01-26 18:29 Stephen Hemminger
  2009-01-26 18:33 ` Johannes Berg
  2009-01-30 11:17 ` Johannes Berg
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Hemminger @ 2009-01-26 18:29 UTC (permalink / raw)
  To: johannes, flamingice; +Cc: linux-wireless

Convert to new net_device_ops in 2.6.28 and later.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/mac80211/iface.c	2009-01-17 12:27:00.000000000 +1100
+++ b/net/mac80211/iface.c	2009-01-25 21:03:03.737986092 +1100
@@ -569,18 +569,21 @@ static void ieee80211_set_multicast_list
 	dev_mc_sync(local->mdev, dev);
 }
 
+static const struct net_device_ops ieee80211_netdev_ops = {
+	.ndo_open		= ieee80211_open,
+	.ndo_stop		= ieee80211_stop,
+	.ndo_start_xmit		= ieee80211_subif_start_xmit,
+	.ndo_set_multicast_list = ieee80211_set_multicast_list,
+	.ndo_change_mtu 	= ieee80211_change_mtu,
+	.ndo_set_mac_address 	= eth_mac_addr,
+};
+
 static void ieee80211_if_setup(struct net_device *dev)
 {
 	ether_setup(dev);
-	dev->hard_start_xmit = ieee80211_subif_start_xmit;
+	dev->netdev_ops = &ieee80211_netdev_ops;
 	dev->wireless_handlers = &ieee80211_iw_handler_def;
-	dev->set_multicast_list = ieee80211_set_multicast_list;
-	dev->change_mtu = ieee80211_change_mtu;
-	dev->open = ieee80211_open;
-	dev->stop = ieee80211_stop;
 	dev->destructor = free_netdev;
-	/* we will validate the address ourselves in ->open */
-	dev->validate_addr = NULL;
 }
 /*
  * Called when the netdev is removed or, by the code below, before

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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-26 18:29 [PATCH] mac80211: convert to net_device_ops Stephen Hemminger
@ 2009-01-26 18:33 ` Johannes Berg
  2009-01-30 11:17 ` Johannes Berg
  1 sibling, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-01-26 18:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: flamingice, linux-wireless

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

On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
> Convert to new net_device_ops in 2.6.28 and later.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

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

> 
> --- a/net/mac80211/iface.c	2009-01-17 12:27:00.000000000 +1100
> +++ b/net/mac80211/iface.c	2009-01-25 21:03:03.737986092 +1100
> @@ -569,18 +569,21 @@ static void ieee80211_set_multicast_list
>  	dev_mc_sync(local->mdev, dev);
>  }
>  
> +static const struct net_device_ops ieee80211_netdev_ops = {
> +	.ndo_open		= ieee80211_open,
> +	.ndo_stop		= ieee80211_stop,
> +	.ndo_start_xmit		= ieee80211_subif_start_xmit,
> +	.ndo_set_multicast_list = ieee80211_set_multicast_list,
> +	.ndo_change_mtu 	= ieee80211_change_mtu,
> +	.ndo_set_mac_address 	= eth_mac_addr,
> +};
> +
>  static void ieee80211_if_setup(struct net_device *dev)
>  {
>  	ether_setup(dev);
> -	dev->hard_start_xmit = ieee80211_subif_start_xmit;
> +	dev->netdev_ops = &ieee80211_netdev_ops;
>  	dev->wireless_handlers = &ieee80211_iw_handler_def;
> -	dev->set_multicast_list = ieee80211_set_multicast_list;
> -	dev->change_mtu = ieee80211_change_mtu;
> -	dev->open = ieee80211_open;
> -	dev->stop = ieee80211_stop;
>  	dev->destructor = free_netdev;
> -	/* we will validate the address ourselves in ->open */
> -	dev->validate_addr = NULL;
>  }
>  /*
>   * Called when the netdev is removed or, by the code below, before
> 

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

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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-26 18:29 [PATCH] mac80211: convert to net_device_ops Stephen Hemminger
  2009-01-26 18:33 ` Johannes Berg
@ 2009-01-30 11:17 ` Johannes Berg
  2009-01-30 11:27   ` Johannes Berg
                     ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Johannes Berg @ 2009-01-30 11:17 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: linux-wireless, Kalle Valo

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

On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
> Convert to new net_device_ops in 2.6.28 and later.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

John, please revert this commit for now, it's breaking monitor mode
injection (and thus AP mode) because the xmit handler assignment in
ieee80211_setup_sdata is not effective.

johannes

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

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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-30 11:17 ` Johannes Berg
@ 2009-01-30 11:27   ` Johannes Berg
  2009-01-30 11:27   ` Johannes Berg
  2009-01-30 18:36   ` John W. Linville
  2 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-01-30 11:27 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: linux-wireless, Kalle Valo

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

On Fri, 2009-01-30 at 12:17 +0100, Johannes Berg wrote:
> On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
> > Convert to new net_device_ops in 2.6.28 and later.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> John, please revert this commit for now, it's breaking monitor mode
> injection (and thus AP mode) because the xmit handler assignment in
> ieee80211_setup_sdata is not effective.

This also broke calling our uninit function so we have memory and
debugfs file leaks.

johannes

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

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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-30 11:17 ` Johannes Berg
  2009-01-30 11:27   ` Johannes Berg
@ 2009-01-30 11:27   ` Johannes Berg
  2009-01-30 11:43     ` Kalle Valo
  2009-01-30 18:36   ` John W. Linville
  2 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2009-01-30 11:27 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: linux-wireless, Kalle Valo

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

On Fri, 2009-01-30 at 12:17 +0100, Johannes Berg wrote:
> On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
> > Convert to new net_device_ops in 2.6.28 and later.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> John, please revert this commit for now, it's breaking monitor mode
> injection (and thus AP mode) because the xmit handler assignment in
> ieee80211_setup_sdata is not effective.

Oh, for reference:

commit e22cab741afdd1e9857ea9fe51e28a6fe3c97b90
Author: Stephen Hemminger <shemminger@vyatta.com>
Date:   Tue Jan 27 05:29:25 2009 +1100

    mac80211: convert to net_device_ops
    
    Convert to new net_device_ops in 2.6.28 and later.
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Acked-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

And yes, it's my fault, sorry!

johannes

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

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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-30 11:27   ` Johannes Berg
@ 2009-01-30 11:43     ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2009-01-30 11:43 UTC (permalink / raw)
  To: ext Johannes Berg; +Cc: Stephen Hemminger, linux-wireless@vger.kernel.org

ext Johannes Berg wrote:
> On Fri, 2009-01-30 at 12:17 +0100, Johannes Berg wrote:
>> On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
>>> Convert to new net_device_ops in 2.6.28 and later.
>>>
>>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>> John, please revert this commit for now, it's breaking monitor mode
>> injection (and thus AP mode) because the xmit handler assignment in
>> ieee80211_setup_sdata is not effective.
> 
> Oh, for reference:
> 
> commit e22cab741afdd1e9857ea9fe51e28a6fe3c97b90
> Author: Stephen Hemminger <shemminger@vyatta.com>
> Date:   Tue Jan 27 05:29:25 2009 +1100
> 
>     mac80211: convert to net_device_ops
>     
>     Convert to new net_device_ops in 2.6.28 and later.
>     
>     Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>     Acked-by: Johannes Berg <johannes@sipsolutions.net>
>     Signed-off-by: John W. Linville <linville@tuxdriver.com>

Yes, I can confirm that reverting this commit solves the hostapd 
problems I have been seeing.

Kalle


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

* [PATCH] mac80211: convert to net_device_ops
@ 2009-01-30 12:35 Johannes Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-01-30 12:35 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Fixed version of the original patch.

 net/mac80211/iface.c |   47 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 17 deletions(-)

--- wireless-testing.orig/net/mac80211/iface.c	2009-01-30 13:10:16.000000000 +0100
+++ wireless-testing/net/mac80211/iface.c	2009-01-30 13:10:18.000000000 +0100
@@ -591,19 +591,6 @@ static void ieee80211_set_multicast_list
 	dev_mc_sync(local->mdev, dev);
 }
 
-static void ieee80211_if_setup(struct net_device *dev)
-{
-	ether_setup(dev);
-	dev->hard_start_xmit = ieee80211_subif_start_xmit;
-	dev->wireless_handlers = &ieee80211_iw_handler_def;
-	dev->set_multicast_list = ieee80211_set_multicast_list;
-	dev->change_mtu = ieee80211_change_mtu;
-	dev->open = ieee80211_open;
-	dev->stop = ieee80211_stop;
-	dev->destructor = free_netdev;
-	/* we will validate the address ourselves in ->open */
-	dev->validate_addr = NULL;
-}
 /*
  * Called when the netdev is removed or, by the code below, before
  * the interface type changes.
@@ -671,6 +658,34 @@ static void ieee80211_teardown_sdata(str
 	WARN_ON(flushed);
 }
 
+static const struct net_device_ops ieee80211_dataif_ops = {
+	.ndo_open		= ieee80211_open,
+	.ndo_stop		= ieee80211_stop,
+	.ndo_uninit		= ieee80211_teardown_sdata,
+	.ndo_start_xmit		= ieee80211_subif_start_xmit,
+	.ndo_set_multicast_list = ieee80211_set_multicast_list,
+	.ndo_change_mtu 	= ieee80211_change_mtu,
+	.ndo_set_mac_address 	= eth_mac_addr,
+};
+
+static const struct net_device_ops ieee80211_monitorif_ops = {
+	.ndo_open		= ieee80211_open,
+	.ndo_stop		= ieee80211_stop,
+	.ndo_uninit		= ieee80211_teardown_sdata,
+	.ndo_start_xmit		= ieee80211_monitor_start_xmit,
+	.ndo_set_multicast_list = ieee80211_set_multicast_list,
+	.ndo_change_mtu 	= ieee80211_change_mtu,
+	.ndo_set_mac_address 	= eth_mac_addr,
+};
+
+static void ieee80211_if_setup(struct net_device *dev)
+{
+	ether_setup(dev);
+	dev->netdev_ops = &ieee80211_dataif_ops;
+	dev->wireless_handlers = &ieee80211_iw_handler_def;
+	dev->destructor = free_netdev;
+}
+
 /*
  * Helper function to initialise an interface to a specific type.
  */
@@ -682,7 +697,7 @@ static void ieee80211_setup_sdata(struct
 
 	/* and set some type-dependent values */
 	sdata->vif.type = type;
-	sdata->dev->hard_start_xmit = ieee80211_subif_start_xmit;
+	sdata->dev->netdev_ops = &ieee80211_dataif_ops;
 	sdata->wdev.iftype = type;
 
 	/* only monitor differs */
@@ -703,7 +718,7 @@ static void ieee80211_setup_sdata(struct
 		break;
 	case NL80211_IFTYPE_MONITOR:
 		sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP;
-		sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit;
+		sdata->dev->netdev_ops = &ieee80211_monitorif_ops;
 		sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
 				      MONITOR_FLAG_OTHER_BSS;
 		break;
@@ -809,8 +824,6 @@ int ieee80211_if_add(struct ieee80211_lo
 	if (ret)
 		goto fail;
 
-	ndev->uninit = ieee80211_teardown_sdata;
-
 	if (ieee80211_vif_is_mesh(&sdata->vif) &&
 	    params && params->mesh_id_len)
 		ieee80211_sdata_set_mesh_id(sdata,



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

* Re: [PATCH] mac80211: convert to net_device_ops
  2009-01-30 11:17 ` Johannes Berg
  2009-01-30 11:27   ` Johannes Berg
  2009-01-30 11:27   ` Johannes Berg
@ 2009-01-30 18:36   ` John W. Linville
  2 siblings, 0 replies; 8+ messages in thread
From: John W. Linville @ 2009-01-30 18:36 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Stephen Hemminger, linux-wireless, Kalle Valo

On Fri, Jan 30, 2009 at 12:17:37PM +0100, Johannes Berg wrote:
> On Tue, 2009-01-27 at 05:29 +1100, Stephen Hemminger wrote:
> > Convert to new net_device_ops in 2.6.28 and later.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> John, please revert this commit for now, it's breaking monitor mode
> injection (and thus AP mode) because the xmit handler assignment in
> ieee80211_setup_sdata is not effective.

Ok, done.  I reverted the hostap one as well, as I think it is
incomplete and could use more review.

Thanks,

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

end of thread, other threads:[~2009-01-30 18:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 18:29 [PATCH] mac80211: convert to net_device_ops Stephen Hemminger
2009-01-26 18:33 ` Johannes Berg
2009-01-30 11:17 ` Johannes Berg
2009-01-30 11:27   ` Johannes Berg
2009-01-30 11:27   ` Johannes Berg
2009-01-30 11:43     ` Kalle Valo
2009-01-30 18:36   ` John W. Linville
  -- strict thread matches above, loose matches on Subject: below --
2009-01-30 12:35 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).