Changeset 7969087 in mainline for uspace/srv/devman/client_conn.c
- Timestamp:
- 2013-09-11T10:35:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 43dd8028
- Parents:
- e5556e4a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/client_conn.c
re5556e4a r7969087 450 450 } 451 451 452 /** Find driver by name. */ 453 static void devman_driver_get_handle(ipc_callid_t iid, ipc_call_t *icall) 454 { 455 char *drvname; 456 457 int rc = async_data_write_accept((void **) &drvname, true, 0, 0, 0, 0); 458 if (rc != EOK) { 459 async_answer_0(iid, rc); 460 return; 461 } 462 463 driver_t *driver = driver_find_by_name(&drivers_list, drvname); 464 465 free(drvname); 466 467 if (driver == NULL) { 468 async_answer_0(iid, ENOENT); 469 return; 470 } 471 472 async_answer_1(iid, EOK, driver->handle); 473 } 474 452 475 /** Get driver name. */ 453 476 static void devman_driver_get_name(ipc_callid_t iid, ipc_call_t *icall) … … 502 525 503 526 async_answer_1(iid, EOK, (sysarg_t) drv->state); 527 } 528 529 /** Forcibly load a driver. */ 530 static void devman_driver_load(ipc_callid_t iid, ipc_call_t *icall) 531 { 532 driver_t *drv; 533 int rc; 534 535 drv = driver_find(&drivers_list, IPC_GET_ARG1(*icall)); 536 if (drv == NULL) { 537 async_answer_0(iid, ENOENT); 538 return; 539 } 540 541 fibril_mutex_lock(&drv->driver_mutex); 542 rc = start_driver(drv) ? EOK : EIO; 543 fibril_mutex_unlock(&drv->driver_mutex); 544 545 async_answer_0(iid, rc); 504 546 } 505 547 … … 548 590 devman_get_drivers(callid, &call); 549 591 break; 592 case DEVMAN_DRIVER_GET_HANDLE: 593 devman_driver_get_handle(callid, &call); 594 break; 550 595 case DEVMAN_DRIVER_GET_NAME: 551 596 devman_driver_get_name(callid, &call); … … 553 598 case DEVMAN_DRIVER_GET_STATE: 554 599 devman_driver_get_state(callid, &call); 600 break; 601 case DEVMAN_DRIVER_LOAD: 602 devman_driver_load(callid, &call); 555 603 break; 556 604 default:
Note:
See TracChangeset
for help on using the changeset viewer.