Changeset bda60d9 in mainline for uspace/lib/libdrv
- Timestamp:
- 2010-03-19T14:40:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d347b53
- Parents:
- 7707954
- Location:
- uspace/lib/libdrv
- Files:
-
- 2 edited
-
generic/driver.c (modified) (3 diffs)
-
include/driver.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libdrv/generic/driver.c
r7707954 rbda60d9 72 72 // result of the operation - device was added, device is not present etc. 73 73 ipcarg_t ret = 0; 74 ipcarg_t dev_handle = IPC_GET_ARG1(*icall);74 device_handle_t dev_handle = IPC_GET_ARG1(*icall); 75 75 76 76 printf("%s: adding device with handle = %x \n", driver->name, dev_handle); … … 109 109 ipc_answer_0(callid, ENOENT); 110 110 } 111 } 112 111 } 113 112 } 114 113 … … 150 149 } 151 150 152 bool child_device_register(device_t *child, const char *child_name,device_t *parent)151 bool child_device_register(device_t *child, device_t *parent) 153 152 { 154 if (devman_child_device_register(child_name, parent->handle, &child->handle)) { 153 printf("%s: child_device_register\n", driver->name); 154 155 assert(NULL != child->name); 156 157 if (devman_child_device_register(child->name, &child->match_ids, parent->handle, &child->handle)) { 155 158 // TODO initialize child device 156 159 return true; -
uspace/lib/libdrv/include/driver.h
r7707954 rbda60d9 37 37 38 38 #include <adt/list.h> 39 #include <ipc/devman.h> 39 40 40 41 typedef struct device { 41 longhandle;42 device_handle_t handle; 42 43 ipcarg_t parent_phone; 44 const char *name; 45 match_id_list_t match_ids; 43 46 44 47 // TODO add more items - parent bus type etc. … … 64 67 if (NULL != dev) { 65 68 memset(dev, 0, sizeof(device_t)); 66 } 67 69 } 70 list_initialize(&dev->match_ids.ids); 68 71 return dev; 69 72 } 70 73 71 bool child_device_register(device_t *child, const char *child_name, device_t *parent); 74 static inline delete_device(device_t *dev) { 75 clean_match_ids(&dev->match_ids); 76 if (NULL != dev->name) { 77 free(dev->name); 78 } 79 free(dev); 80 } 72 81 82 bool child_device_register(device_t *child, device_t *parent); 73 83 74 84
Note:
See TracChangeset
for help on using the changeset viewer.
