&= ~OPOST;		/* disable postprocess output characters */  
&= ~OPOST;    /* disable postprocess output char */  
static void cypress_set_termios (struct usb_serial_port *port, struct termios *old_termios){	struct cypress_private *priv = usb_get_serial_port_data(port);	struct tty_struct *tty;	int data_bits, stop_bits, parity_type, parity_enable;	unsigned cflag, iflag, baud_mask;	unsigned long flags;	__u8 oldlines;	int linechange = 0;		dbg("%s - port %d", __FUNCTION__, port->number);	tty = port->tty;	if ((!tty) || (!tty->termios)) {		dbg("%s - no tty structures", __FUNCTION__);		return;	}	spin_lock_irqsave(&priv->lock, flags);	if (!priv->termios_initialized) {		if (priv->chiptype == CT_EARTHMATE) {			*(tty->termios) = tty_std_termios;			tty->termios->c_cflag = B4800 | CS8 | CREAD | HUPCL | CLOCAL;		} else if (priv->chiptype == CT_CYPHIDCOM) {			*(tty->termios) = tty_std_termios;			tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;		}		priv->termios_initialized = 1;	}	spin_unlock_irqrestore(&priv->lock, flags);	cflag = tty->termios->c_cflag;	iflag = tty->termios->c_iflag;	/* check if there are new settings */	if (old_termios) {		if ((cflag != old_termios->c_cflag) ||		    (RELEVANT_IFLAG(iflag) != RELEVANT_IFLAG(old_termios->c_iflag))) {			dbg("%s - attempting to set new termios settings", __FUNCTION__);			/* should make a copy of this in case something goes wrong in the function, we can restore it */			spin_lock_irqsave(&priv->lock, flags);			priv->tmp_termios = *(tty->termios);			spin_unlock_irqrestore(&priv->lock, flags); 		} else {			dbg("%s - nothing to do, exiting", __FUNCTION__);			return;		}	} else		return;	/* set number of data bits, parity, stop bits */	/* when parity is disabled the parity type bit is ignored */	stop_bits = cflag & CSTOPB ? 1 : 0; /* 1 means 2 stop bits, 0 means 1 stop bit */		if (cflag & PARENB) {		parity_enable = 1;		parity_type = cflag & PARODD ? 1 : 0; /* 1 means odd parity, 0 means even parity */	} else		parity_enable = parity_type = 0;	if (cflag & CSIZE) {		switch (cflag & CSIZE) {			case CS5: data_bits = 0; break;			case CS6: data_bits = 1; break;			case CS7: data_bits = 2; break;			case CS8: data_bits = 3; break;			default: err("%s - CSIZE was set, but not CS5-CS8", __FUNCTION__); data_bits = 3;		}	} else		data_bits = 3;	spin_lock_irqsave(&priv->lock, flags);	oldlines = priv->line_control;	if ((cflag & CBAUD) == B0) {		/* drop dtr and rts */		dbg("%s - dropping the lines, baud rate 0bps", __FUNCTION__);		baud_mask = B0;		priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);	} else {		baud_mask = (cflag & CBAUD);		switch(baud_mask) {			case B300: dbg("%s - setting baud 300bps", __FUNCTION__); break;			case B600: dbg("%s - setting baud 600bps", __FUNCTION__); break;			case B1200: dbg("%s - setting baud 1200bps", __FUNCTION__); break;			case B2400: dbg("%s - setting baud 2400bps", __FUNCTION__); break;			case B4800: dbg("%s - setting baud 4800bps", __FUNCTION__); break;			case B9600: dbg("%s - setting baud 9600bps", __FUNCTION__); break;			case B19200: dbg("%s - setting baud 19200bps", __FUNCTION__); break;			case B38400: dbg("%s - setting baud 38400bps", __FUNCTION__); break;			case B57600: dbg("%s - setting baud 57600bps", __FUNCTION__); break;			case B115200: dbg("%s - setting baud 115200bps", __FUNCTION__); break;			default: dbg("%s - unknown masked baud rate", __FUNCTION__);		}		priv->line_control = (CONTROL_DTR | CONTROL_RTS);	}	spin_unlock_irqrestore(&priv->lock, flags);		dbg("%s - sending %d stop_bits, %d parity_enable, %d parity_type, %d data_bits (+5)", __FUNCTION__,	    stop_bits, parity_enable, parity_type, data_bits);	cypress_serial_control(port, baud_mask, data_bits, stop_bits, parity_enable,			       parity_type, 0, CYPRESS_SET_CONFIG);	/* we perform a CYPRESS_GET_CONFIG so that the current settings are filled into the private structure         * this should confirm that all is working if it returns what we just set */	cypress_serial_control(port, 0, 0, 0, 0, 0, 0, CYPRESS_GET_CONFIG);	/* Here we can define custom tty settings for devices         *         * the main tty termios flag base comes from empeg.c         */	spin_lock_irqsave(&priv->lock, flags);		if ( (priv->chiptype == CT_EARTHMATE) && (priv->baud_rate == 4800) ) {		dbg("Using custom termios settings for a baud rate of 4800bps.");		/* define custom termios settings for NMEA protocol */		tty->termios->c_iflag /* input modes - */			&= ~(IGNBRK		/* disable ignore break */			| BRKINT		/* disable break causes interrupt */			| PARMRK		/* disable mark parity errors */			| ISTRIP		/* disable clear high bit of input characters */			| INLCR			/* disable translate NL to CR */			| IGNCR			/* disable ignore CR */			| ICRNL			/* disable translate CR to NL */			| IXON);		/* disable enable XON/XOFF flow control */				tty->termios->c_oflag /* output modes */			&= ~OPOST;		/* disable postprocess output characters */				tty->termios->c_lflag /* line discipline modes */			&= ~(ECHO 		/* disable echo input characters */			| ECHONL		/* disable echo new line */			| ICANON		/* disable erase, kill, werase, and rprnt special characters */			| ISIG			/* disable interrupt, quit, and suspend special characters */			| IEXTEN);		/* disable non-POSIX special characters */	} /* CT_CYPHIDCOM: Application should handle this for device */	linechange = (priv->line_control != oldlines);	spin_unlock_irqrestore(&priv->lock, flags);	/* if necessary, set lines */	if (linechange) {		priv->cmd_ctrl = 1;		cypress_write(port, NULL, 0);	}} /* cypress_set_termios */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b9db07fba7f113764d7379b0f68324a9a5450306/cypress_m8.c/clean/drivers/usb/serial/cypress_m8.c