Ignore:
Timestamp:
2017-10-17T13:11:35Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60af4cdb
Parents:
dbf32b1 (diff), a416d070 (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:

Merge mainline

File:
1 edited

Legend:

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

    rdbf32b1 r95c675b  
    4545static void remote_hw_res_enable_interrupt(ddf_fun_t *, void *, ipc_callid_t,
    4646    ipc_call_t *);
     47static void remote_hw_res_disable_interrupt(ddf_fun_t *, void *, ipc_callid_t,
     48    ipc_call_t *);
     49static void remote_hw_res_clear_interrupt(ddf_fun_t *, void *, ipc_callid_t,
     50    ipc_call_t *);
    4751static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_callid_t,
    4852    ipc_call_t *);
     
    5357        [HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list,
    5458        [HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt,
     59        [HW_RES_DISABLE_INTERRUPT] = &remote_hw_res_disable_interrupt,
     60        [HW_RES_CLEAR_INTERRUPT] = &remote_hw_res_clear_interrupt,
    5561        [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup,
    5662        [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain,
     
    6773        hw_res_ops_t *hw_res_ops = (hw_res_ops_t *) ops;
    6874       
    69         if (hw_res_ops->enable_interrupt == NULL)
     75        if (hw_res_ops->enable_interrupt == NULL) {
    7076                async_answer_0(callid, ENOTSUP);
    71         else if (hw_res_ops->enable_interrupt(fun))
    72                 async_answer_0(callid, EOK);
    73         else
    74                 async_answer_0(callid, EREFUSED);
     77                return;
     78        }
     79       
     80        const int irq = DEV_IPC_GET_ARG1(*call);
     81        const int ret = hw_res_ops->enable_interrupt(fun, irq);
     82        async_answer_0(callid, ret);
     83}
     84
     85static void remote_hw_res_disable_interrupt(ddf_fun_t *fun, void *ops,
     86    ipc_callid_t callid, ipc_call_t *call)
     87{
     88        hw_res_ops_t *hw_res_ops = (hw_res_ops_t *) ops;
     89       
     90        if (hw_res_ops->disable_interrupt == NULL) {
     91                async_answer_0(callid, ENOTSUP);
     92                return;
     93        }
     94       
     95        const int irq = DEV_IPC_GET_ARG1(*call);
     96        const int ret = hw_res_ops->disable_interrupt(fun, irq);
     97        async_answer_0(callid, ret);
     98}
     99
     100static void remote_hw_res_clear_interrupt(ddf_fun_t *fun, void *ops,
     101    ipc_callid_t callid, ipc_call_t *call)
     102{
     103        hw_res_ops_t *hw_res_ops = (hw_res_ops_t *) ops;
     104       
     105        if (hw_res_ops->clear_interrupt == NULL) {
     106                async_answer_0(callid, ENOTSUP);
     107                return;
     108        }
     109       
     110        const int irq = DEV_IPC_GET_ARG1(*call);
     111        const int ret = hw_res_ops->enable_interrupt(fun, irq);
     112        async_answer_0(callid, ret);
    75113}
    76114
Note: See TracChangeset for help on using the changeset viewer.