Changeset 2770b66 in mainline for uspace/drv/bus/usb/xhci/rh.c
- Timestamp:
- 2017-10-15T15:05:06Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 816f5f4
- Parents:
- 20eaa82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
r20eaa82 r2770b66 36 36 #include <errno.h> 37 37 #include <str_error.h> 38 #include <usb/request.h> 38 39 #include <usb/debug.h> 39 40 #include <usb/host/utils/malloc32.h> 40 41 #include <usb/host/bus.h> 41 42 #include <usb/host/ddf_helpers.h> 43 #include <usb/host/hcd.h> 42 44 43 45 #include "debug.h" … … 74 76 // TODO: This currently assumes the device is attached to rh directly. 75 77 // Also, we should consider moving a lot of functionailty to xhci bus 76 int xhci_rh_address_device(xhci_rh_t *rh, device_t *dev )78 int xhci_rh_address_device(xhci_rh_t *rh, device_t *dev, xhci_bus_t *bus) 77 79 { 78 80 int err; … … 160 162 usb_log_debug2("Obtained USB address: %d.\n", dev->address); 161 163 162 // TODO: Ask libusbhost to create a control endpoint for EP0. 163 164 // TODO: Save all data structures in the corresponding xhci_device_t. 165 166 return EOK; 167 164 // Ask libusbhost to create a control endpoint for EP0. 165 bus_t *bus_base = &bus->base; 166 usb_target_t ep0_target = { .address = dev->address, .endpoint = 0 }; 167 usb_direction_t ep0_direction = USB_DIRECTION_BOTH; 168 169 // TODO: Should this call be unified with other calls to `bus_add_ep()`? 170 err = bus_add_ep(bus_base, dev, ep0_target.endpoint, ep0_direction, 171 USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 1); 172 173 if (err != EOK) 174 goto err_add_ep; 175 176 // Save all data structures in the corresponding xhci_device_t. 177 endpoint_t *ep0_base = bus_find_endpoint(bus_base, ep0_target, ep0_direction); 178 xhci_endpoint_t *ep0 = xhci_endpoint_get(ep0_base); 179 xhci_device_t *xhci_dev = ep0->device; 180 181 xhci_dev->device = dev; 182 xhci_dev->slot_id = slot_id; 183 184 // TODO: Save anything else? 185 186 return EOK; 187 188 err_add_ep: 168 189 err_dctx: 169 190 if (dctx) {
Note:
See TracChangeset
for help on using the changeset viewer.