Changeset d32d51d in mainline
- Timestamp:
- 2017-08-20T12:01:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 07c08ea
- Parents:
- 5ff9e1d
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/Makefile
r5ff9e1d rd32d51d 31 31 LIBS = \ 32 32 $(LIBUSBHOST_PREFIX)/libusbhost.a \ 33 $(LIBUSBVIRT_PREFIX)/libusbvirt.a \ 33 34 $(LIBUSB_PREFIX)/libusb.a \ 34 35 $(LIBDRV_PREFIX)/libdrv.a … … 36 37 EXTRA_CFLAGS += \ 37 38 -I$(LIBUSB_PREFIX)/include \ 39 -I$(LIBUSBDEV_PREFIX)/include \ 38 40 -I$(LIBUSBHOST_PREFIX)/include \ 41 -I$(LIBUSBVIRT_PREFIX)/include \ 39 42 -I$(LIBDRV_PREFIX)/include 40 43 -
uspace/drv/bus/usb/xhci/endpoint.c
r5ff9e1d rd32d51d 55 55 56 56 usb_log_debug("Endpoint %d:%d initialized.", ep->address, ep->endpoint); 57 57 58 return EOK; 58 59 } -
uspace/drv/bus/usb/xhci/hc.c
r5ff9e1d rd32d51d 220 220 goto err_event_ring; 221 221 222 return EOK; 223 222 if ((err = xhci_rh_init(&hc->rh))) 223 goto err_rh; 224 225 return EOK; 226 227 err_rh: 228 xhci_rh_fini(&hc->rh); 224 229 err_event_ring: 225 230 xhci_event_ring_fini(&hc->event_ring); … … 362 367 assert(batch); 363 368 369 /* Check for root hub communication */ 370 /* FIXME: Zero is a very crude workaround. Detect RH better. */ 371 if (batch->ep->address == 0) { 372 usb_log_debug("XHCI root hub request.\n"); 373 return xhci_rh_schedule(&hc->rh, batch); 374 } 375 364 376 usb_log_debug2("EP(%d:%d) started %s transfer of size %lu.", 365 377 batch->ep->address, batch->ep->endpoint, … … 386 398 } 387 399 388 return E NAK;400 return EOK; 389 401 } 390 402 … … 515 527 hc_dcbaa_fini(hc); 516 528 xhci_fini_commands(hc); 529 xhci_rh_fini(&hc->rh); 517 530 pio_disable(hc->base, RNGSZ(hc->mmio_range)); 518 531 usb_log_info("HC(%p): Finalized.", hc); -
uspace/drv/bus/usb/xhci/hc.h
r5ff9e1d rd32d51d 42 42 #include "scratchpad.h" 43 43 #include "trb_ring.h" 44 #include "rh.h" 44 45 45 46 typedef struct xhci_virt_device_ctx { … … 75 76 xhci_scratchpad_t *scratchpad; 76 77 78 /* Root hub emulation */ 79 xhci_rh_t rh; 80 77 81 /* Cached capabilities */ 78 82 xhci_port_speed_t speeds [16]; -
uspace/drv/bus/usb/xhci/rh.c
r5ff9e1d rd32d51d 44 44 #include "rh.h" 45 45 46 int xhci_rh_init(xhci_rh_t *rh) 47 { 48 /* TODO: Implement me! */ 49 return EOK; 50 } 51 46 52 // TODO: Check device deallocation, we free device_ctx in hc.c, not 47 53 // sure about the other structs. … … 221 227 } 222 228 229 int xhci_rh_schedule(xhci_rh_t *rh, usb_transfer_batch_t *batch) 230 { 231 /* TODO: Implement me! */ 232 return EOK; 233 } 234 235 int xhci_rh_fini(xhci_rh_t *rh) 236 { 237 /* TODO: Implement me! */ 238 return EOK; 239 } 240 223 241 224 242 /** -
uspace/drv/bus/usb/xhci/rh.h
r5ff9e1d rd32d51d 37 37 #define XHCI_RH_H 38 38 39 #include <usb/host/usb_transfer_batch.h> 40 #include <usbvirt/virthub_base.h> 41 42 /* XHCI root hub instance */ 43 typedef struct { 44 /** Virtual hub instance */ 45 virthub_base_t base; 46 } xhci_rh_t; 47 48 int xhci_rh_init(xhci_rh_t *); 49 int xhci_rh_fini(xhci_rh_t *); 39 50 int xhci_handle_port_status_change_event(xhci_hc_t *, xhci_trb_t *); 40 51 int xhci_get_hub_port(xhci_trb_t *); 41 52 int xhci_reset_hub_port(xhci_hc_t *, uint8_t); 53 int xhci_rh_schedule(xhci_rh_t *, usb_transfer_batch_t *); 42 54 43 55 #endif
Note:
See TracChangeset
for help on using the changeset viewer.