aboutsummaryrefslogtreecommitdiffstats
path: root/package/acx/patches/006-netdev_ops.patch
blob: b687c211c756a8455964780a39d908de08d42f46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Index: acx-20080210/pci.c
===================================================================
--- acx-20080210.orig/pci.c	2010-05-02 21:37:00.000000000 +0200
+++ acx-20080210/pci.c	2010-05-02 21:48:22.000000000 +0200
@@ -1437,6 +1437,18 @@
 
 static void dummy_netdev_init(struct net_device *ndev) {}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
+static const struct net_device_ops acx_netdev_ops = {
+	.ndo_open		= &acxpci_e_open,
+	.ndo_stop		= &acxpci_e_close,
+	.ndo_start_xmit		= &acx_i_start_xmit,
+	.ndo_get_stats		= &acx_e_get_stats,
+	.ndo_set_multicast_list = &acxpci_i_set_multicast_list,
+	.ndo_tx_timeout		= &acxpci_i_tx_timeout,
+	.ndo_change_mtu		= &acx_e_change_mtu,
+};
+#endif
+
 #ifdef CONFIG_PCI
 static int __devinit acxpci_e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1547,17 +1559,21 @@
 	}
 
 	ether_setup(ndev);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
 	ndev->open = &acxpci_e_open;
 	ndev->stop = &acxpci_e_close;
 	ndev->hard_start_xmit = &acx_i_start_xmit;
 	ndev->get_stats = &acx_e_get_stats;
+	ndev->set_multicast_list = &acxpci_i_set_multicast_list;
+	ndev->tx_timeout = &acxpci_i_tx_timeout;
+	ndev->change_mtu = &acx_e_change_mtu;
+#else
+	ndev->netdev_ops = &acx_netdev_ops;
+#endif
 #if IW_HANDLER_VERSION <= 5
 	ndev->get_wireless_stats = &acx_e_get_wireless_stats;
 #endif
 	ndev->wireless_handlers = (struct iw_handler_def *)&acx_ioctl_handler_def;
-	ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-	ndev->tx_timeout = &acxpci_i_tx_timeout;
-	ndev->change_mtu = &acx_e_change_mtu;
 	ndev->watchdog_timeo = 4 * HZ;
 	ndev->irq = pdev->irq;
 	ndev->base_addr = pci_resource_start(pdev, 0);
@@ -4191,17 +4207,24 @@
 		goto fail_alloc_netdev;
 	}
 	ether_setup(ndev);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
 	ndev->open = &acxpci_e_open;
 	ndev->stop = &acxpci_e_close;
 	ndev->hard_start_xmit = &acx_i_start_xmit;
 	ndev->get_stats = &acx_e_get_stats;
+	ndev->set_multicast_list = &acxpci_i_set_multicast_list;
+	ndev->tx_timeout = &acxpci_i_tx_timeout;
+	ndev->change_mtu = &acx_e_change_mtu;
+	ndev->set_multicast_list = &acxpci_i_set_multicast_list;
+	ndev->tx_timeout = &acxpci_i_tx_timeout;
+	ndev->change_mtu = &acx_e_change_mtu;
+#else
+	ndev->netdev_ops = &acx_netdev_ops;
+#endif
 #if IW_HANDLER_VERSION <= 5
 	ndev->get_wireless_stats = &acx_e_get_wireless_stats;
 #endif
 	ndev->wireless_handlers = (struct iw_handler_def *)&acx_ioctl_handler_def;
-	ndev->set_multicast_list = &acxpci_i_set_multicast_list;
-	ndev->tx_timeout = &acxpci_i_tx_timeout;
-	ndev->change_mtu = &acx_e_change_mtu;
 	ndev->watchdog_timeo = 4 * HZ;
 
 	adev = ndev2adev(ndev);