Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/device.c
- Timestamp:
- 2018-01-23T12:41:22Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7e1fd3
- Parents:
- e546142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/device.c
re546142 r8033f89 56 56 #include "device.h" 57 57 58 /** Initial descriptor used for control endpoint 0 before more configuration is retrieved. */ 58 /** 59 * Initial descriptor used for control endpoint 0, 60 * before more configuration is retrieved. 61 */ 59 62 static const usb_endpoint_descriptors_t ep0_initial_desc = { 60 63 .endpoint.max_packet_size = CTRL_PIPE_MIN_PACKET_SIZE, … … 87 90 dev->base.endpoints[0] = ep0_base; 88 91 89 usb_log_debug("Looking up new device initial MPS: %s", usb_str_speed(dev->base.speed)); 92 usb_log_debug("Looking up new device initial MPS: %s", 93 usb_str_speed(dev->base.speed)); 90 94 ep0_base->max_packet_size = hc_get_ep0_initial_mps(dev->base.speed); 91 95 … … 117 121 118 122 uint16_t max_packet_size; 119 if ((err = hc_get_ep0_max_packet_size(&max_packet_size, (bus_t *) &hc->bus, &dev->base))) 123 if ((err = hc_get_ep0_max_packet_size(&max_packet_size, 124 (bus_t *) &hc->bus, &dev->base))) 120 125 return err; 121 126 … … 160 165 } 161 166 162 usb_log_debug("Device(%u): recognised USB hub with %u ports", dev->base.address, dev->num_ports); 167 usb_log_debug("Device(%u): recognised USB hub with %u ports", 168 dev->base.address, dev->num_ports); 163 169 return EOK; 164 170 } … … 197 203 198 204 if (err) { 199 usb_log_error("Failed to setup address of the new device: %s", str_error(err)); 205 usb_log_error("Failed to setup address of the new device: %s", 206 str_error(err)); 200 207 return err; 201 208 } … … 208 215 209 216 if ((err = setup_ep0_packet_size(bus->hc, xhci_dev))) { 210 usb_log_error("Failed to setup control endpoint of the new device: %s", str_error(err)); 217 usb_log_error("Failed to setup control endpoint " 218 "of the new device: %s", str_error(err)); 211 219 goto err_address; 212 220 } … … 215 223 216 224 if ((err = hc_get_device_desc(dev, &desc))) { 217 usb_log_error("Device(%d): failed to get devices descriptor: %s", dev->address, str_error(err)); 225 usb_log_error("Device(%d): failed to get device " 226 "descriptor: %s", dev->address, str_error(err)); 218 227 goto err_address; 219 228 } 220 229 221 230 if ((err = setup_hub(xhci_dev, &desc))) 222 usb_log_warning("Device(%d): failed to setup hub characteristics: %s. " 223 " Continuing anyway.", dev->address, str_error(err)); 231 usb_log_warning("Device(%d): failed to setup hub " 232 "characteristics: %s. Continuing anyway.", 233 dev->address, str_error(err)); 224 234 225 235 if ((err = hcd_ddf_setup_match_ids(dev, &desc))) { 226 usb_log_error("Device(%d): failed to setup match IDs: %s", dev->address, str_error(err)); 236 usb_log_error("Device(%d): failed to setup match IDs: %s", 237 dev->address, str_error(err)); 227 238 goto err_address; 228 239 } … … 253 264 const uint32_t slot_id = xhci_dev->slot_id; 254 265 if ((err = hc_disable_slot(xhci_dev))) { 255 usb_log_warning("Failed to disable slot of device " XHCI_DEV_FMT ": %s",256 XHCI_DEV_ARGS(*xhci_dev), str_error(err));266 usb_log_warning("Failed to disable slot of device " XHCI_DEV_FMT 267 ": %s", XHCI_DEV_ARGS(*xhci_dev), str_error(err)); 257 268 } 258 269 … … 277 288 /* Transition the device from the Addressed to the Configured state. */ 278 289 if ((err = hc_configure_device(dev))) { 279 usb_log_warning("Failed to configure device " XHCI_DEV_FMT ".", XHCI_DEV_ARGS(*dev)); 290 usb_log_warning("Failed to configure device " XHCI_DEV_FMT ".", 291 XHCI_DEV_ARGS(*dev)); 280 292 return err; 281 293 } … … 302 314 /* Issue one HC command to simultaneously drop all endpoints except zero. */ 303 315 if ((err = hc_deconfigure_device(dev))) { 304 usb_log_warning("Failed to deconfigure device " XHCI_DEV_FMT ".",305 XHCI_DEV_ ARGS(*dev));316 usb_log_warning("Failed to deconfigure device " 317 XHCI_DEV_FMT ".", XHCI_DEV_ARGS(*dev)); 306 318 } 307 319 } … … 339 351 } 340 352 341 // As we always allocate space for whole input context, we can set this to maximum 353 /* 354 * As we always allocate space for whole input context, we can set this 355 * to maximum. The only exception being Address Device command, which 356 * explicitly requires this to be se to 1. 357 */ 342 358 XHCI_SLOT_CTX_ENTRIES_SET(*ctx, 31); 343 359 }
Note:
See TracChangeset
for help on using the changeset viewer.