struct board_chan *bc; 
struct board_chan __iomem *bc; 
static int pc_chars_in_buffer(struct tty_struct *tty){ /* Begin pc_chars_in_buffer */	int chars;	unsigned int ctail, head, tail;	int remain;	unsigned long flags;	struct channel *ch;	struct board_chan *bc;	/* ---------------------------------------------------------		verifyChannel returns the channel from the tty struct		if it is valid.  This serves as a sanity check.	------------------------------------------------------------- */	if ((ch = verifyChannel(tty)) == NULL)		return(0);	spin_lock_irqsave(&epca_lock, flags);	globalwinon(ch);	bc = ch->brdchan;	tail = readw(&bc->tout);	head = readw(&bc->tin);	ctail = readw(&ch->mailbox->cout);	if (tail == head && readw(&ch->mailbox->cin) == ctail && readb(&bc->tbusy) == 0)		chars = 0;	else  { /* Begin if some space on the card has been used */		head = readw(&bc->tin) & (ch->txbufsize - 1);		tail &= (ch->txbufsize - 1);		/*  --------------------------------------------------------------			The logic here is basically opposite of the above pc_write_room			here we are finding the amount of bytes in the buffer filled.			Not the amount of bytes empty.		------------------------------------------------------------------- */		if ((remain = tail - head - 1) < 0 )			remain += ch->txbufsize;		chars = (int)(ch->txbufsize - remain);		/* -------------------------------------------------------------  			Make it possible to wakeup anything waiting for output			in tty_ioctl.c, etc.			If not already set.  Setup an event to indicate when the			transmit buffer empties 		----------------------------------------------------------------- */		if (!(ch->statusflags & EMPTYWAIT))			setup_empty_event(tty,ch);	} /* End if some space on the card has been used */	memoff(ch);	spin_unlock_irqrestore(&epca_lock, flags);	/* Return number of characters residing on card. */	return(chars);} /* End pc_chars_in_buffer */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bc9a5154a24d16d41cc79dbf1442de34454bc7db/epca.c/buggy/drivers/char/epca.c