Skip to contentSkip to conversation

mac80211: convert to net_device_ops

PATCH In review Stephen Hemminger 4 participants 7 messages Jan 26, 2009 – Jan 30, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: convert to net_device_ops

Convert to new net_device_ops in 2.6.28 and later.

net/mac80211/iface.c +10 -7
@@ -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
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

Quoted 33 lines
net/mac80211/iface.c +10 -7
@@ -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
maintainer
#3 lore raw
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

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

maintainer Acked-by
#4 lore raw
In reply to Johannes Berg
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

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 <[email protected]>
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.

And yes, it's my fault, sorry!

johannes

#5 lore raw
Quoted 15 lines · ext Johannes Berg
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

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 <[email protected]>
Date:   Tue Jan 27 05:29:25 2009 +1100
Quoted 7 lines

mac80211: convert to net_device_ops

Convert to new net_device_ops in 2.6.28 and later.

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

Kalle

#6 lore raw
In reply to Johannes Berg
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Stephen Hemminger

Convert to new net_device_ops in 2.6.28 and later.

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

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.