Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2018-01-23T12:41:22Z (6 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/endpoint.c
re546142 r8033f89 58 58 * @return Error code. 59 59 */ 60 static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, const usb_endpoint_descriptors_t *desc) 60 static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, 61 const usb_endpoint_descriptors_t *desc) 61 62 { 62 63 int rc; … … 79 80 xhci_ep->mult = 1; 80 81 81 /* In USB 3, the semantics of wMaxPacketSize changed. Now the number of 82 /* 83 * In USB 3, the semantics of wMaxPacketSize changed. Now the number of 82 84 * packets per service interval is determined from max_burst and mult. 83 85 */ … … 93 95 * others have 2-based log of it. 94 96 */ 95 if (dev->speed >= USB_SPEED_HIGH || ep->transfer_type != USB_TRANSFER_INTERRUPT) { 97 if (dev->speed >= USB_SPEED_HIGH 98 || ep->transfer_type != USB_TRANSFER_INTERRUPT) { 96 99 xhci_ep->interval = 1 << (xhci_ep->interval - 1); 97 100 } … … 119 122 * Bus callback. 120 123 */ 121 endpoint_t *xhci_endpoint_create(device_t *dev, const usb_endpoint_descriptors_t *desc) 124 endpoint_t *xhci_endpoint_create(device_t *dev, 125 const usb_endpoint_descriptors_t *desc) 122 126 { 123 127 const usb_transfer_type_t type = USB_ED_GET_TRANSFER_TYPE(desc->endpoint); … … 193 197 const int err = hc_stop_endpoint(xhci_ep); 194 198 if (err) { 195 usb_log_warning("Failed to stop endpoint %u of device " XHCI_DEV_FMT ": %s", 196 ep->endpoint, XHCI_DEV_ARGS(*dev), str_error(err)); 199 usb_log_warning("Failed to stop endpoint %u of device " 200 XHCI_DEV_FMT ": %s", ep->endpoint, XHCI_DEV_ARGS(*dev), 201 str_error(err)); 197 202 } 198 203 … … 233 238 234 239 if ((err = hc_drop_endpoint(ep))) { 235 usb_log_error("Failed to drop endpoint " XHCI_EP_FMT ": %s", XHCI_EP_ARGS(*ep), str_error(err)); 240 usb_log_error("Failed to drop endpoint " XHCI_EP_FMT ": %s", 241 XHCI_EP_ARGS(*ep), str_error(err)); 236 242 } 237 243 } else { … … 271 277 } 272 278 273 /** Allocate transfer data structures for XHCI endpoint not using streams. 279 /** 280 * Allocate transfer data structures for XHCI endpoint not using streams. 274 281 * @param[in] xhci_ep XHCI endpoint to allocate data structures for. 275 282 * … … 279 286 { 280 287 /* Can't use XHCI_EP_FMT because the endpoint may not have device. */ 281 usb_log_debug("Allocating main transfer ring for endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 288 usb_log_debug("Allocating main transfer ring for endpoint " XHCI_EP_FMT, 289 XHCI_EP_ARGS(*xhci_ep)); 282 290 283 291 xhci_ep->primary_stream_data_array = NULL; … … 299 307 } 300 308 301 /** Free transfer data structures for XHCI endpoint. 309 /** 310 * Free transfer data structures for XHCI endpoint. 302 311 * @param[in] xhci_ep XHCI endpoint to free data structures for. 303 312 */ … … 307 316 xhci_stream_free_ds(xhci_ep); 308 317 } else { 309 usb_log_debug("Freeing main transfer ring of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 318 usb_log_debug("Freeing main transfer ring of endpoint " XHCI_EP_FMT, 319 XHCI_EP_ARGS(*xhci_ep)); 310 320 xhci_trb_ring_fini(&xhci_ep->ring); 311 321 } … … 329 339 } 330 340 331 /** Configure endpoint context of a control endpoint. 341 /** 342 * Configure endpoint context of a control endpoint. 332 343 * @param[in] ep XHCI control endpoint. 333 344 * @param[in] ctx Endpoint context to configure. … … 344 355 } 345 356 346 /** Configure endpoint context of a bulk endpoint. 357 /** 358 * Configure endpoint context of a bulk endpoint. 347 359 * @param[in] ep XHCI bulk endpoint. 348 360 * @param[in] ctx Endpoint context to configure. … … 360 372 } 361 373 362 /** Configure endpoint context of a isochronous endpoint. 374 /** 375 * Configure endpoint context of a isochronous endpoint. 363 376 * @param[in] ep XHCI isochronous endpoint. 364 377 * @param[in] ctx Endpoint context to configure. … … 379 392 } 380 393 381 /** Configure endpoint context of a interrupt endpoint. 394 /** 395 * Configure endpoint context of a interrupt endpoint. 382 396 * @param[in] ep XHCI interrupt endpoint. 383 397 * @param[in] ctx Endpoint context to configure. … … 399 413 typedef void (*setup_ep_ctx_helper)(xhci_endpoint_t *, xhci_ep_ctx_t *); 400 414 401 /** Static array, which maps USB endpoint types to their respective endpoint context configuration functions. */ 415 /** 416 * Static array, which maps USB endpoint types to their respective endpoint 417 * context configuration functions. 418 */ 402 419 static const setup_ep_ctx_helper setup_ep_ctx_helpers[] = { 403 420 [USB_TRANSFER_CONTROL] = setup_control_ep_ctx,
Note:
See TracChangeset
for help on using the changeset viewer.