Commit 60c7e915 authored by David S. Miller's avatar David S. Miller

[NET]: Convert ia64 simeth.c away from init_etherdev().

parent 4e956a78
...@@ -191,7 +191,7 @@ simeth_probe1(void) ...@@ -191,7 +191,7 @@ simeth_probe1(void)
unsigned char mac_addr[ETH_ALEN]; unsigned char mac_addr[ETH_ALEN];
struct simeth_local *local; struct simeth_local *local;
struct net_device *dev; struct net_device *dev;
int fd, i; int fd, i, err;
/* /*
* XXX Fix me * XXX Fix me
...@@ -207,22 +207,12 @@ simeth_probe1(void) ...@@ -207,22 +207,12 @@ simeth_probe1(void)
if (fd == -1) if (fd == -1)
return -ENODEV; return -ENODEV;
dev = init_etherdev(NULL, sizeof(struct simeth_local)); dev = alloc_etherdev(sizeof(struct simeth_local));
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr)); memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr));
dev->irq = ia64_alloc_vector();
/*
* attach the interrupt in the simulator, this does enable interrupts
* until a netdev_attach() is called
*/
netdev_connect(dev->irq);
memset(dev->priv, 0, sizeof(struct simeth_local));
local = dev->priv; local = dev->priv;
local->simfd = fd; /* keep track of underlying file descriptor */ local->simfd = fd; /* keep track of underlying file descriptor */
...@@ -232,8 +222,19 @@ simeth_probe1(void) ...@@ -232,8 +222,19 @@ simeth_probe1(void)
dev->get_stats = simeth_get_stats; dev->get_stats = simeth_get_stats;
dev->set_multicast_list = set_multicast_list; /* no yet used */ dev->set_multicast_list = set_multicast_list; /* no yet used */
/* Fill in the fields of the device structure with ethernet-generic values. */ err = register_netdev(dev);
ether_setup(dev); if (dev) {
kfree(dev);
return err;
}
dev->irq = ia64_alloc_vector();
/*
* attach the interrupt in the simulator, this does enable interrupts
* until a netdev_attach() is called
*/
netdev_connect(dev->irq);
printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr", printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
dev->name, simeth_device, local->simfd); dev->name, simeth_device, local->simfd);
...@@ -242,7 +243,7 @@ simeth_probe1(void) ...@@ -242,7 +243,7 @@ simeth_probe1(void)
} }
printk(", IRQ %d\n", dev->irq); printk(", IRQ %d\n", dev->irq);
return 0; return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment