Changeset 903bac0a in mainline for uspace/lib/c/generic/devman.c
- Timestamp:
- 2011-08-19T09:00:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e2ab36f1
- Parents:
- d894fbd (diff), 42a619b (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/lib/c/generic/devman.c
rd894fbd r903bac0a 271 271 } 272 272 273 int devman_add_device_to_c lass(devman_handle_t devman_handle,274 const char *c lass_name)273 int devman_add_device_to_category(devman_handle_t devman_handle, 274 const char *cat_name) 275 275 { 276 276 async_exch_t *exch = devman_exchange_begin_blocking(DEVMAN_DRIVER); 277 277 278 278 ipc_call_t answer; 279 aid_t req = async_send_1(exch, DEVMAN_ADD_DEVICE_TO_C LASS,279 aid_t req = async_send_1(exch, DEVMAN_ADD_DEVICE_TO_CATEGORY, 280 280 devman_handle, &answer); 281 sysarg_t retval = async_data_write_start(exch, c lass_name,282 str_size(c lass_name));281 sysarg_t retval = async_data_write_start(exch, cat_name, 282 str_size(cat_name)); 283 283 284 284 devman_exchange_end(exch); … … 308 308 } 309 309 310 /** Remove function from device. 311 * 312 * Request devman to remove function owned by this driver task. 313 * @param funh Devman handle of the function 314 * 315 * @return EOK on success or negative error code. 316 */ 317 int devman_remove_function(devman_handle_t funh) 318 { 319 async_exch_t *exch; 320 sysarg_t retval; 321 322 exch = devman_exchange_begin_blocking(DEVMAN_DRIVER); 323 retval = async_req_1_0(exch, DEVMAN_REMOVE_FUNCTION, (sysarg_t) funh); 324 devman_exchange_end(exch); 325 326 return (int) retval; 327 } 328 310 329 async_sess_t *devman_parent_device_connect(exch_mgmt_t mgmt, 311 330 devman_handle_t handle, unsigned int flags) … … 333 352 exch = devman_exchange_begin(DEVMAN_CLIENT); 334 353 if (exch == NULL) 335 return errno;354 return ENOMEM; 336 355 } 337 356 … … 364 383 } 365 384 366 int devman_device_get_handle_by_class(const char *classname,367 const char *devname, devman_handle_t *handle, unsigned int flags)368 {369 async_exch_t *exch;370 371 if (flags & IPC_FLAG_BLOCKING)372 exch = devman_exchange_begin_blocking(DEVMAN_CLIENT);373 else {374 exch = devman_exchange_begin(DEVMAN_CLIENT);375 if (exch == NULL)376 return errno;377 }378 379 ipc_call_t answer;380 aid_t req = async_send_1(exch, DEVMAN_DEVICE_GET_HANDLE_BY_CLASS,381 flags, &answer);382 sysarg_t retval = async_data_write_start(exch, classname,383 str_size(classname));384 385 if (retval != EOK) {386 devman_exchange_end(exch);387 async_wait_for(req, NULL);388 return retval;389 }390 391 retval = async_data_write_start(exch, devname,392 str_size(devname));393 394 devman_exchange_end(exch);395 396 if (retval != EOK) {397 async_wait_for(req, NULL);398 return retval;399 }400 401 async_wait_for(req, &retval);402 403 if (retval != EOK) {404 if (handle != NULL)405 *handle = (devman_handle_t) -1;406 407 return retval;408 }409 410 if (handle != NULL)411 *handle = (devman_handle_t) IPC_GET_ARG1(answer);412 413 return retval;414 }415 416 385 int devman_get_device_path(devman_handle_t handle, char *path, size_t path_size) 417 386 { 418 387 async_exch_t *exch = devman_exchange_begin(DEVMAN_CLIENT); 419 388 if (exch == NULL) 420 return errno;389 return ENOMEM; 421 390 422 391 ipc_call_t answer; … … 463 432 } 464 433 434 int devman_fun_sid_to_handle(service_id_t sid, devman_handle_t *handle) 435 { 436 async_exch_t *exch = devman_exchange_begin(DEVMAN_CLIENT); 437 if (exch == NULL) 438 return ENOMEM; 439 440 sysarg_t retval = async_req_1_1(exch, DEVMAN_FUN_SID_TO_HANDLE, 441 sid, handle); 442 443 devman_exchange_end(exch); 444 return (int) retval; 445 } 446 465 447 /** @} 466 448 */
Note:
See TracChangeset
for help on using the changeset viewer.