tuple.DesiredTuple = CISTPL_CONFIG; i = first_tuple(handle, &tuple, &parse); 
tuple = &cfg_mem->tuple; parse = &cfg_mem->parse; buf = cfg_mem->buf;  tuple->Attributes = tuple->TupleOffset = 0; tuple->TupleData = (cisdata_t *)buf; tuple->TupleDataMax = 64;  tuple->DesiredTuple = CISTPL_CONFIG; i = first_tuple(handle, tuple, parse); 
static void smc91c92_config(dev_link_t *link){    client_handle_t handle = link->handle;    struct net_device *dev = link->priv;    struct smc_private *smc = netdev_priv(dev);    tuple_t tuple;    cisparse_t parse;    u_short buf[32];    char *name;    int i, j, rev;    kio_addr_t ioaddr;    u_long mir;    DEBUG(0, "smc91c92_config(0x%p)\n", link);    tuple.Attributes = tuple.TupleOffset = 0;    tuple.TupleData = (cisdata_t *)buf;    tuple.TupleDataMax = sizeof(buf);    tuple.DesiredTuple = CISTPL_CONFIG;    i = first_tuple(handle, &tuple, &parse);    CS_EXIT_TEST(i, ParseTuple, config_failed);    link->conf.ConfigBase = parse.config.base;    link->conf.Present = parse.config.rmask[0];    tuple.DesiredTuple = CISTPL_MANFID;    tuple.Attributes = TUPLE_RETURN_COMMON;    if (first_tuple(handle, &tuple, &parse) == CS_SUCCESS) {	smc->manfid = parse.manfid.manf;	smc->cardid = parse.manfid.card;    }    /* Configure card */    link->state |= DEV_CONFIG;    if ((smc->manfid == MANFID_OSITECH) &&	(smc->cardid != PRODID_OSITECH_SEVEN)) {	i = osi_config(link);    } else if ((smc->manfid == MANFID_MOTOROLA) ||	       ((smc->manfid == MANFID_MEGAHERTZ) &&		((smc->cardid == PRODID_MEGAHERTZ_VARIOUS) ||		 (smc->cardid == PRODID_MEGAHERTZ_EM3288)))) {	i = mhz_mfc_config(link);    } else {	i = smc_config(link);    }    CS_EXIT_TEST(i, RequestIO, config_failed);    i = pcmcia_request_irq(link->handle, &link->irq);    CS_EXIT_TEST(i, RequestIRQ, config_failed);    i = pcmcia_request_configuration(link->handle, &link->conf);    CS_EXIT_TEST(i, RequestConfiguration, config_failed);    if (smc->manfid == MANFID_MOTOROLA)	mot_config(link);    dev->irq = link->irq.AssignedIRQ;    if ((if_port >= 0) && (if_port <= 2))	dev->if_port = if_port;    else	printk(KERN_NOTICE "smc91c92_cs: invalid if_port requested\n");    switch (smc->manfid) {    case MANFID_OSITECH:    case MANFID_PSION:	i = osi_setup(link, smc->manfid, smc->cardid); break;    case MANFID_SMC:    case MANFID_NEW_MEDIA:	i = smc_setup(link); break;    case 0x128: /* For broken Megahertz cards */    case MANFID_MEGAHERTZ:	i = mhz_setup(link); break;    case MANFID_MOTOROLA:    default: /* get the hw address from EEPROM */	i = mot_setup(link); break;    }    if (i != 0) {	printk(KERN_NOTICE "smc91c92_cs: Unable to find hardware address.\n");	goto config_undo;    }    smc->duplex = 0;    smc->rx_ovrn = 0;    rev = check_sig(link);    name = "???";    if (rev > 0)	switch (rev >> 4) {	case 3: name = "92"; break;	case 4: name = ((rev & 15) >= 6) ? "96" : "94"; break;	case 5: name = "95"; break;	case 7: name = "100"; break;	case 8: name = "100-FD"; break;	case 9: name = "110"; break;	}    ioaddr = dev->base_addr;    if (rev > 0) {	u_long mcr;	SMC_SELECT_BANK(0);	mir = inw(ioaddr + MEMINFO) & 0xff;	if (mir == 0xff) mir++;	/* Get scale factor for memory size */	mcr = ((rev >> 4) > 3) ? inw(ioaddr + MEMCFG) : 0x0200;	mir *= 128 * (1<<((mcr >> 9) & 7));	SMC_SELECT_BANK(1);	smc->cfg = inw(ioaddr + CONFIG) & ~CFG_AUI_SELECT;	smc->cfg |= CFG_NO_WAIT | CFG_16BIT | CFG_STATIC;	if (smc->manfid == MANFID_OSITECH)	    smc->cfg |= CFG_IRQ_SEL_1 | CFG_IRQ_SEL_0;	if ((rev >> 4) >= 7)	    smc->cfg |= CFG_MII_SELECT;    } else	mir = 0;    if (smc->cfg & CFG_MII_SELECT) {	SMC_SELECT_BANK(3);	for (i = 0; i < 32; i++) {	    j = mdio_read(dev, i, 1);	    if ((j != 0) && (j != 0xffff)) break;	}	smc->mii_if.phy_id = (i < 32) ? i : -1;	SMC_SELECT_BANK(0);    }    link->dev = &smc->node;    link->state &= ~DEV_CONFIG_PENDING;    SET_NETDEV_DEV(dev, &handle_to_dev(handle));    if (register_netdev(dev) != 0) {	printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");	link->dev = NULL;	goto config_undo;    }    strcpy(smc->node.dev_name, dev->name);    printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, "	   "hw_addr ", dev->name, name, (rev & 0x0f), dev->base_addr,	   dev->irq);    for (i = 0; i < 6; i++)	printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));    if (rev > 0) {	if (mir & 0x3ff)	    printk(KERN_INFO "  %lu byte", mir);	else	    printk(KERN_INFO "  %lu kb", mir>>10);	printk(" buffer, %s xcvr\n", (smc->cfg & CFG_MII_SELECT) ?	       "MII" : if_names[dev->if_port]);    }    if (smc->cfg & CFG_MII_SELECT) {	if (smc->mii_if.phy_id != -1) {	    DEBUG(0, "  MII transceiver at index %d, status %x.\n",		  smc->mii_if.phy_id, j);	} else {    	    printk(KERN_NOTICE "  No MII transceivers found!\n");	}    }    return;config_undo:    unregister_netdev(dev);config_failed:			/* CS_EXIT_TEST() calls jump to here... */    smc91c92_release(link);    link->state &= ~DEV_CONFIG_PENDING;} /* smc91c92_config */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4638aef40ba9ebb9734caeed1f373c24015259fd/smc91c92_cs.c/clean/drivers/net/pcmcia/smc91c92_cs.c