Changes in uspace/lib/usb/src/pipesinit.c [b7d8fd9:bf4cc3e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/pipesinit.c
rb7d8fd9 rbf4cc3e 38 38 #include <usb/dp.h> 39 39 #include <usb/request.h> 40 #include <usbhc_iface.h>41 40 #include <errno.h> 42 41 #include <assert.h> … … 394 393 } 395 394 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 _PACK423 }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 446 395 /** 447 396 * @}
Note:
See TracChangeset
for help on using the changeset viewer.