Lines Matching refs:port_priv

215 static inline int update_mctrl(struct qt2_port_private *port_priv,  in update_mctrl()  argument
218 struct usb_serial_port *port = port_priv->port; in update_mctrl()
236 status = qt2_setregister(dev, port_priv->device_port, UART_MCR, in update_mctrl()
268 struct qt2_port_private *port_priv; in qt2_set_termios() local
275 port_priv = usb_get_serial_port_data(port); in qt2_set_termios()
290 status = qt2_set_port_config(dev, port_priv->device_port, baud, in qt2_set_termios()
299 port_priv->device_port); in qt2_set_termios()
302 0, port_priv->device_port); in qt2_set_termios()
311 x, port_priv->device_port); in qt2_set_termios()
314 0, port_priv->device_port); in qt2_set_termios()
325 struct qt2_port_private *port_priv; in qt2_open() local
335 port_priv = usb_get_serial_port_data(port); in qt2_open()
367 spin_lock_irqsave(&port_priv->lock, flags); in qt2_open()
368 port_priv->shadowLSR = data[0]; in qt2_open()
369 port_priv->shadowMSR = data[1]; in qt2_open()
370 spin_unlock_irqrestore(&port_priv->lock, flags); in qt2_open()
383 port_priv->device_port = (u8) device_port; in qt2_open()
395 struct qt2_port_private *port_priv; in qt2_close() local
399 port_priv = usb_get_serial_port_data(port); in qt2_close()
401 usb_kill_urb(port_priv->write_urb); in qt2_close()
407 port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); in qt2_close()
417 port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); in qt2_close()
428 port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); in qt2_close()
555 struct qt2_port_private *port_priv; in qt2_write_bulk_callback() local
559 port_priv = usb_get_serial_port_data(port); in qt2_write_bulk_callback()
561 spin_lock_irqsave(&port_priv->urb_lock, flags); in qt2_write_bulk_callback()
563 port_priv->urb_in_use = false; in qt2_write_bulk_callback()
566 spin_unlock_irqrestore(&port_priv->urb_lock, flags); in qt2_write_bulk_callback()
665 struct qt2_port_private *port_priv; in qt2_port_probe() local
668 port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL); in qt2_port_probe()
669 if (!port_priv) in qt2_port_probe()
672 spin_lock_init(&port_priv->lock); in qt2_port_probe()
673 spin_lock_init(&port_priv->urb_lock); in qt2_port_probe()
674 port_priv->port = port; in qt2_port_probe()
676 port_priv->write_buffer = kmalloc(QT2_WRITE_BUFFER_SIZE, GFP_KERNEL); in qt2_port_probe()
677 if (!port_priv->write_buffer) in qt2_port_probe()
680 port_priv->write_urb = usb_alloc_urb(0, GFP_KERNEL); in qt2_port_probe()
681 if (!port_priv->write_urb) in qt2_port_probe()
685 usb_fill_bulk_urb(port_priv->write_urb, serial->dev, in qt2_port_probe()
687 port_priv->write_buffer, in qt2_port_probe()
691 usb_set_serial_port_data(port, port_priv); in qt2_port_probe()
695 kfree(port_priv->write_buffer); in qt2_port_probe()
697 kfree(port_priv); in qt2_port_probe()
703 struct qt2_port_private *port_priv; in qt2_port_remove() local
705 port_priv = usb_get_serial_port_data(port); in qt2_port_remove()
706 usb_free_urb(port_priv->write_urb); in qt2_port_remove()
707 kfree(port_priv->write_buffer); in qt2_port_remove()
708 kfree(port_priv); in qt2_port_remove()
715 struct qt2_port_private *port_priv = usb_get_serial_port_data(port); in qt2_tiocmget() local
723 r = qt2_getregister(dev, port_priv->device_port, UART_MCR, d); in qt2_tiocmget()
727 r = qt2_getregister(dev, port_priv->device_port, UART_MSR, d + 1); in qt2_tiocmget()
746 struct qt2_port_private *port_priv; in qt2_tiocmset() local
748 port_priv = usb_get_serial_port_data(tty->driver_data); in qt2_tiocmset()
749 return update_mctrl(port_priv, set, clear); in qt2_tiocmset()
755 struct qt2_port_private *port_priv; in qt2_break_ctl() local
759 port_priv = usb_get_serial_port_data(port); in qt2_break_ctl()
764 val, port_priv->device_port); in qt2_break_ctl()
776 struct qt2_port_private *port_priv = usb_get_serial_port_data(port); in qt2_dtr_rts() local
780 if (qt2_setregister(dev, port_priv->device_port, in qt2_dtr_rts()
786 update_mctrl(port_priv, TIOCM_DTR | TIOCM_RTS, 0); in qt2_dtr_rts()
788 update_mctrl(port_priv, 0, TIOCM_DTR | TIOCM_RTS); in qt2_dtr_rts()
793 struct qt2_port_private *port_priv; in qt2_update_msr() local
798 port_priv = usb_get_serial_port_data(port); in qt2_update_msr()
799 if (!port_priv) in qt2_update_msr()
802 spin_lock_irqsave(&port_priv->lock, flags); in qt2_update_msr()
803 port_priv->shadowMSR = newMSR; in qt2_update_msr()
804 spin_unlock_irqrestore(&port_priv->lock, flags); in qt2_update_msr()
823 struct qt2_port_private *port_priv; in qt2_update_lsr() local
829 port_priv = usb_get_serial_port_data(port); in qt2_update_lsr()
830 if (!port_priv) in qt2_update_lsr()
836 spin_lock_irqsave(&port_priv->lock, flags); in qt2_update_lsr()
837 port_priv->shadowLSR = newLSR; in qt2_update_lsr()
838 spin_unlock_irqrestore(&port_priv->lock, flags); in qt2_update_lsr()
862 struct qt2_port_private *port_priv; in qt2_write_room() local
866 port_priv = usb_get_serial_port_data(port); in qt2_write_room()
868 spin_lock_irqsave(&port_priv->urb_lock, flags); in qt2_write_room()
870 if (port_priv->urb_in_use) in qt2_write_room()
875 spin_unlock_irqrestore(&port_priv->urb_lock, flags); in qt2_write_room()
884 struct qt2_port_private *port_priv; in qt2_write() local
891 port_priv = usb_get_serial_port_data(port); in qt2_write()
893 if (port_priv->write_urb == NULL) { in qt2_write()
897 write_urb = port_priv->write_urb; in qt2_write()
902 spin_lock_irqsave(&port_priv->urb_lock, flags); in qt2_write()
903 if (port_priv->urb_in_use) { in qt2_write()
910 *data++ = port_priv->device_port; in qt2_write()
919 port_priv->urb_in_use = true; in qt2_write()
924 spin_unlock_irqrestore(&port_priv->urb_lock, flags); in qt2_write()