Skip to content

Commit 9a4a842

Browse files
committed
8390/8390p: Fix compat netdev ops handling.
Based upon a report from Randy Dunlap. The compat netdev ops assignments need to happen in 8390.c and 8390p.c, not lib8390.c, as only the type specific code can assign the correct function pointers. Signed-off-by: David S. Miller <[email protected]>
1 parent 8b124a8 commit 9a4a842

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

drivers/net/8390.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,16 @@ EXPORT_SYMBOL(ei_netdev_ops);
7272

7373
struct net_device *__alloc_ei_netdev(int size)
7474
{
75-
return ____alloc_ei_netdev(size);
75+
struct net_device *dev = ____alloc_ei_netdev(size);
76+
#ifdef CONFIG_COMPAT_NET_DEV_OPS
77+
if (dev) {
78+
dev->hard_start_xmit = ei_start_xmit;
79+
dev->get_stats = ei_get_stats;
80+
dev->set_multicast_list = ei_set_multicast_list;
81+
dev->tx_timeout = ei_tx_timeout;
82+
}
83+
#endif
84+
return dev;
7685
}
7786
EXPORT_SYMBOL(__alloc_ei_netdev);
7887

drivers/net/8390p.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ EXPORT_SYMBOL(eip_netdev_ops);
7777

7878
struct net_device *__alloc_eip_netdev(int size)
7979
{
80-
return ____alloc_ei_netdev(size);
80+
struct net_device *dev = ____alloc_ei_netdev(size);
81+
#ifdef CONFIG_COMPAT_NET_DEV_OPS
82+
if (dev) {
83+
dev->hard_start_xmit = eip_start_xmit;
84+
dev->get_stats = eip_get_stats;
85+
dev->set_multicast_list = eip_set_multicast_list;
86+
dev->tx_timeout = eip_tx_timeout;
87+
}
88+
#endif
89+
return dev;
8190
}
8291
EXPORT_SYMBOL(__alloc_eip_netdev);
8392

drivers/net/lib8390.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,12 +1010,6 @@ static void ethdev_setup(struct net_device *dev)
10101010
if (ei_debug > 1)
10111011
printk(version);
10121012

1013-
#ifdef CONFIG_COMPAT_NET_DEV_OPS
1014-
dev->hard_start_xmit = ei_start_xmit;
1015-
dev->get_stats = ei_get_stats;
1016-
dev->set_multicast_list = ei_set_multicast_list;
1017-
dev->tx_timeout = __ei_tx_timeout;
1018-
#endif
10191013
ether_setup(dev);
10201014

10211015
spin_lock_init(&ei_local->page_lock);

0 commit comments

Comments
 (0)