linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / net / pcmcia / pcnet_cs.c
index 0ecebfc..d85b758 100644 (file)
@@ -12,7 +12,7 @@
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
     pcnet_cs.c 1.153 2003/11/09 18:53:09
-
+    
     The network driver code is based on Donald Becker's NE2000 code:
 
     Written 1992,1993 by Donald Becker.
@@ -66,7 +66,7 @@
 
 #define PCNET_RDC_TIMEOUT (2*HZ/100)   /* Max wait in jiffies for Tx RDC */
 
-static const char *if_names[] = { "auto", "10baseT", "10base2"};
+static char *if_names[] = { "auto", "10baseT", "10base2"};
 
 #ifdef PCMCIA_DEBUG
 static int pc_debug = PCMCIA_DEBUG;
@@ -103,8 +103,8 @@ module_param_array(hw_addr, int, NULL, 0);
 /*====================================================================*/
 
 static void mii_phy_probe(struct net_device *dev);
-static int pcnet_config(struct pcmcia_device *link);
-static void pcnet_release(struct pcmcia_device *link);
+static void pcnet_config(dev_link_t *link);
+static void pcnet_release(dev_link_t *link);
 static int pcnet_open(struct net_device *dev);
 static int pcnet_close(struct net_device *dev);
 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -113,9 +113,9 @@ static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
 static void ei_watchdog(u_long arg);
 static void pcnet_reset_8390(struct net_device *dev);
 static int set_config(struct net_device *dev, struct ifmap *map);
-static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
+static int setup_shmem_window(dev_link_t *link, int start_pg,
                              int stop_pg, int cm_offset);
-static int setup_dma_config(struct pcmcia_device *link, int start_pg,
+static int setup_dma_config(dev_link_t *link, int start_pg,
                            int stop_pg);
 
 static void pcnet_detach(struct pcmcia_device *p_dev);
@@ -146,7 +146,7 @@ typedef struct hw_info_t {
 #define MII_PHYID_REG2         0x03
 
 static hw_info_t hw_info[] = {
-    { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT },
+    { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT }, 
     { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
     { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },
     { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94,
@@ -193,7 +193,7 @@ static hw_info_t hw_info[] = {
     { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 },
     { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65,
       HAS_MISC_REG | HAS_IBM_MISC },
-    { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45,
+    { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45, 
       HAS_MISC_REG | HAS_IBM_MISC },
     { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 },
     { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 },
@@ -214,7 +214,7 @@ static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
 static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
 
 typedef struct pcnet_dev_t {
-       struct pcmcia_device    *p_dev;
+    dev_link_t         link;
     dev_node_t         node;
     u_int              flags;
     void               __iomem *base;
@@ -240,9 +240,10 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev)
 
 ======================================================================*/
 
-static int pcnet_probe(struct pcmcia_device *link)
+static int pcnet_probe(struct pcmcia_device *p_dev)
 {
     pcnet_dev_t *info;
+    dev_link_t *link;
     struct net_device *dev;
 
     DEBUG(0, "pcnet_attach()\n");
@@ -251,7 +252,7 @@ static int pcnet_probe(struct pcmcia_device *link)
     dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
     if (!dev) return -ENOMEM;
     info = PRIV(dev);
-    info->p_dev = link;
+    link = &info->link;
     link->priv = dev;
 
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
@@ -264,7 +265,13 @@ static int pcnet_probe(struct pcmcia_device *link)
     dev->stop = &pcnet_close;
     dev->set_config = &set_config;
 
-    return pcnet_config(link);
+    link->handle = p_dev;
+    p_dev->instance = link;
+
+    link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+    pcnet_config(link);
+
+    return 0;
 } /* pcnet_attach */
 
 /*======================================================================
@@ -276,16 +283,18 @@ static int pcnet_probe(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static void pcnet_detach(struct pcmcia_device *link)
+static void pcnet_detach(struct pcmcia_device *p_dev)
 {
+       dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
        DEBUG(0, "pcnet_detach(0x%p)\n", link);
 
-       if (link->dev_node)
+       if (link->dev)
                unregister_netdev(dev);
 
-       pcnet_release(link);
+       if (link->state & DEV_CONFIG)
+               pcnet_release(link);
 
        free_netdev(dev);
 } /* pcnet_detach */
@@ -297,7 +306,7 @@ static void pcnet_detach(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static hw_info_t *get_hwinfo(struct pcmcia_device *link)
+static hw_info_t *get_hwinfo(dev_link_t *link)
 {
     struct net_device *dev = link->priv;
     win_req_t req;
@@ -309,9 +318,9 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
     req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
     req.Base = 0; req.Size = 0;
     req.AccessSpeed = 0;
-    i = pcmcia_request_window(&link, &req, &link->win);
+    i = pcmcia_request_window(&link->handle, &req, &link->win);
     if (i != CS_SUCCESS) {
-       cs_error(link, RequestWindow, i);
+       cs_error(link->handle, RequestWindow, i);
        return NULL;
     }
 
@@ -330,11 +339,11 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
        for (j = 0; j < 6; j++)
            dev->dev_addr[j] = readb(base + (j<<1));
     }
-
+    
     iounmap(virt);
     j = pcmcia_release_window(link->win);
     if (j != CS_SUCCESS)
-       cs_error(link, ReleaseWindow, j);
+       cs_error(link->handle, ReleaseWindow, j);
     return (i < NR_INFO) ? hw_info+i : NULL;
 } /* get_hwinfo */
 
@@ -346,7 +355,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static hw_info_t *get_prom(struct pcmcia_device *link)
+static hw_info_t *get_prom(dev_link_t *link)
 {
     struct net_device *dev = link->priv;
     kio_addr_t ioaddr = dev->base_addr;
@@ -400,7 +409,7 @@ static hw_info_t *get_prom(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static hw_info_t *get_dl10019(struct pcmcia_device *link)
+static hw_info_t *get_dl10019(dev_link_t *link)
 {
     struct net_device *dev = link->priv;
     int i;
@@ -422,7 +431,7 @@ static hw_info_t *get_dl10019(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static hw_info_t *get_ax88190(struct pcmcia_device *link)
+static hw_info_t *get_ax88190(dev_link_t *link)
 {
     struct net_device *dev = link->priv;
     kio_addr_t ioaddr = dev->base_addr;
@@ -455,7 +464,7 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static hw_info_t *get_hwired(struct pcmcia_device *link)
+static hw_info_t *get_hwired(dev_link_t *link)
 {
     struct net_device *dev = link->priv;
     int i;
@@ -482,7 +491,7 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
 #define CS_CHECK(fn, ret) \
 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
-static int try_io_port(struct pcmcia_device *link)
+static int try_io_port(dev_link_t *link)
 {
     int j, ret;
     if (link->io.NumPorts1 == 32) {
@@ -490,7 +499,7 @@ static int try_io_port(struct pcmcia_device *link)
        if (link->io.NumPorts2 > 0) {
            /* for master/slave multifunction cards */
            link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-           link->irq.Attributes =
+           link->irq.Attributes = 
                IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
        }
     } else {
@@ -503,17 +512,18 @@ static int try_io_port(struct pcmcia_device *link)
        for (j = 0; j < 0x400; j += 0x20) {
            link->io.BasePort1 = j ^ 0x300;
            link->io.BasePort2 = (j ^ 0x300) + 0x10;
-           ret = pcmcia_request_io(link, &link->io);
+           ret = pcmcia_request_io(link->handle, &link->io);
            if (ret == CS_SUCCESS) return ret;
        }
        return ret;
     } else {
-       return pcmcia_request_io(link, &link->io);
+       return pcmcia_request_io(link->handle, &link->io);
     }
 }
 
-static int pcnet_config(struct pcmcia_device *link)
+static void pcnet_config(dev_link_t *link)
 {
+    client_handle_t handle = link->handle;
     struct net_device *dev = link->priv;
     pcnet_dev_t *info = PRIV(dev);
     tuple_t tuple;
@@ -521,6 +531,7 @@ static int pcnet_config(struct pcmcia_device *link)
     int i, last_ret, last_fn, start_pg, stop_pg, cm_offset;
     int manfid = 0, prodid = 0, has_shmem = 0;
     u_short buf[64];
+    config_info_t conf;
     hw_info_t *hw_info;
 
     DEBUG(0, "pcnet_config(0x%p)\n", link);
@@ -530,32 +541,39 @@ static int pcnet_config(struct pcmcia_device *link)
     tuple.TupleDataMax = sizeof(buf);
     tuple.TupleOffset = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
-    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
-    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
-    CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+    CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
 
+    /* Configure card */
+    link->state |= DEV_CONFIG;
+
+    /* Look up current Vcc */
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
+    link->conf.Vcc = conf.Vcc;
+
     tuple.DesiredTuple = CISTPL_MANFID;
     tuple.Attributes = TUPLE_RETURN_COMMON;
-    if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) &&
-       (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) {
+    if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) &&
+       (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) {
        manfid = le16_to_cpu(buf[0]);
        prodid = le16_to_cpu(buf[1]);
     }
-
+    
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
-    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
+    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (last_ret == CS_SUCCESS) {
        cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
        cistpl_io_t *io = &(parse.cftable_entry.io);
-
-       if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
-                       pcmcia_parse_tuple(link, &tuple, &parse) != 0 ||
+       
+       if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+                       pcmcia_parse_tuple(handle, &tuple, &parse) != 0 ||
                        cfg->index == 0 || cfg->io.nwin == 0)
                goto next_entry;
-
+       
        link->conf.ConfigIndex = cfg->index;
        /* For multifunction cards, by convention, we configure the
           network function with window 0, and serial with window 1 */
@@ -576,15 +594,15 @@ static int pcnet_config(struct pcmcia_device *link)
            if (last_ret == CS_SUCCESS) break;
        }
     next_entry:
-       last_ret = pcmcia_get_next_tuple(link, &tuple);
+       last_ret = pcmcia_get_next_tuple(handle, &tuple);
     }
     if (last_ret != CS_SUCCESS) {
-       cs_error(link, RequestIO, last_ret);
+       cs_error(handle, RequestIO, last_ret);
        goto failed;
     }
 
-    CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
-
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+    
     if (link->io.NumPorts2 == 8) {
        link->conf.Attributes |= CONF_ENABLE_SPKR;
        link->conf.Status = CCSR_AUDIO_ENA;
@@ -592,8 +610,8 @@ static int pcnet_config(struct pcmcia_device *link)
     if ((manfid == MANFID_IBM) &&
        (prodid == PRODID_IBM_HOME_AND_AWAY))
        link->conf.ConfigIndex |= 0x10;
-
-    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+    
+    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
     dev->irq = link->irq.AssignedIRQ;
     dev->base_addr = link->io.BasePort1;
     if (info->flags & HAS_MISC_REG) {
@@ -614,7 +632,7 @@ static int pcnet_config(struct pcmcia_device *link)
        hw_info = get_ax88190(link);
     if (hw_info == NULL)
        hw_info = get_hwired(link);
-
+    
     if (hw_info == NULL) {
        printk(KERN_NOTICE "pcnet_cs: unable to read hardware net"
               " address for io base %#3lx\n", dev->base_addr);
@@ -631,7 +649,7 @@ static int pcnet_config(struct pcmcia_device *link)
        info->flags &= ~USE_BIG_BUF;
     if (!use_big_buf)
        info->flags &= ~USE_BIG_BUF;
-
+    
     if (info->flags & USE_BIG_BUF) {
        start_pg = SOCKET_START_PG;
        stop_pg = SOCKET_STOP_PG;
@@ -661,8 +679,9 @@ static int pcnet_config(struct pcmcia_device *link)
            info->eth_phy = 0;
     }
 
-    link->dev_node = &info->node;
-    SET_NETDEV_DEV(dev, &handle_to_dev(link));
+    link->dev = &info->node;
+    link->state &= ~DEV_CONFIG_PENDING;
+    SET_NETDEV_DEV(dev, &handle_to_dev(handle));
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
     dev->poll_controller = ei_poll;
@@ -670,7 +689,7 @@ static int pcnet_config(struct pcmcia_device *link)
 
     if (register_netdev(dev) != 0) {
        printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
-       link->dev_node = NULL;
+       link->dev = NULL;
        goto failed;
     }
 
@@ -693,13 +712,14 @@ static int pcnet_config(struct pcmcia_device *link)
     printk(" hw_addr ");
     for (i = 0; i < 6; i++)
        printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
-    return 0;
+    return;
 
 cs_failed:
-    cs_error(link, last_fn, last_ret);
+    cs_error(link->handle, last_fn, last_ret);
 failed:
     pcnet_release(link);
-    return -ENODEV;
+    link->state &= ~DEV_CONFIG_PENDING;
+    return;
 } /* pcnet_config */
 
 /*======================================================================
@@ -710,16 +730,21 @@ failed:
 
 ======================================================================*/
 
-static void pcnet_release(struct pcmcia_device *link)
+static void pcnet_release(dev_link_t *link)
 {
-       pcnet_dev_t *info = PRIV(link->priv);
+    pcnet_dev_t *info = PRIV(link->priv);
 
-       DEBUG(0, "pcnet_release(0x%p)\n", link);
+    DEBUG(0, "pcnet_release(0x%p)\n", link);
 
-       if (info->flags & USE_SHMEM)
-               iounmap(info->base);
+    if (info->flags & USE_SHMEM) {
+       iounmap(info->base);
+       pcmcia_release_window(link->win);
+    }
+    pcmcia_release_configuration(link->handle);
+    pcmcia_release_io(link->handle, &link->io);
+    pcmcia_release_irq(link->handle, &link->irq);
 
-       pcmcia_disable_device(link);
+    link->state &= ~DEV_CONFIG;
 }
 
 /*======================================================================
@@ -731,24 +756,34 @@ static void pcnet_release(struct pcmcia_device *link)
 
 ======================================================================*/
 
-static int pcnet_suspend(struct pcmcia_device *link)
+static int pcnet_suspend(struct pcmcia_device *p_dev)
 {
+       dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       if (link->open)
-               netif_device_detach(dev);
+       link->state |= DEV_SUSPEND;
+       if (link->state & DEV_CONFIG) {
+               if (link->open)
+                       netif_device_detach(dev);
+               pcmcia_release_configuration(link->handle);
+       }
 
        return 0;
 }
 
-static int pcnet_resume(struct pcmcia_device *link)
+static int pcnet_resume(struct pcmcia_device *p_dev)
 {
+       dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       if (link->open) {
-               pcnet_reset_8390(dev);
-               NS8390_init(dev, 1);
-               netif_device_attach(dev);
+       link->state &= ~DEV_SUSPEND;
+       if (link->state & DEV_CONFIG) {
+               pcmcia_request_configuration(link->handle, &link->conf);
+               if (link->open) {
+                       pcnet_reset_8390(dev);
+                       NS8390_init(dev, 1);
+                       netif_device_attach(dev);
+               }
        }
 
        return 0;
@@ -929,7 +964,7 @@ static void set_misc_reg(struct net_device *dev)
     kio_addr_t nic_base = dev->base_addr;
     pcnet_dev_t *info = PRIV(dev);
     u_char tmp;
-
+    
     if (info->flags & HAS_MISC_REG) {
        tmp = inb_p(nic_base + PCNET_MISC) & ~3;
        if (dev->if_port == 2)
@@ -988,17 +1023,17 @@ static void mii_phy_probe(struct net_device *dev)
 static int pcnet_open(struct net_device *dev)
 {
     pcnet_dev_t *info = PRIV(dev);
-    struct pcmcia_device *link = info->p_dev;
-
+    dev_link_t *link = &info->link;
+    
     DEBUG(2, "pcnet_open('%s')\n", dev->name);
 
-    if (!pcmcia_dev_present(link))
+    if (!DEV_OK(link))
        return -ENODEV;
 
     link->open++;
 
     set_misc_reg(dev);
-    request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
+    request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
 
     info->phy_id = info->eth_phy;
     info->link_status = 0x00;
@@ -1016,13 +1051,13 @@ static int pcnet_open(struct net_device *dev)
 static int pcnet_close(struct net_device *dev)
 {
     pcnet_dev_t *info = PRIV(dev);
-    struct pcmcia_device *link = info->p_dev;
+    dev_link_t *link = &info->link;
 
     DEBUG(2, "pcnet_close('%s')\n", dev->name);
 
     ei_close(dev);
     free_irq(dev->irq, dev);
-
+    
     link->open--;
     netif_stop_queue(dev);
     del_timer_sync(&info->watchdog);
@@ -1054,12 +1089,12 @@ static void pcnet_reset_8390(struct net_device *dev)
        udelay(100);
     }
     outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
-
+    
     if (i == 100)
        printk(KERN_ERR "%s: pcnet_reset_8390() did not complete.\n",
               dev->name);
     set_misc_reg(dev);
-
+    
 } /* pcnet_reset_8390 */
 
 /*====================================================================*/
@@ -1233,7 +1268,7 @@ static void dma_get_8390_hdr(struct net_device *dev,
               dev->name, ei_status.dmaing, ei_status.irqlock);
        return;
     }
-
+    
     ei_status.dmaing |= 0x01;
     outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base + PCNET_CMD);
     outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
@@ -1394,7 +1429,7 @@ static void dma_block_output(struct net_device *dev, int count,
 
 /*====================================================================*/
 
-static int setup_dma_config(struct pcmcia_device *link, int start_pg,
+static int setup_dma_config(dev_link_t *link, int start_pg,
                            int stop_pg)
 {
     struct net_device *dev = link->priv;
@@ -1458,7 +1493,7 @@ static void shmem_get_8390_hdr(struct net_device *dev,
     void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
                                + (ring_page << 8)
                                - (ei_status.rx_start_page << 8);
-
+    
     copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
     /* Fix for big endian systems */
     hdr->count = le16_to_cpu(hdr->count);
@@ -1473,7 +1508,7 @@ static void shmem_block_input(struct net_device *dev, int count,
     unsigned long offset = (TX_PAGES<<8) + ring_offset
                                - (ei_status.rx_start_page << 8);
     char *buf = skb->data;
-
+    
     if (offset + count > ei_status.priv) {
        /* We must wrap the input move. */
        int semi_count = ei_status.priv - offset;
@@ -1497,7 +1532,7 @@ static void shmem_block_output(struct net_device *dev, int count,
 
 /*====================================================================*/
 
-static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
+static int setup_shmem_window(dev_link_t *link, int start_pg,
                              int stop_pg, int cm_offset)
 {
     struct net_device *dev = link->priv;
@@ -1519,7 +1554,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
     req.Attributes |= WIN_USE_WAIT;
     req.Base = 0; req.Size = window_size;
     req.AccessSpeed = mem_speed;
-    CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
+    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
 
     mem.CardOffset = (start_pg << 8) + cm_offset;
     offset = mem.CardOffset % window_size;
@@ -1541,7 +1576,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
        info->base = NULL; link->win = NULL;
        goto failed;
     }
-
+    
     ei_status.mem = info->base + offset;
     ei_status.priv = req.Size;
     dev->mem_start = (u_long)ei_status.mem;
@@ -1560,7 +1595,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
     return 0;
 
 cs_failed:
-    cs_error(link, last_fn, last_ret);
+    cs_error(link->handle, last_fn, last_ret);
 failed:
     return 1;
 }
@@ -1639,7 +1674,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
        PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2),
        PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd),
-       PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
        PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
        PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa),
        PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
@@ -1693,7 +1727,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V2)", 0x0733cc81, 0x3a3b28e9),
        PCMCIA_DEVICE_PROD_ID12("Linksys", "HomeLink Phoneline + 10/100 Network PC Card (PCM100H1)", 0x733cc81, 0x7a3e5c3a),
        PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TX", 0x88fcdeda, 0x6d772737),
-       PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TE", 0x88fcdeda, 0x0e714bee),
        PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN20T", 0x88fcdeda, 0x81090922),
        PCMCIA_DEVICE_PROD_ID12("LONGSHINE", "PCMCIA Ethernet Card", 0xf866b0b0, 0x6f6652e0),
        PCMCIA_DEVICE_PROD_ID12("MACNICA", "ME1-JEIDA", 0x20841b68, 0xaf8a3578),
@@ -1768,8 +1801,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
        PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "NE2K.cis"),
        PCMCIA_DEVICE_CIS_PROD_ID12("PMX   ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"),
        PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "tamarack.cis"),
-       PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0",
-               0xb4be14e3, 0x43ac239b, 0x0877b627),
        PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, pcnet_ids);