aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/xirc2ps_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/xirc2ps_cs.c')
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 4d1802e457be..5e6b62ba8887 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -297,31 +297,9 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev);
297 297
298static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); 298static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);
299 299
300/****************
301 * A linked list of "instances" of the device. Each actual
302 * PCMCIA card corresponds to one device instance, and is described
303 * by one struct pcmcia_device structure (defined in ds.h).
304 *
305 * You may not want to use a linked list for this -- for example, the
306 * memory card driver uses an array of struct pcmcia_device pointers, where minor
307 * device numbers are used to derive the corresponding array index.
308 */
309
310/****************
311 * A driver needs to provide a dev_node_t structure for each device
312 * on a card. In some cases, there is only one device per card (for
313 * example, ethernet cards, modems). In other cases, there may be
314 * many actual or logical devices (SCSI adapters, memory cards with
315 * multiple partitions). The dev_node_t structures need to be kept
316 * in a linked list starting at the 'dev' field of a struct pcmcia_device
317 * structure. We allocate them in the card's private data structure,
318 * because they generally can't be allocated dynamically.
319 */
320
321typedef struct local_info_t { 300typedef struct local_info_t {
322 struct net_device *dev; 301 struct net_device *dev;
323 struct pcmcia_device *p_dev; 302 struct pcmcia_device *p_dev;
324 dev_node_t node;
325 303
326 int card_type; 304 int card_type;
327 int probe_port; 305 int probe_port;
@@ -555,7 +533,6 @@ xirc2ps_probe(struct pcmcia_device *link)
555 link->conf.Attributes = CONF_ENABLE_IRQ; 533 link->conf.Attributes = CONF_ENABLE_IRQ;
556 link->conf.IntType = INT_MEMORY_AND_IO; 534 link->conf.IntType = INT_MEMORY_AND_IO;
557 link->conf.ConfigIndex = 1; 535 link->conf.ConfigIndex = 1;
558 link->irq.Handler = xirc2ps_interrupt;
559 536
560 /* Fill in card specific entries */ 537 /* Fill in card specific entries */
561 dev->netdev_ops = &netdev_ops; 538 dev->netdev_ops = &netdev_ops;
@@ -580,8 +557,7 @@ xirc2ps_detach(struct pcmcia_device *link)
580 557
581 dev_dbg(&link->dev, "detach\n"); 558 dev_dbg(&link->dev, "detach\n");
582 559
583 if (link->dev_node) 560 unregister_netdev(dev);
584 unregister_netdev(dev);
585 561
586 xirc2ps_release(link); 562 xirc2ps_release(link);
587 563
@@ -841,7 +817,6 @@ xirc2ps_config(struct pcmcia_device * link)
841 link->conf.Attributes |= CONF_ENABLE_SPKR; 817 link->conf.Attributes |= CONF_ENABLE_SPKR;
842 link->conf.Status |= CCSR_AUDIO_ENA; 818 link->conf.Status |= CCSR_AUDIO_ENA;
843 } 819 }
844 link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
845 link->io.NumPorts2 = 8; 820 link->io.NumPorts2 = 8;
846 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 821 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
847 if (local->dingo) { 822 if (local->dingo) {
@@ -866,7 +841,6 @@ xirc2ps_config(struct pcmcia_device * link)
866 } 841 }
867 printk(KNOT_XIRC "no ports available\n"); 842 printk(KNOT_XIRC "no ports available\n");
868 } else { 843 } else {
869 link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
870 link->io.NumPorts1 = 16; 844 link->io.NumPorts1 = 16;
871 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 845 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
872 link->io.BasePort1 = ioaddr; 846 link->io.BasePort1 = ioaddr;
@@ -885,7 +859,7 @@ xirc2ps_config(struct pcmcia_device * link)
885 * Now allocate an interrupt line. Note that this does not 859 * Now allocate an interrupt line. Note that this does not
886 * actually assign a handler to the interrupt. 860 * actually assign a handler to the interrupt.
887 */ 861 */
888 if ((err=pcmcia_request_irq(link, &link->irq))) 862 if ((err=pcmcia_request_irq(link, xirc2ps_interrupt)))
889 goto config_error; 863 goto config_error;
890 864
891 /**************** 865 /****************
@@ -982,23 +956,19 @@ xirc2ps_config(struct pcmcia_device * link)
982 printk(KNOT_XIRC "invalid if_port requested\n"); 956 printk(KNOT_XIRC "invalid if_port requested\n");
983 957
984 /* we can now register the device with the net subsystem */ 958 /* we can now register the device with the net subsystem */
985 dev->irq = link->irq.AssignedIRQ; 959 dev->irq = link->irq;
986 dev->base_addr = link->io.BasePort1; 960 dev->base_addr = link->io.BasePort1;
987 961
988 if (local->dingo) 962 if (local->dingo)
989 do_reset(dev, 1); /* a kludge to make the cem56 work */ 963 do_reset(dev, 1); /* a kludge to make the cem56 work */
990 964
991 link->dev_node = &local->node;
992 SET_NETDEV_DEV(dev, &link->dev); 965 SET_NETDEV_DEV(dev, &link->dev);
993 966
994 if ((err=register_netdev(dev))) { 967 if ((err=register_netdev(dev))) {
995 printk(KNOT_XIRC "register_netdev() failed\n"); 968 printk(KNOT_XIRC "register_netdev() failed\n");
996 link->dev_node = NULL;
997 goto config_error; 969 goto config_error;
998 } 970 }
999 971
1000 strcpy(local->node.dev_name, dev->name);
1001
1002 /* give some infos about the hardware */ 972 /* give some infos about the hardware */
1003 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", 973 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n",
1004 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, 974 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq,