diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-01 20:20:37 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:31 -0400 |
commit | 01590d20b42400be46cf4e565b39764e38ca87fe (patch) | |
tree | 84e27f5cca0b2547adefbb2248d4b693440e2d9c /drivers | |
parent | 8a62bf7978eaa428e400677d5e5f5441262f79b1 (diff) |
ieee1394: eth1394: don't use alloc_etherdev
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index fc6c7fd728d9..0047343dbc22 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -50,7 +50,6 @@ | |||
50 | 50 | ||
51 | #include <linux/netdevice.h> | 51 | #include <linux/netdevice.h> |
52 | #include <linux/inetdevice.h> | 52 | #include <linux/inetdevice.h> |
53 | #include <linux/etherdevice.h> | ||
54 | #include <linux/if_arp.h> | 53 | #include <linux/if_arp.h> |
55 | #include <linux/if_ether.h> | 54 | #include <linux/if_ether.h> |
56 | #include <linux/ip.h> | 55 | #include <linux/ip.h> |
@@ -494,10 +493,8 @@ static void ether1394_reset_priv(struct net_device *dev, int set_mtu) | |||
494 | spin_unlock_irqrestore(&priv->lock, flags); | 493 | spin_unlock_irqrestore(&priv->lock, flags); |
495 | } | 494 | } |
496 | 495 | ||
497 | /* This function is called right before register_netdev */ | ||
498 | static void ether1394_init_dev(struct net_device *dev) | 496 | static void ether1394_init_dev(struct net_device *dev) |
499 | { | 497 | { |
500 | /* Our functions */ | ||
501 | dev->open = ether1394_open; | 498 | dev->open = ether1394_open; |
502 | dev->stop = ether1394_stop; | 499 | dev->stop = ether1394_stop; |
503 | dev->hard_start_xmit = ether1394_tx; | 500 | dev->hard_start_xmit = ether1394_tx; |
@@ -510,10 +507,9 @@ static void ether1394_init_dev(struct net_device *dev) | |||
510 | dev->hard_header_cache = ether1394_header_cache; | 507 | dev->hard_header_cache = ether1394_header_cache; |
511 | dev->header_cache_update= ether1394_header_cache_update; | 508 | dev->header_cache_update= ether1394_header_cache_update; |
512 | dev->hard_header_parse = ether1394_header_parse; | 509 | dev->hard_header_parse = ether1394_header_parse; |
513 | dev->set_mac_address = NULL; | 510 | |
514 | SET_ETHTOOL_OPS(dev, ðtool_ops); | 511 | SET_ETHTOOL_OPS(dev, ðtool_ops); |
515 | 512 | ||
516 | /* Some constants */ | ||
517 | dev->watchdog_timeo = ETHER1394_TIMEOUT; | 513 | dev->watchdog_timeo = ETHER1394_TIMEOUT; |
518 | dev->flags = IFF_BROADCAST | IFF_MULTICAST; | 514 | dev->flags = IFF_BROADCAST | IFF_MULTICAST; |
519 | dev->features = NETIF_F_HIGHDMA; | 515 | dev->features = NETIF_F_HIGHDMA; |
@@ -521,7 +517,8 @@ static void ether1394_init_dev(struct net_device *dev) | |||
521 | dev->hard_header_len = ETH1394_HLEN; | 517 | dev->hard_header_len = ETH1394_HLEN; |
522 | dev->type = ARPHRD_IEEE1394; | 518 | dev->type = ARPHRD_IEEE1394; |
523 | 519 | ||
524 | ether1394_reset_priv(dev, 1); | 520 | /* FIXME: This value was copied from ether_setup(). Is it too much? */ |
521 | dev->tx_queue_len = 1000; | ||
525 | } | 522 | } |
526 | 523 | ||
527 | /* | 524 | /* |
@@ -551,11 +548,7 @@ static void ether1394_add_host(struct hpsb_host *host) | |||
551 | return; | 548 | return; |
552 | } | 549 | } |
553 | 550 | ||
554 | /* We should really have our own alloc_hpsbdev() function in | 551 | dev = alloc_netdev(sizeof(*priv), "eth%d", ether1394_init_dev); |
555 | * net_init.c instead of calling the one for ethernet then hijacking | ||
556 | * it for ourselves. That way we'd be a real networking device. */ | ||
557 | dev = alloc_etherdev(sizeof (struct eth1394_priv)); | ||
558 | |||
559 | if (dev == NULL) { | 552 | if (dev == NULL) { |
560 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); | 553 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); |
561 | goto out; | 554 | goto out; |
@@ -568,21 +561,18 @@ static void ether1394_add_host(struct hpsb_host *host) | |||
568 | #endif | 561 | #endif |
569 | 562 | ||
570 | priv = netdev_priv(dev); | 563 | priv = netdev_priv(dev); |
571 | |||
572 | INIT_LIST_HEAD(&priv->ip_node_list); | 564 | INIT_LIST_HEAD(&priv->ip_node_list); |
573 | |||
574 | spin_lock_init(&priv->lock); | 565 | spin_lock_init(&priv->lock); |
575 | priv->host = host; | 566 | priv->host = host; |
576 | priv->local_fifo = fifo_addr; | 567 | priv->local_fifo = fifo_addr; |
577 | 568 | ||
578 | hi = hpsb_create_hostinfo(ð1394_highlevel, host, sizeof(*hi)); | 569 | hi = hpsb_create_hostinfo(ð1394_highlevel, host, sizeof(*hi)); |
579 | |||
580 | if (hi == NULL) { | 570 | if (hi == NULL) { |
581 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); | 571 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); |
582 | goto out; | 572 | goto out; |
583 | } | 573 | } |
584 | 574 | ||
585 | ether1394_init_dev(dev); | 575 | ether1394_reset_priv(dev, 1); |
586 | 576 | ||
587 | if (register_netdev(dev)) { | 577 | if (register_netdev(dev)) { |
588 | ETH1394_PRINT_G(KERN_ERR, "Cannot register the driver\n"); | 578 | ETH1394_PRINT_G(KERN_ERR, "Cannot register the driver\n"); |