Lines Matching refs:edge_serial
107 struct edgeport_serial *edge_serial; member
1626 struct edgeport_serial *edge_serial = urb->context; in edge_interrupt_callback() local
1661 dev = &edge_serial->serial->dev->dev; in edge_interrupt_callback()
1674 if (port_number >= edge_serial->serial->num_ports) { in edge_interrupt_callback()
1679 port = edge_serial->serial->port[port_number]; in edge_interrupt_callback()
1841 struct edgeport_serial *edge_serial; in edge_open() local
1927 edge_serial = edge_port->edge_serial; in edge_open()
1928 if (mutex_lock_interruptible(&edge_serial->es_lock)) in edge_open()
1930 if (edge_serial->num_ports_open == 0) { in edge_open()
1932 urb = edge_serial->serial->port[0]->interrupt_in_urb; in edge_open()
1933 urb->context = edge_serial; in edge_open()
1962 ++edge_serial->num_ports_open; in edge_open()
1967 if (edge_port->edge_serial->num_ports_open == 0) in edge_open()
1970 mutex_unlock(&edge_serial->es_lock); in edge_open()
1976 struct edgeport_serial *edge_serial; in edge_close() local
1982 edge_serial = usb_get_serial_data(port->serial); in edge_close()
1984 if (edge_serial == NULL || edge_port == NULL) in edge_close()
2005 mutex_lock(&edge_serial->es_lock); in edge_close()
2006 --edge_port->edge_serial->num_ports_open; in edge_close()
2007 if (edge_port->edge_serial->num_ports_open <= 0) { in edge_close()
2010 edge_port->edge_serial->num_ports_open = 0; in edge_close()
2012 mutex_unlock(&edge_serial->es_lock); in edge_close()
2477 static void edge_heartbeat_schedule(struct edgeport_serial *edge_serial) in edge_heartbeat_schedule() argument
2479 if (!edge_serial->use_heartbeat) in edge_heartbeat_schedule()
2482 schedule_delayed_work(&edge_serial->heartbeat_work, in edge_heartbeat_schedule()
2528 struct edgeport_serial *edge_serial; in edge_startup() local
2533 edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); in edge_startup()
2534 if (!edge_serial) in edge_startup()
2537 mutex_init(&edge_serial->es_lock); in edge_startup()
2538 edge_serial->serial = serial; in edge_startup()
2539 INIT_DELAYED_WORK(&edge_serial->heartbeat_work, edge_heartbeat_work); in edge_startup()
2540 usb_set_serial_data(serial, edge_serial); in edge_startup()
2542 status = download_fw(edge_serial); in edge_startup()
2544 kfree(edge_serial); in edge_startup()
2552 edge_serial->serial->dev->descriptor.idProduct); in edge_startup()
2555 if (edge_serial->fw_version > FW_HEARTBEAT_VERSION_CUTOFF) { in edge_startup()
2558 edge_serial->use_heartbeat = true; in edge_startup()
2562 edge_heartbeat_schedule(edge_serial); in edge_startup()
2569 struct edgeport_serial *edge_serial = usb_get_serial_data(serial); in edge_disconnect() local
2571 cancel_delayed_work_sync(&edge_serial->heartbeat_work); in edge_disconnect()
2576 struct edgeport_serial *edge_serial = usb_get_serial_data(serial); in edge_release() local
2578 cancel_delayed_work_sync(&edge_serial->heartbeat_work); in edge_release()
2579 kfree(edge_serial); in edge_release()
2593 edge_port->edge_serial = usb_get_serial_data(port->serial); in edge_port_probe()
2686 struct edgeport_serial *edge_serial = usb_get_serial_data(serial); in edge_suspend() local
2688 cancel_delayed_work_sync(&edge_serial->heartbeat_work); in edge_suspend()
2695 struct edgeport_serial *edge_serial = usb_get_serial_data(serial); in edge_resume() local
2697 edge_heartbeat_schedule(edge_serial); in edge_resume()