Lines Matching refs:info

217 static void change_speed(struct dec_serial *info);
240 static inline int serial_paranoia_check(struct dec_serial *info, in serial_paranoia_check() argument
249 if (!info) { in serial_paranoia_check()
253 if (info->magic != SERIAL_MAGIC) { in serial_paranoia_check()
338 static inline void zs_rtsdtr(struct dec_serial *info, int which, int set) in zs_rtsdtr() argument
344 if (info->zs_channel != info->zs_chan_a) { in zs_rtsdtr()
346 info->zs_chan_a->curregs[5] |= (which & (RTS | DTR)); in zs_rtsdtr()
348 info->zs_chan_a->curregs[5] &= ~(which & (RTS | DTR)); in zs_rtsdtr()
350 write_zsreg(info->zs_chan_a, 5, info->zs_chan_a->curregs[5]); in zs_rtsdtr()
395 static _INLINE_ void rs_sched_event(struct dec_serial *info, in rs_sched_event() argument
398 info->event |= 1 << event; in rs_sched_event()
399 queue_task(&info->tqueue, &tq_zs_serial); in rs_sched_event()
403 static _INLINE_ void receive_chars(struct dec_serial *info, in receive_chars() argument
406 struct tty_struct *tty = info->tty; in receive_chars()
409 while ((read_zsreg(info->zs_channel, R0) & Rx_CH_AV) != 0) { in receive_chars()
411 stat = read_zsreg(info->zs_channel, R1); in receive_chars()
412 ch = read_zsdata(info->zs_channel); in receive_chars()
414 if (!tty && (!info->hook || !info->hook->rx_char)) in receive_chars()
420 if (info->line == sercons.index) { in receive_chars()
429 if (info->flags & ZILOG_SAK) in receive_chars()
442 write_zsreg(info->zs_channel, R0, ERR_RES); in receive_chars()
446 if (break_pressed && info->line == sercons.index) { in receive_chars()
457 if (info->hook && info->hook->rx_char) { in receive_chars()
458 (*info->hook->rx_char)(ch, flag); in receive_chars()
484 static void transmit_chars(struct dec_serial *info) in transmit_chars() argument
486 if ((read_zsreg(info->zs_channel, R0) & Tx_BUF_EMP) == 0) in transmit_chars()
488 info->tx_active = 0; in transmit_chars()
490 if (info->x_char) { in transmit_chars()
492 write_zsdata(info->zs_channel, info->x_char); in transmit_chars()
493 info->x_char = 0; in transmit_chars()
494 info->tx_active = 1; in transmit_chars()
498 if ((info->xmit_cnt <= 0) || (info->tty && info->tty->stopped) in transmit_chars()
499 || info->tx_stopped) { in transmit_chars()
500 write_zsreg(info->zs_channel, R0, RES_Tx_P); in transmit_chars()
504 write_zsdata(info->zs_channel, info->xmit_buf[info->xmit_tail++]); in transmit_chars()
505 info->xmit_tail = info->xmit_tail & (SERIAL_XMIT_SIZE-1); in transmit_chars()
506 info->xmit_cnt--; in transmit_chars()
507 info->tx_active = 1; in transmit_chars()
509 if (info->xmit_cnt < WAKEUP_CHARS) in transmit_chars()
510 rs_sched_event(info, RS_EVENT_WRITE_WAKEUP); in transmit_chars()
513 static _INLINE_ void status_handle(struct dec_serial *info) in status_handle() argument
518 stat = read_zsreg(info->zs_channel, R0); in status_handle()
527 if (info->zs_channel != info->zs_chan_a) { in status_handle()
530 if (info->tty && !C_CLOCAL(info->tty) && in status_handle()
531 ((stat ^ info->read_reg_zero) & DCD) != 0 ) { in status_handle()
533 wake_up_interruptible(&info->open_wait); in status_handle()
534 } else if (!(info->flags & ZILOG_CALLOUT_ACTIVE)) { in status_handle()
535 tty_hangup(info->tty); in status_handle()
540 if (info->tty && C_CRTSCTS(info->tty)) { in status_handle()
542 if (info->tx_stopped) { in status_handle()
543 info->tx_stopped = 0; in status_handle()
544 if (!info->tx_active) in status_handle()
545 transmit_chars(info); in status_handle()
548 info->tx_stopped = 1; in status_handle()
555 write_zsreg(info->zs_channel, R0, RES_EXT_INT); in status_handle()
556 info->read_reg_zero = stat; in status_handle()
564 struct dec_serial *info = (struct dec_serial *) dev_id; in rs_interrupt() local
576 if (info->zs_chan_a == info->zs_channel) in rs_interrupt()
582 zs_intreg = read_zsreg(info->zs_chan_a, R3) >> shift; in rs_interrupt()
587 receive_chars(info, regs); in rs_interrupt()
590 transmit_chars(info); in rs_interrupt()
593 status_handle(info); in rs_interrupt()
598 write_zsreg(info->zs_channel, 0, RES_H_IUS); in rs_interrupt()
636 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_stop() local
639 if (serial_paranoia_check(info, tty->device, "rs_stop")) in rs_stop()
644 if (info->zs_channel->curregs[5] & TxENAB) { in rs_stop()
645 info->zs_channel->curregs[5] &= ~TxENAB; in rs_stop()
646 write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); in rs_stop()
654 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_start() local
657 if (serial_paranoia_check(info, tty->device, "rs_start")) in rs_start()
662 if (info->xmit_cnt && info->xmit_buf && !(info->zs_channel->curregs[5] & TxENAB)) { in rs_start()
663 info->zs_channel->curregs[5] |= TxENAB; in rs_start()
664 write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); in rs_start()
667 if (info->xmit_cnt && info->xmit_buf && !info->tx_active) { in rs_start()
668 transmit_chars(info); in rs_start()
690 struct dec_serial *info = (struct dec_serial *) private_; in do_softint() local
693 tty = info->tty; in do_softint()
697 if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { in do_softint()
702 int zs_startup(struct dec_serial * info) in zs_startup() argument
706 if (info->flags & ZILOG_INITIALIZED) in zs_startup()
709 if (!info->xmit_buf) { in zs_startup()
710 info->xmit_buf = (unsigned char *) get_free_page(GFP_KERNEL); in zs_startup()
711 if (!info->xmit_buf) in zs_startup()
718 printk("starting up ttyS%02d (irq %d)...", info->line, info->irq); in zs_startup()
724 ZS_CLEARFIFO(info->zs_channel); in zs_startup()
725 info->xmit_fifo_size = 1; in zs_startup()
730 write_zsreg(info->zs_channel, R0, ERR_RES); in zs_startup()
731 write_zsreg(info->zs_channel, R0, RES_H_IUS); in zs_startup()
736 change_speed(info); in zs_startup()
741 zs_rtsdtr(info, RTS | DTR, 1); in zs_startup()
746 info->zs_channel->curregs[R1] &= ~RxINT_MASK; in zs_startup()
747 info->zs_channel->curregs[R1] |= (RxINT_ALL | TxINT_ENAB | in zs_startup()
749 info->zs_channel->curregs[R3] |= RxENABLE; in zs_startup()
750 info->zs_channel->curregs[R5] |= TxENAB; in zs_startup()
751 info->zs_channel->curregs[R15] |= (DCDIE | CTSIE | TxUIE | BRKIE); in zs_startup()
752 write_zsreg(info->zs_channel, R1, info->zs_channel->curregs[R1]); in zs_startup()
753 write_zsreg(info->zs_channel, R3, info->zs_channel->curregs[R3]); in zs_startup()
754 write_zsreg(info->zs_channel, R5, info->zs_channel->curregs[R5]); in zs_startup()
755 write_zsreg(info->zs_channel, R15, info->zs_channel->curregs[R15]); in zs_startup()
760 write_zsreg(info->zs_channel, R0, ERR_RES); in zs_startup()
761 write_zsreg(info->zs_channel, R0, RES_H_IUS); in zs_startup()
764 info->read_reg_zero = read_zsreg(info->zs_channel, R0); in zs_startup()
766 if (info->tty) in zs_startup()
767 clear_bit(TTY_IO_ERROR, &info->tty->flags); in zs_startup()
768 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; in zs_startup()
770 info->flags |= ZILOG_INITIALIZED; in zs_startup()
779 static void shutdown(struct dec_serial * info) in shutdown() argument
783 if (!(info->flags & ZILOG_INITIALIZED)) in shutdown()
787 printk("Shutting down serial port %d (irq %d)....", info->line, in shutdown()
788 info->irq); in shutdown()
793 if (info->xmit_buf) { in shutdown()
794 free_page((unsigned long) info->xmit_buf); in shutdown()
795 info->xmit_buf = 0; in shutdown()
798 info->zs_channel->curregs[1] = 0; in shutdown()
799 write_zsreg(info->zs_channel, 1, info->zs_channel->curregs[1]); /* no interrupts */ in shutdown()
801 info->zs_channel->curregs[3] &= ~RxENABLE; in shutdown()
802 write_zsreg(info->zs_channel, 3, info->zs_channel->curregs[3]); in shutdown()
804 info->zs_channel->curregs[5] &= ~TxENAB; in shutdown()
805 write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); in shutdown()
806 if (!info->tty || C_HUPCL(info->tty)) { in shutdown()
807 zs_rtsdtr(info, RTS | DTR, 0); in shutdown()
810 if (info->tty) in shutdown()
811 set_bit(TTY_IO_ERROR, &info->tty->flags); in shutdown()
813 info->flags &= ~ZILOG_INITIALIZED; in shutdown()
821 static void change_speed(struct dec_serial *info) in change_speed() argument
828 if (!info->hook) { in change_speed()
829 if (!info->tty || !info->tty->termios) in change_speed()
831 cflag = info->tty->termios->c_cflag; in change_speed()
832 if (!info->port) in change_speed()
835 cflag = info->hook->cflags; in change_speed()
842 if (!info->hook) in change_speed()
843 info->tty->termios->c_cflag &= ~CBAUDEX; in change_speed()
845 info->hook->cflags &= ~CBAUDEX; in change_speed()
851 info->zs_baud = baud_table[i]; in change_speed()
852 if (info->zs_baud) { in change_speed()
853 brg = BPS_TO_BRG(info->zs_baud, zs_parms->clock/info->clk_divisor); in change_speed()
854 info->zs_channel->curregs[12] = (brg & 255); in change_speed()
855 info->zs_channel->curregs[13] = ((brg >> 8) & 255); in change_speed()
856 zs_rtsdtr(info, DTR, 1); in change_speed()
858 zs_rtsdtr(info, RTS | DTR, 0); in change_speed()
863 info->zs_channel->curregs[3] &= ~RxNBITS_MASK; in change_speed()
864 info->zs_channel->curregs[5] &= ~TxNBITS_MASK; in change_speed()
868 info->zs_channel->curregs[3] |= Rx5; in change_speed()
869 info->zs_channel->curregs[5] |= Tx5; in change_speed()
873 info->zs_channel->curregs[3] |= Rx6; in change_speed()
874 info->zs_channel->curregs[5] |= Tx6; in change_speed()
878 info->zs_channel->curregs[3] |= Rx7; in change_speed()
879 info->zs_channel->curregs[5] |= Tx7; in change_speed()
884 info->zs_channel->curregs[3] |= Rx8; in change_speed()
885 info->zs_channel->curregs[5] |= Tx8; in change_speed()
889 info->timeout = ((info->xmit_fifo_size*HZ*bits) / info->zs_baud); in change_speed()
890 info->timeout += HZ/50; /* Add .02 seconds of slop */ in change_speed()
892 info->zs_channel->curregs[4] &= ~(SB_MASK | PAR_ENA | PAR_EVEN); in change_speed()
894 info->zs_channel->curregs[4] |= SB2; in change_speed()
896 info->zs_channel->curregs[4] |= SB1; in change_speed()
899 info->zs_channel->curregs[4] |= PAR_ENA; in change_speed()
902 info->zs_channel->curregs[4] |= PAR_EVEN; in change_speed()
906 if (!(info->zs_channel->curregs[15] & DCDIE)) in change_speed()
907 info->read_reg_zero = read_zsreg(info->zs_channel, 0); in change_speed()
908 info->zs_channel->curregs[15] |= DCDIE; in change_speed()
910 info->zs_channel->curregs[15] &= ~DCDIE; in change_speed()
912 info->zs_channel->curregs[15] |= CTSIE; in change_speed()
913 if ((read_zsreg(info->zs_channel, 0) & CTS) == 0) in change_speed()
914 info->tx_stopped = 1; in change_speed()
916 info->zs_channel->curregs[15] &= ~CTSIE; in change_speed()
917 info->tx_stopped = 0; in change_speed()
921 load_zsregs(info->zs_channel, info->zs_channel->curregs); in change_speed()
928 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_flush_chars() local
931 if (serial_paranoia_check(info, tty->device, "rs_flush_chars")) in rs_flush_chars()
934 if (info->xmit_cnt <= 0 || tty->stopped || info->tx_stopped || in rs_flush_chars()
935 !info->xmit_buf) in rs_flush_chars()
940 transmit_chars(info); in rs_flush_chars()
948 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_write() local
951 if (serial_paranoia_check(info, tty->device, "rs_write")) in rs_write()
954 if (!tty || !info->xmit_buf) in rs_write()
960 c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, in rs_write()
961 SERIAL_XMIT_SIZE - info->xmit_head)); in rs_write()
968 c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, in rs_write()
969 SERIAL_XMIT_SIZE - info->xmit_head)); in rs_write()
970 memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c); in rs_write()
973 memcpy(info->xmit_buf + info->xmit_head, buf, c); in rs_write()
974 info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); in rs_write()
975 info->xmit_cnt += c; in rs_write()
982 if (info->xmit_cnt && !tty->stopped && !info->tx_stopped in rs_write()
983 && !info->tx_active) in rs_write()
984 transmit_chars(info); in rs_write()
991 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_write_room() local
994 if (serial_paranoia_check(info, tty->device, "rs_write_room")) in rs_write_room()
996 ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1; in rs_write_room()
1004 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_chars_in_buffer() local
1006 if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer")) in rs_chars_in_buffer()
1008 return info->xmit_cnt; in rs_chars_in_buffer()
1013 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_flush_buffer() local
1015 if (serial_paranoia_check(info, tty->device, "rs_flush_buffer")) in rs_flush_buffer()
1018 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; in rs_flush_buffer()
1033 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_throttle() local
1043 if (serial_paranoia_check(info, tty->device, "rs_throttle")) in rs_throttle()
1048 info->x_char = STOP_CHAR(tty); in rs_throttle()
1049 if (!info->tx_active) in rs_throttle()
1050 transmit_chars(info); in rs_throttle()
1055 zs_rtsdtr(info, RTS, 0); in rs_throttle()
1061 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_unthrottle() local
1071 if (serial_paranoia_check(info, tty->device, "rs_unthrottle")) in rs_unthrottle()
1076 if (info->x_char) in rs_unthrottle()
1077 info->x_char = 0; in rs_unthrottle()
1079 info->x_char = START_CHAR(tty); in rs_unthrottle()
1080 if (!info->tx_active) in rs_unthrottle()
1081 transmit_chars(info); in rs_unthrottle()
1087 zs_rtsdtr(info, RTS, 1); in rs_unthrottle()
1097 static int get_serial_info(struct dec_serial * info, in get_serial_info() argument
1105 tmp.type = info->type; in get_serial_info()
1106 tmp.line = info->line; in get_serial_info()
1107 tmp.port = info->port; in get_serial_info()
1108 tmp.irq = info->irq; in get_serial_info()
1109 tmp.flags = info->flags; in get_serial_info()
1110 tmp.baud_base = info->baud_base; in get_serial_info()
1111 tmp.close_delay = info->close_delay; in get_serial_info()
1112 tmp.closing_wait = info->closing_wait; in get_serial_info()
1113 tmp.custom_divisor = info->custom_divisor; in get_serial_info()
1117 static int set_serial_info(struct dec_serial * info, in set_serial_info() argument
1127 old_info = *info; in set_serial_info()
1130 if ((new_serial.baud_base != info->baud_base) || in set_serial_info()
1131 (new_serial.type != info->type) || in set_serial_info()
1132 (new_serial.close_delay != info->close_delay) || in set_serial_info()
1134 (info->flags & ~ZILOG_USR_MASK))) in set_serial_info()
1136 info->flags = ((info->flags & ~ZILOG_USR_MASK) | in set_serial_info()
1138 info->custom_divisor = new_serial.custom_divisor; in set_serial_info()
1142 if (info->count > 1) in set_serial_info()
1150 info->baud_base = new_serial.baud_base; in set_serial_info()
1151 info->flags = ((info->flags & ~ZILOG_FLAGS) | in set_serial_info()
1153 info->type = new_serial.type; in set_serial_info()
1154 info->close_delay = new_serial.close_delay; in set_serial_info()
1155 info->closing_wait = new_serial.closing_wait; in set_serial_info()
1158 retval = zs_startup(info); in set_serial_info()
1172 static int get_lsr_info(struct dec_serial * info, unsigned int *value) in get_lsr_info() argument
1177 status = read_zsreg(info->zs_channel, 0); in get_lsr_info()
1183 static int get_modem_info(struct dec_serial *info, unsigned int *value) in get_modem_info() argument
1188 if (info->zs_channel == info->zs_chan_a) in get_modem_info()
1192 control = info->zs_chan_a->curregs[5]; in get_modem_info()
1193 status_a = read_zsreg(info->zs_chan_a, 0); in get_modem_info()
1194 status_b = read_zsreg(info->zs_channel, 0); in get_modem_info()
1207 static int set_modem_info(struct dec_serial *info, unsigned int cmd, in set_modem_info() argument
1217 if (info->zs_channel == info->zs_chan_a) in set_modem_info()
1225 info->zs_chan_a->curregs[5] |= bits; in set_modem_info()
1228 info->zs_chan_a->curregs[5] &= ~bits; in set_modem_info()
1231 info->zs_chan_a->curregs[5] = in set_modem_info()
1232 (info->zs_chan_a->curregs[5] & ~(DTR | RTS)) | bits; in set_modem_info()
1238 write_zsreg(info->zs_chan_a, 5, info->zs_chan_a->curregs[5]); in set_modem_info()
1248 struct dec_serial *info = (struct dec_serial *) tty->driver_data; in rs_break() local
1251 if (serial_paranoia_check(info, tty->device, "rs_break")) in rs_break()
1253 if (!info->port) in rs_break()
1258 info->zs_channel->curregs[5] |= SND_BRK; in rs_break()
1260 info->zs_channel->curregs[5] &= ~SND_BRK; in rs_break()
1261 write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); in rs_break()
1269 struct dec_serial * info = (struct dec_serial *)tty->driver_data; in rs_ioctl() local
1271 if (info->hook) in rs_ioctl()
1274 if (serial_paranoia_check(info, tty->device, "rs_ioctl")) in rs_ioctl()
1290 return get_modem_info(info, (unsigned int *) arg); in rs_ioctl()
1294 return set_modem_info(info, cmd, (unsigned int *) arg); in rs_ioctl()
1300 return get_serial_info(info, in rs_ioctl()
1303 return set_serial_info(info, in rs_ioctl()
1311 return get_lsr_info(info, (unsigned int *) arg); in rs_ioctl()
1319 info, sizeof(struct dec_serial)); in rs_ioctl()
1330 struct dec_serial *info = (struct dec_serial *)tty->driver_data; in rs_set_termios() local
1335 was_stopped = info->tx_stopped; in rs_set_termios()
1337 change_speed(info); in rs_set_termios()
1339 if (was_stopped && !info->tx_stopped) in rs_set_termios()
1353 struct dec_serial * info = (struct dec_serial *)tty->driver_data; in rs_close() local
1356 if (!info || serial_paranoia_check(info, tty->device, "rs_close")) in rs_close()
1367 printk("rs_close ttyS%02d, count = %d\n", info->line, info->count); in rs_close()
1369 if ((tty->count == 1) && (info->count != 1)) { in rs_close()
1378 "info->count is %d\n", info->count); in rs_close()
1379 info->count = 1; in rs_close()
1381 if (--info->count < 0) { in rs_close()
1383 info->line, info->count); in rs_close()
1384 info->count = 0; in rs_close()
1386 if (info->count) { in rs_close()
1390 info->flags |= ZILOG_CLOSING; in rs_close()
1395 if (info->flags & ZILOG_NORMAL_ACTIVE) in rs_close()
1396 info->normal_termios = *tty->termios; in rs_close()
1397 if (info->flags & ZILOG_CALLOUT_ACTIVE) in rs_close()
1398 info->callout_termios = *tty->termios; in rs_close()
1404 if (info->closing_wait != ZILOG_CLOSING_WAIT_NONE) in rs_close()
1405 tty_wait_until_sent(tty, info->closing_wait); in rs_close()
1410 info->zs_channel->curregs[3] &= ~RxENABLE; in rs_close()
1411 write_zsreg(info->zs_channel, 3, info->zs_channel->curregs[3]); in rs_close()
1412 info->zs_channel->curregs[1] = 0; /* disable any rx ints */ in rs_close()
1413 write_zsreg(info->zs_channel, 1, info->zs_channel->curregs[1]); in rs_close()
1414 ZS_CLEARFIFO(info->zs_channel); in rs_close()
1415 if (info->flags & ZILOG_INITIALIZED) { in rs_close()
1420 rs_wait_until_sent(tty, info->timeout); in rs_close()
1423 shutdown(info); in rs_close()
1428 info->event = 0; in rs_close()
1429 info->tty = 0; in rs_close()
1430 if (info->blocked_open) { in rs_close()
1431 if (info->close_delay) { in rs_close()
1433 schedule_timeout(info->close_delay); in rs_close()
1435 wake_up_interruptible(&info->open_wait); in rs_close()
1437 info->flags &= ~(ZILOG_NORMAL_ACTIVE|ZILOG_CALLOUT_ACTIVE| in rs_close()
1439 wake_up_interruptible(&info->close_wait); in rs_close()
1448 struct dec_serial *info = (struct dec_serial *) tty->driver_data; in rs_wait_until_sent() local
1451 if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent")) in rs_wait_until_sent()
1460 char_time = (info->timeout - HZ/50) / info->xmit_fifo_size; in rs_wait_until_sent()
1466 while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) { in rs_wait_until_sent()
1482 struct dec_serial * info = (struct dec_serial *)tty->driver_data; in rs_hangup() local
1484 if (serial_paranoia_check(info, tty->device, "rs_hangup")) in rs_hangup()
1488 shutdown(info); in rs_hangup()
1489 info->event = 0; in rs_hangup()
1490 info->count = 0; in rs_hangup()
1491 info->flags &= ~(ZILOG_NORMAL_ACTIVE|ZILOG_CALLOUT_ACTIVE); in rs_hangup()
1492 info->tty = 0; in rs_hangup()
1493 wake_up_interruptible(&info->open_wait); in rs_hangup()
1502 struct dec_serial *info) in block_til_ready() argument
1512 if (info->flags & ZILOG_CLOSING) { in block_til_ready()
1513 interruptible_sleep_on(&info->close_wait); in block_til_ready()
1515 return ((info->flags & ZILOG_HUP_NOTIFY) ? in block_til_ready()
1527 if (info->flags & ZILOG_NORMAL_ACTIVE) in block_til_ready()
1529 if ((info->flags & ZILOG_CALLOUT_ACTIVE) && in block_til_ready()
1530 (info->flags & ZILOG_SESSION_LOCKOUT) && in block_til_ready()
1531 (info->session != current->session)) in block_til_ready()
1533 if ((info->flags & ZILOG_CALLOUT_ACTIVE) && in block_til_ready()
1534 (info->flags & ZILOG_PGRP_LOCKOUT) && in block_til_ready()
1535 (info->pgrp != current->pgrp)) in block_til_ready()
1537 info->flags |= ZILOG_CALLOUT_ACTIVE; in block_til_ready()
1547 if (info->flags & ZILOG_CALLOUT_ACTIVE) in block_til_ready()
1549 info->flags |= ZILOG_NORMAL_ACTIVE; in block_til_ready()
1553 if (info->flags & ZILOG_CALLOUT_ACTIVE) { in block_til_ready()
1554 if (info->normal_termios.c_cflag & CLOCAL) in block_til_ready()
1569 add_wait_queue(&info->open_wait, &wait); in block_til_ready()
1572 info->line, info->count); in block_til_ready()
1576 info->count--; in block_til_ready()
1578 info->blocked_open++; in block_til_ready()
1581 if (!(info->flags & ZILOG_CALLOUT_ACTIVE) && in block_til_ready()
1583 zs_rtsdtr(info, RTS | DTR, 1); in block_til_ready()
1587 !(info->flags & ZILOG_INITIALIZED)) { in block_til_ready()
1589 if (info->flags & ZILOG_HUP_NOTIFY) in block_til_ready()
1598 if (!(info->flags & ZILOG_CALLOUT_ACTIVE) && in block_til_ready()
1599 !(info->flags & ZILOG_CLOSING) && in block_til_ready()
1600 (do_clocal || (read_zsreg(info->zs_channel, 0) & DCD))) in block_til_ready()
1608 info->line, info->count); in block_til_ready()
1613 remove_wait_queue(&info->open_wait, &wait); in block_til_ready()
1615 info->count++; in block_til_ready()
1616 info->blocked_open--; in block_til_ready()
1619 info->line, info->count); in block_til_ready()
1623 info->flags |= ZILOG_NORMAL_ACTIVE; in block_til_ready()
1635 struct dec_serial *info; in rs_open() local
1641 info = zs_soft + line; in rs_open()
1643 if (info->hook) in rs_open()
1646 if (serial_paranoia_check(info, tty->device, "rs_open")) in rs_open()
1649 printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, in rs_open()
1650 info->count); in rs_open()
1653 info->count++; in rs_open()
1654 tty->driver_data = info; in rs_open()
1655 info->tty = tty; in rs_open()
1661 (info->flags & ZILOG_CLOSING)) { in rs_open()
1662 if (info->flags & ZILOG_CLOSING) in rs_open()
1663 interruptible_sleep_on(&info->close_wait); in rs_open()
1665 return ((info->flags & ZILOG_HUP_NOTIFY) ? in rs_open()
1675 retval = zs_startup(info); in rs_open()
1679 retval = block_til_ready(tty, filp, info); in rs_open()
1688 if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) { in rs_open()
1690 *tty->termios = info->normal_termios; in rs_open()
1692 *tty->termios = info->callout_termios; in rs_open()
1693 change_speed(info); in rs_open()
1699 change_speed(info); in rs_open()
1703 info->session = current->session; in rs_open()
1704 info->pgrp = current->pgrp; in rs_open()
1707 printk("rs_open ttyS%02d successful...", info->line); in rs_open()
1864 struct dec_serial *info; in zs_init() local
1938 for (info = zs_chain, i = 0; info; info = info->zs_next, i++) { in zs_init()
1941 info->tty = 0; in zs_init()
1942 info->x_char = 0; in zs_init()
1944 if (info->hook && info->hook->init_info) { in zs_init()
1945 (*info->hook->init_info)(info); in zs_init()
1949 info->magic = SERIAL_MAGIC; in zs_init()
1950 info->port = (int) info->zs_channel->control; in zs_init()
1951 info->line = i; in zs_init()
1952 info->custom_divisor = 16; in zs_init()
1953 info->close_delay = 50; in zs_init()
1954 info->closing_wait = 3000; in zs_init()
1955 info->event = 0; in zs_init()
1956 info->count = 0; in zs_init()
1957 info->blocked_open = 0; in zs_init()
1958 info->tqueue.routine = do_softint; in zs_init()
1959 info->tqueue.data = info; in zs_init()
1960 info->callout_termios = callout_driver.init_termios; in zs_init()
1961 info->normal_termios = serial_driver.init_termios; in zs_init()
1962 init_waitqueue_head(&info->open_wait); in zs_init()
1963 init_waitqueue_head(&info->close_wait); in zs_init()
1965 info->line, info->port, info->irq); in zs_init()
1967 serial_driver.minor_start + info->line); in zs_init()
1969 callout_driver.minor_start + info->line); in zs_init()
1997 zs_poll_tx_char(struct dec_serial *info, unsigned char ch) in zs_poll_tx_char() argument
1999 struct dec_zschannel *chan = info->zs_channel; in zs_poll_tx_char()
2020 zs_poll_rx_char(struct dec_serial *info) in zs_poll_rx_char() argument
2022 struct dec_zschannel *chan = info->zs_channel; in zs_poll_rx_char()
2043 struct dec_serial *info = &zs_soft[channel]; in register_zs_hook() local
2045 if (info->hook) { in register_zs_hook()
2052 info->hook = hook; in register_zs_hook()
2060 struct dec_serial *info = &zs_soft[channel]; in unregister_zs_hook() local
2062 if (info->hook) { in unregister_zs_hook()
2063 info->hook = NULL; in unregister_zs_hook()
2087 struct dec_serial *info; in serial_console_write() local
2090 info = zs_soft + co->index; in serial_console_write()
2094 zs_poll_tx_char(info, '\r'); in serial_console_write()
2095 zs_poll_tx_char(info, *s); in serial_console_write()
2112 struct dec_serial *info; in serial_console_setup() local
2125 info = zs_soft + co->index; in serial_console_setup()
2130 info->is_cons = 1; in serial_console_setup()
2202 info->zs_channel->curregs[R12] = (brg & 255); in serial_console_setup()
2203 info->zs_channel->curregs[R13] = ((brg >> 8) & 255); in serial_console_setup()
2209 info->zs_channel->curregs[R3] |= Rx7; in serial_console_setup()
2210 info->zs_channel->curregs[R5] |= Tx7; in serial_console_setup()
2212 info->zs_channel->curregs[R3] |= Rx8; in serial_console_setup()
2213 info->zs_channel->curregs[R5] |= Tx8; in serial_console_setup()
2216 info->zs_channel->curregs[R4] |= PAR_ENA; in serial_console_setup()
2219 info->zs_channel->curregs[R4] |= PAR_EVEN; in serial_console_setup()
2221 info->zs_channel->curregs[R4] |= SB1; in serial_console_setup()
2226 zs_rtsdtr(info, RTS | DTR, 1); in serial_console_setup()
2231 info->zs_channel->curregs[R3] |= RxENABLE; in serial_console_setup()
2232 info->zs_channel->curregs[R5] |= TxENAB; in serial_console_setup()
2237 write_zsreg(info->zs_channel, R0, ERR_RES); in serial_console_setup()
2238 write_zsreg(info->zs_channel, R0, RES_H_IUS); in serial_console_setup()
2243 load_zsregs(info->zs_channel, info->zs_channel->curregs); in serial_console_setup()
2246 info->read_reg_zero = read_zsreg(info->zs_channel, R0); in serial_console_setup()
2322 static int kgdbhook_init_channel(struct dec_serial* info) in kgdbhook_init_channel() argument
2327 static void kgdbhook_init_info(struct dec_serial* info) in kgdbhook_init_info() argument
2331 static void kgdbhook_rx_char(struct dec_serial* info, in kgdbhook_rx_char() argument
2337 write_zsreg(info->zs_channel, 0, ERR_RES); in kgdbhook_rx_char()