unchar *memaddr; 
unchar __iomem *memaddr; 
static void fepcmd(struct channel *ch, int cmd, int word_or_byte,                   int byte2, int ncmds, int bytecmd){ /* Begin fepcmd */	unchar *memaddr;	unsigned int head, cmdTail, cmdStart, cmdMax;	long count;	int n;	/* This is the routine in which commands may be passed to the card. */	if (ch->board->status == DISABLED)		return;	assertgwinon(ch);	/* Remember head (As well as max) is just an offset not a base addr */	head = readw(&ch->mailbox->cin);	/* cmdStart is a base address */	cmdStart = readw(&ch->mailbox->cstart);	/* ------------------------------------------------------------------		We do the addition below because we do not want a max pointer 		relative to cmdStart.  We want a max pointer that points at the 		physical end of the command queue.	-------------------------------------------------------------------- */	cmdMax = (cmdStart + 4 + readw(&ch->mailbox->cmax));	memaddr = ch->board->re_map_membase;	if (head >= (cmdMax - cmdStart) || (head & 03))  {		printk(KERN_ERR "line %d: Out of range, cmd = %x, head = %x\n", __LINE__,  cmd, head);		printk(KERN_ERR "line %d: Out of range, cmdMax = %x, cmdStart = %x\n", __LINE__,  cmdMax, cmdStart);		return;	}	if (bytecmd)  {		writeb(cmd, memaddr + head + cmdStart + 0);		writeb(ch->channelnum,  memaddr + head + cmdStart + 1);		/* Below word_or_byte is bits to set */		writeb(word_or_byte,  memaddr + head + cmdStart + 2);		/* Below byte2 is bits to reset */		writeb(byte2, memaddr + head + cmdStart + 3);	}  else {		writeb(cmd, memaddr + head + cmdStart + 0);		writeb(ch->channelnum,  memaddr + head + cmdStart + 1);		writeb(word_or_byte,  memaddr + head + cmdStart + 2);	}	head = (head + 4) & (cmdMax - cmdStart - 4);	writew(head, &ch->mailbox->cin);	count = FEPTIMEOUT;	for (;;)  { /* Begin forever loop */		count--;		if (count == 0)  {			printk(KERN_ERR "<Error> - Fep not responding in fepcmd()\n");			return;		}		head = readw(&ch->mailbox->cin);		cmdTail = readw(&ch->mailbox->cout);		n = (head - cmdTail) & (cmdMax - cmdStart - 4);		/* ----------------------------------------------------------			Basically this will break when the FEP acknowledges the 			command by incrementing cmdTail (Making it equal to head).		------------------------------------------------------------- */		if (n <= ncmds * (sizeof(short) * 4))			break; /* Well nearly forever :-) */	} /* End forever loop */} /* End fepcmd */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bc9a5154a24d16d41cc79dbf1442de34454bc7db/epca.c/buggy/drivers/char/epca.c