Lines Matching refs:edge_port
223 static void stop_read(struct edgeport_port *edge_port);
224 static int restart_read(struct edgeport_port *edge_port);
1557 static void handle_new_msr(struct edgeport_port *edge_port, __u8 msr) in handle_new_msr() argument
1562 dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, msr); in handle_new_msr()
1566 icount = &edge_port->port->icount; in handle_new_msr()
1577 wake_up_interruptible(&edge_port->port->port.delta_msr_wait); in handle_new_msr()
1581 edge_port->shadow_msr = msr & 0xf0; in handle_new_msr()
1583 tty = tty_port_tty_get(&edge_port->port->port); in handle_new_msr()
1592 static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data, in handle_new_lsr() argument
1599 dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr); in handle_new_lsr()
1601 edge_port->shadow_lsr = lsr; in handle_new_lsr()
1612 edge_tty_recv(edge_port->port, &data, 1); in handle_new_lsr()
1615 icount = &edge_port->port->icount; in handle_new_lsr()
1630 struct edgeport_port *edge_port; in edge_interrupt_callback() local
1682 edge_port = usb_get_serial_port_data(port); in edge_interrupt_callback()
1683 if (!edge_port) { in edge_interrupt_callback()
1696 edge_port->lsr_event = 1; in edge_interrupt_callback()
1697 edge_port->lsr_mask = lsr; in edge_interrupt_callback()
1701 handle_new_lsr(edge_port, 0, lsr, 0); in edge_interrupt_callback()
1710 handle_new_msr(edge_port, msr); in edge_interrupt_callback()
1731 struct edgeport_port *edge_port = urb->context; in edge_bulk_in_callback() local
1732 struct device *dev = &edge_port->port->dev; in edge_bulk_in_callback()
1761 port_number = edge_port->port->port_number; in edge_bulk_in_callback()
1763 if (urb->actual_length > 0 && edge_port->lsr_event) { in edge_bulk_in_callback()
1764 edge_port->lsr_event = 0; in edge_bulk_in_callback()
1766 __func__, port_number, edge_port->lsr_mask, *data); in edge_bulk_in_callback()
1767 handle_new_lsr(edge_port, 1, edge_port->lsr_mask, *data); in edge_bulk_in_callback()
1775 if (edge_port->close_pending) in edge_bulk_in_callback()
1779 edge_tty_recv(edge_port->port, data, in edge_bulk_in_callback()
1781 edge_port->port->icount.rx += urb->actual_length; in edge_bulk_in_callback()
1786 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_bulk_in_callback()
1787 if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) in edge_bulk_in_callback()
1789 else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) in edge_bulk_in_callback()
1790 edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; in edge_bulk_in_callback()
1792 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_bulk_in_callback()
1812 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_bulk_out_callback() local
1816 edge_port->ep_write_urb_in_use = 0; in edge_bulk_out_callback()
1842 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_open() local
1851 if (edge_port == NULL) in edge_open()
1859 status = ti_do_config(edge_port, UMPC_SET_CLR_LOOPBACK, 0); in edge_open()
1876 edge_port->ump_read_timeout = in edge_open()
1916 &edge_port->shadow_msr, 1); in edge_open()
1923 dev_dbg(&port->dev, "ShadowMSR 0x%X\n", edge_port->shadow_msr); in edge_open()
1926 edge_port->shadow_mcr = MCR_RTS | MCR_DTR; in edge_open()
1927 dev_dbg(&port->dev, "ShadowMCR 0x%X\n", edge_port->shadow_mcr); in edge_open()
1929 edge_serial = edge_port->edge_serial; in edge_open()
1954 edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; in edge_open()
1955 urb->context = edge_port; in edge_open()
1969 if (edge_port->edge_serial->num_ports_open == 0) in edge_open()
1979 struct edgeport_port *edge_port; in edge_close() local
1985 edge_port = usb_get_serial_port_data(port); in edge_close()
1986 if (edge_serial == NULL || edge_port == NULL) in edge_close()
1993 edge_port->close_pending = 1; in edge_close()
1997 edge_port->ep_write_urb_in_use = 0; in edge_close()
1998 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_close()
2000 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_close()
2008 --edge_port->edge_serial->num_ports_open; in edge_close()
2009 if (edge_port->edge_serial->num_ports_open <= 0) { in edge_close()
2012 edge_port->edge_serial->num_ports_open = 0; in edge_close()
2015 edge_port->close_pending = 0; in edge_close()
2021 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_write() local
2028 if (edge_port == NULL) in edge_write()
2030 if (edge_port->close_pending == 1) in edge_write()
2034 &edge_port->ep_lock); in edge_write()
2043 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_send() local
2046 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_send()
2048 if (edge_port->ep_write_urb_in_use) { in edge_send()
2049 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_send()
2058 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_send()
2062 edge_port->ep_write_urb_in_use = 1; in edge_send()
2064 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_send()
2077 edge_port->ep_write_urb_in_use = 0; in edge_send()
2080 edge_port->port->icount.tx += count; in edge_send()
2093 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_write_room() local
2097 if (edge_port == NULL) in edge_write_room()
2099 if (edge_port->close_pending == 1) in edge_write_room()
2102 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_write_room()
2104 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_write_room()
2113 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_chars_in_buffer() local
2116 if (edge_port == NULL) in edge_chars_in_buffer()
2119 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_chars_in_buffer()
2121 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_chars_in_buffer()
2129 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_tx_empty() local
2132 ret = tx_active(edge_port); in edge_tx_empty()
2142 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_throttle() local
2145 if (edge_port == NULL) in edge_throttle()
2162 stop_read(edge_port); in edge_throttle()
2169 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_unthrottle() local
2172 if (edge_port == NULL) in edge_unthrottle()
2188 status = restart_read(edge_port); in edge_unthrottle()
2197 static void stop_read(struct edgeport_port *edge_port) in stop_read() argument
2201 spin_lock_irqsave(&edge_port->ep_lock, flags); in stop_read()
2203 if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) in stop_read()
2204 edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPING; in stop_read()
2205 edge_port->shadow_mcr &= ~MCR_RTS; in stop_read()
2207 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in stop_read()
2210 static int restart_read(struct edgeport_port *edge_port) in restart_read() argument
2216 spin_lock_irqsave(&edge_port->ep_lock, flags); in restart_read()
2218 if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPED) { in restart_read()
2219 urb = edge_port->port->read_urb; in restart_read()
2222 edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; in restart_read()
2223 edge_port->shadow_mcr |= MCR_RTS; in restart_read()
2225 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in restart_read()
2231 struct edgeport_port *edge_port, struct ktermios *old_termios) in change_port_settings() argument
2233 struct device *dev = &edge_port->port->dev; in change_port_settings()
2238 int port_number = edge_port->port->port_number; in change_port_settings()
2253 config->bUartMode = (__u8)(edge_port->bUartMode); in change_port_settings()
2305 restart_read(edge_port); in change_port_settings()
2344 edge_port->baud_rate = baud; in change_port_settings()
2364 status = send_cmd(edge_port->port->serial->dev, UMPC_SET_CONFIG, in change_port_settings()
2376 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_set_termios() local
2378 if (edge_port == NULL) in edge_set_termios()
2381 change_port_settings(tty, edge_port, old_termios); in edge_set_termios()
2388 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_tiocmset() local
2392 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_tiocmset()
2393 mcr = edge_port->shadow_mcr; in edge_tiocmset()
2408 edge_port->shadow_mcr = mcr; in edge_tiocmset()
2409 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_tiocmset()
2411 restore_mcr(edge_port, mcr); in edge_tiocmset()
2418 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_tiocmget() local
2424 spin_lock_irqsave(&edge_port->ep_lock, flags); in edge_tiocmget()
2426 msr = edge_port->shadow_msr; in edge_tiocmget()
2427 mcr = edge_port->shadow_mcr; in edge_tiocmget()
2437 spin_unlock_irqrestore(&edge_port->ep_lock, flags); in edge_tiocmget()
2446 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in get_serial_info() local
2449 cwait = edge_port->port->port.closing_wait; in get_serial_info()
2454 ss->line = edge_port->port->minor; in get_serial_info()
2455 ss->port = edge_port->port->port_number; in get_serial_info()
2457 ss->xmit_fifo_size = edge_port->port->bulk_out_size; in get_serial_info()
2467 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in edge_break() local
2473 status = ti_do_config(edge_port, UMPC_SET_CLR_BREAK, bv); in edge_break()
2586 struct edgeport_port *edge_port; in edge_port_probe() local
2589 edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); in edge_port_probe()
2590 if (!edge_port) in edge_port_probe()
2593 spin_lock_init(&edge_port->ep_lock); in edge_port_probe()
2594 edge_port->port = port; in edge_port_probe()
2595 edge_port->edge_serial = usb_get_serial_data(port->serial); in edge_port_probe()
2596 edge_port->bUartMode = default_uart_mode; in edge_port_probe()
2600 edge_port->uart_base = UMPMEM_BASE_UART1; in edge_port_probe()
2601 edge_port->dma_address = UMPD_OEDB1_ADDRESS; in edge_port_probe()
2604 edge_port->uart_base = UMPMEM_BASE_UART2; in edge_port_probe()
2605 edge_port->dma_address = UMPD_OEDB2_ADDRESS; in edge_port_probe()
2615 __func__, port->port_number, edge_port->uart_base, in edge_port_probe()
2616 edge_port->dma_address); in edge_port_probe()
2618 usb_set_serial_port_data(port, edge_port); in edge_port_probe()
2629 kfree(edge_port); in edge_port_probe()
2636 struct edgeport_port *edge_port; in edge_port_remove() local
2638 edge_port = usb_get_serial_port_data(port); in edge_port_remove()
2640 kfree(edge_port); in edge_port_remove()
2651 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in uart_mode_show() local
2653 return sprintf(buf, "%d\n", edge_port->bUartMode); in uart_mode_show()
2660 struct edgeport_port *edge_port = usb_get_serial_port_data(port); in uart_mode_store() local
2666 edge_port->bUartMode = v; in uart_mode_store()