Changeset c372e03 in mainline for uspace/lib/usbdev/src/request.c


Ignore:
Timestamp:
2011-05-11T19:41:45Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4a7a8d4, 55054db0, 64a36e2, 9e195e2c
Parents:
9212f8a (diff), 5f0fe4e9 (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.
Message:

Mass storage fixes (#206)

Also some refactoring was done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/request.c

    r9212f8a rc372e03  
    885885}
    886886
     887/** Clear halt bit of an endpoint pipe (after pipe stall).
     888 *
     889 * @param ctrl_pipe Control pipe.
     890 * @param target_pipe Which pipe is halted and shall be cleared.
     891 * @return Error code.
     892 */
     893int usb_pipe_clear_halt(usb_pipe_t *ctrl_pipe, usb_pipe_t *target_pipe)
     894{
     895        if ((ctrl_pipe == NULL) || (target_pipe == NULL)) {
     896                return EINVAL;
     897        }
     898        return usb_request_clear_endpoint_halt(ctrl_pipe,
     899            target_pipe->endpoint_no);
     900}
     901
     902/** Get endpoint status.
     903 *
     904 * @param[in] ctrl_pipe Control pipe.
     905 * @param[in] pipe Of which pipe the status shall be received.
     906 * @param[out] status Where to store pipe status (in native endianness).
     907 * @return Error code.
     908 */
     909int usb_request_get_endpoint_status(usb_pipe_t *ctrl_pipe, usb_pipe_t *pipe,
     910    uint16_t *status)
     911{
     912        uint16_t status_tmp;
     913        uint16_t pipe_index = (uint16_t) pipe->endpoint_no;
     914        int rc = usb_request_get_status(ctrl_pipe,
     915            USB_REQUEST_RECIPIENT_ENDPOINT, uint16_host2usb(pipe_index),
     916            &status_tmp);
     917        if (rc != EOK) {
     918                return rc;
     919        }
     920
     921        if (status != NULL) {
     922                *status = uint16_usb2host(status_tmp);
     923        }
     924
     925        return EOK;
     926}
     927
    887928/**
    888929 * @}
Note: See TracChangeset for help on using the changeset viewer.