Changeset 54a0070 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2012-09-10T09:54:09Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40b5421
- Parents:
- 1dbd189 (diff), 42bde6a (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/srv/devman/devman.c
r1dbd189 r54a0070 151 151 fibril_mutex_unlock(&drivers_list->drivers_mutex); 152 152 153 log_msg(L VL_NOTE, "Driver `%s' was added to the list of available "153 log_msg(LOG_DEFAULT, LVL_NOTE, "Driver `%s' was added to the list of available " 154 154 "drivers.", drv->name); 155 155 } … … 242 242 bool read_match_ids(const char *conf_path, match_id_list_t *ids) 243 243 { 244 log_msg(L VL_DEBUG, "read_match_ids(conf_path=\"%s\")", conf_path);244 log_msg(LOG_DEFAULT, LVL_DEBUG, "read_match_ids(conf_path=\"%s\")", conf_path); 245 245 246 246 bool suc = false; … … 252 252 fd = open(conf_path, O_RDONLY); 253 253 if (fd < 0) { 254 log_msg(L VL_ERROR, "Unable to open `%s' for reading: %s.",254 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.", 255 255 conf_path, str_error(fd)); 256 256 goto cleanup; … … 261 261 lseek(fd, 0, SEEK_SET); 262 262 if (len == 0) { 263 log_msg(L VL_ERROR, "Configuration file '%s' is empty.",263 log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.", 264 264 conf_path); 265 265 goto cleanup; … … 268 268 buf = malloc(len + 1); 269 269 if (buf == NULL) { 270 log_msg(L VL_ERROR, "Memory allocation failed when parsing file "270 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed when parsing file " 271 271 "'%s'.", conf_path); 272 272 goto cleanup; … … 275 275 ssize_t read_bytes = read_all(fd, buf, len); 276 276 if (read_bytes <= 0) { 277 log_msg(L VL_ERROR, "Unable to read file '%s' (%zd).", conf_path,277 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%zd).", conf_path, 278 278 read_bytes); 279 279 goto cleanup; … … 314 314 bool get_driver_info(const char *base_path, const char *name, driver_t *drv) 315 315 { 316 log_msg(L VL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")",316 log_msg(LOG_DEFAULT, LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")", 317 317 base_path, name); 318 318 … … 346 346 struct stat s; 347 347 if (stat(drv->binary_path, &s) == ENOENT) { /* FIXME!! */ 348 log_msg(L VL_ERROR, "Driver not found at path `%s'.",348 log_msg(LOG_DEFAULT, LVL_ERROR, "Driver not found at path `%s'.", 349 349 drv->binary_path); 350 350 goto cleanup; … … 374 374 int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path) 375 375 { 376 log_msg(L VL_DEBUG, "lookup_available_drivers(dir=\"%s\")", dir_path);376 log_msg(LOG_DEFAULT, LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")", dir_path); 377 377 378 378 int drv_cnt = 0; … … 408 408 dev_node_t *dev; 409 409 410 log_msg(L VL_DEBUG, "create_root_nodes()");410 log_msg(LOG_DEFAULT, LVL_DEBUG, "create_root_nodes()"); 411 411 412 412 fibril_rwlock_write_lock(&tree->rwlock); … … 495 495 void attach_driver(dev_tree_t *tree, dev_node_t *dev, driver_t *drv) 496 496 { 497 log_msg(L VL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")",497 log_msg(LOG_DEFAULT, LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")", 498 498 dev->pfun->pathname, drv->name); 499 499 … … 520 520 assert(drv != NULL); 521 521 522 log_msg(L VL_DEBUG, "detach_driver(dev=\"%s\",drv=\"%s\")",522 log_msg(LOG_DEFAULT, LVL_DEBUG, "detach_driver(dev=\"%s\",drv=\"%s\")", 523 523 dev->pfun->pathname, drv->name); 524 524 … … 545 545 assert(fibril_mutex_is_locked(&drv->driver_mutex)); 546 546 547 log_msg(L VL_DEBUG, "start_driver(drv=\"%s\")", drv->name);547 log_msg(LOG_DEFAULT, LVL_DEBUG, "start_driver(drv=\"%s\")", drv->name); 548 548 549 549 rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL); 550 550 if (rc != EOK) { 551 log_msg(L VL_ERROR, "Spawning driver `%s' (%s) failed: %s.",551 log_msg(LOG_DEFAULT, LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.", 552 552 drv->name, drv->binary_path, str_error(rc)); 553 553 return false; … … 594 594 link_t *link; 595 595 596 log_msg(L VL_DEBUG, "pass_devices_to_driver(driver=\"%s\")",596 log_msg(LOG_DEFAULT, LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")", 597 597 driver->name); 598 598 … … 614 614 } 615 615 616 log_msg(L VL_DEBUG, "pass_devices_to_driver: dev->refcnt=%d\n",616 log_msg(LOG_DEFAULT, LVL_DEBUG, "pass_devices_to_driver: dev->refcnt=%d\n", 617 617 (int)atomic_get(&dev->refcnt)); 618 618 dev_add_ref(dev); … … 650 650 * immediately and possibly started here as well. 651 651 */ 652 log_msg(L VL_DEBUG, "Driver `%s' enters running state.", driver->name);652 log_msg(LOG_DEFAULT, LVL_DEBUG, "Driver `%s' enters running state.", driver->name); 653 653 driver->state = DRIVER_RUNNING; 654 654 … … 667 667 void initialize_running_driver(driver_t *driver, dev_tree_t *tree) 668 668 { 669 log_msg(L VL_DEBUG, "initialize_running_driver(driver=\"%s\")",669 log_msg(LOG_DEFAULT, LVL_DEBUG, "initialize_running_driver(driver=\"%s\")", 670 670 driver->name); 671 671 … … 761 761 * access any structures that would affect driver_t. 762 762 */ 763 log_msg(L VL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")",763 log_msg(LOG_DEFAULT, LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")", 764 764 drv->name, dev->pfun->name); 765 765 … … 827 827 driver_t *drv = find_best_match_driver(drivers_list, dev); 828 828 if (drv == NULL) { 829 log_msg(L VL_ERROR, "No driver found for device `%s'.",829 log_msg(LOG_DEFAULT, LVL_ERROR, "No driver found for device `%s'.", 830 830 dev->pfun->pathname); 831 831 return false; … … 867 867 assert(dev != NULL); 868 868 869 log_msg(L VL_DEBUG, "driver_dev_remove(%p)", dev);869 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_dev_remove(%p)", dev); 870 870 871 871 fibril_rwlock_read_lock(&tree->rwlock); … … 890 890 assert(dev != NULL); 891 891 892 log_msg(L VL_DEBUG, "driver_dev_gone(%p)", dev);892 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_dev_gone(%p)", dev); 893 893 894 894 fibril_rwlock_read_lock(&tree->rwlock); … … 911 911 devman_handle_t handle; 912 912 913 log_msg(L VL_DEBUG, "driver_fun_online(%p)", fun);913 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_fun_online(%p)", fun); 914 914 915 915 fibril_rwlock_read_lock(&tree->rwlock); … … 939 939 devman_handle_t handle; 940 940 941 log_msg(L VL_DEBUG, "driver_fun_offline(%p)", fun);941 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_fun_offline(%p)", fun); 942 942 943 943 fibril_rwlock_read_lock(&tree->rwlock); … … 970 970 bool init_device_tree(dev_tree_t *tree, driver_list_t *drivers_list) 971 971 { 972 log_msg(L VL_DEBUG, "init_device_tree()");972 log_msg(LOG_DEFAULT, LVL_DEBUG, "init_device_tree()"); 973 973 974 974 tree->current_handle = 0; … … 1261 1261 fun->pathname = (char *) malloc(pathsize); 1262 1262 if (fun->pathname == NULL) { 1263 log_msg(L VL_ERROR, "Failed to allocate device path.");1263 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to allocate device path."); 1264 1264 return false; 1265 1265 } … … 1289 1289 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 1290 1290 1291 log_msg(L VL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])",1291 log_msg(LOG_DEFAULT, LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])", 1292 1292 dev, pfun, pfun->pathname); 1293 1293 … … 1313 1313 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 1314 1314 1315 log_msg(L VL_DEBUG, "remove_dev_node(dev=%p)", dev);1315 log_msg(LOG_DEFAULT, LVL_DEBUG, "remove_dev_node(dev=%p)", dev); 1316 1316 1317 1317 /* Remove node from the handle-to-node map. */
Note:
See TracChangeset
for help on using the changeset viewer.