aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/nmclan_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/net/pcmcia/nmclan_cs.c
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff)
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/nmclan_cs.c')
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index c25d9451d574..0ccca12d9d6e 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -362,7 +362,7 @@ typedef struct _mace_statistics {
362} mace_statistics; 362} mace_statistics;
363 363
364typedef struct _mace_private { 364typedef struct _mace_private {
365 dev_link_t link; 365 struct pcmcia_device *p_dev;
366 dev_node_t node; 366 dev_node_t node;
367 struct net_device_stats linux_stats; /* Linux statistics counters */ 367 struct net_device_stats linux_stats; /* Linux statistics counters */
368 mace_statistics mace_stats; /* MACE chip statistics counters */ 368 mace_statistics mace_stats; /* MACE chip statistics counters */
@@ -446,8 +446,8 @@ nmclan_attach
446static int nmclan_attach(struct pcmcia_device *p_dev) 446static int nmclan_attach(struct pcmcia_device *p_dev)
447{ 447{
448 mace_private *lp; 448 mace_private *lp;
449 dev_link_t *link;
450 struct net_device *dev; 449 struct net_device *dev;
450 dev_link_t *link = dev_to_instance(p_dev);
451 451
452 DEBUG(0, "nmclan_attach()\n"); 452 DEBUG(0, "nmclan_attach()\n");
453 DEBUG(1, "%s\n", rcsid); 453 DEBUG(1, "%s\n", rcsid);
@@ -457,7 +457,7 @@ static int nmclan_attach(struct pcmcia_device *p_dev)
457 if (!dev) 457 if (!dev)
458 return -ENOMEM; 458 return -ENOMEM;
459 lp = netdev_priv(dev); 459 lp = netdev_priv(dev);
460 link = &lp->link; 460 lp->p_dev = p_dev;
461 link->priv = dev; 461 link->priv = dev;
462 462
463 spin_lock_init(&lp->bank_lock); 463 spin_lock_init(&lp->bank_lock);
@@ -488,9 +488,6 @@ static int nmclan_attach(struct pcmcia_device *p_dev)
488 dev->watchdog_timeo = TX_TIMEOUT; 488 dev->watchdog_timeo = TX_TIMEOUT;
489#endif 489#endif
490 490
491 link->handle = p_dev;
492 p_dev->instance = link;
493
494 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 491 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
495 nmclan_config(link); 492 nmclan_config(link);
496 493
@@ -512,7 +509,7 @@ static void nmclan_detach(struct pcmcia_device *p_dev)
512 509
513 DEBUG(0, "nmclan_detach(0x%p)\n", link); 510 DEBUG(0, "nmclan_detach(0x%p)\n", link);
514 511
515 if (link->dev) 512 if (link->dev_node)
516 unregister_netdev(dev); 513 unregister_netdev(dev);
517 514
518 if (link->state & DEV_CONFIG) 515 if (link->state & DEV_CONFIG)
@@ -729,14 +726,14 @@ static void nmclan_config(dev_link_t *link)
729 else 726 else
730 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); 727 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n");
731 728
732 link->dev = &lp->node; 729 link->dev_node = &lp->node;
733 link->state &= ~DEV_CONFIG_PENDING; 730 link->state &= ~DEV_CONFIG_PENDING;
734 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 731 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
735 732
736 i = register_netdev(dev); 733 i = register_netdev(dev);
737 if (i != 0) { 734 if (i != 0) {
738 printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); 735 printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n");
739 link->dev = NULL; 736 link->dev_node = NULL;
740 goto failed; 737 goto failed;
741 } 738 }
742 739
@@ -869,7 +866,7 @@ static int mace_open(struct net_device *dev)
869{ 866{
870 kio_addr_t ioaddr = dev->base_addr; 867 kio_addr_t ioaddr = dev->base_addr;
871 mace_private *lp = netdev_priv(dev); 868 mace_private *lp = netdev_priv(dev);
872 dev_link_t *link = &lp->link; 869 dev_link_t *link = lp->p_dev;
873 870
874 if (!DEV_OK(link)) 871 if (!DEV_OK(link))
875 return -ENODEV; 872 return -ENODEV;
@@ -892,7 +889,7 @@ static int mace_close(struct net_device *dev)
892{ 889{
893 kio_addr_t ioaddr = dev->base_addr; 890 kio_addr_t ioaddr = dev->base_addr;
894 mace_private *lp = netdev_priv(dev); 891 mace_private *lp = netdev_priv(dev);
895 dev_link_t *link = &lp->link; 892 dev_link_t *link = lp->p_dev;
896 893
897 DEBUG(2, "%s: shutting down ethercard.\n", dev->name); 894 DEBUG(2, "%s: shutting down ethercard.\n", dev->name);
898 895
@@ -947,7 +944,7 @@ mace_start_xmit
947static void mace_tx_timeout(struct net_device *dev) 944static void mace_tx_timeout(struct net_device *dev)
948{ 945{
949 mace_private *lp = netdev_priv(dev); 946 mace_private *lp = netdev_priv(dev);
950 dev_link_t *link = &lp->link; 947 dev_link_t *link = lp->p_dev;
951 948
952 printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); 949 printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name);
953#if RESET_ON_TIMEOUT 950#if RESET_ON_TIMEOUT