Changeset 5a6cc679 in mainline for uspace/lib/usbhid/src/hidreq.c


Ignore:
Timestamp:
2018-01-31T02:21:24Z (6 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0a9cc2
Parents:
132ab5d1
Message:

Merge commit '50f19b7ee8e94570b5c63896736c4eb49cfa18db' into forwardport

Not all ints are converted to errno_t in xhci tree yet, however it compiles and works :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hidreq.c

    r132ab5d1 r5a6cc679  
    5858 * @return Other value inherited from function usb_control_request_set().
    5959 */
    60 int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no,
     60errno_t usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no,
    6161    usb_hid_report_type_t type, uint8_t *buffer, size_t buf_size)
    6262{
     
    7777         */
    7878       
    79         int rc;
     79        errno_t rc;
    8080       
    8181        uint16_t value = 0;
     
    108108 * @return Other value inherited from function usb_control_request_set().
    109109 */
    110 int usbhid_req_set_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
     110errno_t usbhid_req_set_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
    111111    usb_hid_protocol_t protocol)
    112112{
     
    127127         */
    128128       
    129         int rc;
     129        errno_t rc;
    130130
    131131        usb_log_debug("Sending Set Protocol request to the device ("
     
    157157 * @return Other value inherited from function usb_control_request_set().
    158158 */
    159 int usbhid_req_set_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t duration)
    160 {
    161         if (ctrl_pipe == NULL) {
    162                 usb_log_warning("usbhid_req_set_report(): no pipe given.");
    163                 return EINVAL;
    164         }
    165        
    166         if (iface_no < 0) {
    167                 usb_log_warning("usbhid_req_set_report(): no interface given."
    168                     "\n");
    169                 return EINVAL;
    170         }
    171        
    172         /*
    173          * No need for checking other parameters, as they are checked in
    174          * the called function (usb_control_request_set()).
    175          */
    176        
    177         int rc;
     159errno_t usbhid_req_set_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t duration)
     160{
     161        if (ctrl_pipe == NULL) {
     162                usb_log_warning("usbhid_req_set_report(): no pipe given.");
     163                return EINVAL;
     164        }
     165       
     166        if (iface_no < 0) {
     167                usb_log_warning("usbhid_req_set_report(): no interface given."
     168                    "\n");
     169                return EINVAL;
     170        }
     171       
     172        /*
     173         * No need for checking other parameters, as they are checked in
     174         * the called function (usb_control_request_set()).
     175         */
     176       
     177        errno_t rc;
    178178
    179179        usb_log_debug("Sending Set Idle request to the device ("
     
    210210 * @return Other value inherited from function usb_control_request_set().
    211211 */
    212 int usbhid_req_get_report(usb_pipe_t *ctrl_pipe, int iface_no,
     212errno_t usbhid_req_get_report(usb_pipe_t *ctrl_pipe, int iface_no,
    213213    usb_hid_report_type_t type, uint8_t *buffer, size_t buf_size,
    214214    size_t *actual_size)
     
    230230         */
    231231       
    232         int rc;
     232        errno_t rc;
    233233
    234234        uint16_t value = 0;
     
    262262 * @return Other value inherited from function usb_control_request_set().
    263263 */
    264 int usbhid_req_get_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
     264errno_t usbhid_req_get_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
    265265    usb_hid_protocol_t *protocol)
    266266{
     
    281281         */
    282282       
    283         int rc;
     283        errno_t rc;     
    284284
    285285        usb_log_debug("Sending Get Protocol request to the device ("
     
    324324 *         usb_control_request_set().
    325325 */
    326 int usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration)
    327 {
    328         if (ctrl_pipe == NULL) {
    329                 usb_log_warning("usbhid_req_set_report(): no pipe given.");
    330                 return EINVAL;
    331         }
    332        
    333         if (iface_no < 0) {
    334                 usb_log_warning("usbhid_req_set_report(): no interface given."
    335                     "\n");
    336                 return EINVAL;
    337         }
    338        
    339         /*
    340          * No need for checking other parameters, as they are checked in
    341          * the called function (usb_control_request_set()).
    342          */
    343        
    344         int rc;
     326errno_t usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration)
     327{
     328        if (ctrl_pipe == NULL) {
     329                usb_log_warning("usbhid_req_set_report(): no pipe given.");
     330                return EINVAL;
     331        }
     332       
     333        if (iface_no < 0) {
     334                usb_log_warning("usbhid_req_set_report(): no interface given."
     335                    "\n");
     336                return EINVAL;
     337        }
     338       
     339        /*
     340         * No need for checking other parameters, as they are checked in
     341         * the called function (usb_control_request_set()).
     342         */
     343       
     344        errno_t rc;
    345345
    346346        usb_log_debug("Sending Get Idle request to the device ("
Note: See TracChangeset for help on using the changeset viewer.