Skip to content

Commit dcd39c9

Browse files
Stephen Hemmingerdavem330
authored andcommitted
ne-h8300: convert to net_device_ops
Another device using 8390 library that needs converting. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5618f0d commit dcd39c9

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎drivers/net/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
124124
obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
125125
obj-$(CONFIG_B44) += b44.o
126126
obj-$(CONFIG_FORCEDETH) += forcedeth.o
127-
obj-$(CONFIG_NE_H8300) += ne-h8300.o
127+
obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
128128
obj-$(CONFIG_AX88796) += ax88796.o
129129

130130
obj-$(CONFIG_TSI108_ETH) += tsi108_eth.o

‎drivers/net/ne-h8300.c‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void cleanup_card(struct net_device *dev)
167167
#ifndef MODULE
168168
struct net_device * __init ne_probe(int unit)
169169
{
170-
struct net_device *dev = ____alloc_ei_netdev(0);
170+
struct net_device *dev = alloc_ei_netdev();
171171
int err;
172172

173173
if (!dev)
@@ -193,6 +193,21 @@ struct net_device * __init ne_probe(int unit)
193193
}
194194
#endif
195195

196+
static const struct net_device_ops ne_netdev_ops = {
197+
.ndo_open = ne_open,
198+
.ndo_stop = ne_close,
199+
200+
.ndo_start_xmit = ei_start_xmit,
201+
.ndo_tx_timeout = ei_tx_timeout,
202+
.ndo_get_stats = ei_get_stats,
203+
.ndo_set_multicast_list = ei_set_multicast_list,
204+
.ndo_validate_addr = eth_validate_addr,
205+
.ndo_change_mtu = eth_change_mtu,
206+
#ifdef CONFIG_NET_POLL_CONTROLLER
207+
.ndo_poll_controller = ei_poll,
208+
#endif
209+
};
210+
196211
static int __init ne_probe1(struct net_device *dev, int ioaddr)
197212
{
198213
int i;
@@ -319,11 +334,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
319334
ei_status.block_output = &ne_block_output;
320335
ei_status.get_8390_hdr = &ne_get_8390_hdr;
321336
ei_status.priv = 0;
322-
dev->open = &ne_open;
323-
dev->stop = &ne_close;
324-
#ifdef CONFIG_NET_POLL_CONTROLLER
325-
dev->poll_controller = __ei_poll;
326-
#endif
337+
338+
dev->netdev_ops = &ne_netdev_ops;
339+
327340
__NS8390_init(dev, 0);
328341

329342
ret = register_netdev(dev);
@@ -624,7 +637,7 @@ int init_module(void)
624637
int err;
625638

626639
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
627-
struct net_device *dev = ____alloc_ei_netdev(0);
640+
struct net_device *dev = alloc_ei_netdev();
628641
if (!dev)
629642
break;
630643
if (io[this_dev]) {

0 commit comments

Comments
 (0)