pcmcia: introduce autoconfiguration feature
[linux-2.6-microblaze.git] / drivers / net / pcmcia / axnet_cs.c
index 5f05ffb..17f1040 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/mii.h>
 #include "../8390.h"
 
-#include <pcmcia/cs.h>
 #include <pcmcia/cistpl.h>
 #include <pcmcia/ciscode.h>
 #include <pcmcia/ds.h>
@@ -166,8 +165,7 @@ static int axnet_probe(struct pcmcia_device *link)
     info = PRIV(dev);
     info->p_dev = link;
     link->priv = dev;
-    link->conf.Attributes = CONF_ENABLE_IRQ;
-    link->conf.IntType = INT_MEMORY_AND_IO;
+    link->config_flags |= CONF_ENABLE_IRQ;
 
     dev->netdev_ops = &axnet_netdev_ops;
 
@@ -231,7 +229,7 @@ static int get_prom(struct pcmcia_device *link)
     };
 
     /* Not much of a test, but the alternatives are messy */
-    if (link->conf.ConfigBase != 0x03c0)
+    if (link->config_base != 0x03c0)
        return 0;
 
     axnet_reset_8390(dev);
@@ -289,7 +287,6 @@ static int try_io_port(struct pcmcia_device *link)
 static int axnet_configcheck(struct pcmcia_device *p_dev,
                             cistpl_cftable_entry_t *cfg,
                             cistpl_cftable_entry_t *dflt,
-                            unsigned int vcc,
                             void *priv_data)
 {
        int i;
@@ -298,7 +295,7 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
        if (cfg->index == 0 || cfg->io.nwin == 0)
                return -ENODEV;
 
-       p_dev->conf.ConfigIndex = 0x05;
+       p_dev->config_index = 0x05;
        /* For multifunction cards, by convention, we configure the
           network function with window 0, and serial with window 1 */
        if (io->nwin > 1) {
@@ -326,20 +323,19 @@ static int axnet_config(struct pcmcia_device *link)
     dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
 
     /* don't trust the CIS on this; Linksys got it wrong */
-    link->conf.Present = 0x63;
+    link->config_regs = 0x63;
     ret = pcmcia_loop_config(link, axnet_configcheck, NULL);
     if (ret != 0)
        goto failed;
 
     if (!link->irq)
            goto failed;
+
+    link->config_flags |= CONF_ENABLE_IRQ;
+    if (resource_size(link->resource[1]) == 8)
+       link->config_flags |= CONF_ENABLE_SPKR;
     
-    if (resource_size(link->resource[1]) == 8) {
-       link->conf.Attributes |= CONF_ENABLE_SPKR;
-       link->conf.Status = CCSR_AUDIO_ENA;
-    }
-    
-    ret = pcmcia_request_configuration(link, &link->conf);
+    ret = pcmcia_enable_device(link);
     if (ret)
            goto failed;