Changeset e5556e4a in mainline for uspace/srv
- Timestamp:
- 2013-09-11T09:46:38Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7969087
- Parents:
- 4c6ade6
- Location:
- uspace/srv/devman
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/client_conn.c
r4c6ade6 re5556e4a 490 490 } 491 491 492 /** Get driver state. */ 493 static void devman_driver_get_state(ipc_callid_t iid, ipc_call_t *icall) 494 { 495 driver_t *drv; 496 497 drv = driver_find(&drivers_list, IPC_GET_ARG1(*icall)); 498 if (drv == NULL) { 499 async_answer_0(iid, ENOENT); 500 return; 501 } 502 503 async_answer_1(iid, EOK, (sysarg_t) drv->state); 504 } 505 492 506 /** Function for handling connections from a client to the device manager. */ 493 507 void devman_connection_client(ipc_callid_t iid, ipc_call_t *icall) … … 537 551 devman_driver_get_name(callid, &call); 538 552 break; 553 case DEVMAN_DRIVER_GET_STATE: 554 devman_driver_get_state(callid, &call); 555 break; 539 556 default: 540 557 async_answer_0(callid, ENOENT); -
uspace/srv/devman/devman.h
r4c6ade6 re5556e4a 62 62 } client_t; 63 63 64 typedef enum {65 /** Driver has not been started. */66 DRIVER_NOT_STARTED = 0,67 68 /**69 * Driver has been started, but has not registered as running and ready70 * to receive requests.71 */72 DRIVER_STARTING,73 74 /** Driver is running and prepared to serve incomming requests. */75 DRIVER_RUNNING76 } driver_state_t;77 78 64 /** Representation of device driver. */ 79 65 typedef struct driver { … … 87 73 * and prepared to receive requests. 88 74 */ 89 int state;75 driver_state_t state; 90 76 91 77 /** Session asociated with this driver. */ -
uspace/srv/devman/driver.c
r4c6ade6 re5556e4a 81 81 { 82 82 fibril_mutex_lock(&drivers_list->drivers_mutex); 83 list_ prepend(&drv->drivers, &drivers_list->drivers);83 list_append(&drv->drivers, &drivers_list->drivers); 84 84 drv->handle = drivers_list->next_handle++; 85 85 fibril_mutex_unlock(&drivers_list->drivers_mutex);
Note:
See TracChangeset
for help on using the changeset viewer.