Lines Matching refs:slotid

273     unsigned int slotid;  member
305 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
308 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
615 ev_trb.control = (event->slotid << 24) | (event->epid << 16) | in xhci_write_event()
900 unsigned int slotid, in xhci_epmask_to_eps_with_streams() argument
910 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_epmask_to_eps_with_streams()
912 slot = &xhci->slots[slotid - 1]; in xhci_epmask_to_eps_with_streams()
933 static void xhci_free_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_free_device_streams() argument
939 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, NULL, eps); in xhci_free_device_streams()
945 static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_alloc_device_streams() argument
952 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, epctxs, in xhci_alloc_device_streams()
1073 trace_usb_xhci_ep_state(epctx->slotid, epctx->epid, in xhci_set_ep_state()
1087 unsigned int slotid, in xhci_alloc_epctx() argument
1094 epctx->slotid = slotid; in xhci_alloc_epctx()
1126 static TRBCCode xhci_enable_ep(XHCIState *xhci, unsigned int slotid, in xhci_enable_ep() argument
1133 trace_usb_xhci_ep_enable(slotid, epid); in xhci_enable_ep()
1134 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_ep()
1137 slot = &xhci->slots[slotid-1]; in xhci_enable_ep()
1139 xhci_disable_ep(xhci, slotid, epid); in xhci_enable_ep()
1142 epctx = xhci_alloc_epctx(xhci, slotid, epid); in xhci_enable_ep()
1227 static int xhci_ep_nuke_xfers(XHCIState *xhci, unsigned int slotid, in xhci_ep_nuke_xfers() argument
1235 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_ep_nuke_xfers()
1238 DPRINTF("xhci_ep_nuke_xfers(%d, %d)\n", slotid, epid); in xhci_ep_nuke_xfers()
1240 slot = &xhci->slots[slotid-1]; in xhci_ep_nuke_xfers()
1267 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid, in xhci_disable_ep() argument
1273 trace_usb_xhci_ep_disable(slotid, epid); in xhci_disable_ep()
1274 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_ep()
1277 slot = &xhci->slots[slotid-1]; in xhci_disable_ep()
1280 DPRINTF("xhci: slot %d ep %d already disabled\n", slotid, epid); in xhci_disable_ep()
1284 xhci_ep_nuke_xfers(xhci, slotid, epid, 0); in xhci_disable_ep()
1304 static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid, in xhci_stop_ep() argument
1310 trace_usb_xhci_ep_stop(slotid, epid); in xhci_stop_ep()
1311 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_stop_ep()
1318 slot = &xhci->slots[slotid-1]; in xhci_stop_ep()
1321 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_stop_ep()
1325 if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) { in xhci_stop_ep()
1341 static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid, in xhci_reset_ep() argument
1347 trace_usb_xhci_ep_reset(slotid, epid); in xhci_reset_ep()
1348 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_ep()
1355 slot = &xhci->slots[slotid-1]; in xhci_reset_ep()
1358 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_reset_ep()
1370 if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) { in xhci_reset_ep()
1375 if (!xhci->slots[slotid-1].uport || in xhci_reset_ep()
1376 !xhci->slots[slotid-1].uport->dev || in xhci_reset_ep()
1377 !xhci->slots[slotid-1].uport->dev->attached) { in xhci_reset_ep()
1390 static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid, in xhci_set_ep_dequeue() argument
1399 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_set_ep_dequeue()
1406 trace_usb_xhci_ep_set_dequeue(slotid, epid, streamid, pdequeue); in xhci_set_ep_dequeue()
1409 slot = &xhci->slots[slotid-1]; in xhci_set_ep_dequeue()
1412 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_set_ep_dequeue()
1535 event.slotid = xfer->epctx->slotid; in xhci_xfer_report()
1609 xfer->epctx->slotid); in xhci_setup_packet()
1689 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_ctl_transfer()
1786 DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", epctx->slotid, epctx->epid); in xhci_submit()
1836 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_transfer()
1841 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, in xhci_kick_ep() argument
1846 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_kick_ep()
1849 if (!xhci->slots[slotid-1].enabled) { in xhci_kick_ep()
1850 DPRINTF("xhci: xhci_kick_ep for disabled slot %d\n", slotid); in xhci_kick_ep()
1853 epctx = xhci->slots[slotid-1].eps[epid-1]; in xhci_kick_ep()
1856 epid, slotid); in xhci_kick_ep()
1866 static bool xhci_slot_ok(XHCIState *xhci, int slotid) in xhci_slot_ok() argument
1868 return (xhci->slots[slotid - 1].uport && in xhci_slot_ok()
1869 xhci->slots[slotid - 1].uport->dev && in xhci_slot_ok()
1870 xhci->slots[slotid - 1].uport->dev->attached); in xhci_slot_ok()
1885 trace_usb_xhci_ep_kick(epctx->slotid, epctx->epid, streamid); in xhci_kick_epctx()
1890 if (!xhci_slot_ok(xhci, epctx->slotid)) { in xhci_kick_epctx()
1970 ev.slotid = epctx->slotid; in xhci_kick_epctx()
1973 xhci_event(xhci, &ev, xhci->slots[epctx->slotid-1].intr); in xhci_kick_epctx()
1999 if (!xhci_slot_ok(xhci, epctx->slotid)) { in xhci_kick_epctx()
2032 static TRBCCode xhci_enable_slot(XHCIState *xhci, unsigned int slotid) in xhci_enable_slot() argument
2034 trace_usb_xhci_slot_enable(slotid); in xhci_enable_slot()
2035 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_slot()
2036 xhci->slots[slotid-1].enabled = 1; in xhci_enable_slot()
2037 xhci->slots[slotid-1].uport = NULL; in xhci_enable_slot()
2038 memset(xhci->slots[slotid-1].eps, 0, sizeof(XHCIEPContext*)*31); in xhci_enable_slot()
2043 static TRBCCode xhci_disable_slot(XHCIState *xhci, unsigned int slotid) in xhci_disable_slot() argument
2047 trace_usb_xhci_slot_disable(slotid); in xhci_disable_slot()
2048 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_slot()
2051 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_disable_slot()
2052 xhci_disable_ep(xhci, slotid, i); in xhci_disable_slot()
2056 xhci->slots[slotid-1].enabled = 0; in xhci_disable_slot()
2057 xhci->slots[slotid-1].addressed = 0; in xhci_disable_slot()
2058 xhci->slots[slotid-1].uport = NULL; in xhci_disable_slot()
2059 xhci->slots[slotid-1].intr = 0; in xhci_disable_slot()
2091 static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, in xhci_address_slot() argument
2105 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_address_slot()
2108 ldq_le_dma(xhci->as, dcbaap + 8 * slotid, &poctx, MEMTXATTRS_UNSPECIFIED); in xhci_address_slot()
2137 trace_usb_xhci_slot_address(slotid, uport->path); in xhci_address_slot()
2146 if (i == slotid-1) { in xhci_address_slot()
2156 slot = &xhci->slots[slotid-1]; in xhci_address_slot()
2169 slot_ctx[3] = (SLOT_ADDRESSED << SLOT_STATE_SHIFT) | slotid; in xhci_address_slot()
2177 slotid, 0, 0, NULL); in xhci_address_slot()
2182 res = xhci_enable_ep(xhci, slotid, 1, octx+32, ep0_ctx); in xhci_address_slot()
2192 xhci->slots[slotid-1].addressed = 1; in xhci_address_slot()
2197 static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid, in xhci_configure_slot() argument
2208 trace_usb_xhci_slot_configure(slotid); in xhci_configure_slot()
2209 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_configure_slot()
2212 octx = xhci->slots[slotid-1].ctx; in xhci_configure_slot()
2219 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_configure_slot()
2220 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2250 xhci_free_device_streams(xhci, slotid, ictl_ctx[0] | ictl_ctx[1]); in xhci_configure_slot()
2254 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2261 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2262 res = xhci_enable_ep(xhci, slotid, i, octx+(32*i), ep_ctx); in xhci_configure_slot()
2273 res = xhci_alloc_device_streams(xhci, slotid, ictl_ctx[1]); in xhci_configure_slot()
2277 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2297 static TRBCCode xhci_evaluate_slot(XHCIState *xhci, unsigned int slotid, in xhci_evaluate_slot() argument
2307 trace_usb_xhci_slot_evaluate(slotid); in xhci_evaluate_slot()
2308 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_evaluate_slot()
2311 octx = xhci->slots[slotid-1].ctx; in xhci_evaluate_slot()
2335 xhci->slots[slotid-1].intr = get_field(islot_ctx[2], TRB_INTR); in xhci_evaluate_slot()
2336 set_field(&slot_ctx[2], xhci->slots[slotid-1].intr, TRB_INTR); in xhci_evaluate_slot()
2365 static TRBCCode xhci_reset_slot(XHCIState *xhci, unsigned int slotid) in xhci_reset_slot() argument
2371 trace_usb_xhci_slot_reset(slotid); in xhci_reset_slot()
2372 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_slot()
2374 octx = xhci->slots[slotid-1].ctx; in xhci_reset_slot()
2379 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_reset_slot()
2380 xhci_disable_ep(xhci, slotid, i); in xhci_reset_slot()
2396 unsigned int slotid; in xhci_get_slot() local
2397 slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK; in xhci_get_slot()
2398 if (slotid < 1 || slotid > xhci->numslots) { in xhci_get_slot()
2399 DPRINTF("xhci: bad slot id %d\n", slotid); in xhci_get_slot()
2402 } else if (!xhci->slots[slotid-1].enabled) { in xhci_get_slot()
2403 DPRINTF("xhci: slot id %d not enabled\n", slotid); in xhci_get_slot()
2407 return slotid; in xhci_get_slot()
2476 unsigned int i, slotid = 0, count = 0; in xhci_process_commands() local
2499 slotid = i+1; in xhci_process_commands()
2500 event.ccode = xhci_enable_slot(xhci, slotid); in xhci_process_commands()
2504 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2505 if (slotid) { in xhci_process_commands()
2506 event.ccode = xhci_disable_slot(xhci, slotid); in xhci_process_commands()
2510 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2511 if (slotid) { in xhci_process_commands()
2512 event.ccode = xhci_address_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2517 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2518 if (slotid) { in xhci_process_commands()
2519 event.ccode = xhci_configure_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2524 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2525 if (slotid) { in xhci_process_commands()
2526 event.ccode = xhci_evaluate_slot(xhci, slotid, trb.parameter); in xhci_process_commands()
2530 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2531 if (slotid) { in xhci_process_commands()
2534 event.ccode = xhci_stop_ep(xhci, slotid, epid); in xhci_process_commands()
2538 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2539 if (slotid) { in xhci_process_commands()
2542 event.ccode = xhci_reset_ep(xhci, slotid, epid); in xhci_process_commands()
2546 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2547 if (slotid) { in xhci_process_commands()
2551 event.ccode = xhci_set_ep_dequeue(xhci, slotid, in xhci_process_commands()
2557 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2558 if (slotid) { in xhci_process_commands()
2559 event.ccode = xhci_reset_slot(xhci, slotid); in xhci_process_commands()
2583 slotid = val >> 24; in xhci_process_commands()
2594 event.slotid = slotid; in xhci_process_commands()
3312 uport = epctx->xhci->slots[epctx->slotid - 1].uport; in xhci_epid_to_usbep()
3324 int slotid; in xhci_wakeup_endpoint() local
3327 slotid = ep->dev->addr; in xhci_wakeup_endpoint()
3328 if (slotid == 0 || slotid > xhci->numslots || in xhci_wakeup_endpoint()
3329 !xhci->slots[slotid - 1].enabled) { in xhci_wakeup_endpoint()
3333 xhci_kick_ep(xhci, slotid, xhci_find_epid(ep), stream); in xhci_wakeup_endpoint()
3478 int slotid, epid, state; in usb_xhci_post_load() local
3483 for (slotid = 1; slotid <= xhci->numslots; slotid++) { in usb_xhci_post_load()
3484 slot = &xhci->slots[slotid-1]; in usb_xhci_post_load()
3488 ldq_le_dma(xhci->as, dcbaap + 8 * slotid, &addr, MEMTXATTRS_UNSPECIFIED); in usb_xhci_post_load()
3508 epctx = xhci_alloc_epctx(xhci, slotid, epid); in usb_xhci_post_load()
3559 VMSTATE_UINT8(slotid, XHCIEvent),