Lines Matching refs:slotid

272     unsigned int slotid;  member
304 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
307 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
609 ev_trb.control = (event->slotid << 24) | (event->epid << 16) | in xhci_write_event()
857 unsigned int slotid, in xhci_epmask_to_eps_with_streams() argument
867 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_epmask_to_eps_with_streams()
869 slot = &xhci->slots[slotid - 1]; in xhci_epmask_to_eps_with_streams()
890 static void xhci_free_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_free_device_streams() argument
896 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, NULL, eps); in xhci_free_device_streams()
902 static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid, in xhci_alloc_device_streams() argument
909 nr_eps = xhci_epmask_to_eps_with_streams(xhci, slotid, epmask, epctxs, in xhci_alloc_device_streams()
1028 trace_usb_xhci_ep_state(epctx->slotid, epctx->epid, in xhci_set_ep_state()
1042 unsigned int slotid, in xhci_alloc_epctx() argument
1049 epctx->slotid = slotid; in xhci_alloc_epctx()
1081 static TRBCCode xhci_enable_ep(XHCIState *xhci, unsigned int slotid, in xhci_enable_ep() argument
1088 trace_usb_xhci_ep_enable(slotid, epid); in xhci_enable_ep()
1089 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_ep()
1092 slot = &xhci->slots[slotid-1]; in xhci_enable_ep()
1094 xhci_disable_ep(xhci, slotid, epid); in xhci_enable_ep()
1097 epctx = xhci_alloc_epctx(xhci, slotid, epid); in xhci_enable_ep()
1175 static int xhci_ep_nuke_xfers(XHCIState *xhci, unsigned int slotid, in xhci_ep_nuke_xfers() argument
1183 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_ep_nuke_xfers()
1186 DPRINTF("xhci_ep_nuke_xfers(%d, %d)\n", slotid, epid); in xhci_ep_nuke_xfers()
1188 slot = &xhci->slots[slotid-1]; in xhci_ep_nuke_xfers()
1215 static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid, in xhci_disable_ep() argument
1221 trace_usb_xhci_ep_disable(slotid, epid); in xhci_disable_ep()
1222 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_ep()
1225 slot = &xhci->slots[slotid-1]; in xhci_disable_ep()
1228 DPRINTF("xhci: slot %d ep %d already disabled\n", slotid, epid); in xhci_disable_ep()
1232 xhci_ep_nuke_xfers(xhci, slotid, epid, 0); in xhci_disable_ep()
1252 static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid, in xhci_stop_ep() argument
1258 trace_usb_xhci_ep_stop(slotid, epid); in xhci_stop_ep()
1259 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_stop_ep()
1266 slot = &xhci->slots[slotid-1]; in xhci_stop_ep()
1269 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_stop_ep()
1273 if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) { in xhci_stop_ep()
1289 static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid, in xhci_reset_ep() argument
1295 trace_usb_xhci_ep_reset(slotid, epid); in xhci_reset_ep()
1296 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_ep()
1303 slot = &xhci->slots[slotid-1]; in xhci_reset_ep()
1306 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_reset_ep()
1318 if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) { in xhci_reset_ep()
1323 if (!xhci->slots[slotid-1].uport || in xhci_reset_ep()
1324 !xhci->slots[slotid-1].uport->dev || in xhci_reset_ep()
1325 !xhci->slots[slotid-1].uport->dev->attached) { in xhci_reset_ep()
1338 static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid, in xhci_set_ep_dequeue() argument
1347 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_set_ep_dequeue()
1354 trace_usb_xhci_ep_set_dequeue(slotid, epid, streamid, pdequeue); in xhci_set_ep_dequeue()
1357 slot = &xhci->slots[slotid-1]; in xhci_set_ep_dequeue()
1360 DPRINTF("xhci: slot %d ep %d not enabled\n", slotid, epid); in xhci_set_ep_dequeue()
1489 event.slotid = xfer->epctx->slotid; in xhci_xfer_report()
1563 xfer->epctx->slotid); in xhci_setup_packet()
1643 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_ctl_transfer()
1740 DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", epctx->slotid, epctx->epid); in xhci_submit()
1790 trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid, in xhci_fire_transfer()
1795 static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, in xhci_kick_ep() argument
1800 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_kick_ep()
1803 if (!xhci->slots[slotid-1].enabled) { in xhci_kick_ep()
1804 DPRINTF("xhci: xhci_kick_ep for disabled slot %d\n", slotid); in xhci_kick_ep()
1807 epctx = xhci->slots[slotid-1].eps[epid-1]; in xhci_kick_ep()
1810 epid, slotid); in xhci_kick_ep()
1820 static bool xhci_slot_ok(XHCIState *xhci, int slotid) in xhci_slot_ok() argument
1822 return (xhci->slots[slotid - 1].uport && in xhci_slot_ok()
1823 xhci->slots[slotid - 1].uport->dev && in xhci_slot_ok()
1824 xhci->slots[slotid - 1].uport->dev->attached); in xhci_slot_ok()
1839 trace_usb_xhci_ep_kick(epctx->slotid, epctx->epid, streamid); in xhci_kick_epctx()
1844 if (!xhci_slot_ok(xhci, epctx->slotid)) { in xhci_kick_epctx()
1924 ev.slotid = epctx->slotid; in xhci_kick_epctx()
1927 xhci_event(xhci, &ev, xhci->slots[epctx->slotid-1].intr); in xhci_kick_epctx()
1953 if (!xhci_slot_ok(xhci, epctx->slotid)) { in xhci_kick_epctx()
1986 static TRBCCode xhci_enable_slot(XHCIState *xhci, unsigned int slotid) in xhci_enable_slot() argument
1988 trace_usb_xhci_slot_enable(slotid); in xhci_enable_slot()
1989 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_enable_slot()
1990 xhci->slots[slotid-1].enabled = 1; in xhci_enable_slot()
1991 xhci->slots[slotid-1].uport = NULL; in xhci_enable_slot()
1992 memset(xhci->slots[slotid-1].eps, 0, sizeof(XHCIEPContext*)*31); in xhci_enable_slot()
1997 static TRBCCode xhci_disable_slot(XHCIState *xhci, unsigned int slotid) in xhci_disable_slot() argument
2001 trace_usb_xhci_slot_disable(slotid); in xhci_disable_slot()
2002 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_disable_slot()
2005 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_disable_slot()
2006 xhci_disable_ep(xhci, slotid, i); in xhci_disable_slot()
2010 xhci->slots[slotid-1].enabled = 0; in xhci_disable_slot()
2011 xhci->slots[slotid-1].addressed = 0; in xhci_disable_slot()
2012 xhci->slots[slotid-1].uport = NULL; in xhci_disable_slot()
2013 xhci->slots[slotid-1].intr = 0; in xhci_disable_slot()
2045 static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, in xhci_address_slot() argument
2059 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_address_slot()
2062 poctx = ldq_le_dma(xhci->as, dcbaap + 8 * slotid); in xhci_address_slot()
2091 trace_usb_xhci_slot_address(slotid, uport->path); in xhci_address_slot()
2100 if (i == slotid-1) { in xhci_address_slot()
2110 slot = &xhci->slots[slotid-1]; in xhci_address_slot()
2123 slot_ctx[3] = (SLOT_ADDRESSED << SLOT_STATE_SHIFT) | slotid; in xhci_address_slot()
2131 slotid, 0, 0, NULL); in xhci_address_slot()
2136 res = xhci_enable_ep(xhci, slotid, 1, octx+32, ep0_ctx); in xhci_address_slot()
2146 xhci->slots[slotid-1].addressed = 1; in xhci_address_slot()
2151 static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid, in xhci_configure_slot() argument
2162 trace_usb_xhci_slot_configure(slotid); in xhci_configure_slot()
2163 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_configure_slot()
2166 octx = xhci->slots[slotid-1].ctx; in xhci_configure_slot()
2173 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_configure_slot()
2174 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2204 xhci_free_device_streams(xhci, slotid, ictl_ctx[0] | ictl_ctx[1]); in xhci_configure_slot()
2208 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2215 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2216 res = xhci_enable_ep(xhci, slotid, i, octx+(32*i), ep_ctx); in xhci_configure_slot()
2227 res = xhci_alloc_device_streams(xhci, slotid, ictl_ctx[1]); in xhci_configure_slot()
2231 xhci_disable_ep(xhci, slotid, i); in xhci_configure_slot()
2251 static TRBCCode xhci_evaluate_slot(XHCIState *xhci, unsigned int slotid, in xhci_evaluate_slot() argument
2261 trace_usb_xhci_slot_evaluate(slotid); in xhci_evaluate_slot()
2262 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_evaluate_slot()
2265 octx = xhci->slots[slotid-1].ctx; in xhci_evaluate_slot()
2289 xhci->slots[slotid-1].intr = get_field(islot_ctx[2], TRB_INTR); in xhci_evaluate_slot()
2290 set_field(&slot_ctx[2], xhci->slots[slotid-1].intr, TRB_INTR); in xhci_evaluate_slot()
2319 static TRBCCode xhci_reset_slot(XHCIState *xhci, unsigned int slotid) in xhci_reset_slot() argument
2325 trace_usb_xhci_slot_reset(slotid); in xhci_reset_slot()
2326 assert(slotid >= 1 && slotid <= xhci->numslots); in xhci_reset_slot()
2328 octx = xhci->slots[slotid-1].ctx; in xhci_reset_slot()
2333 if (xhci->slots[slotid-1].eps[i-1]) { in xhci_reset_slot()
2334 xhci_disable_ep(xhci, slotid, i); in xhci_reset_slot()
2350 unsigned int slotid; in xhci_get_slot() local
2351 slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK; in xhci_get_slot()
2352 if (slotid < 1 || slotid > xhci->numslots) { in xhci_get_slot()
2353 DPRINTF("xhci: bad slot id %d\n", slotid); in xhci_get_slot()
2356 } else if (!xhci->slots[slotid-1].enabled) { in xhci_get_slot()
2357 DPRINTF("xhci: slot id %d not enabled\n", slotid); in xhci_get_slot()
2361 return slotid; in xhci_get_slot()
2427 unsigned int i, slotid = 0, count = 0; in xhci_process_commands() local
2450 slotid = i+1; in xhci_process_commands()
2451 event.ccode = xhci_enable_slot(xhci, slotid); in xhci_process_commands()
2455 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2456 if (slotid) { in xhci_process_commands()
2457 event.ccode = xhci_disable_slot(xhci, slotid); in xhci_process_commands()
2461 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2462 if (slotid) { in xhci_process_commands()
2463 event.ccode = xhci_address_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2468 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2469 if (slotid) { in xhci_process_commands()
2470 event.ccode = xhci_configure_slot(xhci, slotid, trb.parameter, in xhci_process_commands()
2475 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2476 if (slotid) { in xhci_process_commands()
2477 event.ccode = xhci_evaluate_slot(xhci, slotid, trb.parameter); in xhci_process_commands()
2481 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2482 if (slotid) { in xhci_process_commands()
2485 event.ccode = xhci_stop_ep(xhci, slotid, epid); in xhci_process_commands()
2489 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2490 if (slotid) { in xhci_process_commands()
2493 event.ccode = xhci_reset_ep(xhci, slotid, epid); in xhci_process_commands()
2497 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2498 if (slotid) { in xhci_process_commands()
2502 event.ccode = xhci_set_ep_dequeue(xhci, slotid, in xhci_process_commands()
2508 slotid = xhci_get_slot(xhci, &event, &trb); in xhci_process_commands()
2509 if (slotid) { in xhci_process_commands()
2510 event.ccode = xhci_reset_slot(xhci, slotid); in xhci_process_commands()
2534 slotid = val >> 24; in xhci_process_commands()
2545 event.slotid = slotid; in xhci_process_commands()
3252 uport = epctx->xhci->slots[epctx->slotid - 1].uport; in xhci_epid_to_usbep()
3264 int slotid; in xhci_wakeup_endpoint() local
3267 slotid = ep->dev->addr; in xhci_wakeup_endpoint()
3268 if (slotid == 0 || !xhci->slots[slotid-1].enabled) { in xhci_wakeup_endpoint()
3272 xhci_kick_ep(xhci, slotid, xhci_find_epid(ep), stream); in xhci_wakeup_endpoint()
3427 int slotid, epid, state; in usb_xhci_post_load() local
3431 for (slotid = 1; slotid <= xhci->numslots; slotid++) { in usb_xhci_post_load()
3432 slot = &xhci->slots[slotid-1]; in usb_xhci_post_load()
3437 xhci_mask64(ldq_le_dma(xhci->as, dcbaap + 8 * slotid)); in usb_xhci_post_load()
3455 epctx = xhci_alloc_epctx(xhci, slotid, epid); in usb_xhci_post_load()
3506 VMSTATE_UINT8(slotid, XHCIEvent),