return; 
goto done; 
static void rp_do_receive(struct r_port *info,			  struct tty_struct *tty,			  CHANNEL_t * cp, unsigned int ChanStatus){	unsigned int CharNStat;	int ToRecv, wRecv, space = 0, count;	unsigned char *cbuf;	char *fbuf;	struct tty_ldisc *ld;	ld = tty_ldisc_ref(tty);	ToRecv = sGetRxCnt(cp);	if (ld)		space = ld->receive_room(tty);	if (space > 2 * TTY_FLIPBUF_SIZE)		space = 2 * TTY_FLIPBUF_SIZE;	cbuf = tty->flip.char_buf;	fbuf = tty->flip.flag_buf;	count = 0;#ifdef ROCKET_DEBUG_INTR	printk(KERN_INFO "rp_do_receive(%d, %d)...", ToRecv, space);#endif	/*	 * determine how many we can actually read in.  If we can't	 * read any in then we have a software overrun condition.	 */	if (ToRecv > space)		ToRecv = space;	if (ToRecv <= 0)		return;	/*	 * if status indicates there are errored characters in the	 * FIFO, then enter status mode (a word in FIFO holds	 * character and status).	 */	if (ChanStatus & (RXFOVERFL | RXBREAK | RXFRAME | RXPARITY)) {		if (!(ChanStatus & STATMODE)) {#ifdef ROCKET_DEBUG_RECEIVE			printk(KERN_INFO "Entering STATMODE...");#endif			ChanStatus |= STATMODE;			sEnRxStatusMode(cp);		}	}	/* 	 * if we previously entered status mode, then read down the	 * FIFO one word at a time, pulling apart the character and	 * the status.  Update error counters depending on status	 */	if (ChanStatus & STATMODE) {#ifdef ROCKET_DEBUG_RECEIVE		printk(KERN_INFO "Ignore %x, read %x...", info->ignore_status_mask,		       info->read_status_mask);#endif		while (ToRecv) {			CharNStat = sInW(sGetTxRxDataIO(cp));#ifdef ROCKET_DEBUG_RECEIVE			printk(KERN_INFO "%x...", CharNStat);#endif			if (CharNStat & STMBREAKH)				CharNStat &= ~(STMFRAMEH | STMPARITYH);			if (CharNStat & info->ignore_status_mask) {				ToRecv--;				continue;			}			CharNStat &= info->read_status_mask;			if (CharNStat & STMBREAKH)				*fbuf++ = TTY_BREAK;			else if (CharNStat & STMPARITYH)				*fbuf++ = TTY_PARITY;			else if (CharNStat & STMFRAMEH)				*fbuf++ = TTY_FRAME;			else if (CharNStat & STMRCVROVRH)				*fbuf++ = TTY_OVERRUN;			else				*fbuf++ = 0;			*cbuf++ = CharNStat & 0xff;			count++;			ToRecv--;		}		/*		 * after we've emptied the FIFO in status mode, turn		 * status mode back off		 */		if (sGetRxCnt(cp) == 0) {#ifdef ROCKET_DEBUG_RECEIVE			printk(KERN_INFO "Status mode off.\n");#endif			sDisRxStatusMode(cp);		}	} else {		/*		 * we aren't in status mode, so read down the FIFO two		 * characters at time by doing repeated word IO		 * transfer.		 */		wRecv = ToRecv >> 1;		if (wRecv)			sInStrW(sGetTxRxDataIO(cp), (unsigned short *) cbuf, wRecv);		if (ToRecv & 1)			cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp));		memset(fbuf, 0, ToRecv);		cbuf += ToRecv;		fbuf += ToRecv;		count += ToRecv;	}	/*  Push the data up to the tty layer */	ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count);	tty_ldisc_deref(ld);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a1287ba1ba810aae1f8b81e32560d5d3bf3ff9f0/rocket.c/clean/drivers/char/rocket.c