Changeset 9a66bc2 in mainline for uspace/srv/drivers/rootia32/rootia32.c
- Timestamp:
- 2010-04-04T21:52:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c06905
- Parents:
- 5cd136ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/drivers/rootia32/rootia32.c
r5cd136ab r9a66bc2 50 50 #include <ipc/devman.h> 51 51 #include <ipc/dev_iface.h> 52 #include <resource.h> 52 53 53 54 #define NAME "rootia32" 54 55 55 typedef struct rootia32_ dev_data {56 typedef struct rootia32_child_dev_data { 56 57 hw_resource_list_t hw_resources; 57 } rootia32_ dev_data_t;58 } rootia32_child_dev_data_t; 58 59 59 60 static bool rootia32_add_device(device_t *dev); … … 82 83 }; 83 84 84 static rootia32_ dev_data_t pci_data = {85 static rootia32_child_dev_data_t pci_data = { 85 86 .hw_resources = { 86 87 1, … … 89 90 }; 90 91 92 static hw_resource_list_t * rootia32_get_child_resources(device_t *dev) 93 { 94 rootia32_child_dev_data_t *data = (rootia32_child_dev_data_t *)dev->driver_data; 95 if (NULL == data) { 96 return NULL; 97 } 98 return &data->hw_resources; 99 } 100 101 static bool rootia32_enable_child_interrupt(device_t *dev) 102 { 103 // TODO 104 105 return false; 106 } 107 108 static resource_iface_t child_res_iface = { 109 &rootia32_get_child_resources, 110 &rootia32_enable_child_interrupt 111 }; 112 91 113 static bool rootia32_add_child( 92 114 device_t *parent, const char *name, const char *str_match_id, 93 rootia32_ dev_data_t *drv_data)115 rootia32_child_dev_data_t *drv_data) 94 116 { 95 117 printf(NAME ": adding new child device '%s'.\n", name); … … 113 135 match_id->score = 100; 114 136 add_match_id(&child->match_ids, match_id); 137 138 // add an interface to the device 139 device_set_iface(child, HW_RES_DEV_IFACE, &child_res_iface); 115 140 116 141 // register child device … … 151 176 if (!rootia32_add_children(dev)) { 152 177 printf(NAME ": failed to add child devices for platform ia32.\n"); 153 return false;154 178 } 155 179
Note:
See TracChangeset
for help on using the changeset viewer.