Changeset a1b7e80 in mainline for uspace/srv/devman/devman.h
- Timestamp:
- 2011-09-02T16:54:18Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f480d7e
- Parents:
- 7a72ce1a (diff), 224c0e7 (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/srv/devman/devman.h
r7a72ce1a ra1b7e80 118 118 } driver_list_t; 119 119 120 /** The state of the device.*/120 /** Device state */ 121 121 typedef enum { 122 122 DEVICE_NOT_INITIALIZED = 0, 123 123 DEVICE_USABLE, 124 124 DEVICE_NOT_PRESENT, 125 DEVICE_INVALID 125 DEVICE_INVALID, 126 /** Device node has been removed from the tree */ 127 DEVICE_REMOVED 126 128 } device_state_t; 127 129 128 130 /** Device node in the device tree. */ 129 131 struct dev_node { 132 /** Reference count */ 133 atomic_t refcnt; 134 130 135 /** The global unique identifier of the device. */ 131 136 devman_handle_t handle; … … 154 159 }; 155 160 161 /** Function state */ 162 typedef enum { 163 FUN_INIT = 0, 164 FUN_OFF_LINE, 165 FUN_ON_LINE, 166 /** Function node has been removed from the tree */ 167 FUN_REMOVED 168 } fun_state_t; 169 156 170 /** Function node in the device tree. */ 157 171 struct fun_node { 172 /** Reference count */ 173 atomic_t refcnt; 174 /** State */ 175 fun_state_t state; 176 158 177 /** The global unique identifier of the function */ 159 178 devman_handle_t handle; … … 239 258 240 259 extern void add_driver(driver_list_t *, driver_t *); 241 extern void attach_driver(dev_node_t *, driver_t *); 260 extern void attach_driver(dev_tree_t *, dev_node_t *, driver_t *); 261 extern void detach_driver(dev_tree_t *, dev_node_t *); 242 262 extern void add_device(driver_t *, dev_node_t *, dev_tree_t *); 243 263 extern bool start_driver(driver_t *); 264 extern int driver_dev_remove(dev_tree_t *, dev_node_t *); 265 extern int driver_fun_online(dev_tree_t *, fun_node_t *); 266 extern int driver_fun_offline(dev_tree_t *, fun_node_t *); 244 267 245 268 extern driver_t *find_driver(driver_list_t *, const char *); … … 254 277 extern dev_node_t *create_dev_node(void); 255 278 extern void delete_dev_node(dev_node_t *node); 279 extern void dev_add_ref(dev_node_t *); 280 extern void dev_del_ref(dev_node_t *); 256 281 extern dev_node_t *find_dev_node_no_lock(dev_tree_t *tree, 257 282 devman_handle_t handle); … … 263 288 extern fun_node_t *create_fun_node(void); 264 289 extern void delete_fun_node(fun_node_t *); 290 extern void fun_add_ref(fun_node_t *); 291 extern void fun_del_ref(fun_node_t *); 265 292 extern fun_node_t *find_fun_node_no_lock(dev_tree_t *tree, 266 293 devman_handle_t handle); 267 294 extern fun_node_t *find_fun_node(dev_tree_t *tree, devman_handle_t handle); 268 295 extern fun_node_t *find_fun_node_by_path(dev_tree_t *, char *); 269 extern fun_node_t *find_fun_node_in_device(dev_node_t *, const char *); 296 extern fun_node_t *find_fun_node_in_device(dev_tree_t *tree, dev_node_t *, 297 const char *); 270 298 271 299 /* Device tree */ … … 274 302 extern bool create_root_nodes(dev_tree_t *); 275 303 extern bool insert_dev_node(dev_tree_t *, dev_node_t *, fun_node_t *); 304 extern void remove_dev_node(dev_tree_t *, dev_node_t *); 276 305 extern bool insert_fun_node(dev_tree_t *, fun_node_t *, char *, dev_node_t *); 277 306 extern void remove_fun_node(dev_tree_t *, fun_node_t *);
Note:
See TracChangeset
for help on using the changeset viewer.