Changeset f9b2cb4c in mainline for uspace/lib/c/generic/devman.c
- Timestamp:
- 2015-08-23T12:50:23Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ef495f
- Parents:
- 0dd16778
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/devman.c
r0dd16778 rf9b2cb4c 77 77 * 78 78 */ 79 async_exch_t *devman_exchange_begin_blocking( devman_interface_t iface)79 async_exch_t *devman_exchange_begin_blocking(iface_t iface) 80 80 { 81 81 switch (iface) { 82 case DEVMAN_DRIVER:82 case INTERFACE_DDF_DRIVER: 83 83 fibril_mutex_lock(&devman_driver_block_mutex); 84 84 … … 89 89 if (devman_driver_block_sess == NULL) 90 90 devman_driver_block_sess = 91 service_connect_blocking _iface(EXCHANGE_PARALLEL,92 DEVMAN_DRIVER, SERVICE_DEVMAN, 0);91 service_connect_blocking(SERVICE_DEVMAN, 92 INTERFACE_DDF_DRIVER, 0); 93 93 } 94 94 … … 99 99 100 100 return async_exchange_begin(devman_driver_block_sess); 101 case DEVMAN_CLIENT:101 case INTERFACE_DDF_CLIENT: 102 102 fibril_mutex_lock(&devman_client_block_mutex); 103 103 … … 108 108 if (devman_client_block_sess == NULL) 109 109 devman_client_block_sess = 110 service_connect_blocking _iface(EXCHANGE_SERIALIZE,111 DEVMAN_CLIENT, SERVICE_DEVMAN, 0);110 service_connect_blocking(SERVICE_DEVMAN, 111 INTERFACE_DDF_CLIENT, 0); 112 112 } 113 113 … … 130 130 * 131 131 */ 132 async_exch_t *devman_exchange_begin( devman_interface_t iface)132 async_exch_t *devman_exchange_begin(iface_t iface) 133 133 { 134 134 switch (iface) { 135 case DEVMAN_DRIVER:135 case INTERFACE_DDF_DRIVER: 136 136 fibril_mutex_lock(&devman_driver_mutex); 137 137 138 138 if (devman_driver_sess == NULL) 139 139 devman_driver_sess = 140 service_connect _iface(EXCHANGE_PARALLEL, DEVMAN_DRIVER,141 SERVICE_DEVMAN, 0);140 service_connect(SERVICE_DEVMAN, 141 INTERFACE_DDF_DRIVER, 0); 142 142 143 143 fibril_mutex_unlock(&devman_driver_mutex); … … 147 147 148 148 return async_exchange_begin(devman_driver_sess); 149 case DEVMAN_CLIENT:149 case INTERFACE_DDF_CLIENT: 150 150 fibril_mutex_lock(&devman_client_mutex); 151 151 152 152 if (devman_client_sess == NULL) 153 153 devman_client_sess = 154 service_connect _iface(EXCHANGE_SERIALIZE, DEVMAN_CLIENT,155 SERVICE_DEVMAN, 0);154 service_connect(SERVICE_DEVMAN, 155 INTERFACE_DDF_CLIENT, 0); 156 156 157 157 fibril_mutex_unlock(&devman_client_mutex); … … 179 179 int devman_driver_register(const char *name) 180 180 { 181 async_exch_t *exch = devman_exchange_begin_blocking( DEVMAN_DRIVER);181 async_exch_t *exch = devman_exchange_begin_blocking(INTERFACE_DDF_DRIVER); 182 182 183 183 ipc_call_t answer; … … 192 192 } 193 193 194 exch = devman_exchange_begin( DEVMAN_DRIVER);195 async_connect_to_me(exch, 0, 0, 0 , NULL, NULL);194 exch = devman_exchange_begin(INTERFACE_DDF_DRIVER); 195 async_connect_to_me(exch, 0, 0, 0); 196 196 devman_exchange_end(exch); 197 197 … … 218 218 { 219 219 int match_count = list_count(&match_ids->ids); 220 async_exch_t *exch = devman_exchange_begin_blocking( DEVMAN_DRIVER);220 async_exch_t *exch = devman_exchange_begin_blocking(INTERFACE_DDF_DRIVER); 221 221 222 222 ipc_call_t answer; … … 268 268 const char *cat_name) 269 269 { 270 async_exch_t *exch = devman_exchange_begin_blocking( DEVMAN_DRIVER);270 async_exch_t *exch = devman_exchange_begin_blocking(INTERFACE_DDF_DRIVER); 271 271 272 272 ipc_call_t answer; … … 287 287 } 288 288 289 async_sess_t *devman_device_connect(exch_mgmt_t mgmt, devman_handle_t handle, 290 unsigned int flags) 289 async_sess_t *devman_device_connect(devman_handle_t handle, unsigned int flags) 291 290 { 292 291 async_sess_t *sess; 293 292 294 293 if (flags & IPC_FLAG_BLOCKING) 295 sess = service_connect_blocking _iface(mgmt, DEVMAN_CONNECT_TO_DEVICE,296 SERVICE_DEVMAN, handle);294 sess = service_connect_blocking(SERVICE_DEVMAN, 295 INTERFACE_DEVMAN_DEVICE, handle); 297 296 else 298 sess = service_connect _iface(mgmt, DEVMAN_CONNECT_TO_DEVICE,299 SERVICE_DEVMAN, handle);297 sess = service_connect(SERVICE_DEVMAN, 298 INTERFACE_DEVMAN_DEVICE, handle); 300 299 301 300 return sess; … … 314 313 sysarg_t retval; 315 314 316 exch = devman_exchange_begin_blocking( DEVMAN_DRIVER);315 exch = devman_exchange_begin_blocking(INTERFACE_DDF_DRIVER); 317 316 retval = async_req_1_0(exch, DEVMAN_REMOVE_FUNCTION, (sysarg_t) funh); 318 317 devman_exchange_end(exch); … … 323 322 int devman_drv_fun_online(devman_handle_t funh) 324 323 { 325 async_exch_t *exch = devman_exchange_begin( DEVMAN_DRIVER);324 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_DRIVER); 326 325 if (exch == NULL) 327 326 return ENOMEM; … … 335 334 int devman_drv_fun_offline(devman_handle_t funh) 336 335 { 337 async_exch_t *exch = devman_exchange_begin( DEVMAN_DRIVER);336 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_DRIVER); 338 337 if (exch == NULL) 339 338 return ENOMEM; … … 345 344 } 346 345 347 async_sess_t *devman_parent_device_connect( exch_mgmt_t mgmt,348 devman_handle_t handle,unsigned int flags)346 async_sess_t *devman_parent_device_connect(devman_handle_t handle, 347 unsigned int flags) 349 348 { 350 349 async_sess_t *sess; 351 350 352 351 if (flags & IPC_FLAG_BLOCKING) 353 sess = service_connect_blocking _iface(mgmt,354 DEVMAN_CONNECT_TO_PARENTS_DEVICE, SERVICE_DEVMAN, handle);352 sess = service_connect_blocking(SERVICE_DEVMAN, 353 INTERFACE_DEVMAN_PARENT, handle); 355 354 else 356 sess = service_connect_ iface(mgmt,357 DEVMAN_CONNECT_TO_PARENTS_DEVICE, SERVICE_DEVMAN, handle);355 sess = service_connect_blocking(SERVICE_DEVMAN, 356 INTERFACE_DEVMAN_PARENT, handle); 358 357 359 358 return sess; … … 366 365 367 366 if (flags & IPC_FLAG_BLOCKING) 368 exch = devman_exchange_begin_blocking( DEVMAN_CLIENT);367 exch = devman_exchange_begin_blocking(INTERFACE_DDF_CLIENT); 369 368 else { 370 exch = devman_exchange_begin( DEVMAN_CLIENT);369 exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 371 370 if (exch == NULL) 372 371 return ENOMEM; … … 409 408 sysarg_t dretval; 410 409 411 exch = devman_exchange_begin_blocking( DEVMAN_CLIENT);410 exch = devman_exchange_begin_blocking(INTERFACE_DDF_CLIENT); 412 411 413 412 ipc_call_t answer; … … 474 473 int devman_fun_online(devman_handle_t funh) 475 474 { 476 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);475 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 477 476 if (exch == NULL) 478 477 return ENOMEM; … … 486 485 int devman_fun_offline(devman_handle_t funh) 487 486 { 488 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);487 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 489 488 if (exch == NULL) 490 489 return ENOMEM; … … 499 498 devman_handle_t *handle_buf, size_t buf_size, size_t *act_size) 500 499 { 501 async_exch_t *exch = devman_exchange_begin_blocking( DEVMAN_CLIENT);500 async_exch_t *exch = devman_exchange_begin_blocking(INTERFACE_DDF_CLIENT); 502 501 503 502 ipc_call_t answer; … … 578 577 int devman_fun_get_child(devman_handle_t funh, devman_handle_t *devh) 579 578 { 580 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);579 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 581 580 if (exch == NULL) 582 581 return ENOMEM; … … 598 597 int devman_dev_get_parent(devman_handle_t devh, devman_handle_t *funh) 599 598 { 600 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);599 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 601 600 if (exch == NULL) 602 601 return ENOMEM; … … 611 610 int devman_fun_sid_to_handle(service_id_t sid, devman_handle_t *handle) 612 611 { 613 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);612 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 614 613 if (exch == NULL) 615 614 return ENOMEM; … … 639 638 async_exch_t *exch; 640 639 641 exch = devman_exchange_begin( DEVMAN_CLIENT);640 exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 642 641 if (exch == NULL) 643 642 return ENOMEM; … … 694 693 { 695 694 sysarg_t state; 696 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);695 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 697 696 if (exch == NULL) 698 697 return ENOMEM; … … 711 710 int devman_driver_load(devman_handle_t drvh) 712 711 { 713 async_exch_t *exch = devman_exchange_begin( DEVMAN_CLIENT);712 async_exch_t *exch = devman_exchange_begin(INTERFACE_DDF_CLIENT); 714 713 if (exch == NULL) 715 714 return ENOMEM;
Note:
See TracChangeset
for help on using the changeset viewer.