Changeset 802898f in mainline for uspace/lib/drv/generic/remote_hw_res.c
- Timestamp:
- 2013-09-02T20:14:11Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c95dff
- Parents:
- 0435fe41 (diff), 61ab4a9 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_hw_res.c
r0435fe41 r802898f 1 1 /* 2 2 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. 4 5 * … … 43 44 static void remote_hw_res_enable_interrupt(ddf_fun_t *, void *, ipc_callid_t, 44 45 ipc_call_t *); 46 static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_callid_t, 47 ipc_call_t *); 48 static void remote_hw_res_dma_channel_remain(ddf_fun_t *, void *, ipc_callid_t, 49 ipc_call_t *); 45 50 46 51 static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = { 47 &remote_hw_res_get_resource_list, 48 &remote_hw_res_enable_interrupt 52 [HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list, 53 [HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt, 54 [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup, 55 [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain, 49 56 }; 50 57 … … 94 101 } 95 102 103 static void remote_hw_res_dma_channel_setup(ddf_fun_t *fun, void *ops, 104 ipc_callid_t callid, ipc_call_t *call) 105 { 106 hw_res_ops_t *hw_res_ops = ops; 107 108 if (hw_res_ops->dma_channel_setup == NULL) { 109 async_answer_0(callid, ENOTSUP); 110 return; 111 } 112 const unsigned channel = DEV_IPC_GET_ARG1(*call) & 0xffff; 113 const uint8_t mode = DEV_IPC_GET_ARG1(*call) >> 16; 114 const uint32_t address = DEV_IPC_GET_ARG2(*call); 115 const uint32_t size = DEV_IPC_GET_ARG3(*call); 116 117 const int ret = hw_res_ops->dma_channel_setup( 118 fun, channel, address, size, mode); 119 async_answer_0(callid, ret); 120 } 121 122 static void remote_hw_res_dma_channel_remain(ddf_fun_t *fun, void *ops, 123 ipc_callid_t callid, ipc_call_t *call) 124 { 125 hw_res_ops_t *hw_res_ops = ops; 126 127 if (hw_res_ops->dma_channel_setup == NULL) { 128 async_answer_0(callid, ENOTSUP); 129 return; 130 } 131 const unsigned channel = DEV_IPC_GET_ARG1(*call); 132 size_t remain = 0; 133 const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain); 134 async_answer_1(callid, ret, remain); 135 } 96 136 /** 97 137 * @}
Note:
See TracChangeset
for help on using the changeset viewer.