/* Check the DSR lines that Specialix uses as board 
/* Check the DSR lines that Specialix uses as board 
static int sx_probe(struct specialix_board *bp){	unsigned char val1, val2;#if 0	int irqs = 0;	int retries;#endif	int rev;	int chip;	func_enter();	if (sx_check_io_range(bp)) {		func_exit();		return 1;	}	/* Are the I/O ports here ? */	sx_out_off(bp, CD186x_PPRL, 0x5a);	short_pause ();	val1 = sx_in_off(bp, CD186x_PPRL);	sx_out_off(bp, CD186x_PPRL, 0xa5);	short_pause ();	val2 = sx_in_off(bp, CD186x_PPRL);		if ((val1 != 0x5a) || (val2 != 0xa5)) {		printk(KERN_INFO "sx%d: specialix IO8+ Board at 0x%03x not found.\n",		       board_No(bp), bp->base);		func_exit();		return 1;	}	/* Check the DSR lines that Specialix uses as board 	   identification */	val1 = read_cross_byte (bp, CD186x_MSVR, MSVR_DSR);	val2 = read_cross_byte (bp, CD186x_MSVR, MSVR_RTS);	dprintk (SX_DEBUG_INIT, "sx%d: DSR lines are: %02x, rts lines are: %02x\n",	        board_No(bp),  val1, val2);	/* They managed to switch the bit order between the docs and	   the IO8+ card. The new PCI card now conforms to old docs.	   They changed the PCI docs to reflect the situation on the	   old card. */	val2 = (bp->flags & SX_BOARD_IS_PCI)?0x4d : 0xb2;	if (val1 != val2) {		printk(KERN_INFO "sx%d: specialix IO8+ ID %02x at 0x%03x not found (%02x).\n",		       board_No(bp), val2, bp->base, val1);		func_exit();		return 1;	}#if 0	/* It's time to find IRQ for this board */	for (retries = 0; retries < 5 && irqs <= 0; retries++) {		irqs = probe_irq_on();		sx_init_CD186x(bp);	       		/* Reset CD186x chip       */		sx_out(bp, CD186x_CAR, 2);               /* Select port 2          */		sx_wait_CCR(bp);		sx_out(bp, CD186x_CCR, CCR_TXEN);        /* Enable transmitter     */		sx_out(bp, CD186x_IER, IER_TXRDY);       /* Enable tx empty intr   */		sx_long_delay(HZ/20);	       				irqs = probe_irq_off(irqs);		dprintk (SX_DEBUG_INIT, "SRSR = %02x, ", sx_in(bp, CD186x_SRSR));		dprintk (SX_DEBUG_INIT, "TRAR = %02x, ", sx_in(bp, CD186x_TRAR));		dprintk (SX_DEBUG_INIT, "GIVR = %02x, ", sx_in(bp, CD186x_GIVR));		dprintk (SX_DEBUG_INIT, "GICR = %02x, ", sx_in(bp, CD186x_GICR));		dprintk (SX_DEBUG_INIT, "\n");		/* Reset CD186x again      */		if (!sx_init_CD186x(bp)) {			/* Hmmm. This is dead code anyway. */		}		dprintk (SX_DEBUG_INIT "val1 = %02x, val2 = %02x, val3 = %02x.\n",		        val1, val2, val3); 		}	#if 0	if (irqs <= 0) {		printk(KERN_ERR "sx%d: Can't find IRQ for specialix IO8+ board at 0x%03x.\n",		       board_No(bp), bp->base);		func_exit();		return 1;	}#endif	printk (KERN_INFO "Started with irq=%d, but now have irq=%d.\n", bp->irq, irqs);	if (irqs > 0)		bp->irq = irqs;#endif	/* Reset CD186x again  */	if (!sx_init_CD186x(bp)) {		func_exit();		return -EIO;	}	sx_request_io_range(bp);	bp->flags |= SX_BOARD_PRESENT;		/* Chip           revcode   pkgtype	                  GFRCR     SRCR bit 7	   CD180 rev B    0x81      0	   CD180 rev C    0x82      0	   CD1864 rev A   0x82      1	   CD1865 rev A   0x83      1  -- Do not use!!! Does not work. 	   CD1865 rev B   0x84      1	 -- Thanks to Gwen Wang, Cirrus Logic.	 */	switch (sx_in_off(bp, CD186x_GFRCR)) {	case 0x82:chip = 1864;rev='A';break;	case 0x83:chip = 1865;rev='A';break;	case 0x84:chip = 1865;rev='B';break;	case 0x85:chip = 1865;rev='C';break; /* Does not exist at this time */	default:chip=-1;rev='x';	}	dprintk (SX_DEBUG_INIT, " GFCR = 0x%02x\n", sx_in_off(bp, CD186x_GFRCR) );#ifdef SPECIALIX_TIMER	init_timer (&missed_irq_timer);	missed_irq_timer.function = missed_irq;	missed_irq_timer.data = (unsigned long) bp;	missed_irq_timer.expires = jiffies + sx_poll;	add_timer (&missed_irq_timer);#endif	printk(KERN_INFO"sx%d: specialix IO8+ board detected at 0x%03x, IRQ %d, CD%d Rev. %c.\n",	       board_No(bp),	       bp->base, bp->irq,	       chip, rev);	func_exit();	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d61780c0d384939ef31c46b47442854d5def4623/specialix.c/buggy/drivers/char/specialix.c