Lines Matching refs:slotid

280     unsigned int slotid;  member
312 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
315 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
654 ev_trb.control = (event->slotid << 24) | (event->epid << 16) | in xhci_write_event()
904 unsigned int slotid, in xhci_epmask_to_eps_with_streams() argument
914 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_epmask_to_eps_with_streams()
916 slot = &xhci->slots[slotid - 1]; in xhci_epmask_to_eps_with_streams()
937 static void xhci_free_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_free_device_streams() argument
943 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, NULL, eps); in xhci_free_device_streams()
949 static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_alloc_device_streams() argument
956 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, epctxs, in xhci_alloc_device_streams()
1075 trace_usb_xhci_ep_state(epctx->slotid, epctx->epid, in xhci_set_ep_state()
1089 unsigned int slotid, in xhci_alloc_epctx() argument
1096 epctx->slotid = slotid; in xhci_alloc_epctx()
1128 static TRBCCode xhci_enable_ep(XHCIState *xhci, unsigned int slotid, in xhci_enable_ep() argument
1135 trace_usb_xhci_ep_enable(slotid, epid); in xhci_enable_ep()
1136 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_ep()
1139 slot = &xhci->slots[slotid-1]; in xhci_enable_ep()
1141 xhci_disable_ep(xhci, slotid, epid); in xhci_enable_ep()
1144 epctx = xhci_alloc_epctx(xhci, slotid, epid); in xhci_enable_ep()
1222 static int xhci_ep_nuke_xfers(XHCIState *xhci, unsigned int slotid, in xhci_ep_nuke_xfers() argument
1230 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_ep_nuke_xfers()
1233 DPRINTF("xhci_ep_nuke_xfers(%d, %d)\n", slotid, epid); in xhci_ep_nuke_xfers()
1235 slot = &xhci->slots[slotid-1]; in xhci_ep_nuke_xfers()
1262 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid, in xhci_disable_ep() argument
1268 trace_usb_xhci_ep_disable(slotid, epid); in xhci_disable_ep()
1269 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_ep()
1272 slot = &xhci->slots[slotid-1]; in xhci_disable_ep()
1275 DPRINTF("xhci: slot %d ep %d already disabled\n", slotid, epid); in xhci_disable_ep()
1279 xhci_ep_nuke_xfers(xhci, slotid, epid, 0); in xhci_disable_ep()
1299 static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid, in xhci_stop_ep() argument
1305 trace_usb_xhci_ep_stop(slotid, epid); in xhci_stop_ep()
1306 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_stop_ep()
1313 slot = &xhci->slots[slotid-1]; in xhci_stop_ep()
1316 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_stop_ep()
1320 if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) { in xhci_stop_ep()
1336 static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid, in xhci_reset_ep() argument
1342 trace_usb_xhci_ep_reset(slotid, epid); in xhci_reset_ep()
1343 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_ep()
1350 slot = &xhci->slots[slotid-1]; in xhci_reset_ep()
1353 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_reset_ep()
1365 if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) { in xhci_reset_ep()
1370 if (!xhci->slots[slotid-1].uport || in xhci_reset_ep()
1371 !xhci->slots[slotid-1].uport->dev || in xhci_reset_ep()
1372 !xhci->slots[slotid-1].uport->dev->attached) { in xhci_reset_ep()
1385 static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid, in xhci_set_ep_dequeue() argument
1394 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_set_ep_dequeue()
1401 trace_usb_xhci_ep_set_dequeue(slotid, epid, streamid, pdequeue); in xhci_set_ep_dequeue()
1404 slot = &xhci->slots[slotid-1]; in xhci_set_ep_dequeue()
1407 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_set_ep_dequeue()
1536 event.slotid = xfer->epctx->slotid; in xhci_xfer_report()
1610 xfer->epctx->slotid); in xhci_setup_packet()
1687 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_ctl_transfer()
1784 DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", epctx->slotid, epctx->epid); in xhci_submit()
1834 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_transfer()
1839 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, in xhci_kick_ep() argument
1844 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_kick_ep()
1847 if (!xhci->slots[slotid-1].enabled) { in xhci_kick_ep()
1848 DPRINTF("xhci: xhci_kick_ep for disabled slot %d\n", slotid); in xhci_kick_ep()
1851 epctx = xhci->slots[slotid-1].eps[epid-1]; in xhci_kick_ep()
1854 epid, slotid); in xhci_kick_ep()
1876 trace_usb_xhci_ep_kick(epctx->slotid, epctx->epid, streamid); in xhci_kick_epctx()
1881 if (!xhci->slots[epctx->slotid - 1].uport || in xhci_kick_epctx()
1882 !xhci->slots[epctx->slotid - 1].uport->dev || in xhci_kick_epctx()
1883 !xhci->slots[epctx->slotid - 1].uport->dev->attached) { in xhci_kick_epctx()
1961 ev.slotid = epctx->slotid; in xhci_kick_epctx()
1964 xhci_event(xhci, &ev, xhci->slots[epctx->slotid-1].intr); in xhci_kick_epctx()
2018 static TRBCCode xhci_enable_slot(XHCIState *xhci, unsigned int slotid) in xhci_enable_slot() argument
2020 trace_usb_xhci_slot_enable(slotid); in xhci_enable_slot()
2021 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_slot()
2022 xhci->slots[slotid-1].enabled = 1; in xhci_enable_slot()
2023 xhci->slots[slotid-1].uport = NULL; in xhci_enable_slot()
2024 memset(xhci->slots[slotid-1].eps, 0, sizeof(XHCIEPContext*)*31); in xhci_enable_slot()
2029 static TRBCCode xhci_disable_slot(XHCIState *xhci, unsigned int slotid) in xhci_disable_slot() argument
2033 trace_usb_xhci_slot_disable(slotid); in xhci_disable_slot()
2034 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_slot()
2037 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_disable_slot()
2038 xhci_disable_ep(xhci, slotid, i); in xhci_disable_slot()
2042 xhci->slots[slotid-1].enabled = 0; in xhci_disable_slot()
2043 xhci->slots[slotid-1].addressed = 0; in xhci_disable_slot()
2044 xhci->slots[slotid-1].uport = NULL; in xhci_disable_slot()
2045 xhci->slots[slotid-1].intr = 0; in xhci_disable_slot()
2077 static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, in xhci_address_slot() argument
2091 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_address_slot()
2094 poctx = ldq_le_pci_dma(PCI_DEVICE(xhci), dcbaap + 8 * slotid); in xhci_address_slot()
2123 trace_usb_xhci_slot_address(slotid, uport->path); in xhci_address_slot()
2132 if (i == slotid-1) { in xhci_address_slot()
2142 slot = &xhci->slots[slotid-1]; in xhci_address_slot()
2155 slot_ctx[3] = (SLOT_ADDRESSED << SLOT_STATE_SHIFT) | slotid; in xhci_address_slot()
2163 slotid, 0, 0, NULL); in xhci_address_slot()
2168 res = xhci_enable_ep(xhci, slotid, 1, octx+32, ep0_ctx); in xhci_address_slot()
2178 xhci->slots[slotid-1].addressed = 1; in xhci_address_slot()
2183 static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid, in xhci_configure_slot() argument
2194 trace_usb_xhci_slot_configure(slotid); in xhci_configure_slot()
2195 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_configure_slot()
2198 octx = xhci->slots[slotid-1].ctx; in xhci_configure_slot()
2205 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_configure_slot()
2206 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2236 xhci_free_device_streams(xhci, slotid, ictl_ctx[0] | ictl_ctx[1]); in xhci_configure_slot()
2240 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2247 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2248 res = xhci_enable_ep(xhci, slotid, i, octx+(32*i), ep_ctx); in xhci_configure_slot()
2259 res = xhci_alloc_device_streams(xhci, slotid, ictl_ctx[1]); in xhci_configure_slot()
2263 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2283 static TRBCCode xhci_evaluate_slot(XHCIState *xhci, unsigned int slotid, in xhci_evaluate_slot() argument
2293 trace_usb_xhci_slot_evaluate(slotid); in xhci_evaluate_slot()
2294 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_evaluate_slot()
2297 octx = xhci->slots[slotid-1].ctx; in xhci_evaluate_slot()
2321 xhci->slots[slotid-1].intr = get_field(islot_ctx[2], TRB_INTR); in xhci_evaluate_slot()
2322 set_field(&slot_ctx[2], xhci->slots[slotid-1].intr, TRB_INTR); in xhci_evaluate_slot()
2351 static TRBCCode xhci_reset_slot(XHCIState *xhci, unsigned int slotid) in xhci_reset_slot() argument
2357 trace_usb_xhci_slot_reset(slotid); in xhci_reset_slot()
2358 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_slot()
2360 octx = xhci->slots[slotid-1].ctx; in xhci_reset_slot()
2365 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_reset_slot()
2366 xhci_disable_ep(xhci, slotid, i); in xhci_reset_slot()
2382 unsigned int slotid; in xhci_get_slot() local
2383 slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK; in xhci_get_slot()
2384 if (slotid < 1 || slotid > xhci->numslots) { in xhci_get_slot()
2385 DPRINTF("xhci: bad slot id %d\n", slotid); in xhci_get_slot()
2388 } else if (!xhci->slots[slotid-1].enabled) { in xhci_get_slot()
2389 DPRINTF("xhci: slot id %d not enabled\n", slotid); in xhci_get_slot()
2393 return slotid; in xhci_get_slot()
2459 unsigned int i, slotid = 0, count = 0; in xhci_process_commands() local
2482 slotid = i+1; in xhci_process_commands()
2483 event.ccode = xhci_enable_slot(xhci, slotid); in xhci_process_commands()
2487 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2488 if (slotid) { in xhci_process_commands()
2489 event.ccode = xhci_disable_slot(xhci, slotid); in xhci_process_commands()
2493 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2494 if (slotid) { in xhci_process_commands()
2495 event.ccode = xhci_address_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2500 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2501 if (slotid) { in xhci_process_commands()
2502 event.ccode = xhci_configure_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2507 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2508 if (slotid) { in xhci_process_commands()
2509 event.ccode = xhci_evaluate_slot(xhci, slotid, trb.parameter); in xhci_process_commands()
2513 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2514 if (slotid) { in xhci_process_commands()
2517 event.ccode = xhci_stop_ep(xhci, slotid, epid); in xhci_process_commands()
2521 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2522 if (slotid) { in xhci_process_commands()
2525 event.ccode = xhci_reset_ep(xhci, slotid, epid); in xhci_process_commands()
2529 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2530 if (slotid) { in xhci_process_commands()
2534 event.ccode = xhci_set_ep_dequeue(xhci, slotid, in xhci_process_commands()
2540 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2541 if (slotid) { in xhci_process_commands()
2542 event.ccode = xhci_reset_slot(xhci, slotid); in xhci_process_commands()
2566 slotid = val >> 24; in xhci_process_commands()
2577 event.slotid = slotid; in xhci_process_commands()
3286 uport = epctx->xhci->slots[epctx->slotid - 1].uport; in xhci_epid_to_usbep()
3298 int slotid; in xhci_wakeup_endpoint() local
3301 slotid = ep->dev->addr; in xhci_wakeup_endpoint()
3302 if (slotid == 0 || !xhci->slots[slotid-1].enabled) { in xhci_wakeup_endpoint()
3306 xhci_kick_ep(xhci, slotid, xhci_find_epid(ep), stream); in xhci_wakeup_endpoint()
3514 int slotid, epid, state, intr; in usb_xhci_post_load() local
3518 for (slotid = 1; slotid <= xhci->numslots; slotid++) { in usb_xhci_post_load()
3519 slot = &xhci->slots[slotid-1]; in usb_xhci_post_load()
3524 xhci_mask64(ldq_le_pci_dma(pci_dev, dcbaap + 8 * slotid)); in usb_xhci_post_load()
3542 epctx = xhci_alloc_epctx(xhci, slotid, epid); in usb_xhci_post_load()
3602 VMSTATE_UINT8(slotid, XHCIEvent),