Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset bd575647 in mainline for uspace/lib/usbdev/src/pipesio.c


Ignore:
Timestamp:
2011-12-11T16:30:42Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
7d5ef94
Parents:
2c202c5
Message:

libusbdev: Use shared hc_connection for pipes.

File:
1 edited

Legend:

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

    r2c202c5 rbd575647  
    7171            return ENOTSUP;
    7272
    73         int ret = pipe_add_ref(pipe, false);
    74         if (ret != EOK) {
    75                 return ret;
    76         }
    77 
    78         /* Ensure serialization over the phone. */
    79         pipe_start_transaction(pipe);
    80         async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
    81         if (!exch) {
    82                 pipe_end_transaction(pipe);
    83                 pipe_drop_ref(pipe);
    84                 return ENOMEM;
    85         }
    86 
    87         ret = usbhc_read(exch, pipe->wire->address, pipe->endpoint_no,
    88             setup, buffer, size, size_transfered);
    89         async_exchange_end(exch);
    90         pipe_end_transaction(pipe);
    91         pipe_drop_ref(pipe);
    92         return ret;
     73        return usb_hc_control_read(pipe->wire->hc_connection,
     74            pipe->wire->address, pipe->endpoint_no, setup, buffer, size,
     75            size_transfered);
    9376}
    9477
     
    10992            return ENOTSUP;
    11093
    111         int ret = pipe_add_ref(pipe, false);
    112         if (ret != EOK) {
    113                 return ret;
    114         }
    115 
    116         /* Ensure serialization over the phone. */
    117         pipe_start_transaction(pipe);
    118         async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
    119         if (!exch) {
    120                 pipe_end_transaction(pipe);
    121                 pipe_drop_ref(pipe);
    122                 return ENOMEM;
    123         }
    124         ret = usbhc_write(exch, pipe->wire->address, pipe->endpoint_no,
    125             setup, buffer, size);
    126         async_exchange_end(exch);
    127         pipe_end_transaction(pipe);
    128         pipe_drop_ref(pipe);
    129         return ret;
     94        return usb_hc_control_write(pipe->wire->hc_connection,
     95            pipe->wire->address, pipe->endpoint_no, setup, buffer, size);
    13096}
    13197
Note: See TracChangeset for help on using the changeset viewer.