Driver/tiny_tty/tiny_tiocmset()

Last-modified: 2007-09-26 (水) 14:22:33

336 :static int tiny_tiocmset(struct tty_struct *tty, struct file *file,
337 : unsigned int set, unsigned int clear)

MCR modem control register, p574参照

338 :{
339 : struct tiny_serial *tiny = tty->driver_data;
340 : unsigned int mcr = tiny->mcr;
341 :
342 : if (set & TIOCM_RTS)
343 : mcr |= MCR_RTS;
344 : if (set & TIOCM_DTR)
345 : mcr |= MCR_RTS;
346 :
347 : if (clear & TIOCM_RTS)
348 : mcr &= ~MCR_RTS;
349 : if (clear & TIOCM_DTR)
350 : mcr &= ~MCR_RTS;
351 :
352 : /* set the new MCR value in the device */
353 : tiny->mcr = mcr;
354 : return 0;
355 :}