Changeset 0b5a4131 in mainline
- Timestamp:
- 2010-11-18T18:10:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c63e70c
- Parents:
- 991f645
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/test_serial/test_serial.c
r991f645 r0b5a4131 69 69 int res; 70 70 res = devman_get_phone(DEVMAN_CLIENT, IPC_FLAG_BLOCKING); 71 dev ice_handle_t handle;71 devman_handle_t handle; 72 72 73 73 res = devman_device_get_handle("/hw/pci0/00:01.0/com1", &handle, -
uspace/lib/c/generic/devman.c
r991f645 r0b5a4131 141 141 142 142 int devman_child_device_register( 143 const char *name, match_id_list_t *match_ids, dev ice_handle_t parent_handle, device_handle_t *handle)143 const char *name, match_id_list_t *match_ids, devman_handle_t parent_handle, devman_handle_t *handle) 144 144 { 145 145 int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING); … … 180 180 } 181 181 182 int devman_add_device_to_class(dev ice_handle_t dev_handle, const char *class_name)182 int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name) 183 183 { 184 184 int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING); … … 189 189 async_serialize_start(); 190 190 ipc_call_t answer; 191 aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev _handle, &answer);191 aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer); 192 192 193 193 ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name)); … … 224 224 } 225 225 226 int devman_device_connect(dev ice_handle_t handle, unsigned int flags)226 int devman_device_connect(devman_handle_t handle, unsigned int flags) 227 227 { 228 228 int phone; … … 239 239 } 240 240 241 int devman_parent_device_connect(dev ice_handle_t handle, unsigned int flags)241 int devman_parent_device_connect(devman_handle_t handle, unsigned int flags) 242 242 { 243 243 int phone; … … 254 254 } 255 255 256 int devman_device_get_handle(const char *pathname, dev ice_handle_t *handle, unsigned int flags)256 int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags) 257 257 { 258 258 int phone = devman_get_phone(DEVMAN_CLIENT, flags); … … 280 280 if (retval != EOK) { 281 281 if (handle != NULL) 282 *handle = (dev ice_handle_t) -1;282 *handle = (devman_handle_t) -1; 283 283 return retval; 284 284 } 285 285 286 286 if (handle != NULL) 287 *handle = (dev ice_handle_t) IPC_GET_ARG1(answer);287 *handle = (devman_handle_t) IPC_GET_ARG1(answer); 288 288 289 289 return retval; -
uspace/lib/c/include/devman.h
r991f645 r0b5a4131 46 46 47 47 int devman_driver_register(const char *, async_client_conn_t); 48 int devman_child_device_register(const char *, match_id_list_t *, dev ice_handle_t, device_handle_t *);48 int devman_child_device_register(const char *, match_id_list_t *, devman_handle_t, devman_handle_t *); 49 49 50 int devman_device_connect(dev ice_handle_t handle, unsigned int flags);51 int devman_parent_device_connect(dev ice_handle_t handle, unsigned int flags);50 int devman_device_connect(devman_handle_t handle, unsigned int flags); 51 int devman_parent_device_connect(devman_handle_t handle, unsigned int flags); 52 52 53 int devman_device_get_handle(const char *pathname, dev ice_handle_t *handle, unsigned int flags);53 int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags); 54 54 55 int devman_add_device_to_class(dev ice_handle_t dev_handle, const char *class_name);55 int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name); 56 56 57 57 #endif -
uspace/lib/c/include/ipc/devman.h
r991f645 r0b5a4131 42 42 #define DEVMAN_NAME_MAXLEN 256 43 43 44 typedef ipcarg_t dev ice_handle_t;44 typedef ipcarg_t devman_handle_t; 45 45 46 46 /** Ids of device models used for device-to-driver matching. -
uspace/lib/drv/generic/driver.c
r991f645 r0b5a4131 139 139 } 140 140 141 static device_t * driver_get_device(link_t *devices, dev ice_handle_t handle)141 static device_t * driver_get_device(link_t *devices, devman_handle_t handle) 142 142 { 143 143 device_t *dev = NULL; … … 163 163 int res = EOK; 164 164 165 dev ice_handle_t dev_handle = IPC_GET_ARG1(*icall);165 devman_handle_t dev_handle = IPC_GET_ARG1(*icall); 166 166 device_t *dev = create_device(); 167 167 dev->handle = dev_handle; … … 221 221 * the device to which the client connected. 222 222 */ 223 dev ice_handle_t handle = IPC_GET_ARG2(*icall);223 devman_handle_t handle = IPC_GET_ARG2(*icall); 224 224 device_t *dev = driver_get_device(&devices, handle); 225 225 -
uspace/lib/drv/include/driver.h
r991f645 r0b5a4131 118 118 * device manager). 119 119 */ 120 dev ice_handle_t handle;120 devman_handle_t handle; 121 121 122 122 /** -
uspace/srv/devman/devman.c
r991f645 r0b5a4131 52 52 { 53 53 node_t *dev = hash_table_get_instance(item, node_t, devman_link); 54 return (dev->handle == (dev ice_handle_t) key[0]);54 return (dev->handle == (devman_handle_t) key[0]); 55 55 } 56 56 … … 782 782 * @return The device node. 783 783 */ 784 node_t *find_dev_node_no_lock(dev_tree_t *tree, dev ice_handle_t handle)784 node_t *find_dev_node_no_lock(dev_tree_t *tree, devman_handle_t handle) 785 785 { 786 786 unsigned long key = handle; … … 795 795 * @return The device node. 796 796 */ 797 node_t *find_dev_node(dev_tree_t *tree, dev ice_handle_t handle)797 node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle) 798 798 { 799 799 node_t *node = NULL; -
uspace/srv/devman/devman.h
r991f645 r0b5a4131 121 121 struct node { 122 122 /** The global unique identifier of the device. */ 123 dev ice_handle_t handle;123 devman_handle_t handle; 124 124 /** The name of the device specified by its parent. */ 125 125 char *name; … … 179 179 * manner. 180 180 */ 181 dev ice_handle_t current_handle;181 devman_handle_t current_handle; 182 182 183 183 /** Synchronize access to the device tree. */ … … 309 309 extern void delete_dev_node(node_t *node); 310 310 extern node_t *find_dev_node_no_lock(dev_tree_t *tree, 311 dev ice_handle_t handle);312 extern node_t *find_dev_node(dev_tree_t *tree, dev ice_handle_t handle);311 devman_handle_t handle); 312 extern node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle); 313 313 extern node_t *find_dev_node_by_path(dev_tree_t *, char *); 314 314 extern node_t *find_node_child(node_t *, const char *); -
uspace/srv/devman/main.c
r991f645 r0b5a4131 202 202 static void devman_add_child(ipc_callid_t callid, ipc_call_t *call) 203 203 { 204 dev ice_handle_t parent_handle = IPC_GET_ARG1(*call);204 devman_handle_t parent_handle = IPC_GET_ARG1(*call); 205 205 ipcarg_t match_count = IPC_GET_ARG2(*call); 206 206 dev_tree_t *tree = &device_tree; … … 271 271 static void devman_add_device_to_class(ipc_callid_t callid, ipc_call_t *call) 272 272 { 273 dev ice_handle_t handle = IPC_GET_ARG1(*call);273 devman_handle_t handle = IPC_GET_ARG1(*call); 274 274 275 275 /* Get class name. */ … … 414 414 bool drv_to_parent) 415 415 { 416 dev ice_handle_t handle = IPC_GET_ARG2(*icall);416 devman_handle_t handle = IPC_GET_ARG2(*icall); 417 417 418 418 node_t *dev = find_dev_node(&device_tree, handle);
Note:
See TracChangeset
for help on using the changeset viewer.