Changeset 1ffa73b in mainline for uspace/lib/drv/generic/remote_hw_res.c
- Timestamp:
- 2011-01-10T16:33:08Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b207803
- Parents:
- 863d45e (diff), 6610565b (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 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_hw_res.c
r863d45e r1ffa73b 37 37 #include <errno.h> 38 38 39 #include "ops/hw_res.h" 39 40 #include "driver.h" 40 #include "resource.h"41 41 42 static void remote_ res_get_resources(device_t *, void *, ipc_callid_t,42 static void remote_hw_res_get_resource_list(device_t *, void *, ipc_callid_t, 43 43 ipc_call_t *); 44 static void remote_ res_enable_interrupt(device_t *, void *, ipc_callid_t,44 static void remote_hw_res_enable_interrupt(device_t *, void *, ipc_callid_t, 45 45 ipc_call_t *); 46 46 47 static remote_iface_func_ptr_t remote_ res_iface_ops [] = {48 &remote_ res_get_resources,49 &remote_ res_enable_interrupt47 static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = { 48 &remote_hw_res_get_resource_list, 49 &remote_hw_res_enable_interrupt 50 50 }; 51 51 52 remote_iface_t remote_ res_iface = {53 .method_count = sizeof(remote_ res_iface_ops) /52 remote_iface_t remote_hw_res_iface = { 53 .method_count = sizeof(remote_hw_res_iface_ops) / 54 54 sizeof(remote_iface_func_ptr_t), 55 .methods = remote_ res_iface_ops55 .methods = remote_hw_res_iface_ops 56 56 }; 57 57 58 static void remote_ res_enable_interrupt(device_t *dev, void *iface,58 static void remote_hw_res_enable_interrupt(device_t *dev, void *ops, 59 59 ipc_callid_t callid, ipc_call_t *call) 60 60 { 61 resource_iface_t *ires = (resource_iface_t *) iface;61 hw_res_ops_t *hw_res_ops = (hw_res_ops_t *) ops; 62 62 63 if ( NULL == ires->enable_interrupt)63 if (hw_res_ops->enable_interrupt == NULL) 64 64 ipc_answer_0(callid, ENOTSUP); 65 else if ( ires->enable_interrupt(dev))65 else if (hw_res_ops->enable_interrupt(dev)) 66 66 ipc_answer_0(callid, EOK); 67 67 else … … 69 69 } 70 70 71 static void remote_ res_get_resources(device_t *dev, void *iface,71 static void remote_hw_res_get_resource_list(device_t *dev, void *ops, 72 72 ipc_callid_t callid, ipc_call_t *call) 73 73 { 74 resource_iface_t *ires = (resource_iface_t *) iface; 75 if (NULL == ires->get_resources) { 74 hw_res_ops_t *hw_res_ops = (hw_res_ops_t *) ops; 75 76 if (hw_res_ops->get_resource_list == NULL) { 76 77 ipc_answer_0(callid, ENOTSUP); 77 78 return; 78 79 } 79 80 80 hw_resource_list_t *hw_resources = ires->get_resources(dev);81 if ( NULL == hw_resources){81 hw_resource_list_t *hw_resources = hw_res_ops->get_resource_list(dev); 82 if (hw_resources == NULL){ 82 83 ipc_answer_0(callid, ENOENT); 83 84 return; 84 } 85 } 85 86 86 ipc_answer_1(callid, EOK, hw_resources->count); 87 ipc_answer_1(callid, EOK, hw_resources->count); 87 88 88 89 size_t len; 89 90 if (!async_data_read_receive(&callid, &len)) { 90 /* protocol error - the recipient is not accepting data */91 /* Protocol error - the recipient is not accepting data */ 91 92 return; 92 93 }
Note:
See TracChangeset
for help on using the changeset viewer.