Lines Matching refs:info
38 tty->name, (info->tport.flags), serial_driver->refcount,info->count,tty->count,s)
112 static void change_speed(struct tty_struct *tty, struct serial_state *info,
157 struct serial_state *info = tty->driver_data;
161 if (info->IER & UART_IER_THRI) {
162 info->IER &= ~UART_IER_THRI;
174 struct serial_state *info = tty->driver_data;
178 if (info->xmit.head != info->xmit.tail
179 && info->xmit.buf
180 && !(info->IER & UART_IER_THRI)) {
181 info->IER |= UART_IER_THRI;
212 static void receive_chars(struct serial_state *info)
220 icount = &info->icount;
267 if (status & info->ignore_status_mask)
270 status &= info->read_status_mask;
277 if (info->tport.flags & ASYNC_SAK)
278 do_SAK(info->tport.tty);
292 tty_insert_flip_char(&info->tport, ch, flag);
294 tty_insert_flip_char(&info->tport, 0, TTY_OVERRUN);
295 tty_flip_buffer_push(&info->tport);
300 static void transmit_chars(struct serial_state *info)
304 if (info->x_char) {
305 custom.serdat = info->x_char | 0x100;
307 info->icount.tx++;
308 info->x_char = 0;
311 if (info->xmit.head == info->xmit.tail
312 || info->tport.tty->stopped
313 || info->tport.tty->hw_stopped) {
314 info->IER &= ~UART_IER_THRI;
320 custom.serdat = info->xmit.buf[info->xmit.tail++] | 0x100;
322 info->xmit.tail = info->xmit.tail & (SERIAL_XMIT_SIZE-1);
323 info->icount.tx++;
325 if (CIRC_CNT(info->xmit.head,
326 info->xmit.tail,
328 tty_wakeup(info->tport.tty);
333 if (info->xmit.head == info->xmit.tail) {
336 info->IER &= ~UART_IER_THRI;
340 static void check_modem_status(struct serial_state *info)
342 struct tty_port *port = &info->tport;
352 icount = &info->icount;
366 printk("ttyS%d CD now %s...", info->line,
386 info->IER |= UART_IER_THRI;
401 info->IER &= ~UART_IER_THRI;
415 struct serial_state *info = data;
420 if(info->IER & UART_IER_MSI)
421 check_modem_status(info);
427 struct serial_state *info = dev_id;
433 if (!info->tport.tty)
436 receive_chars(info);
445 struct serial_state *info = dev_id;
452 if (!info->tport.tty)
455 transmit_chars(info);
478 static int startup(struct tty_struct *tty, struct serial_state *info)
480 struct tty_port *port = &info->tport;
496 if (info->xmit.buf)
499 info->xmit.buf = (unsigned char *) page;
502 printk("starting up ttys%d ...", info->line);
510 retval = request_irq(IRQ_AMIGA_VERTB, ser_vbl_int, 0, "serial status", info);
522 info->IER = UART_IER_MSI;
527 info->MCR = 0;
529 info->MCR = SER_DTR | SER_RTS;
530 rtsdtr_ctrl(info->MCR);
533 info->xmit.head = info->xmit.tail = 0;
538 change_speed(tty, info, NULL);
553 static void shutdown(struct tty_struct *tty, struct serial_state *info)
558 if (!tty_port_initialized(&info->tport))
561 state = info;
564 printk("Shutting down serial port %d ....\n", info->line);
573 wake_up_interruptible(&info->tport.delta_msr_wait);
578 free_irq(IRQ_AMIGA_VERTB, info);
580 if (info->xmit.buf) {
581 free_page((unsigned long) info->xmit.buf);
582 info->xmit.buf = NULL;
585 info->IER = 0;
594 info->MCR &= ~(SER_DTR|SER_RTS);
595 rtsdtr_ctrl(info->MCR);
599 tty_port_set_initialized(&info->tport, 0);
608 static void change_speed(struct tty_struct *tty, struct serial_state *info,
611 struct tty_port *port = &info->tport;
641 baud_base = info->baud_base;
643 quot = info->custom_divisor;
661 quot = info->custom_divisor;
673 info->quot = quot;
674 info->timeout = ((info->xmit_fifo_size*HZ*bits*quot) / baud_base);
675 info->timeout += HZ/50; /* Add .02 seconds of slop */
678 info->IER &= ~UART_IER_MSI;
680 info->IER |= UART_IER_MSI;
683 info->IER |= UART_IER_MSI;
686 info->IER |= UART_IER_MSI;
695 info->read_status_mask = UART_LSR_OE | UART_LSR_DR;
697 info->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
699 info->read_status_mask |= UART_LSR_BI;
704 info->ignore_status_mask = 0;
706 info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
708 info->ignore_status_mask |= UART_LSR_BI;
714 info->ignore_status_mask |= UART_LSR_OE;
720 info->ignore_status_mask |= UART_LSR_DR;
743 struct serial_state *info;
746 info = tty->driver_data;
748 if (!info->xmit.buf)
752 if (CIRC_SPACE(info->xmit.head,
753 info->xmit.tail,
759 info->xmit.buf[info->xmit.head++] = ch;
760 info->xmit.head &= SERIAL_XMIT_SIZE-1;
767 struct serial_state *info = tty->driver_data;
770 if (info->xmit.head == info->xmit.tail
773 || !info->xmit.buf)
777 info->IER |= UART_IER_THRI;
789 struct serial_state *info = tty->driver_data;
792 if (!info->xmit.buf)
797 c = CIRC_SPACE_TO_END(info->xmit.head,
798 info->xmit.tail,
805 memcpy(info->xmit.buf + info->xmit.head, buf, c);
806 info->xmit.head = ((info->xmit.head + c) &
814 if (info->xmit.head != info->xmit.tail
817 && !(info->IER & UART_IER_THRI)) {
818 info->IER |= UART_IER_THRI;
832 struct serial_state *info = tty->driver_data;
834 return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
839 struct serial_state *info = tty->driver_data;
841 return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
846 struct serial_state *info = tty->driver_data;
850 info->xmit.head = info->xmit.tail = 0;
861 struct serial_state *info = tty->driver_data;
864 info->x_char = ch;
879 info->IER |= UART_IER_THRI;
893 struct serial_state *info = tty->driver_data;
903 info->MCR &= ~SER_RTS;
906 rtsdtr_ctrl(info->MCR);
912 struct serial_state *info = tty->driver_data;
919 if (info->x_char)
920 info->x_char = 0;
925 info->MCR |= SER_RTS;
927 rtsdtr_ctrl(info->MCR);
1019 * get_lsr_info - get line status register info
1021 * Purpose: Let user call ioctl() to get info when the UART physically
1028 static int get_lsr_info(struct serial_state *info, unsigned int __user *value)
1047 struct serial_state *info = tty->driver_data;
1054 control = info->MCR;
1068 struct serial_state *info = tty->driver_data;
1076 info->MCR |= SER_RTS;
1078 info->MCR |= SER_DTR;
1080 info->MCR &= ~SER_RTS;
1082 info->MCR &= ~SER_DTR;
1083 rtsdtr_ctrl(info->MCR);
1114 struct serial_state *info = tty->driver_data;
1119 cnow = info->icount;
1139 struct serial_state *info = tty->driver_data;
1157 return get_lsr_info(info, argp);
1168 cprev = info->icount;
1171 prepare_to_wait(&info->tport.delta_msr_wait,
1174 cnow = info->icount; /* atomic copy */
1196 finish_wait(&info->tport.delta_msr_wait, &wait);
1207 struct serial_state *info = tty->driver_data;
1211 change_speed(tty, info, old_termios);
1215 info->MCR &= ~(SER_DTR|SER_RTS);
1217 rtsdtr_ctrl(info->MCR);
1223 info->MCR |= SER_DTR;
1225 info->MCR |= SER_RTS;
1227 rtsdtr_ctrl(info->MCR);
1245 wake_up_interruptible(&info->open_wait);
1303 struct serial_state *info = tty->driver_data;
1307 if (info->xmit_fifo_size == 0)
1320 char_time = (info->timeout - HZ/50) / info->xmit_fifo_size;
1331 * takes longer than info->timeout, this is probably due to a
1333 * 2*info->timeout.
1335 if (!timeout || timeout > 2*info->timeout)
1336 timeout = 2*info->timeout;
1363 struct serial_state *info = tty->driver_data;
1366 shutdown(tty, info);
1367 info->tport.count = 0;
1368 tty_port_set_active(&info->tport, 0);
1369 info->tport.tty = NULL;
1370 wake_up_interruptible(&info->tport.open_wait);
1381 struct serial_state *info = rs_table + tty->index;
1382 struct tty_port *port = &info->tport;
1387 tty->driver_data = info;
1392 retval = startup(tty, info);
1513 struct serial_state *info = container_of(port, struct serial_state,
1518 info->MCR |= SER_DTR|SER_RTS;
1520 info->MCR &= ~(SER_DTR|SER_RTS);
1523 rtsdtr_ctrl(info->MCR);