tuple_t tuple; u_char buf[256]; cisparse_t parse; cistpl_cftable_entry_t *cf = &parse.cftable_entry; 
struct serial_cfg_mem *cfg_mem; tuple_t *tuple; u_char *buf; cisparse_t *parse; cistpl_cftable_entry_t *cf; 
static int multi_config(dev_link_t * link){	client_handle_t handle = link->handle;	struct serial_info *info = link->priv;	tuple_t tuple;	u_char buf[256];	cisparse_t parse;	cistpl_cftable_entry_t *cf = &parse.cftable_entry;	config_info_t config;	int i, base2 = 0;	i = pcmcia_get_configuration_info(handle, &config);	if (i != CS_SUCCESS) {		cs_error(handle, GetConfigurationInfo, i);		return -1;	}	link->conf.Vcc = config.Vcc;	tuple.TupleData = (cisdata_t *) buf;	tuple.TupleOffset = 0;	tuple.TupleDataMax = 255;	tuple.Attributes = 0;	tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;	/* First, look for a generic full-sized window */	link->io.NumPorts1 = info->multi * 8;	i = first_tuple(handle, &tuple, &parse);	while (i != CS_NO_MORE_ITEMS) {		/* The quad port cards have bad CIS's, so just look for a		   window larger than 8 ports and assume it will be right */		if ((i == CS_SUCCESS) && (cf->io.nwin == 1) &&		    (cf->io.win[0].len > 8)) {			link->conf.ConfigIndex = cf->index;			link->io.BasePort1 = cf->io.win[0].base;			link->io.IOAddrLines =			    cf->io.flags & CISTPL_IO_LINES_MASK;			i = pcmcia_request_io(link->handle, &link->io);			base2 = link->io.BasePort1 + 8;			if (i == CS_SUCCESS)				break;		}		i = next_tuple(handle, &tuple, &parse);	}	/* If that didn't work, look for two windows */	if (i != CS_SUCCESS) {		link->io.NumPorts1 = link->io.NumPorts2 = 8;		info->multi = 2;		i = first_tuple(handle, &tuple, &parse);		while (i != CS_NO_MORE_ITEMS) {			if ((i == CS_SUCCESS) && (cf->io.nwin == 2)) {				link->conf.ConfigIndex = cf->index;				link->io.BasePort1 = cf->io.win[0].base;				link->io.BasePort2 = cf->io.win[1].base;				link->io.IOAddrLines =				    cf->io.flags & CISTPL_IO_LINES_MASK;				i = pcmcia_request_io(link->handle, &link->io);				base2 = link->io.BasePort2;				if (i == CS_SUCCESS)					break;			}			i = next_tuple(handle, &tuple, &parse);		}	}	if (i != CS_SUCCESS) {		cs_error(link->handle, RequestIO, i);		return -1;	}	i = pcmcia_request_irq(link->handle, &link->irq);	if (i != CS_SUCCESS) {		printk(KERN_NOTICE		       "serial_cs: no usable port range found, giving up\n");		cs_error(link->handle, RequestIRQ, i);		link->irq.AssignedIRQ = 0;	}	/* Socket Dual IO: this enables irq's for second port */	if (info->multi && (info->manfid == MANFID_SOCKET)) {		link->conf.Present |= PRESENT_EXT_STATUS;		link->conf.ExtStatus = ESR_REQ_ATTN_ENA;	}	i = pcmcia_request_configuration(link->handle, &link->conf);	if (i != CS_SUCCESS) {		cs_error(link->handle, RequestConfiguration, i);		return -1;	}	/* The Oxford Semiconductor OXCF950 cards are in fact single-port:	   8 registers are for the UART, the others are extra registers */	if (info->manfid == MANFID_OXSEMI) {		if (cf->index == 1 || cf->index == 3) {			setup_serial(handle, info, base2, link->irq.AssignedIRQ);			outb(12, link->io.BasePort1 + 1);		} else {			setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ);			outb(12, base2 + 1);		}		return 0;	}	setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ);	/* The Nokia cards are not really multiport cards */	if (info->manfid == MANFID_NOKIA)		return 0;	for (i = 0; i < info->multi - 1; i++)		setup_serial(handle, info, base2 + (8 * i), link->irq.AssignedIRQ);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/16f31113a614a35acc2da64f4ae39ab0ed7e194f/serial_cs.c/clean/drivers/serial/serial_cs.c