Changeset 41abf3c in mainline
- Timestamp:
- 2018-01-18T19:08:51Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7138a78b
- Parents:
- 8fe29a7c
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-18 19:06:36)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-18 19:08:51)
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/debug.c
r8fe29a7c r41abf3c 264 264 void xhci_dump_trb(const xhci_trb_t *trb) 265 265 { 266 usb_log_debug2("TRB(%p): type %s, cycle %u ", trb, xhci_trb_str_type(TRB_TYPE(*trb)), TRB_CYCLE(*trb));266 usb_log_debug2("TRB(%p): type %s, cycle %u, status 0x%#08" PRIx32 ", parameter 0x%#016" PRIx64, trb, xhci_trb_str_type(TRB_TYPE(*trb)), TRB_CYCLE(*trb), trb->status, trb->parameter); 267 267 } 268 268 … … 341 341 } 342 342 343 staticvoid xhci_dump_slot_ctx(const struct xhci_slot_ctx *ctx)343 void xhci_dump_slot_ctx(const struct xhci_slot_ctx *ctx) 344 344 { 345 345 #define SLOT_DUMP(name) usb_log_debug("\t" #name ":\t0x%x", XHCI_SLOT_##name(*ctx)) … … 356 356 SLOT_DUMP(INTERRUPTER); 357 357 SLOT_DUMP(DEVICE_ADDRESS); 358 SLOT_DUMP(S LOT_STATE);358 SLOT_DUMP(STATE); 359 359 #undef SLOT_DUMP 360 360 } 361 361 362 staticvoid xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *ctx)362 void xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *ctx) 363 363 { 364 364 #define EP_DUMP_DW(name) usb_log_debug("\t" #name ":\t0x%x", XHCI_EP_##name(*ctx)) -
uspace/drv/bus/usb/xhci/debug.h
r8fe29a7c r41abf3c 46 46 struct xhci_trb; 47 47 struct xhci_extcap; 48 struct xhci_slot_ctx; 49 struct xhci_endpoint_ctx; 48 50 struct xhci_input_ctx; 49 51 … … 59 61 void xhci_dump_extcap(const struct xhci_extcap *); 60 62 63 void xhci_dump_slot_ctx(const struct xhci_slot_ctx *); 64 void xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *); 61 65 void xhci_dump_input_ctx(const struct xhci_input_ctx *); 62 66 -
uspace/drv/bus/usb/xhci/endpoint.h
r8fe29a7c r41abf3c 63 63 EP_TYPE_BULK_IN = 6, 64 64 EP_TYPE_INTERRUPT_IN = 7 65 };66 67 enum {68 EP_STATE_DISABLED = 0,69 EP_STATE_RUNNING = 1,70 EP_STATE_HALTED = 2,71 EP_STATE_STOPPED = 3,72 EP_STATE_ERROR = 4,73 65 }; 74 66 -
uspace/drv/bus/usb/xhci/hw_struct/context.h
r8fe29a7c r41abf3c 109 109 } __attribute__((packed)) xhci_ep_ctx_t; 110 110 111 enum { 112 EP_STATE_DISABLED = 0, 113 EP_STATE_RUNNING = 1, 114 EP_STATE_HALTED = 2, 115 EP_STATE_STOPPED = 3, 116 EP_STATE_ERROR = 4, 117 }; 118 111 119 /** 112 120 * Slot context: section 6.2.2 … … 148 156 149 157 #define XHCI_SLOT_DEVICE_ADDRESS(ctx) XHCI_DWORD_EXTRACT((ctx).data[3], 7, 0) 150 #define XHCI_SLOT_S LOT_STATE(ctx) XHCI_DWORD_EXTRACT((ctx).data[3], 31, 27)158 #define XHCI_SLOT_STATE(ctx) XHCI_DWORD_EXTRACT((ctx).data[3], 31, 27) 151 159 152 160 } __attribute__((packed)) xhci_slot_ctx_t; 161 162 enum { 163 SLOT_STATE_DISABLED = 0, 164 SLOT_STATE_DEFAULT = 1, 165 SLOT_STATE_ADDRESS = 2, 166 SLOT_STATE_CONFIGURED = 3, 167 }; 153 168 154 169 /** -
uspace/drv/bus/usb/xhci/transfers.c
r8fe29a7c r41abf3c 297 297 const usb_endpoint_t ep_num = ep_dci / 2; 298 298 const usb_endpoint_t dir = ep_dci % 2 ? USB_DIRECTION_IN : USB_DIRECTION_OUT; 299 /* Creating temporary reference */ 299 300 endpoint_t *ep_base = bus_find_endpoint(&dev->base, ep_num, dir); 300 301 if (!ep_base) { … … 325 326 if (ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS) { 326 327 isoch_handle_transfer_event(hc, ep, trb); 328 /* Dropping temporary reference */ 327 329 endpoint_del_ref(&ep->base); 328 330 return EOK; … … 333 335 if (!batch) { 334 336 fibril_mutex_unlock(&ep->base.guard); 337 /* Dropping temporary reference */ 335 338 endpoint_del_ref(&ep->base); 336 339 return ENOENT; … … 395 398 if (xhci_endpoint_get_state(ep) == EP_STATE_HALTED) { 396 399 usb_log_debug("Endpoint halted, resetting endpoint."); 397 xhci_endpoint_clear_halt(ep, batch->target.stream); 398 400 const int err = xhci_endpoint_clear_halt(ep, batch->target.stream); 401 if (err) 402 usb_log_error("Failed to clear halted condition on " 403 "endpoint " XHCI_EP_FMT ". Unexpected results " 404 "coming.", XHCI_EP_ARGS(*ep)); 399 405 } 400 406 … … 406 412 407 413 usb_transfer_batch_finish(batch); 414 /* Dropping temporary reference */ 408 415 endpoint_del_ref(&ep->base); 409 416 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.