Changeset 1e64b250 in mainline


Ignore:
Timestamp:
2011-02-11T14:20:57Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4e38d69
Parents:
0a6fa9f
Message:

Remove traces of GET_BUFFER method

Location:
uspace/lib/drv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    r0a6fa9f r1e64b250  
    4242
    4343static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    44 static void remote_usbhc_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4544static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4645static void remote_usbhc_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    6463        remote_usbhc_get_address,
    6564
    66         remote_usbhc_get_buffer,
    67 
    6865        remote_usbhc_reserve_default_address,
    6966        remote_usbhc_release_default_address,
     
    157154}
    158155
    159 void remote_usbhc_get_buffer(device_t *device, void *iface,
    160     ipc_callid_t callid, ipc_call_t *call)
    161 {
    162         sysarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);
    163         async_transaction_t * trans = (async_transaction_t *)buffer_hash;
    164         if (trans == NULL) {
    165                 async_answer_0(callid, ENOENT);
    166                 return;
    167         }
    168         if (trans->buffer == NULL) {
    169                 async_answer_0(callid, EINVAL);
    170                 async_transaction_destroy(trans);
    171                 return;
    172         }
    173 
    174         ipc_callid_t cid;
    175         size_t accepted_size;
    176         if (!async_data_read_receive(&cid, &accepted_size)) {
    177                 async_answer_0(callid, EINVAL);
    178                 async_transaction_destroy(trans);
    179                 return;
    180         }
    181 
    182         if (accepted_size > trans->size) {
    183                 accepted_size = trans->size;
    184         }
    185         async_data_read_finalize(cid, trans->buffer, accepted_size);
    186 
    187         async_answer_1(callid, EOK, accepted_size);
    188 
    189         async_transaction_destroy(trans);
    190 }
    191 
    192156void remote_usbhc_reserve_default_address(device_t *device, void *iface,
    193157    ipc_callid_t callid, ipc_call_t *call)
     
    304268
    305269        async_answer_0(trans->caller, USB_OUTCOME_OK);
     270
     271        async_transaction_destroy(trans);
    306272}
    307273
  • uspace/lib/drv/include/usbhc_iface.h

    r0a6fa9f r1e64b250  
    6666 *   - argument #2 is target endpoint
    6767 *   - argument #3 is buffer size
     68 * - this call is immediately followed by IPC data read (async version)
    6869 * - the call is not answered until the device returns some data (or until
    6970 *   error occurs)
    70  * - if the call is answered with EOK, first argument of the answer is buffer
    71  *   hash that could be used to retrieve the actual data
    7271 *
    7372 * Some special methods (NO-DATA transactions) do not send any data. These
    7473 * might behave as both OUT or IN transactions because communication parts
    7574 * where actual buffers are exchanged are omitted.
    76  *
    77  * The mentioned data retrieval can be done any time after receiving EOK
    78  * answer to IN method.
    79  * This retrieval is done using the IPC_M_USBHC_GET_BUFFER where
    80  * the first argument is buffer hash from call answer.
    81  * This call must be immediately followed by data read-in and after the
    82  * data are transferred, the initial call (IPC_M_USBHC_GET_BUFFER)
    83  * is answered. Each buffer can be retrieved only once.
    84  *
     75 **
    8576 * For all these methods, wrap functions exists. Important rule: functions
    8677 * for IN transactions have (as parameters) buffers where retrieved data
     
    10495        IPC_M_USBHC_GET_ADDRESS,
    10596
    106         /** Asks for data buffer.
    107          * See explanation at usb_iface_funcs_t.
    108          * This function does not have counter part in functional interface
    109          * as it is handled by the remote part itself.
    110          */
    111         IPC_M_USBHC_GET_BUFFER,
    112 
    11397
    11498        /** Reserve usage of default address.
Note: See TracChangeset for help on using the changeset viewer.