Lines Matching refs:tty
90 struct ipw_tty *tty = get_tty(linux_tty->index); in ipw_open() local
92 if (!tty) in ipw_open()
95 mutex_lock(&tty->ipw_tty_mutex); in ipw_open()
96 if (tty->port.count == 0) in ipw_open()
97 tty->tx_bytes_queued = 0; in ipw_open()
99 tty->port.count++; in ipw_open()
101 tty->port.tty = linux_tty; in ipw_open()
102 linux_tty->driver_data = tty; in ipw_open()
104 if (tty->tty_type == TTYTYPE_MODEM) in ipw_open()
105 ipwireless_ppp_open(tty->network); in ipw_open()
107 mutex_unlock(&tty->ipw_tty_mutex); in ipw_open()
112 static void do_ipw_close(struct ipw_tty *tty) in do_ipw_close() argument
114 tty->port.count--; in do_ipw_close()
116 if (tty->port.count == 0) { in do_ipw_close()
117 struct tty_struct *linux_tty = tty->port.tty; in do_ipw_close()
120 tty->port.tty = NULL; in do_ipw_close()
123 if (tty->tty_type == TTYTYPE_MODEM) in do_ipw_close()
124 ipwireless_ppp_close(tty->network); in do_ipw_close()
131 struct ipw_tty *tty = linux_tty->driver_data; in ipw_hangup() local
133 if (!tty) in ipw_hangup()
136 mutex_lock(&tty->ipw_tty_mutex); in ipw_hangup()
137 if (tty->port.count == 0) { in ipw_hangup()
138 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
142 do_ipw_close(tty); in ipw_hangup()
144 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
153 void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, in ipwireless_tty_received() argument
158 mutex_lock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
160 if (!tty->port.count) { in ipwireless_tty_received()
161 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
164 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
166 work = tty_insert_flip_string(&tty->port, data, length); in ipwireless_tty_received()
174 tty_flip_buffer_push(&tty->port); in ipwireless_tty_received()
180 struct ipw_tty *tty = callback_data; in ipw_write_packet_sent_callback() local
186 tty->tx_bytes_queued -= packet_length; in ipw_write_packet_sent_callback()
192 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write() local
195 if (!tty) in ipw_write()
198 mutex_lock(&tty->ipw_tty_mutex); in ipw_write()
199 if (!tty->port.count) { in ipw_write()
200 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
204 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write()
212 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
216 ret = ipwireless_send_packet(tty->hardware, IPW_CHANNEL_RAS, in ipw_write()
218 ipw_write_packet_sent_callback, tty); in ipw_write()
220 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
224 tty->tx_bytes_queued += count; in ipw_write()
225 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
232 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write_room() local
236 if (!tty) in ipw_write_room()
239 if (!tty->port.count) in ipw_write_room()
242 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write_room()
252 struct ipw_tty *tty = linux_tty->driver_data; in ipwireless_get_serial_info() local
254 if (!tty) in ipwireless_get_serial_info()
257 if (!tty->port.count) in ipwireless_get_serial_info()
261 ss->line = tty->index; in ipwireless_get_serial_info()
274 struct ipw_tty *tty = linux_tty->driver_data; in ipw_chars_in_buffer() local
276 if (!tty) in ipw_chars_in_buffer()
279 if (!tty->port.count) in ipw_chars_in_buffer()
282 return tty->tx_bytes_queued; in ipw_chars_in_buffer()
285 static int get_control_lines(struct ipw_tty *tty) in get_control_lines() argument
287 unsigned int my = tty->control_lines; in get_control_lines()
304 static int set_control_lines(struct ipw_tty *tty, unsigned int set, in set_control_lines() argument
310 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 1); in set_control_lines()
313 if (tty->secondary_channel_idx != -1) { in set_control_lines()
314 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
315 tty->secondary_channel_idx, 1); in set_control_lines()
321 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 1); in set_control_lines()
324 if (tty->secondary_channel_idx != -1) { in set_control_lines()
325 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
326 tty->secondary_channel_idx, 1); in set_control_lines()
332 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 0); in set_control_lines()
333 if (tty->secondary_channel_idx != -1) { in set_control_lines()
334 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
335 tty->secondary_channel_idx, 0); in set_control_lines()
341 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 0); in set_control_lines()
342 if (tty->secondary_channel_idx != -1) { in set_control_lines()
343 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
344 tty->secondary_channel_idx, 0); in set_control_lines()
354 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmget() local
357 if (!tty) in ipw_tiocmget()
360 if (!tty->port.count) in ipw_tiocmget()
363 return get_control_lines(tty); in ipw_tiocmget()
370 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmset() local
373 if (!tty) in ipw_tiocmset()
376 if (!tty->port.count) in ipw_tiocmset()
379 return set_control_lines(tty, set, clear); in ipw_tiocmset()
385 struct ipw_tty *tty = linux_tty->driver_data; in ipw_ioctl() local
387 if (!tty) in ipw_ioctl()
390 if (!tty->port.count) in ipw_ioctl()
394 if (tty->tty_type == TTYTYPE_MODEM) { in ipw_ioctl()
399 tty->network); in ipw_ioctl()
411 tty->network); in ipw_ioctl()
512 void ipwireless_tty_free(struct ipw_tty *tty) in ipwireless_tty_free() argument
515 struct ipw_network *network = ttys[tty->index]->network; in ipwireless_tty_free()
517 for (j = tty->index; j < IPWIRELESS_PCMCIA_MINORS; in ipwireless_tty_free()
527 if (ttyj->port.tty != NULL) { in ipwireless_tty_free()
529 tty_vhangup(ttyj->port.tty); in ipwireless_tty_free()
601 int ipwireless_tty_is_modem(struct ipw_tty *tty) in ipwireless_tty_is_modem() argument
603 return tty->tty_type == TTYTYPE_MODEM; in ipwireless_tty_is_modem()
607 ipwireless_tty_notify_control_line_change(struct ipw_tty *tty, in ipwireless_tty_notify_control_line_change() argument
612 unsigned int old_control_lines = tty->control_lines; in ipwireless_tty_notify_control_line_change()
614 tty->control_lines = (tty->control_lines & ~changed_mask) in ipwireless_tty_notify_control_line_change()
622 && !(tty->control_lines & IPW_CONTROL_LINE_DCD) in ipwireless_tty_notify_control_line_change()
623 && tty->port.tty) { in ipwireless_tty_notify_control_line_change()
624 tty_hangup(tty->port.tty); in ipwireless_tty_notify_control_line_change()