Lines Matching refs:tty
91 struct ipw_tty *tty = get_tty(linux_tty->index); in ipw_open() local
93 if (!tty) in ipw_open()
96 mutex_lock(&tty->ipw_tty_mutex); in ipw_open()
97 if (tty->port.count == 0) in ipw_open()
98 tty->tx_bytes_queued = 0; in ipw_open()
100 tty->port.count++; in ipw_open()
102 tty->port.tty = linux_tty; in ipw_open()
103 linux_tty->driver_data = tty; in ipw_open()
104 tty->port.low_latency = 1; in ipw_open()
106 if (tty->tty_type == TTYTYPE_MODEM) in ipw_open()
107 ipwireless_ppp_open(tty->network); in ipw_open()
109 mutex_unlock(&tty->ipw_tty_mutex); in ipw_open()
114 static void do_ipw_close(struct ipw_tty *tty) in do_ipw_close() argument
116 tty->port.count--; in do_ipw_close()
118 if (tty->port.count == 0) { in do_ipw_close()
119 struct tty_struct *linux_tty = tty->port.tty; in do_ipw_close()
122 tty->port.tty = NULL; in do_ipw_close()
125 if (tty->tty_type == TTYTYPE_MODEM) in do_ipw_close()
126 ipwireless_ppp_close(tty->network); in do_ipw_close()
133 struct ipw_tty *tty = linux_tty->driver_data; in ipw_hangup() local
135 if (!tty) in ipw_hangup()
138 mutex_lock(&tty->ipw_tty_mutex); in ipw_hangup()
139 if (tty->port.count == 0) { in ipw_hangup()
140 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
144 do_ipw_close(tty); in ipw_hangup()
146 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
155 void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, in ipwireless_tty_received() argument
160 mutex_lock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
162 if (!tty->port.count) { in ipwireless_tty_received()
163 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
166 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
168 work = tty_insert_flip_string(&tty->port, data, length); in ipwireless_tty_received()
176 tty_flip_buffer_push(&tty->port); in ipwireless_tty_received()
182 struct ipw_tty *tty = callback_data; in ipw_write_packet_sent_callback() local
188 tty->tx_bytes_queued -= packet_length; in ipw_write_packet_sent_callback()
194 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write() local
197 if (!tty) in ipw_write()
200 mutex_lock(&tty->ipw_tty_mutex); in ipw_write()
201 if (!tty->port.count) { in ipw_write()
202 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
206 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write()
214 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
218 ret = ipwireless_send_packet(tty->hardware, IPW_CHANNEL_RAS, in ipw_write()
220 ipw_write_packet_sent_callback, tty); in ipw_write()
222 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
226 tty->tx_bytes_queued += count; in ipw_write()
227 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
234 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write_room() local
238 if (!tty) in ipw_write_room()
241 if (!tty->port.count) in ipw_write_room()
244 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write_room()
254 struct ipw_tty *tty = linux_tty->driver_data; in ipwireless_get_serial_info() local
256 if (!tty) in ipwireless_get_serial_info()
259 if (!tty->port.count) in ipwireless_get_serial_info()
263 ss->line = tty->index; in ipwireless_get_serial_info()
276 struct ipw_tty *tty = linux_tty->driver_data; in ipw_chars_in_buffer() local
278 if (!tty) in ipw_chars_in_buffer()
281 if (!tty->port.count) in ipw_chars_in_buffer()
284 return tty->tx_bytes_queued; in ipw_chars_in_buffer()
287 static int get_control_lines(struct ipw_tty *tty) in get_control_lines() argument
289 unsigned int my = tty->control_lines; in get_control_lines()
306 static int set_control_lines(struct ipw_tty *tty, unsigned int set, in set_control_lines() argument
312 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 1); in set_control_lines()
315 if (tty->secondary_channel_idx != -1) { in set_control_lines()
316 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
317 tty->secondary_channel_idx, 1); in set_control_lines()
323 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 1); in set_control_lines()
326 if (tty->secondary_channel_idx != -1) { in set_control_lines()
327 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
328 tty->secondary_channel_idx, 1); in set_control_lines()
334 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 0); in set_control_lines()
335 if (tty->secondary_channel_idx != -1) { in set_control_lines()
336 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
337 tty->secondary_channel_idx, 0); in set_control_lines()
343 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 0); in set_control_lines()
344 if (tty->secondary_channel_idx != -1) { in set_control_lines()
345 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
346 tty->secondary_channel_idx, 0); in set_control_lines()
356 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmget() local
359 if (!tty) in ipw_tiocmget()
362 if (!tty->port.count) in ipw_tiocmget()
365 return get_control_lines(tty); in ipw_tiocmget()
372 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmset() local
375 if (!tty) in ipw_tiocmset()
378 if (!tty->port.count) in ipw_tiocmset()
381 return set_control_lines(tty, set, clear); in ipw_tiocmset()
387 struct ipw_tty *tty = linux_tty->driver_data; in ipw_ioctl() local
389 if (!tty) in ipw_ioctl()
392 if (!tty->port.count) in ipw_ioctl()
396 if (tty->tty_type == TTYTYPE_MODEM) { in ipw_ioctl()
401 tty->network); in ipw_ioctl()
413 tty->network); in ipw_ioctl()
514 void ipwireless_tty_free(struct ipw_tty *tty) in ipwireless_tty_free() argument
517 struct ipw_network *network = ttys[tty->index]->network; in ipwireless_tty_free()
519 for (j = tty->index; j < IPWIRELESS_PCMCIA_MINORS; in ipwireless_tty_free()
530 if (ttyj->port.tty != NULL) { in ipwireless_tty_free()
532 tty_vhangup(ttyj->port.tty); in ipwireless_tty_free()
609 int ipwireless_tty_is_modem(struct ipw_tty *tty) in ipwireless_tty_is_modem() argument
611 return tty->tty_type == TTYTYPE_MODEM; in ipwireless_tty_is_modem()
615 ipwireless_tty_notify_control_line_change(struct ipw_tty *tty, in ipwireless_tty_notify_control_line_change() argument
620 unsigned int old_control_lines = tty->control_lines; in ipwireless_tty_notify_control_line_change()
622 tty->control_lines = (tty->control_lines & ~changed_mask) in ipwireless_tty_notify_control_line_change()
630 && !(tty->control_lines & IPW_CONTROL_LINE_DCD) in ipwireless_tty_notify_control_line_change()
631 && tty->port.tty) { in ipwireless_tty_notify_control_line_change()
632 tty_hangup(tty->port.tty); in ipwireless_tty_notify_control_line_change()