Changeset df747b9c in mainline for uspace/srv/devman
- Timestamp:
- 2010-04-23T11:30:25Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5af21c5
- Parents:
- a78fa2a
- Location:
- uspace/srv/devman
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
ra78fa2a rdf747b9c 519 519 async_wait_for(req, &rc); 520 520 switch(rc) { 521 // TODO inspect return value to find out whether the device was successfully probed and added522 521 case EOK: 522 node->state = DEVICE_USABLE; 523 break; 523 524 case ENOENT: 524 525 node->state = DEVICE_NOT_PRESENT; 525 526 break; 526 527 default: 528 node->state = DEVICE_INVALID; 527 529 } 528 530 -
uspace/srv/devman/devman.h
ra78fa2a rdf747b9c 93 93 } driver_list_t; 94 94 95 /** The state of the device. */ 96 typedef enum { 97 DEVICE_NOT_INITIALIZED = 0, 98 DEVICE_USABLE, 99 DEVICE_NOT_PRESENT, 100 DEVICE_INVALID 101 } device_state_t; 102 95 103 /** Representation of a node in the device tree.*/ 96 104 struct node { … … 113 121 /** Driver of this device.*/ 114 122 driver_t *drv; 123 /** The state of the device. */ 124 device_state_t state; 115 125 /** Pointer to the previous and next device in the list of devices 116 126 owned by one driver */ -
uspace/srv/devman/main.c
ra78fa2a rdf747b9c 309 309 driver = dev->parent->drv; 310 310 } 311 } else {311 } else if (DEVICE_USABLE == dev->state) { 312 312 driver = dev->drv; 313 assert(NULL != driver); 313 314 } 314 315 315 316 if (NULL == driver) { 316 printf(NAME ": devman_forward error - no driver to connect to.\n", handle);317 printf(NAME ": devman_forward error - the device is not in usable state.\n", handle); 317 318 ipc_answer_0(iid, ENOENT); 318 319 return; … … 331 332 return; 332 333 } 333 printf(NAME ": devman_forward: forward connection to device %s to driver %s with phone %d.\n", 334 dev->pathname, driver->name, driver->phone); 334 printf(NAME ": devman_forward: forward connection to device %s to driver %s.\n", dev->pathname, driver->name); 335 335 ipc_forward_fast(iid, driver->phone, method, dev->handle, 0, IPC_FF_NONE); 336 336 }
Note:
See TracChangeset
for help on using the changeset viewer.
