Lines Matching +full:dev +full:- +full:ctrl

31 #include "hw/usb/uhci-regs.h"
35 #include "hw/qdev-properties.h"
41 #include "qemu/main-loop.h"
44 #include "hcd-uhci.h"
98 uint32_t ctrl; /* see TD_CTRL_xxx */ member
114 if ((td->token & (0xf << 15)) == 0) { in uhci_queue_token()
115 /* ctrl ep, cover ep and dev, not pid! */ in uhci_queue_token()
116 return td->token & 0x7ff00; in uhci_queue_token()
118 /* covers ep, dev, pid -> identifies the endpoint */ in uhci_queue_token()
119 return td->token & 0x7ffff; in uhci_queue_token()
129 queue->uhci = s; in uhci_queue_new()
130 queue->qh_addr = qh_addr; in uhci_queue_new()
131 queue->token = uhci_queue_token(td); in uhci_queue_new()
132 queue->ep = ep; in uhci_queue_new()
133 QTAILQ_INIT(&queue->asyncs); in uhci_queue_new()
134 QTAILQ_INSERT_HEAD(&s->queues, queue, next); in uhci_queue_new()
135 queue->valid = QH_VALID; in uhci_queue_new()
136 trace_usb_uhci_queue_add(queue->token); in uhci_queue_new()
142 UHCIState *s = queue->uhci; in uhci_queue_free()
145 while (!QTAILQ_EMPTY(&queue->asyncs)) { in uhci_queue_free()
146 async = QTAILQ_FIRST(&queue->asyncs); in uhci_queue_free()
149 usb_device_ep_stopped(queue->ep->dev, queue->ep); in uhci_queue_free()
151 trace_usb_uhci_queue_del(queue->token, reason); in uhci_queue_free()
152 QTAILQ_REMOVE(&s->queues, queue, next); in uhci_queue_free()
161 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_queue_find()
162 if (queue->token == token) { in uhci_queue_find()
172 UHCIAsync *first = QTAILQ_FIRST(&queue->asyncs); in uhci_queue_verify()
173 uint32_t queue_token_addr = (queue->token >> 8) & 0x7f; in uhci_queue_verify()
175 return queue->qh_addr == qh_addr && in uhci_queue_verify()
176 queue->token == uhci_queue_token(td) && in uhci_queue_verify()
177 queue_token_addr == queue->ep->dev->addr && in uhci_queue_verify()
178 (queuing || !(td->ctrl & TD_CTRL_ACTIVE) || first == NULL || in uhci_queue_verify()
179 first->td_addr == td_addr); in uhci_queue_verify()
186 async->queue = queue; in uhci_async_alloc()
187 async->td_addr = td_addr; in uhci_async_alloc()
188 usb_packet_init(&async->packet); in uhci_async_alloc()
189 trace_usb_uhci_packet_add(async->queue->token, async->td_addr); in uhci_async_alloc()
196 trace_usb_uhci_packet_del(async->queue->token, async->td_addr); in uhci_async_free()
197 usb_packet_cleanup(&async->packet); in uhci_async_free()
198 if (async->buf != async->static_buf) { in uhci_async_free()
199 g_free(async->buf); in uhci_async_free()
206 UHCIQueue *queue = async->queue; in uhci_async_link()
207 QTAILQ_INSERT_TAIL(&queue->asyncs, async, next); in uhci_async_link()
208 trace_usb_uhci_packet_link_async(async->queue->token, async->td_addr); in uhci_async_link()
213 UHCIQueue *queue = async->queue; in uhci_async_unlink()
214 QTAILQ_REMOVE(&queue->asyncs, async, next); in uhci_async_unlink()
215 trace_usb_uhci_packet_unlink_async(async->queue->token, async->td_addr); in uhci_async_unlink()
221 trace_usb_uhci_packet_cancel(async->queue->token, async->td_addr, in uhci_async_cancel()
222 async->done); in uhci_async_cancel()
223 if (!async->done) { in uhci_async_cancel()
224 usb_cancel_packet(&async->packet); in uhci_async_cancel()
237 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_async_validate_begin()
238 queue->valid--; in uhci_async_validate_begin()
249 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) { in uhci_async_validate_end()
250 if (!queue->valid) { in uhci_async_validate_end()
251 uhci_queue_free(queue, "validate-end"); in uhci_async_validate_end()
256 static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev) in uhci_async_cancel_device() argument
260 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) { in uhci_async_cancel_device()
261 if (queue->ep->dev == dev) { in uhci_async_cancel_device()
262 uhci_queue_free(queue, "cancel-device"); in uhci_async_cancel_device()
271 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, nq) { in uhci_async_cancel_all()
272 uhci_queue_free(queue, "cancel-all"); in uhci_async_cancel_all()
281 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_async_find_td()
282 QTAILQ_FOREACH(async, &queue->asyncs, next) { in uhci_async_find_td()
283 if (async->td_addr == td_addr) { in uhci_async_find_td()
294 if (((s->status2 & 1) && (s->intr & (1 << 2))) || in uhci_update_irq()
295 ((s->status2 & 2) && (s->intr & (1 << 3))) || in uhci_update_irq()
296 ((s->status & UHCI_STS_USBERR) && (s->intr & (1 << 0))) || in uhci_update_irq()
297 ((s->status & UHCI_STS_RD) && (s->intr & (1 << 1))) || in uhci_update_irq()
298 (s->status & UHCI_STS_HSERR) || in uhci_update_irq()
299 (s->status & UHCI_STS_HCPERR)) { in uhci_update_irq()
302 qemu_set_irq(s->irq, level); in uhci_update_irq()
305 static void uhci_reset(DeviceState *dev) in uhci_reset() argument
307 PCIDevice *d = PCI_DEVICE(dev); in uhci_reset()
315 pci_conf = s->dev.config; in uhci_reset()
319 s->cmd = 0; in uhci_reset()
320 s->status = UHCI_STS_HCHALTED; in uhci_reset()
321 s->status2 = 0; in uhci_reset()
322 s->intr = 0; in uhci_reset()
323 s->fl_base_addr = 0; in uhci_reset()
324 s->sof_timing = 64; in uhci_reset()
327 port = &s->ports[i]; in uhci_reset()
328 port->ctrl = 0x0080; in uhci_reset()
329 if (port->port.dev && port->port.dev->attached) { in uhci_reset()
330 usb_port_reset(&port->port); in uhci_reset()
335 qemu_bh_cancel(s->bh); in uhci_reset()
344 VMSTATE_UINT16(ctrl, UHCIPort),
354 s->expire_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + in uhci_post_load()
366 VMSTATE_PCI_DEVICE(dev, UHCIState),
393 if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) { in uhci_port_write()
396 s->expire_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + in uhci_port_write()
398 timer_mod(s->frame_timer, s->expire_time); in uhci_port_write()
399 s->status &= ~UHCI_STS_HCHALTED; in uhci_port_write()
401 s->status |= UHCI_STS_HCHALTED; in uhci_port_write()
409 port = &s->ports[i]; in uhci_port_write()
410 usb_device_reset(port->port.dev); in uhci_port_write()
419 s->cmd = val; in uhci_port_write()
421 if ((s->ports[0].ctrl & UHCI_PORT_RD) || in uhci_port_write()
422 (s->ports[1].ctrl & UHCI_PORT_RD)) { in uhci_port_write()
428 s->status &= ~val; in uhci_port_write()
434 s->status2 = 0; in uhci_port_write()
439 s->intr = val; in uhci_port_write()
443 if (s->status & UHCI_STS_HCHALTED) { in uhci_port_write()
444 s->frnum = val & 0x7ff; in uhci_port_write()
448 s->fl_base_addr &= 0xffff0000; in uhci_port_write()
449 s->fl_base_addr |= val & ~0xfff; in uhci_port_write()
452 s->fl_base_addr &= 0x0000ffff; in uhci_port_write()
453 s->fl_base_addr |= (val << 16); in uhci_port_write()
456 s->sof_timing = val & 0xff; in uhci_port_write()
461 USBDevice *dev; in uhci_port_write() local
468 port = &s->ports[n]; in uhci_port_write()
469 dev = port->port.dev; in uhci_port_write()
470 if (dev && dev->attached) { in uhci_port_write()
473 !(port->ctrl & UHCI_PORT_RESET)) { in uhci_port_write()
474 usb_device_reset(dev); in uhci_port_write()
477 port->ctrl &= UHCI_PORT_READ_ONLY; in uhci_port_write()
479 if (!(port->ctrl & UHCI_PORT_CCS)) { in uhci_port_write()
482 port->ctrl |= (val & ~UHCI_PORT_READ_ONLY); in uhci_port_write()
484 port->ctrl &= ~(val & UHCI_PORT_WRITE_CLEAR); in uhci_port_write()
497 val = s->cmd; in uhci_port_read()
500 val = s->status; in uhci_port_read()
503 val = s->intr; in uhci_port_read()
506 val = s->frnum; in uhci_port_read()
509 val = s->fl_base_addr & 0xffff; in uhci_port_read()
512 val = (s->fl_base_addr >> 16) & 0xffff; in uhci_port_read()
515 val = s->sof_timing; in uhci_port_read()
525 port = &s->ports[n]; in uhci_port_read()
526 val = port->ctrl; in uhci_port_read()
549 if (s->cmd & UHCI_CMD_EGSM) { in uhci_resume()
550 s->cmd |= UHCI_CMD_FGR; in uhci_resume()
551 s->status |= UHCI_STS_RD; in uhci_resume()
558 UHCIState *s = port1->opaque; in uhci_attach()
559 UHCIPort *port = &s->ports[port1->index]; in uhci_attach()
562 port->ctrl |= UHCI_PORT_CCS | UHCI_PORT_CSC; in uhci_attach()
565 if (port->port.dev->speed == USB_SPEED_LOW) { in uhci_attach()
566 port->ctrl |= UHCI_PORT_LSDA; in uhci_attach()
568 port->ctrl &= ~UHCI_PORT_LSDA; in uhci_attach()
576 UHCIState *s = port1->opaque; in uhci_detach()
577 UHCIPort *port = &s->ports[port1->index]; in uhci_detach()
579 uhci_async_cancel_device(s, port1->dev); in uhci_detach()
582 if (port->ctrl & UHCI_PORT_CCS) { in uhci_detach()
583 port->ctrl &= ~UHCI_PORT_CCS; in uhci_detach()
584 port->ctrl |= UHCI_PORT_CSC; in uhci_detach()
587 if (port->ctrl & UHCI_PORT_EN) { in uhci_detach()
588 port->ctrl &= ~UHCI_PORT_EN; in uhci_detach()
589 port->ctrl |= UHCI_PORT_ENC; in uhci_detach()
597 UHCIState *s = port1->opaque; in uhci_child_detach()
604 UHCIState *s = port1->opaque; in uhci_wakeup()
605 UHCIPort *port = &s->ports[port1->index]; in uhci_wakeup()
607 if (port->ctrl & UHCI_PORT_SUSPEND && !(port->ctrl & UHCI_PORT_RD)) { in uhci_wakeup()
608 port->ctrl |= UHCI_PORT_RD; in uhci_wakeup()
615 USBDevice *dev; in uhci_find_device() local
619 UHCIPort *port = &s->ports[i]; in uhci_find_device()
620 if (!(port->ctrl & UHCI_PORT_EN)) { in uhci_find_device()
623 dev = usb_find_device(&port->port, addr); in uhci_find_device()
624 if (dev != NULL) { in uhci_find_device()
625 return dev; in uhci_find_device()
633 pci_dma_read(&s->dev, link & ~0xf, td, sizeof(*td)); in uhci_read_td()
634 le32_to_cpus(&td->link); in uhci_read_td()
635 le32_to_cpus(&td->ctrl); in uhci_read_td()
636 le32_to_cpus(&td->token); in uhci_read_td()
637 le32_to_cpus(&td->buffer); in uhci_read_td()
648 td->ctrl |= TD_CTRL_NAK; in uhci_handle_td_error()
652 td->ctrl |= TD_CTRL_STALL; in uhci_handle_td_error()
658 td->ctrl |= TD_CTRL_BABBLE | TD_CTRL_STALL; in uhci_handle_td_error()
667 td->ctrl |= TD_CTRL_TIMEOUT; in uhci_handle_td_error()
668 td->ctrl &= ~(3 << TD_CTRL_ERROR_SHIFT); in uhci_handle_td_error()
674 td->ctrl &= ~TD_CTRL_ACTIVE; in uhci_handle_td_error()
675 s->status |= UHCI_STS_USBERR; in uhci_handle_td_error()
676 if (td->ctrl & TD_CTRL_IOC) { in uhci_handle_td_error()
689 max_len = ((td->token >> 21) + 1) & 0x7ff; in uhci_complete_td()
690 pid = td->token & 0xff; in uhci_complete_td()
692 if (td->ctrl & TD_CTRL_IOS) { in uhci_complete_td()
693 td->ctrl &= ~TD_CTRL_ACTIVE; in uhci_complete_td()
696 if (async->packet.status != USB_RET_SUCCESS) { in uhci_complete_td()
697 return uhci_handle_td_error(s, td, async->td_addr, in uhci_complete_td()
698 async->packet.status, int_mask); in uhci_complete_td()
701 len = async->packet.actual_length; in uhci_complete_td()
702 td->ctrl = (td->ctrl & ~0x7ff) | ((len - 1) & 0x7ff); in uhci_complete_td()
709 td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK); in uhci_complete_td()
710 if (td->ctrl & TD_CTRL_IOC) { in uhci_complete_td()
715 pci_dma_write(&s->dev, td->buffer, async->buf, len); in uhci_complete_td()
716 if ((td->ctrl & TD_CTRL_SPD) && len < max_len) { in uhci_complete_td()
719 trace_usb_uhci_packet_complete_shortxfer(async->queue->token, in uhci_complete_td()
720 async->td_addr); in uhci_complete_td()
726 trace_usb_uhci_packet_complete_success(async->queue->token, in uhci_complete_td()
727 async->td_addr); in uhci_complete_td()
737 uint8_t pid = td->token & 0xff; in uhci_handle_td()
738 uint8_t ep_id = (td->token >> 15) & 0xf; in uhci_handle_td()
743 if (uhci_queue_verify(async->queue, qh_addr, td, td_addr, queuing)) { in uhci_handle_td()
744 assert(q == NULL || q == async->queue); in uhci_handle_td()
745 q = async->queue; in uhci_handle_td()
747 uhci_queue_free(async->queue, "guest re-used pending td"); in uhci_handle_td()
755 uhci_queue_free(q, "guest re-used qh"); in uhci_handle_td()
761 q->valid = QH_VALID; in uhci_handle_td()
765 if (!(td->ctrl & TD_CTRL_ACTIVE)) { in uhci_handle_td()
767 /* Guest marked a pending td non-active, cancel the queue */ in uhci_handle_td()
768 uhci_queue_free(async->queue, "pending td non-active"); in uhci_handle_td()
774 if (td->ctrl & TD_CTRL_IOC) { in uhci_handle_td()
792 s->status |= UHCI_STS_HCPERR; in uhci_handle_td()
793 s->cmd &= ~UHCI_CMD_RS; in uhci_handle_td()
807 if (!async->done) { in uhci_handle_td()
809 UHCIAsync *last = QTAILQ_LAST(&async->queue->asyncs); in uhci_handle_td()
812 * may have added more tds to the queue. Note we re-read the td in uhci_handle_td()
815 uhci_read_td(s, &last_td, last->td_addr); in uhci_handle_td()
816 uhci_queue_fill(async->queue, &last_td); in uhci_handle_td()
824 if (s->completions_only) { in uhci_handle_td()
830 USBDevice *dev; in uhci_handle_td() local
833 dev = uhci_find_device(s, (td->token >> 8) & 0x7f); in uhci_handle_td()
834 if (dev == NULL) { in uhci_handle_td()
838 ep = usb_ep_get(dev, pid, ep_id); in uhci_handle_td()
843 max_len = ((td->token >> 21) + 1) & 0x7ff; in uhci_handle_td()
844 spd = (pid == USB_TOKEN_IN && (td->ctrl & TD_CTRL_SPD) != 0); in uhci_handle_td()
845 usb_packet_setup(&async->packet, pid, q->ep, 0, td_addr, spd, in uhci_handle_td()
846 (td->ctrl & TD_CTRL_IOC) != 0); in uhci_handle_td()
847 if (max_len <= sizeof(async->static_buf)) { in uhci_handle_td()
848 async->buf = async->static_buf; in uhci_handle_td()
850 async->buf = g_malloc(max_len); in uhci_handle_td()
852 usb_packet_addbuf(&async->packet, async->buf, max_len); in uhci_handle_td()
857 pci_dma_read(&s->dev, td->buffer, async->buf, max_len); in uhci_handle_td()
858 usb_handle_packet(q->ep->dev, &async->packet); in uhci_handle_td()
859 if (async->packet.status == USB_RET_SUCCESS) { in uhci_handle_td()
860 async->packet.actual_length = max_len; in uhci_handle_td()
865 usb_handle_packet(q->ep->dev, &async->packet); in uhci_handle_td()
872 if (async->packet.status == USB_RET_ASYNC) { in uhci_handle_td()
889 UHCIState *s = async->queue->uhci; in uhci_async_complete()
891 if (packet->status == USB_RET_REMOVE_FROM_QUEUE) { in uhci_async_complete()
896 async->done = 1; in uhci_async_complete()
898 s->completions_only = true; in uhci_async_complete()
899 qemu_bh_schedule(s->bh); in uhci_async_complete()
926 db->count = 0; in qhdb_reset()
933 for (i = 0; i < db->count; i++) { in qhdb_insert()
934 if (db->addr[i] == addr) { in qhdb_insert()
939 if (db->count >= UHCI_MAX_QUEUES) { in qhdb_insert()
943 db->addr[db->count++] = addr; in qhdb_insert()
950 uint32_t plink = td->link; in uhci_queue_fill()
955 uhci_read_td(q->uhci, &ptd, plink); in uhci_queue_fill()
956 if (!(ptd.ctrl & TD_CTRL_ACTIVE)) { in uhci_queue_fill()
959 if (uhci_queue_token(&ptd) != q->token) { in uhci_queue_fill()
962 trace_usb_uhci_td_queue(plink & ~0xf, ptd.ctrl, ptd.token); in uhci_queue_fill()
963 ret = uhci_handle_td(q->uhci, q, q->qh_addr, &ptd, plink, &int_mask); in uhci_queue_fill()
971 usb_device_flush_ep_queue(q->ep->dev, q->ep); in uhci_queue_fill()
983 frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2); in uhci_process_frame()
985 pci_dma_read(&s->dev, frame_addr, &link, 4); in uhci_process_frame()
993 for (cnt = FRAME_MAX_LOOPS; is_valid(link) && cnt; cnt--) { in uhci_process_frame()
994 if (!s->completions_only && s->frame_bytes >= s->frame_bandwidth) { in uhci_process_frame()
1025 pci_dma_read(&s->dev, link & ~0xf, &qh, sizeof(qh)); in uhci_process_frame()
1043 trace_usb_uhci_td_load(curr_qh & ~0xf, link & ~0xf, td.ctrl, td.token); in uhci_process_frame()
1045 old_td_ctrl = td.ctrl; in uhci_process_frame()
1047 if (old_td_ctrl != td.ctrl) { in uhci_process_frame()
1049 val = cpu_to_le32(td.ctrl); in uhci_process_frame()
1050 pci_dma_write(&s->dev, (link & ~0xf) + 4, &val, sizeof(val)); in uhci_process_frame()
1072 s->frame_bytes += (td.ctrl & 0x7ff) + 1; in uhci_process_frame()
1078 pci_dma_write(&s->dev, (curr_qh & ~0xf) + 4, &val, sizeof(val)); in uhci_process_frame()
1096 s->pending_int_mask |= int_mask; in uhci_process_frame()
1112 s->completions_only = false; in uhci_frame_timer()
1113 qemu_bh_cancel(s->bh); in uhci_frame_timer()
1115 if (!(s->cmd & UHCI_CMD_RS)) { in uhci_frame_timer()
1118 timer_del(s->frame_timer); in uhci_frame_timer()
1120 /* set hchalted bit in status - UHCI11D 2.1.2 */ in uhci_frame_timer()
1121 s->status |= UHCI_STS_HCHALTED; in uhci_frame_timer()
1126 t_last_run = s->expire_time - frame_t; in uhci_frame_timer()
1130 frames = (t_now - t_last_run) / frame_t; in uhci_frame_timer()
1131 if (frames > s->maxframes) { in uhci_frame_timer()
1132 int skipped = frames - s->maxframes; in uhci_frame_timer()
1133 s->expire_time += skipped * frame_t; in uhci_frame_timer()
1134 s->frnum = (s->frnum + skipped) & 0x7ff; in uhci_frame_timer()
1135 frames -= skipped; in uhci_frame_timer()
1142 s->frame_bytes = 0; in uhci_frame_timer()
1143 trace_usb_uhci_frame_start(s->frnum); in uhci_frame_timer()
1149 * the guest must look at frnum - 1 on interrupt, so inc frnum now in uhci_frame_timer()
1151 s->frnum = (s->frnum + 1) & 0x7ff; in uhci_frame_timer()
1152 s->expire_time += frame_t; in uhci_frame_timer()
1156 if (s->pending_int_mask) { in uhci_frame_timer()
1157 s->status2 |= s->pending_int_mask; in uhci_frame_timer()
1158 s->status |= UHCI_STS_USBINT; in uhci_frame_timer()
1161 s->pending_int_mask = 0; in uhci_frame_timer()
1163 timer_mod(s->frame_timer, t_now + frame_t); in uhci_frame_timer()
1187 void usb_uhci_common_realize(PCIDevice *dev, Error **errp) in usb_uhci_common_realize() argument
1190 UHCIPCIDeviceClass *u = UHCI_GET_CLASS(dev); in usb_uhci_common_realize()
1191 UHCIState *s = UHCI(dev); in usb_uhci_common_realize()
1192 uint8_t *pci_conf = s->dev.config; in usb_uhci_common_realize()
1198 pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1); in usb_uhci_common_realize()
1199 s->irq = pci_allocate_irq(dev); in usb_uhci_common_realize()
1201 if (s->masterbus) { in usb_uhci_common_realize()
1204 ports[i] = &s->ports[i].port; in usb_uhci_common_realize()
1206 usb_register_companion(s->masterbus, ports, UHCI_PORTS, in usb_uhci_common_realize()
1207 s->firstport, s, &uhci_port_ops, in usb_uhci_common_realize()
1215 usb_bus_new(&s->bus, sizeof(s->bus), &uhci_bus_ops, DEVICE(dev)); in usb_uhci_common_realize()
1217 usb_register_port(&s->bus, &s->ports[i].port, s, i, &uhci_port_ops, in usb_uhci_common_realize()
1221 s->bh = qemu_bh_new_guarded(uhci_bh, s, &DEVICE(dev)->mem_reentrancy_guard); in usb_uhci_common_realize()
1222 s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, uhci_frame_timer, s); in usb_uhci_common_realize()
1223 s->num_ports_vmstate = UHCI_PORTS; in usb_uhci_common_realize()
1224 QTAILQ_INIT(&s->queues); in usb_uhci_common_realize()
1226 memory_region_init_io(&s->io_bar, OBJECT(s), &uhci_ioport_ops, s, in usb_uhci_common_realize()
1233 pci_register_bar(&s->dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar); in usb_uhci_common_realize()
1236 static void usb_uhci_exit(PCIDevice *dev) in usb_uhci_exit() argument
1238 UHCIState *s = UHCI(dev); in usb_uhci_exit()
1242 if (s->frame_timer) { in usb_uhci_exit()
1243 timer_free(s->frame_timer); in usb_uhci_exit()
1244 s->frame_timer = NULL; in usb_uhci_exit()
1247 if (s->bh) { in usb_uhci_exit()
1248 qemu_bh_delete(s->bh); in usb_uhci_exit()
1253 if (!s->masterbus) { in usb_uhci_exit()
1254 usb_bus_release(&s->bus); in usb_uhci_exit()
1274 k->class_id = PCI_CLASS_SERIAL_USB; in uhci_class_init()
1275 dc->vmsd = &vmstate_uhci; in uhci_class_init()
1277 set_bit(DEVICE_CATEGORY_USB, dc->categories); in uhci_class_init()
1300 k->realize = info->realize ? info->realize : usb_uhci_common_realize; in uhci_data_class_init()
1301 k->exit = info->unplug ? usb_uhci_exit : NULL; in uhci_data_class_init()
1302 k->vendor_id = info->vendor_id; in uhci_data_class_init()
1303 k->device_id = info->device_id; in uhci_data_class_init()
1304 k->revision = info->revision; in uhci_data_class_init()
1305 if (!info->unplug) { in uhci_data_class_init()
1307 dc->hotpluggable = false; in uhci_data_class_init()
1312 if (info->notuser) { in uhci_data_class_init()
1313 dc->user_creatable = false; in uhci_data_class_init()
1315 u->info = *info; in uhci_data_class_init()