Changeset fa0f53b in mainline
- Timestamp:
- 2011-04-14T13:54:40Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12b8e03
- Parents:
- 5e168be1
- Location:
- uspace/lib/usb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/pipes.h
r5e168be1 rfa0f53b 99 99 /** Number of active transfers over the pipe. */ 100 100 int refcount; 101 102 /** Whether to automatically reset halt on the endpoint. 103 * Valid only for control endpoint zero. 104 */ 105 bool auto_reset_halt; 101 106 } usb_pipe_t; 102 107 -
uspace/lib/usb/src/pipesinit.c
r5e168be1 rfa0f53b 365 365 pipe->direction = direction; 366 366 pipe->refcount = 0; 367 pipe->auto_reset_halt = false; 367 368 368 369 return EOK; … … 385 386 0, USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE, 386 387 USB_DIRECTION_BOTH); 388 389 pipe->auto_reset_halt = true; 387 390 388 391 return rc; -
uspace/lib/usb/src/pipesio.c
r5e168be1 rfa0f53b 49 49 #include <assert.h> 50 50 #include <usbhc_iface.h> 51 #include <usb/request.h> 51 52 #include "pipepriv.h" 52 53 … … 307 308 } 308 309 310 /** Try to clear endpoint halt of default control pipe. 311 * 312 * @param pipe Pipe for control endpoint zero. 313 */ 314 static void clear_self_endpoint_halt(usb_pipe_t *pipe) 315 { 316 assert(pipe != NULL); 317 318 if (!pipe->auto_reset_halt || (pipe->endpoint_no != 0)) { 319 return; 320 } 321 322 323 /* Prevent indefinite recursion. */ 324 pipe->auto_reset_halt = false; 325 usb_request_clear_endpoint_halt(pipe, 0); 326 pipe->auto_reset_halt = true; 327 } 328 309 329 310 330 /** Request a control read transfer, no checking of input parameters. … … 436 456 setup_buffer, setup_buffer_size, 437 457 data_buffer, data_buffer_size, &act_size); 458 459 if (rc == ESTALL) { 460 clear_self_endpoint_halt(pipe); 461 } 438 462 439 463 pipe_drop_ref(pipe); … … 563 587 setup_buffer, setup_buffer_size, data_buffer, data_buffer_size); 564 588 589 if (rc == ESTALL) { 590 clear_self_endpoint_halt(pipe); 591 } 592 565 593 pipe_drop_ref(pipe); 566 594
Note:
See TracChangeset
for help on using the changeset viewer.