Changeset 45457265 in mainline for uspace/drv/bus/usb/xhci/streams.c
- Timestamp:
- 2018-02-03T02:14:26Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb862fd
- Parents:
- 961a5ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/streams.c
r961a5ee r45457265 85 85 * @param[in] count Amount of primary streams. 86 86 */ 87 static int initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count)87 static errno_t initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count) 88 88 { 89 89 usb_log_debug("Allocating primary stream context array of size %u " … … 152 152 * @param[in] index index of the initialized stream structure. 153 153 */ 154 static int initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,155 154 static errno_t initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, 155 unsigned index) 156 156 { 157 157 xhci_stream_ctx_t *ctx = &xhci_ep->primary_stream_ctx_array[index]; … … 159 159 memset(data, 0, sizeof(xhci_stream_data_t)); 160 160 161 int err = EOK;161 errno_t err = EOK; 162 162 163 163 /* Init and register TRB ring for the primary stream */ … … 178 178 * @param[in] xhci_ep XHCI bulk endpoint to use. 179 179 */ 180 static int initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep)181 { 182 int err = EOK;180 static errno_t initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep) 181 { 182 errno_t err = EOK; 183 183 size_t index; 184 184 for (index = 0; index < xhci_ep->primary_stream_data_size; ++index) { … … 205 205 * @param[in] count Number of secondary streams to initialize. 206 206 */ 207 static int initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,208 207 static errno_t initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, 208 unsigned idx, unsigned count) 209 209 { 210 210 if (count == 0) { … … 243 243 244 244 /* Initialize all the rings. */ 245 int err = EOK;245 errno_t err = EOK; 246 246 size_t index; 247 247 for (index = 0; index < count; ++index) { … … 275 275 */ 276 276 static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx, 277 277 unsigned pstreams, unsigned lsa) 278 278 { 279 279 XHCI_EP_TYPE_SET(*ctx, xhci_endpoint_type(xhci_ep)); … … 294 294 * @param[in] count Amount of primary streams requested. 295 295 */ 296 static int verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,296 static errno_t verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev, 297 297 xhci_endpoint_t *xhci_ep, unsigned count) 298 298 { … … 345 345 * @param[in] xhci_ep Associated XHCI bulk endpoint. 346 346 */ 347 int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,348 347 errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, 348 xhci_endpoint_t *xhci_ep) 349 349 { 350 350 if (!xhci_ep->primary_stream_data_size) { … … 357 357 358 358 /* Streams are now removed, proceed with reconfiguring endpoint. */ 359 int err;359 errno_t err; 360 360 if ((err = xhci_trb_ring_init(&xhci_ep->ring, 0))) { 361 361 usb_log_error("Failed to initialize a transfer ring."); … … 373 373 * @param[in] count Amount of primary streams requested. 374 374 */ 375 int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,375 errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev, 376 376 xhci_endpoint_t *xhci_ep, unsigned count) 377 377 { 378 int err = verify_stream_conditions(hc, dev, xhci_ep, count);378 errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count); 379 379 if (err) { 380 380 return err; … … 421 421 * @param[in] count Amount of primary streams requested. 422 422 */ 423 int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,423 errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev, 424 424 xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count) 425 425 { … … 430 430 } 431 431 432 int err = verify_stream_conditions(hc, dev, xhci_ep, count);432 errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count); 433 433 if (err) { 434 434 return err;
Note:
See TracChangeset
for help on using the changeset viewer.