Driver/tiny_serial/tiny_timer()

Last-modified: 2007-09-20 (木) 15:05:32
参考 p.570

095 :static void tiny_timer(unsigned long data)
096 :{
097 : struct uart_port *port;
098 : struct tty_struct *tty;
099 :
100 :
101 : port = (struct uart_port *)data;
102 : if (!port)
103 : return;
104 : if (!port->info)
105 : return;
106 : tty = port->info->tty;
107 : if (!tty)
108 : return;
109 :
110 : /* add one character to the tty port */
111 : /* this doesn't actually push the data through unless tty->low_latency is set */
112 : tty_insert_flip_char(tty, TINY_DATA_CHARACTER, 0);

1文字だけ受信バッファに追加する。

113 :
114 : tty_flip_buffer_push(tty);
 データをユーザにプッシュする。
115 :
116 : /* resubmit the timer again */
117 : timer->expires = jiffies + DELAY_TIME;
118 : add_timer(timer);
119 :
120 : /* see if we have any data to transmit */
121 : tiny_tx_chars(port);
122 :}