2 This patch backports the struct net_device_ops changes added
3 on 2.6.29. It also backports the namespace changes added
4 through net/wireless/wext.c. Note that there is another
5 patch file which also addresses netns changes, we leave
6 them separate as there is no easy way to split the stuff
7 without creating a headache on maintenance of the pathes.
9 --- a/drivers/net/usb/rndis_host.c
10 +++ b/drivers/net/usb/rndis_host.c
11 @@ -274,6 +274,7 @@ response_error:
15 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
16 /* same as usbnet_netdev_ops but MTU change not allowed */
17 static const struct net_device_ops rndis_netdev_ops = {
18 .ndo_open = usbnet_open,
19 @@ -283,6 +284,7 @@ static const struct net_device_ops rndis
20 .ndo_set_mac_address = eth_mac_addr,
21 .ndo_validate_addr = eth_validate_addr,
26 generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
27 @@ -345,7 +347,11 @@ generic_rndis_bind(struct usbnet *dev, s
28 dev->rx_urb_size &= ~(dev->maxpacket - 1);
29 u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
32 net->netdev_ops = &rndis_netdev_ops;
34 + net->change_mtu = NULL;
37 retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
38 if (unlikely(retval < 0)) {
39 --- a/drivers/net/usb/usbnet.c
40 +++ b/drivers/net/usb/usbnet.c
41 @@ -1236,6 +1236,7 @@ void usbnet_disconnect (struct usb_inter
43 EXPORT_SYMBOL_GPL(usbnet_disconnect);
45 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
46 static const struct net_device_ops usbnet_netdev_ops = {
47 .ndo_open = usbnet_open,
48 .ndo_stop = usbnet_stop,
49 @@ -1245,6 +1246,7 @@ static const struct net_device_ops usbne
50 .ndo_set_mac_address = eth_mac_addr,
51 .ndo_validate_addr = eth_validate_addr,
55 /*-------------------------------------------------------------------------*/
57 @@ -1324,7 +1326,15 @@ usbnet_probe (struct usb_interface *udev
58 net->features |= NETIF_F_HIGHDMA;
61 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
62 net->netdev_ops = &usbnet_netdev_ops;
64 + net->change_mtu = usbnet_change_mtu;
65 + net->hard_start_xmit = usbnet_start_xmit;
66 + net->open = usbnet_open;
67 + net->stop = usbnet_stop;
68 + net->tx_timeout = usbnet_tx_timeout;
70 net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
71 net->ethtool_ops = &usbnet_ethtool_ops;
73 --- a/drivers/net/wireless/rndis_wlan.c
74 +++ b/drivers/net/wireless/rndis_wlan.c
75 @@ -2703,6 +2703,7 @@ static int bcm4320b_early_init(struct us
79 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
80 /* same as rndis_netdev_ops but with local multicast handler */
81 static const struct net_device_ops rndis_wlan_netdev_ops = {
82 .ndo_open = usbnet_open,
83 @@ -2713,6 +2714,7 @@ static const struct net_device_ops rndis
84 .ndo_validate_addr = eth_validate_addr,
85 .ndo_set_multicast_list = rndis_wlan_set_multicast_list,
89 static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
91 @@ -2760,7 +2762,11 @@ static int rndis_wlan_bind(struct usbnet
92 * rndis_host wants to avoid all OID as much as possible
93 * so do promisc/multicast handling in rndis_wlan.
95 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
96 usbdev->net->netdev_ops = &rndis_wlan_netdev_ops;
98 + usbdev->net->set_multicast_list = rndis_wlan_set_multicast_list;
101 tmp = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST;
102 retval = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &tmp,
103 --- a/net/mac80211/iface.c
104 +++ b/net/mac80211/iface.c
105 @@ -666,6 +666,7 @@ static u16 ieee80211_netdev_select_queue
106 return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
109 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
110 static const struct net_device_ops ieee80211_dataif_ops = {
111 .ndo_open = ieee80211_open,
112 .ndo_stop = ieee80211_stop,
113 @@ -676,6 +677,7 @@ static const struct net_device_ops ieee8
114 .ndo_set_mac_address = ieee80211_change_mac,
115 .ndo_select_queue = ieee80211_netdev_select_queue,
119 static u16 ieee80211_monitor_select_queue(struct net_device *dev,
121 @@ -710,6 +712,7 @@ static u16 ieee80211_monitor_select_queu
122 return ieee80211_downgrade_queue(local, skb);
125 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
126 static const struct net_device_ops ieee80211_monitorif_ops = {
127 .ndo_open = ieee80211_open,
128 .ndo_stop = ieee80211_stop,
129 @@ -720,14 +723,28 @@ static const struct net_device_ops ieee8
130 .ndo_set_mac_address = eth_mac_addr,
131 .ndo_select_queue = ieee80211_monitor_select_queue,
135 static void ieee80211_if_setup(struct net_device *dev)
138 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
139 dev->netdev_ops = &ieee80211_dataif_ops;
141 + dev->hard_start_xmit = ieee80211_subif_start_xmit;
142 + dev->set_multicast_list = ieee80211_set_multicast_list;
143 + dev->change_mtu = ieee80211_change_mtu;
144 + dev->set_mac_address = ieee80211_change_mac;
145 + dev->select_queue = ieee80211_netdev_select_queue;
146 + dev->open = ieee80211_open;
147 + dev->stop = ieee80211_stop;
148 + /* we will validate the address ourselves in ->open */
149 + dev->validate_addr = NULL;
151 dev->destructor = free_netdev;
156 * Helper function to initialise an interface to a specific type.
158 @@ -739,7 +756,11 @@ static void ieee80211_setup_sdata(struct
160 /* and set some type-dependent values */
161 sdata->vif.type = type;
162 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
163 sdata->dev->netdev_ops = &ieee80211_dataif_ops;
165 + sdata->dev->hard_start_xmit = ieee80211_subif_start_xmit;
167 sdata->wdev.iftype = type;
169 /* only monitor differs */
170 @@ -762,7 +783,13 @@ static void ieee80211_setup_sdata(struct
172 case NL80211_IFTYPE_MONITOR:
173 sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP;
174 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
175 sdata->dev->netdev_ops = &ieee80211_monitorif_ops;
177 + sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit;
178 + sdata->dev->select_queue = ieee80211_monitor_select_queue;
179 + sdata->dev->set_mac_address = eth_mac_addr;
181 sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
182 MONITOR_FLAG_OTHER_BSS;
184 @@ -831,6 +858,8 @@ int ieee80211_if_add(struct ieee80211_lo
186 dev_net_set(ndev, wiphy_net(local->hw.wiphy));
188 +/* This is an optimization, just ignore for older kernels */
189 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
190 ndev->needed_headroom = local->tx_headroom +
191 4*6 /* four MAC addresses */
192 + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
193 @@ -839,6 +868,7 @@ int ieee80211_if_add(struct ieee80211_lo
194 - ETH_HLEN /* ethernet hard_header_len */
195 + IEEE80211_ENCRYPT_HEADROOM;
196 ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
199 ret = dev_alloc_name(ndev, ndev->name);
201 @@ -884,6 +914,10 @@ int ieee80211_if_add(struct ieee80211_lo
205 +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28))
206 + ndev->uninit = ieee80211_teardown_sdata;
209 if (ieee80211_vif_is_mesh(&sdata->vif) &&
210 params && params->mesh_id_len)
211 ieee80211_sdata_set_mesh_id(sdata,
212 --- a/drivers/net/b44.c
213 +++ b/drivers/net/b44.c
214 @@ -2109,6 +2109,7 @@ static int __devinit b44_get_invariants(
218 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
219 static const struct net_device_ops b44_netdev_ops = {
220 .ndo_open = b44_open,
221 .ndo_stop = b44_close,
222 @@ -2124,6 +2125,7 @@ static const struct net_device_ops b44_n
223 .ndo_poll_controller = b44_poll_controller,
228 static int __devinit b44_init_one(struct ssb_device *sdev,
229 const struct ssb_device_id *ent)
230 @@ -2163,9 +2165,26 @@ static int __devinit b44_init_one(struct
231 bp->rx_pending = B44_DEF_RX_RING_PENDING;
232 bp->tx_pending = B44_DEF_TX_RING_PENDING;
234 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
235 + dev->open = b44_open;
236 + dev->stop = b44_close;
237 + dev->hard_start_xmit = b44_start_xmit;
238 + dev->get_stats = b44_get_stats;
239 + dev->set_multicast_list = b44_set_rx_mode;
240 + dev->set_mac_address = b44_set_mac_addr;
241 + dev->do_ioctl = b44_ioctl;
242 + dev->tx_timeout = b44_tx_timeout;
243 + netif_napi_add(dev, &bp->napi, b44_poll, 64);
244 + dev->watchdog_timeo = B44_TX_TIMEOUT;
245 +#ifdef CONFIG_NET_POLL_CONTROLLER
246 + dev->poll_controller = b44_poll_controller;
248 + dev->change_mtu = b44_change_mtu;
250 dev->netdev_ops = &b44_netdev_ops;
251 netif_napi_add(dev, &bp->napi, b44_poll, 64);
252 dev->watchdog_timeo = B44_TX_TIMEOUT;
254 dev->irq = sdev->irq;
255 SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
257 --- a/net/wireless/wext-core.c
258 +++ b/net/wireless/wext-core.c
259 @@ -340,6 +340,7 @@ static const int compat_event_type_size[
263 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
264 static int __net_init wext_pernet_init(struct net *net)
266 skb_queue_head_init(&net->wext_nlevents);
267 @@ -382,6 +383,29 @@ static void wireless_nlevent_process(str
269 static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);
272 +/* Older kernels get the old way of doing stuff*/
273 +static struct sk_buff_head wireless_nlevent_queue;
275 +static int __init wireless_nlevent_init(void)
277 + skb_queue_head_init(&wireless_nlevent_queue);
281 +subsys_initcall(wireless_nlevent_init);
283 +static void wireless_nlevent_process(unsigned long data)
285 + struct sk_buff *skb;
286 + while ((skb = skb_dequeue(&wireless_nlevent_queue)))
287 + rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
290 +static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0);
294 static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev,
297 @@ -592,8 +616,13 @@ void wireless_send_event(struct net_devi
299 skb_shinfo(skb)->frag_list = compskb;
301 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
302 skb_queue_tail(&dev_net(dev)->wext_nlevents, skb);
303 schedule_work(&wireless_nlevent_work);
305 + skb_queue_tail(&wireless_nlevent_queue, skb);
306 + tasklet_schedule(&wireless_nlevent_tasklet);
309 EXPORT_SYMBOL(wireless_send_event);
311 @@ -902,8 +931,13 @@ static int wireless_process_ioctl(struct
312 return private(dev, iwr, cmd, info, handler);
314 /* Old driver API : call driver ioctl handler */
315 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
316 if (dev->netdev_ops->ndo_do_ioctl)
317 return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
320 + return dev->do_ioctl(dev, ifr, cmd);
325 --- a/drivers/net/wireless/ipw2x00/ipw2100.c
326 +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
327 @@ -6091,6 +6091,7 @@ static void ipw2100_rf_kill(struct work_
329 static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
331 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
332 static const struct net_device_ops ipw2100_netdev_ops = {
333 .ndo_open = ipw2100_open,
334 .ndo_stop = ipw2100_close,
335 @@ -6101,6 +6102,7 @@ static const struct net_device_ops ipw21
336 .ndo_set_mac_address = ipw2100_set_address,
337 .ndo_validate_addr = eth_validate_addr,
341 /* Look into using netdev destructor to shutdown ieee80211? */
343 @@ -6126,7 +6128,16 @@ static struct net_device *ipw2100_alloc_
344 priv->ieee->perfect_rssi = -20;
345 priv->ieee->worst_rssi = -85;
347 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
348 dev->netdev_ops = &ipw2100_netdev_ops;
350 + dev->open = ipw2100_open;
351 + dev->stop = ipw2100_close;
352 + dev->init = ipw2100_net_init;
353 + dev->tx_timeout = ipw2100_tx_timeout;
354 + dev->set_mac_address = ipw2100_set_address;
357 dev->ethtool_ops = &ipw2100_ethtool_ops;
358 dev->wireless_handlers = &ipw2100_wx_handler_def;
359 priv->wireless_data.libipw = priv->ieee;
360 --- a/drivers/net/wireless/ipw2x00/ipw2200.c
361 +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
362 @@ -11635,6 +11635,7 @@ static netdev_tx_t ipw_prom_hard_start_x
366 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
367 static const struct net_device_ops ipw_prom_netdev_ops = {
368 .ndo_open = ipw_prom_open,
369 .ndo_stop = ipw_prom_stop,
370 @@ -11643,6 +11644,7 @@ static const struct net_device_ops ipw_p
371 .ndo_set_mac_address = eth_mac_addr,
372 .ndo_validate_addr = eth_validate_addr,
376 static int ipw_prom_alloc(struct ipw_priv *priv)
378 @@ -11663,7 +11665,13 @@ static int ipw_prom_alloc(struct ipw_pri
379 memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN);
381 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
382 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
383 priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops;
385 + priv->prom_net_dev->open = ipw_prom_open;
386 + priv->prom_net_dev->stop = ipw_prom_stop;
387 + priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit;
390 priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR;
391 SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev);
392 @@ -11691,6 +11699,7 @@ static void ipw_prom_free(struct ipw_pri
396 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
397 static const struct net_device_ops ipw_netdev_ops = {
398 .ndo_init = ipw_net_init,
399 .ndo_open = ipw_net_open,
400 @@ -11701,6 +11710,7 @@ static const struct net_device_ops ipw_n
401 .ndo_change_mtu = libipw_change_mtu,
402 .ndo_validate_addr = eth_validate_addr,
406 static int __devinit ipw_pci_probe(struct pci_dev *pdev,
407 const struct pci_device_id *ent)
408 @@ -11802,7 +11812,15 @@ static int __devinit ipw_pci_probe(struc
409 priv->ieee->perfect_rssi = -20;
410 priv->ieee->worst_rssi = -85;
412 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
413 net_dev->netdev_ops = &ipw_netdev_ops;
415 + net_dev->open = ipw_net_open;
416 + net_dev->stop = ipw_net_stop;
417 + net_dev->init = ipw_net_init;
418 + net_dev->set_multicast_list = ipw_net_set_multicast_list;
419 + net_dev->set_mac_address = ipw_net_set_mac_address;
421 priv->wireless_data.spy_data = &priv->ieee->spy_data;
422 net_dev->wireless_data = &priv->wireless_data;
423 net_dev->wireless_handlers = &ipw_wx_handler_def;
424 --- a/drivers/net/wireless/ipw2x00/libipw_module.c
425 +++ b/drivers/net/wireless/ipw2x00/libipw_module.c
426 @@ -157,6 +157,10 @@ struct net_device *alloc_ieee80211(int s
429 ieee = netdev_priv(dev);
430 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
431 + dev->hard_start_xmit = libipw_xmit;
432 + dev->change_mtu = libipw_change_mtu;
437 --- a/drivers/net/wireless/libertas/main.c
438 +++ b/drivers/net/wireless/libertas/main.c
439 @@ -881,6 +881,7 @@ static void lbs_free_adapter(struct lbs_
440 lbs_deb_leave(LBS_DEB_MAIN);
443 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
444 static const struct net_device_ops lbs_netdev_ops = {
445 .ndo_open = lbs_dev_open,
446 .ndo_stop = lbs_eth_stop,
447 @@ -891,6 +892,7 @@ static const struct net_device_ops lbs_n
448 .ndo_change_mtu = eth_change_mtu,
449 .ndo_validate_addr = eth_validate_addr,
454 * @brief This function adds the card. it will probe the
455 @@ -936,7 +938,16 @@ struct lbs_private *lbs_add_card(void *c
459 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
460 dev->netdev_ops = &lbs_netdev_ops;
462 + dev->open = lbs_dev_open;
463 + dev->hard_start_xmit = lbs_hard_start_xmit;
464 + dev->stop = lbs_eth_stop;
465 + dev->set_mac_address = lbs_set_mac_address;
466 + dev->tx_timeout = lbs_tx_timeout;
467 + dev->set_multicast_list = lbs_set_multicast_list;
469 dev->watchdog_timeo = 5 * HZ;
470 dev->ethtool_ops = &lbs_ethtool_ops;
472 @@ -1242,11 +1253,13 @@ out:
473 lbs_deb_leave(LBS_DEB_MAIN);
476 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
477 static const struct net_device_ops rtap_netdev_ops = {
478 .ndo_open = lbs_rtap_open,
479 .ndo_stop = lbs_rtap_stop,
480 .ndo_start_xmit = lbs_rtap_hard_start_xmit,
484 static int lbs_add_rtap(struct lbs_private *priv)
486 @@ -1267,7 +1280,13 @@ static int lbs_add_rtap(struct lbs_priva
488 memcpy(rtap_dev->dev_addr, priv->current_addr, ETH_ALEN);
489 rtap_dev->type = ARPHRD_IEEE80211_RADIOTAP;
490 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
491 rtap_dev->netdev_ops = &rtap_netdev_ops;
493 + rtap_dev->open = lbs_rtap_open;
494 + rtap_dev->stop = lbs_rtap_stop;
495 + rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
497 rtap_dev->ml_priv = priv;
498 SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent);
500 --- a/drivers/net/wireless/libertas/mesh.c
501 +++ b/drivers/net/wireless/libertas/mesh.c
502 @@ -332,6 +332,7 @@ static int lbs_mesh_dev_open(struct net_
506 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
507 static const struct net_device_ops mesh_netdev_ops = {
508 .ndo_open = lbs_mesh_dev_open,
509 .ndo_stop = lbs_mesh_stop,
510 @@ -339,6 +340,7 @@ static const struct net_device_ops mesh_
511 .ndo_set_mac_address = lbs_set_mac_address,
512 .ndo_set_multicast_list = lbs_set_multicast_list,
517 * @brief This function adds mshX interface
518 @@ -363,7 +365,15 @@ int lbs_add_mesh(struct lbs_private *pri
519 mesh_dev->ml_priv = priv;
520 priv->mesh_dev = mesh_dev;
522 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
523 mesh_dev->netdev_ops = &mesh_netdev_ops;
525 + mesh_dev->open = lbs_mesh_dev_open;
526 + mesh_dev->hard_start_xmit = lbs_hard_start_xmit;
527 + mesh_dev->stop = lbs_mesh_stop;
528 + mesh_dev->set_mac_address = lbs_set_mac_address;
529 + mesh_dev->set_multicast_list = lbs_set_multicast_list;
531 mesh_dev->ethtool_ops = &lbs_ethtool_ops;
532 memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, ETH_ALEN);
534 --- a/drivers/net/wireless/libertas/defs.h
535 +++ b/drivers/net/wireless/libertas/defs.h
537 #define DRV_NAME "libertas"
541 + * Really nasty hack to avoid stuffing compat.diff with tons of ifdefs,
542 + * we could add this to a compat header file but too lazy to check ml_priv
543 + * is not used anywhere else
545 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
546 +#define ml_priv priv
549 #define LBS_DEB_ENTER 0x00000001
550 #define LBS_DEB_LEAVE 0x00000002
551 --- a/drivers/net/wireless/mac80211_hwsim.c
552 +++ b/drivers/net/wireless/mac80211_hwsim.c
553 @@ -1015,16 +1015,22 @@ static struct device_driver mac80211_hws
554 .name = "mac80211_hwsim"
557 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
558 static const struct net_device_ops hwsim_netdev_ops = {
559 .ndo_start_xmit = hwsim_mon_xmit,
560 .ndo_change_mtu = eth_change_mtu,
561 .ndo_set_mac_address = eth_mac_addr,
562 .ndo_validate_addr = eth_validate_addr,
566 static void hwsim_mon_setup(struct net_device *dev)
568 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
569 dev->netdev_ops = &hwsim_netdev_ops;
571 + dev->hard_start_xmit = hwsim_mon_xmit;
573 dev->destructor = free_netdev;
575 dev->tx_queue_len = 0;
576 --- a/net/bluetooth/bnep/netdev.c
577 +++ b/net/bluetooth/bnep/netdev.c
578 @@ -167,8 +167,12 @@ static inline int bnep_net_proto_filter(
582 -static netdev_tx_t bnep_net_xmit(struct sk_buff *skb,
583 - struct net_device *dev)
584 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
585 +static netdev_tx_t bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
587 +static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
591 struct bnep_session *s = netdev_priv(dev);
592 struct sock *sk = s->sock->sk;
593 @@ -209,6 +213,7 @@ static netdev_tx_t bnep_net_xmit(struct
597 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28))
598 static const struct net_device_ops bnep_netdev_ops = {
599 .ndo_open = bnep_net_open,
600 .ndo_stop = bnep_net_close,
601 @@ -220,6 +225,16 @@ static const struct net_device_ops bnep_
602 .ndo_change_mtu = eth_change_mtu,
606 +static struct net_device_stats *bnep_net_get_stats(struct net_device *dev)
608 + return &dev->stats;
610 +static int bnep_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
616 void bnep_net_setup(struct net_device *dev)
618 @@ -228,7 +243,18 @@ void bnep_net_setup(struct net_device *d
619 dev->addr_len = ETH_ALEN;
622 +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28))
623 dev->netdev_ops = &bnep_netdev_ops;
625 + dev->open = bnep_net_open;
626 + dev->stop = bnep_net_close;
627 + dev->hard_start_xmit = bnep_net_xmit;
628 + dev->get_stats = bnep_net_get_stats;
629 + dev->do_ioctl = bnep_net_ioctl;
630 + dev->set_mac_address = bnep_net_set_mac_addr;
631 + dev->set_multicast_list = bnep_net_set_mc_list;
632 + dev->tx_timeout = bnep_net_timeout;
635 dev->watchdog_timeo = HZ * 2;
637 --- a/drivers/net/atl1e/atl1e_main.c
638 +++ b/drivers/net/atl1e/atl1e_main.c
639 @@ -2202,6 +2202,7 @@ static void atl1e_shutdown(struct pci_de
640 atl1e_suspend(pdev, PMSG_SUSPEND);
643 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
644 static const struct net_device_ops atl1e_netdev_ops = {
645 .ndo_open = atl1e_open,
646 .ndo_stop = atl1e_close,
647 @@ -2219,6 +2220,7 @@ static const struct net_device_ops atl1e
653 static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
655 @@ -2226,7 +2228,23 @@ static int atl1e_init_netdev(struct net_
656 pci_set_drvdata(pdev, netdev);
658 netdev->irq = pdev->irq;
659 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
660 netdev->netdev_ops = &atl1e_netdev_ops;
662 + netdev->change_mtu = atl1e_change_mtu;
663 + netdev->hard_start_xmit = atl1e_xmit_frame;
664 + netdev->open = atl1e_open;
665 + netdev->stop = atl1e_close;
666 + netdev->tx_timeout = atl1e_tx_timeout;
667 + netdev->set_mac_address = atl1e_set_mac_addr;
668 + netdev->do_ioctl = atl1e_ioctl;
669 + netdev->get_stats = atl1e_get_stats;
670 + netdev->set_multicast_list = atl1e_set_multi;
671 + netdev->vlan_rx_register = atl1e_vlan_rx_register;
672 +#ifdef CONFIG_NET_POLL_CONTROLLER
673 + netdev->poll_controller = atl1e_netpoll;
677 netdev->watchdog_timeo = AT_TX_WATCHDOG;
678 atl1e_set_ethtool_ops(netdev);
679 --- a/drivers/net/atl1c/atl1c_main.c
680 +++ b/drivers/net/atl1c/atl1c_main.c
681 @@ -2534,6 +2534,7 @@ static void atl1c_shutdown(struct pci_de
682 atl1c_suspend(pdev, PMSG_SUSPEND);
685 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
686 static const struct net_device_ops atl1c_netdev_ops = {
687 .ndo_open = atl1c_open,
688 .ndo_stop = atl1c_close,
689 @@ -2550,6 +2551,7 @@ static const struct net_device_ops atl1c
690 .ndo_poll_controller = atl1c_netpoll,
695 static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
697 @@ -2557,7 +2559,23 @@ static int atl1c_init_netdev(struct net_
698 pci_set_drvdata(pdev, netdev);
700 netdev->irq = pdev->irq;
701 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
702 netdev->netdev_ops = &atl1c_netdev_ops;
704 + netdev->change_mtu = atl1c_change_mtu;
705 + netdev->hard_start_xmit = atl1c_xmit_frame;
706 + netdev->open = atl1c_open;
707 + netdev->stop = atl1c_close;
708 + netdev->tx_timeout = atl1c_tx_timeout;
709 + netdev->set_mac_address = atl1c_set_mac_addr;
710 + netdev->do_ioctl = atl1c_ioctl;
711 + netdev->get_stats = atl1c_get_stats;
712 + netdev->set_multicast_list = atl1c_set_multi;
713 + netdev->vlan_rx_register = atl1c_vlan_rx_register;
714 +#ifdef CONFIG_NET_POLL_CONTROLLER
715 + netdev->poll_controller = atl1c_netpoll;
718 netdev->watchdog_timeo = AT_TX_WATCHDOG;
719 atl1c_set_ethtool_ops(netdev);
721 --- a/drivers/net/atlx/atl1.c
722 +++ b/drivers/net/atlx/atl1.c
723 @@ -2878,6 +2878,7 @@ static void atl1_poll_controller(struct
727 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
728 static const struct net_device_ops atl1_netdev_ops = {
729 .ndo_open = atl1_open,
730 .ndo_stop = atl1_close,
731 @@ -2893,6 +2894,7 @@ static const struct net_device_ops atl1_
732 .ndo_poll_controller = atl1_poll_controller,
738 * atl1_probe - Device Initialization Routine
739 @@ -2981,7 +2983,22 @@ static int __devinit atl1_probe(struct p
740 adapter->mii.phy_id_mask = 0x1f;
741 adapter->mii.reg_num_mask = 0x1f;
743 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
744 netdev->netdev_ops = &atl1_netdev_ops;
746 + netdev->change_mtu = atl1_change_mtu;
747 + netdev->hard_start_xmit = atl1_xmit_frame;
748 + netdev->open = atl1_open;
749 + netdev->stop = atl1_close;
750 + netdev->tx_timeout = atlx_tx_timeout;
751 + netdev->set_mac_address = atl1_set_mac;
752 + netdev->do_ioctl = atlx_ioctl;
753 + netdev->set_multicast_list = atlx_set_multi;
754 + netdev->vlan_rx_register = atlx_vlan_rx_register;
755 +#ifdef CONFIG_NET_POLL_CONTROLLER
756 + netdev->poll_controller = atl1_poll_controller;
759 netdev->watchdog_timeo = 5 * HZ;
761 netdev->ethtool_ops = &atl1_ethtool_ops;
762 --- a/drivers/net/atlx/atl2.c
763 +++ b/drivers/net/atlx/atl2.c
764 @@ -1306,6 +1306,7 @@ static void atl2_poll_controller(struct
768 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
769 static const struct net_device_ops atl2_netdev_ops = {
770 .ndo_open = atl2_open,
771 .ndo_stop = atl2_close,
772 @@ -1321,6 +1322,7 @@ static const struct net_device_ops atl2_
773 .ndo_poll_controller = atl2_poll_controller,
779 * atl2_probe - Device Initialization Routine
780 @@ -1395,7 +1397,22 @@ static int __devinit atl2_probe(struct p
782 atl2_setup_pcicmd(pdev);
784 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
785 netdev->netdev_ops = &atl2_netdev_ops;
787 + netdev->change_mtu = atl2_change_mtu;
788 + netdev->hard_start_xmit = atl2_xmit_frame;
789 + netdev->open = atl2_open;
790 + netdev->stop = atl2_close;
791 + netdev->tx_timeout = atl2_tx_timeout;
792 + netdev->set_mac_address = atl2_set_mac;
793 + netdev->do_ioctl = atl2_ioctl;
794 + netdev->set_multicast_list = atl2_set_multi;
795 + netdev->vlan_rx_register = atl2_vlan_rx_register;
796 +#ifdef CONFIG_NET_POLL_CONTROLLER
797 + netdev->poll_controller = atl2_poll_controller;
800 atl2_set_ethtool_ops(netdev);
801 netdev->watchdog_timeo = 5 * HZ;
802 strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);