Changeset 6298d80 in mainline for uspace/lib/usb
- Timestamp:
- 2011-03-14T02:01:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ff34e5a
- Parents:
- 17ceb72 (diff), 189cd4e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/usb
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/Makefile
r17ceb72 r6298d80 37 37 src/ddfiface.c \ 38 38 src/debug.c \ 39 src/devdrv.c \ 40 src/devpoll.c \ 39 41 src/dp.c \ 40 42 src/dump.c \ -
uspace/lib/usb/include/usb/pipes.h
r17ceb72 r6298d80 106 106 const usb_endpoint_description_t *description; 107 107 /** Interface number the endpoint must belong to (-1 for any). */ 108 constint interface_no;108 int interface_no; 109 109 /** Found descriptor fitting the description. */ 110 110 usb_standard_endpoint_descriptor_t *descriptor; … … 131 131 int usb_endpoint_pipe_initialize_from_configuration(usb_endpoint_mapping_t *, 132 132 size_t, uint8_t *, size_t, usb_device_connection_t *); 133 133 int usb_endpoint_pipe_register(usb_endpoint_pipe_t *, unsigned int, 134 usb_hc_connection_t *); 135 int usb_endpoint_pipe_unregister(usb_endpoint_pipe_t *, usb_hc_connection_t *); 134 136 135 137 int usb_endpoint_pipe_start_session(usb_endpoint_pipe_t *); -
uspace/lib/usb/src/pipesinit.c
r17ceb72 r6298d80 38 38 #include <usb/dp.h> 39 39 #include <usb/request.h> 40 #include <usbhc_iface.h> 40 41 #include <errno.h> 41 42 #include <assert.h> … … 393 394 } 394 395 396 /** Register endpoint with the host controller. 397 * 398 * @param pipe Pipe to be registered. 399 * @param interval Polling interval. 400 * @param hc_connection Connection to the host controller (must be opened). 401 * @return Error code. 402 */ 403 int usb_endpoint_pipe_register(usb_endpoint_pipe_t *pipe, 404 unsigned int interval, 405 usb_hc_connection_t *hc_connection) 406 { 407 assert(pipe); 408 assert(hc_connection); 409 410 if (!usb_hc_connection_is_opened(hc_connection)) { 411 return EBADF; 412 } 413 414 #define _PACK(high, low) ((high) * 256 + (low)) 415 416 return async_req_5_0(hc_connection->hc_phone, 417 DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_REGISTER_ENDPOINT, 418 _PACK(pipe->wire->address, pipe->endpoint_no), 419 _PACK(pipe->transfer_type, pipe->direction), 420 pipe->max_packet_size, interval); 421 422 #undef _PACK 423 } 424 425 /** Revert endpoint registration with the host controller. 426 * 427 * @param pipe Pipe to be unregistered. 428 * @param hc_connection Connection to the host controller (must be opened). 429 * @return Error code. 430 */ 431 int usb_endpoint_pipe_unregister(usb_endpoint_pipe_t *pipe, 432 usb_hc_connection_t *hc_connection) 433 { 434 assert(pipe); 435 assert(hc_connection); 436 437 if (!usb_hc_connection_is_opened(hc_connection)) { 438 return EBADF; 439 } 440 441 return async_req_4_0(hc_connection->hc_phone, 442 DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_UNREGISTER_ENDPOINT, 443 pipe->wire->address, pipe->endpoint_no, pipe->direction); 444 } 445 395 446 /** 396 447 * @} -
uspace/lib/usb/src/recognise.c
r17ceb72 r6298d80 374 374 * naming etc., something more descriptive could be created. 375 375 */ 376 rc = asprintf(&child_name, "usbdev%02zu", this_device_name_index); 376 rc = asprintf(&child_name, "usb%02zu_a%d", 377 this_device_name_index, address); 377 378 if (rc < 0) { 378 379 goto failure;
Note:
See TracChangeset
for help on using the changeset viewer.