Changeset 50c57df in mainline
- Timestamp:
- 2011-01-09T17:40:10Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41b56084
- Parents:
- 36a6e11
- Location:
- uspace
- Files:
-
- 8 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/isa/isa.c
r36a6e11 r50c57df 51 51 52 52 #include <driver.h> 53 #include < resource.h>53 #include <hw_res.h> 54 54 55 55 #include <devman.h> … … 84 84 } 85 85 86 static resource_iface_t isa_child_res_iface= {86 static hw_res_ops_t isa_child_hw_res_ops = { 87 87 &isa_get_child_resources, 88 88 &isa_enable_child_interrupt … … 502 502 static void isa_init() 503 503 { 504 isa_child_dev_ops.interfaces[HW_RES_DEV_IFACE] = &isa_child_ res_iface;504 isa_child_dev_ops.interfaces[HW_RES_DEV_IFACE] = &isa_child_hw_res_ops; 505 505 } 506 506 -
uspace/drv/ns8250/ns8250.c
r36a6e11 r50c57df 53 53 54 54 #include <driver.h> 55 #include <char.h> 56 #include <resource.h> 55 #include <char_dev.h> 57 56 58 57 #include <devman.h> … … 227 226 228 227 /** The character interface's callbacks. */ 229 static char_ iface_t ns8250_char_iface= {228 static char_dev_ops_t ns8250_char_dev_ops = { 230 229 .read = &ns8250_read, 231 230 .write = &ns8250_write … … 924 923 ns8250_dev_ops.close = &ns8250_close; 925 924 926 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_ iface;925 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_dev_ops; 927 926 ns8250_dev_ops.default_handler = &ns8250_default_handler; 928 927 } -
uspace/drv/pciintel/pci.c
r36a6e11 r50c57df 49 49 #include <ipc/devman.h> 50 50 #include <ipc/dev_iface.h> 51 #include < resource.h>51 #include <hw_res.h> 52 52 #include <device/hw_res.h> 53 53 #include <ddi.h> … … 77 77 } 78 78 79 static resource_iface_t pciintel_child_res_iface= {79 static hw_res_ops_t pciintel_child_hw_res_ops = { 80 80 &pciintel_get_child_resources, 81 81 &pciintel_enable_child_interrupt … … 515 515 static void pciintel_init(void) 516 516 { 517 pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_ res_iface;517 pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_hw_res_ops; 518 518 } 519 519 -
uspace/drv/rootpc/rootpc.c
r36a6e11 r50c57df 50 50 #include <ipc/devman.h> 51 51 #include <ipc/dev_iface.h> 52 #include < resource.h>52 #include <hw_res.h> 53 53 #include <device/hw_res.h> 54 54 … … 107 107 } 108 108 109 static resource_iface_t child_res_iface= {109 static hw_res_ops_t child_hw_res_ops = { 110 110 &rootpc_get_child_resources, 111 111 &rootpc_enable_child_interrupt … … 190 190 static void root_pc_init(void) 191 191 { 192 rootpc_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_ res_iface;192 rootpc_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_hw_res_ops; 193 193 } 194 194 -
uspace/drv/test1/char.c
r36a6e11 r50c57df 33 33 #include <errno.h> 34 34 #include <mem.h> 35 #include <char .h>35 #include <char_dev.h> 36 36 37 37 #include "test1.h" … … 46 46 } 47 47 48 static char_ iface_t char_interface= {48 static char_dev_ops_t char_dev_ops = { 49 49 .read = &impl_char_read, 50 50 .write = &imp_char_write … … 52 52 53 53 device_ops_t char_device_ops = { 54 .interfaces[CHAR_DEV_IFACE] = &char_ interface54 .interfaces[CHAR_DEV_IFACE] = &char_dev_ops 55 55 }; 56 56 -
uspace/lib/drv/generic/dev_iface.c
r36a6e11 r50c57df 37 37 38 38 #include "dev_iface.h" 39 #include "remote_ res.h"40 #include "remote_char .h"39 #include "remote_hw_res.h" 40 #include "remote_char_dev.h" 41 41 42 42 static iface_dipatch_table_t remote_ifaces = { 43 43 .ifaces = { 44 &remote_ res_iface,45 &remote_char_ iface44 &remote_hw_res_iface, 45 &remote_char_dev_iface 46 46 } 47 47 }; -
uspace/lib/drv/generic/remote_char.c
r36a6e11 r50c57df 37 37 #include <errno.h> 38 38 39 #include "char .h"39 #include "char_dev.h" 40 40 #include "driver.h" 41 41 … … 46 46 47 47 /** Remote character interface operations. */ 48 static remote_iface_func_ptr_t remote_char_ iface_ops[] = {48 static remote_iface_func_ptr_t remote_char_dev_iface_ops[] = { 49 49 &remote_char_read, 50 50 &remote_char_write … … 56 56 * character interface. 57 57 */ 58 remote_iface_t remote_char_ iface = {59 .method_count = sizeof(remote_char_ iface_ops) /58 remote_iface_t remote_char_dev_iface = { 59 .method_count = sizeof(remote_char_dev_iface_ops) / 60 60 sizeof(remote_iface_func_ptr_t), 61 .methods = remote_char_ iface_ops61 .methods = remote_char_dev_iface_ops 62 62 }; 63 63 … … 75 75 ipc_call_t *call) 76 76 { 77 char_ iface_t *char_iface = (char_iface_t *) iface;77 char_dev_ops_t *char_iface = (char_dev_ops_t *) iface; 78 78 ipc_callid_t cid; 79 79 … … 122 122 ipc_call_t *call) 123 123 { 124 char_ iface_t *char_iface = (char_iface_t *) iface;124 char_dev_ops_t *char_iface = (char_dev_ops_t *) iface; 125 125 ipc_callid_t cid; 126 126 size_t len; -
uspace/lib/drv/generic/remote_res.c
r36a6e11 r50c57df 38 38 39 39 #include "driver.h" 40 #include " resource.h"40 #include "hw_res.h" 41 41 42 static void remote_res_get_resource s(device_t *, void *, ipc_callid_t,42 static void remote_res_get_resource_list(device_t *, void *, ipc_callid_t, 43 43 ipc_call_t *); 44 44 static void remote_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_resource s,47 static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = { 48 &remote_res_get_resource_list, 49 49 &remote_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 … … 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 *ires = (hw_res_ops_t *) iface; 62 62 63 63 if (NULL == ires->enable_interrupt) … … 69 69 } 70 70 71 static void remote_res_get_resource s(device_t *dev, void *iface,71 static void remote_res_get_resource_list(device_t *dev, void *iface, 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_resource s) {74 hw_res_ops_t *ires = (hw_res_ops_t *) iface; 75 if (NULL == ires->get_resource_list) { 76 76 ipc_answer_0(callid, ENOTSUP); 77 77 return; 78 78 } 79 79 80 hw_resource_list_t *hw_resources = ires->get_resource s(dev);80 hw_resource_list_t *hw_resources = ires->get_resource_list(dev); 81 81 if (NULL == hw_resources){ 82 82 ipc_answer_0(callid, ENOENT); -
uspace/lib/drv/include/char_dev.h
r36a6e11 r50c57df 33 33 */ 34 34 35 #ifndef LIBDRV_CHAR_ H_36 #define LIBDRV_CHAR_ H_35 #ifndef LIBDRV_CHAR_DEV_H_ 36 #define LIBDRV_CHAR_DEV_H_ 37 37 38 38 #include "driver.h" 39 39 40 typedef struct char_iface{40 typedef struct { 41 41 int (*read)(device_t *, char *, size_t); 42 42 int (*write)(device_t *, char *, size_t); 43 } char_ iface_t;43 } char_dev_ops_t; 44 44 45 45 #endif -
uspace/lib/drv/include/hw_res.h
r36a6e11 r50c57df 33 33 */ 34 34 35 #ifndef LIBDRV_ RESOURCE_H_36 #define LIBDRV_ RESOURCE_H_35 #ifndef LIBDRV_HW_RES_H_ 36 #define LIBDRV_HW_RES_H_ 37 37 38 38 #include <device/hw_res.h> 39 39 #include <sys/types.h> 40 40 41 typedef struct resource_iface{42 hw_resource_list_t *(* get_resources)(device_t *);41 typedef struct { 42 hw_resource_list_t *(*get_resource_list)(device_t *); 43 43 bool (*enable_interrupt)(device_t *); 44 } resource_iface_t; 45 44 } hw_res_ops_t; 46 45 47 46 #endif -
uspace/lib/drv/include/remote_char_dev.h
r36a6e11 r50c57df 33 33 */ 34 34 35 #ifndef LIBDRV_REMOTE_ RES_H_36 #define LIBDRV_REMOTE_ RES_H_35 #ifndef LIBDRV_REMOTE_CHAR_DEV_H_ 36 #define LIBDRV_REMOTE_CHAR_DEV_H_ 37 37 38 extern remote_iface_t remote_ res_iface;38 extern remote_iface_t remote_char_dev_iface; 39 39 40 40 #endif -
uspace/lib/drv/include/remote_hw_res.h
r36a6e11 r50c57df 33 33 */ 34 34 35 #ifndef LIBDRV_REMOTE_ CHAR_H_36 #define LIBDRV_REMOTE_ CHAR_H_35 #ifndef LIBDRV_REMOTE_HW_RES_H_ 36 #define LIBDRV_REMOTE_HW_RES_H_ 37 37 38 extern remote_iface_t remote_ char_iface;38 extern remote_iface_t remote_hw_res_iface; 39 39 40 40 #endif
Note:
See TracChangeset
for help on using the changeset viewer.