summaryrefslogtreecommitdiffstats
path: root/package/ep80579-drivers/patches/100-iegbe_netdev_ops.patch
blob: ab23da63ff1bb5e4cbb1ab67d1264eb0c190c90d (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
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -724,6 +724,26 @@ static void iegbe_dump_eeprom(struct ieg
 	kfree(data);
 }
 
+static const struct net_device_ops iegbe_netdev_ops = {
+	.ndo_open		= iegbe_open,
+	.ndo_stop		= iegbe_close,
+	.ndo_start_xmit		= iegbe_xmit_frame,
+	.ndo_get_stats		= iegbe_get_stats,
+	.ndo_set_rx_mode	= iegbe_set_rx_mode,
+	.ndo_set_mac_address	= iegbe_set_mac,
+	.ndo_tx_timeout		= iegbe_tx_timeout,
+	.ndo_change_mtu		= iegbe_change_mtu,
+	.ndo_do_ioctl		= iegbe_ioctl,
+	.ndo_validate_addr	= eth_validate_addr,
+
+	.ndo_vlan_rx_register	= iegbe_vlan_rx_register,
+	.ndo_vlan_rx_add_vid	= iegbe_vlan_rx_add_vid,
+	.ndo_vlan_rx_kill_vid	= iegbe_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller	= iegbe_netpoll,
+#endif
+};
+
 /**
  * iegbe_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -800,24 +820,11 @@ static int __devinit iegbe_probe(struct 
 	if (!hw->hw_addr)
         goto err_ioremap;
 
-    netdev->open = &iegbe_open;
-    netdev->stop = &iegbe_close;
-    netdev->hard_start_xmit = &iegbe_xmit_frame;
-    netdev->get_stats = &iegbe_get_stats;
-	netdev->set_rx_mode = &iegbe_set_rx_mode;
-	netdev->set_mac_address = &iegbe_set_mac;
-    netdev->change_mtu = &iegbe_change_mtu;
-    netdev->do_ioctl = &iegbe_ioctl;
+	netdev->netdev_ops = &iegbe_netdev_ops;
 	set_ethtool_ops(netdev);
-    netdev->tx_timeout = &iegbe_tx_timeout;
 	netdev->watchdog_timeo = 5 * HZ;
 	netif_napi_add(netdev, &adapter->napi, iegbe_clean, 64);
-    netdev->vlan_rx_register = iegbe_vlan_rx_register;
-    netdev->vlan_rx_add_vid = iegbe_vlan_rx_add_vid;
-    netdev->vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-    netdev->poll_controller = iegbe_netpoll;
-#endif
+
 	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);