bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); 
bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); 
static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs){	int i;	unsigned char ch, *cp;	struct tty_struct *tty = port->info->tty;	struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;	volatile cbd_t *bdp;	u16 status;	unsigned int flg;	pr_debug("CPM uart[%d]:RX INT\n", port->line);	/* Just loop through the closed BDs and copy the characters into	 * the buffer.	 */	bdp = pinfo->rx_cur;	for (;;) {		/* get status */		status = bdp->cbd_sc;		/* If this one is empty, return happy */		if (status & BD_SC_EMPTY)			break;		/* get number of characters, and check spce in flip-buffer */		i = bdp->cbd_datlen;		/* If we have not enough room in tty flip buffer, then we try 		 * later, which will be the next rx-interrupt or a timeout		 */		if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) {			tty->flip.work.func((void *)tty);			if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) {				printk(KERN_WARNING "TTY_DONT_FLIP set\n");				return;			}		}		/* get pointer */		cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr);		/* loop through the buffer */		while (i-- > 0) {			ch = *cp++;			port->icount.rx++;			flg = TTY_NORMAL;			if (status &			    (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))				goto handle_error;			if (uart_handle_sysrq_char(port, ch, regs))				continue;		      error_return:			*tty->flip.char_buf_ptr++ = ch;			*tty->flip.flag_buf_ptr++ = flg;			tty->flip.count++;		}		/* End while (i--) */		/* This BD is ready to be used again. Clear status. get next */		bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV);		bdp->cbd_sc |= BD_SC_EMPTY;		if (bdp->cbd_sc & BD_SC_WRAP)			bdp = pinfo->rx_bd_base;		else			bdp++;	} /* End for (;;) */	/* Write back buffer pointer */	pinfo->rx_cur = (volatile cbd_t *) bdp;	/* activate BH processing */	tty_flip_buffer_push(tty);	return;	/* Error processing */      handle_error:	/* Statistics */	if (status & BD_SC_BR)		port->icount.brk++;	if (status & BD_SC_PR)		port->icount.parity++;	if (status & BD_SC_FR)		port->icount.frame++;	if (status & BD_SC_OV)		port->icount.overrun++;	/* Mask out ignored conditions */	status &= port->read_status_mask;	/* Handle the remaining ones */	if (status & BD_SC_BR)		flg = TTY_BREAK;	else if (status & BD_SC_PR)		flg = TTY_PARITY;	else if (status & BD_SC_FR)		flg = TTY_FRAME;	/* overrun does not affect the current character ! */	if (status & BD_SC_OV) {		ch = 0;		flg = TTY_OVERRUN;		/* We skip this buffer */		/* CHECK: Is really nothing senseful there */		/* ASSUMPTION: it contains nothing valid */		i = 0;	}#ifdef SUPPORT_SYSRQ	port->sysrq = 0;#endif	goto error_return;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/311c46273f0e8b140d4cc68e13128cbc22114807/cpm_uart_core.c/clean/drivers/serial/cpm_uart/cpm_uart_core.c