Lines Matching refs:tty
76 static void report_registering(struct ipw_tty *tty) in report_registering() argument
78 char *iftype = tty_type_name(tty->tty_type); in report_registering()
81 ": registering %s device ttyIPWp%d\n", iftype, tty->index); in report_registering()
84 static void report_deregistering(struct ipw_tty *tty) in report_deregistering() argument
86 char *iftype = tty_type_name(tty->tty_type); in report_deregistering()
90 tty->index); in report_deregistering()
119 struct ipw_tty *tty = get_tty(minor); in ipw_open() local
121 if (!tty) in ipw_open()
124 mutex_lock(&tty->ipw_tty_mutex); in ipw_open()
126 if (tty->closing) { in ipw_open()
127 mutex_unlock(&tty->ipw_tty_mutex); in ipw_open()
130 if (tty->open_count == 0) in ipw_open()
131 tty->tx_bytes_queued = 0; in ipw_open()
133 tty->open_count++; in ipw_open()
135 tty->linux_tty = linux_tty; in ipw_open()
136 linux_tty->driver_data = tty; in ipw_open()
139 if (tty->tty_type == TTYTYPE_MODEM) in ipw_open()
140 ipwireless_ppp_open(tty->network); in ipw_open()
142 mutex_unlock(&tty->ipw_tty_mutex); in ipw_open()
147 static void do_ipw_close(struct ipw_tty *tty) in do_ipw_close() argument
149 tty->open_count--; in do_ipw_close()
151 if (tty->open_count == 0) { in do_ipw_close()
152 struct tty_struct *linux_tty = tty->linux_tty; in do_ipw_close()
155 tty->linux_tty = NULL; in do_ipw_close()
158 if (tty->tty_type == TTYTYPE_MODEM) in do_ipw_close()
159 ipwireless_ppp_close(tty->network); in do_ipw_close()
166 struct ipw_tty *tty = linux_tty->driver_data; in ipw_hangup() local
168 if (!tty) in ipw_hangup()
171 mutex_lock(&tty->ipw_tty_mutex); in ipw_hangup()
172 if (tty->open_count == 0) { in ipw_hangup()
173 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
177 do_ipw_close(tty); in ipw_hangup()
179 mutex_unlock(&tty->ipw_tty_mutex); in ipw_hangup()
188 void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, in ipwireless_tty_received() argument
194 mutex_lock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
195 linux_tty = tty->linux_tty; in ipwireless_tty_received()
197 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
201 if (!tty->open_count) { in ipwireless_tty_received()
202 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
205 mutex_unlock(&tty->ipw_tty_mutex); in ipwireless_tty_received()
224 struct ipw_tty *tty = callback_data; in ipw_write_packet_sent_callback() local
230 tty->tx_bytes_queued -= packet_length; in ipw_write_packet_sent_callback()
236 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write() local
239 if (!tty) in ipw_write()
242 mutex_lock(&tty->ipw_tty_mutex); in ipw_write()
243 if (!tty->open_count) { in ipw_write()
244 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
248 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write()
256 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
260 ret = ipwireless_send_packet(tty->hardware, IPW_CHANNEL_RAS, in ipw_write()
262 ipw_write_packet_sent_callback, tty); in ipw_write()
264 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
268 tty->tx_bytes_queued += count; in ipw_write()
269 mutex_unlock(&tty->ipw_tty_mutex); in ipw_write()
276 struct ipw_tty *tty = linux_tty->driver_data; in ipw_write_room() local
280 if (!tty) in ipw_write_room()
283 if (!tty->open_count) in ipw_write_room()
286 room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; in ipw_write_room()
293 static int ipwireless_get_serial_info(struct ipw_tty *tty, in ipwireless_get_serial_info() argument
303 tmp.line = tty->index; in ipwireless_get_serial_info()
320 struct ipw_tty *tty = linux_tty->driver_data; in ipw_chars_in_buffer() local
322 if (!tty) in ipw_chars_in_buffer()
325 if (!tty->open_count) in ipw_chars_in_buffer()
328 return tty->tx_bytes_queued; in ipw_chars_in_buffer()
331 static int get_control_lines(struct ipw_tty *tty) in get_control_lines() argument
333 unsigned int my = tty->control_lines; in get_control_lines()
350 static int set_control_lines(struct ipw_tty *tty, unsigned int set, in set_control_lines() argument
356 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 1); in set_control_lines()
359 if (tty->secondary_channel_idx != -1) { in set_control_lines()
360 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
361 tty->secondary_channel_idx, 1); in set_control_lines()
367 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 1); in set_control_lines()
370 if (tty->secondary_channel_idx != -1) { in set_control_lines()
371 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
372 tty->secondary_channel_idx, 1); in set_control_lines()
378 ret = ipwireless_set_RTS(tty->hardware, tty->channel_idx, 0); in set_control_lines()
379 if (tty->secondary_channel_idx != -1) { in set_control_lines()
380 ret = ipwireless_set_RTS(tty->hardware, in set_control_lines()
381 tty->secondary_channel_idx, 0); in set_control_lines()
387 ret = ipwireless_set_DTR(tty->hardware, tty->channel_idx, 0); in set_control_lines()
388 if (tty->secondary_channel_idx != -1) { in set_control_lines()
389 ret = ipwireless_set_DTR(tty->hardware, in set_control_lines()
390 tty->secondary_channel_idx, 0); in set_control_lines()
400 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmget() local
403 if (!tty) in ipw_tiocmget()
406 if (!tty->open_count) in ipw_tiocmget()
409 return get_control_lines(tty); in ipw_tiocmget()
416 struct ipw_tty *tty = linux_tty->driver_data; in ipw_tiocmset() local
419 if (!tty) in ipw_tiocmset()
422 if (!tty->open_count) in ipw_tiocmset()
425 return set_control_lines(tty, set, clear); in ipw_tiocmset()
431 struct ipw_tty *tty = linux_tty->driver_data; in ipw_ioctl() local
433 if (!tty) in ipw_ioctl()
436 if (!tty->open_count) in ipw_ioctl()
443 return ipwireless_get_serial_info(tty, (void __user *) arg); in ipw_ioctl()
449 if (tty->tty_type == TTYTYPE_MODEM) { in ipw_ioctl()
454 tty->network); in ipw_ioctl()
466 tty->network); in ipw_ioctl()
571 void ipwireless_tty_free(struct ipw_tty *tty) in ipwireless_tty_free() argument
574 struct ipw_network *network = ttys[tty->index]->network; in ipwireless_tty_free()
576 for (j = tty->index; j < IPWIRELESS_PCMCIA_MINORS; in ipwireless_tty_free()
662 int ipwireless_tty_is_modem(struct ipw_tty *tty) in ipwireless_tty_is_modem() argument
664 return tty->tty_type == TTYTYPE_MODEM; in ipwireless_tty_is_modem()
668 ipwireless_tty_notify_control_line_change(struct ipw_tty *tty, in ipwireless_tty_notify_control_line_change() argument
673 unsigned int old_control_lines = tty->control_lines; in ipwireless_tty_notify_control_line_change()
675 tty->control_lines = (tty->control_lines & ~changed_mask) in ipwireless_tty_notify_control_line_change()
683 && !(tty->control_lines & IPW_CONTROL_LINE_DCD) in ipwireless_tty_notify_control_line_change()
684 && tty->linux_tty) { in ipwireless_tty_notify_control_line_change()
685 tty_hangup(tty->linux_tty); in ipwireless_tty_notify_control_line_change()