Lines Matching full:port
72 USBPort port; member
98 unsigned port; member
614 res->portnum = usb_hp->port; in usbback_hotplug_notify()
615 res->speed = usbif->ports[usb_hp->port - 1].speed; in usbback_hotplug_notify()
623 TR_BUS(&usbif->xendev, "hotplug port %d speed %d\n", usb_hp->port, in usbback_hotplug_notify()
684 static void usbback_hotplug_enq(struct usbback_info *usbif, unsigned port) in usbback_hotplug_enq() argument
689 usb_hp->port = port; in usbback_hotplug_enq()
694 static void usbback_portid_drain(struct usbback_info *usbif, unsigned port) in usbback_portid_drain() argument
699 QTAILQ_FOREACH_SAFE(req, &usbif->ports[port - 1].submit_q, q, tmp) { in usbback_portid_drain()
709 static void usbback_portid_detach(struct usbback_info *usbif, unsigned port) in usbback_portid_detach() argument
711 if (!usbif->ports[port - 1].attached) { in usbback_portid_detach()
715 usbif->ports[port - 1].speed = USBIF_SPEED_NONE; in usbback_portid_detach()
716 usbif->ports[port - 1].attached = false; in usbback_portid_detach()
717 usbback_portid_drain(usbif, port); in usbback_portid_detach()
718 usbback_hotplug_enq(usbif, port); in usbback_portid_detach()
721 static void usbback_portid_remove(struct usbback_info *usbif, unsigned port) in usbback_portid_remove() argument
723 if (!usbif->ports[port - 1].dev) { in usbback_portid_remove()
727 object_unparent(OBJECT(usbif->ports[port - 1].dev)); in usbback_portid_remove()
728 usbif->ports[port - 1].dev = NULL; in usbback_portid_remove()
729 usbback_portid_detach(usbif, port); in usbback_portid_remove()
731 TR_BUS(&usbif->xendev, "port %d removed\n", port); in usbback_portid_remove()
734 static void usbback_portid_add(struct usbback_info *usbif, unsigned port, in usbback_portid_add() argument
744 if (usbif->ports[port - 1].dev) { in usbback_portid_add()
761 tmp = g_strdup_printf("%s-%u", DEVICE(&usbif->xendev)->id, port); in usbback_portid_add()
764 qdict_put_int(qdict, "port", port); in usbback_portid_add()
769 usbif->ports[port - 1].dev = USB_DEVICE(qdev_device_add(opts, &local_err)); in usbback_portid_add()
770 if (!usbif->ports[port - 1].dev) { in usbback_portid_add()
779 speed = usbif->ports[port - 1].dev->speed; in usbback_portid_add()
797 object_unparent(OBJECT(usbif->ports[port - 1].dev)); in usbback_portid_add()
798 usbif->ports[port - 1].dev = NULL; in usbback_portid_add()
801 usb_device_reset(usbif->ports[port - 1].dev); in usbback_portid_add()
802 usbif->ports[port - 1].speed = speed; in usbback_portid_add()
803 usbif->ports[port - 1].attached = true; in usbback_portid_add()
804 QTAILQ_INIT(&usbif->ports[port - 1].submit_q); in usbback_portid_add()
805 usbback_hotplug_enq(usbif, port); in usbback_portid_add()
807 TR_BUS(&usbif->xendev, "port %d attached\n", port); in usbback_portid_add()
810 static void usbback_process_port(struct usbback_info *usbif, unsigned port) in usbback_process_port() argument
815 snprintf(node, sizeof(node), "port/%d", port); in usbback_process_port()
822 /* Remove portid, if the port is not connected. */ in usbback_process_port()
824 usbback_portid_remove(usbif, port); in usbback_process_port()
826 usbback_portid_add(usbif, port, busid); in usbback_process_port()
911 "remote port %d, local port %d\n", urb_ring_ref, in usbback_connect()
956 usbback_backend_changed(xendev, "port"); in usbback_init()
963 static void xen_bus_attach(USBPort *port) in xen_bus_attach() argument
967 usbif = port->opaque; in xen_bus_attach()
969 usbif->ports[port->index].attached = true; in xen_bus_attach()
970 usbback_hotplug_enq(usbif, port->index + 1); in xen_bus_attach()
973 static void xen_bus_detach(USBPort *port) in xen_bus_detach() argument
977 usbif = port->opaque; in xen_bus_detach()
979 usbback_portid_detach(usbif, port->index + 1); in xen_bus_detach()
982 static void xen_bus_child_detach(USBPort *port, USBDevice *child) in xen_bus_child_detach() argument
986 usbif = port->opaque; in xen_bus_child_detach()
990 static void xen_bus_complete(USBPort *port, USBPacket *packet) in xen_bus_complete() argument
1027 p = &(usbif->ports[i].port); in usbback_alloc()
1068 usb_unregister_port(&usbif->bus, &(usbif->ports[i].port)); in usbback_free()