Changeset 33c2952 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2012-11-07T21:00:02Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dcb0751
- Parents:
- fc89e32 (diff), 94795812 (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
-
uspace/srv/devman/devman.c (modified) (30 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
rfc89e32 r33c2952 122 122 .key_hash = handle_key_hash, 123 123 .key_equal = devman_devices_key_equal, 124 .equal = 0,125 .remove_callback = 0124 .equal = NULL, 125 .remove_callback = NULL 126 126 }; 127 127 … … 130 130 .key_hash = handle_key_hash, 131 131 .key_equal = devman_functions_key_equal, 132 .equal = 0,133 .remove_callback = 0132 .equal = NULL, 133 .remove_callback = NULL 134 134 }; 135 135 … … 138 138 .key_hash = service_id_key_hash, 139 139 .key_equal = loc_functions_key_equal, 140 .equal = 0,141 .remove_callback = 0140 .equal = NULL, 141 .remove_callback = NULL 142 142 }; 143 143 … … 179 179 fibril_mutex_unlock(&drivers_list->drivers_mutex); 180 180 181 log_msg(L VL_NOTE, "Driver `%s' was added to the list of available "181 log_msg(LOG_DEFAULT, LVL_NOTE, "Driver `%s' was added to the list of available " 182 182 "drivers.", drv->name); 183 183 } … … 270 270 bool read_match_ids(const char *conf_path, match_id_list_t *ids) 271 271 { 272 log_msg(L VL_DEBUG, "read_match_ids(conf_path=\"%s\")", conf_path);272 log_msg(LOG_DEFAULT, LVL_DEBUG, "read_match_ids(conf_path=\"%s\")", conf_path); 273 273 274 274 bool suc = false; … … 280 280 fd = open(conf_path, O_RDONLY); 281 281 if (fd < 0) { 282 log_msg(L VL_ERROR, "Unable to open `%s' for reading: %s.",282 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.", 283 283 conf_path, str_error(fd)); 284 284 goto cleanup; … … 289 289 lseek(fd, 0, SEEK_SET); 290 290 if (len == 0) { 291 log_msg(L VL_ERROR, "Configuration file '%s' is empty.",291 log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.", 292 292 conf_path); 293 293 goto cleanup; … … 296 296 buf = malloc(len + 1); 297 297 if (buf == NULL) { 298 log_msg(L VL_ERROR, "Memory allocation failed when parsing file "298 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed when parsing file " 299 299 "'%s'.", conf_path); 300 300 goto cleanup; … … 303 303 ssize_t read_bytes = read_all(fd, buf, len); 304 304 if (read_bytes <= 0) { 305 log_msg(L VL_ERROR, "Unable to read file '%s' (%zd).", conf_path,305 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%zd).", conf_path, 306 306 read_bytes); 307 307 goto cleanup; … … 342 342 bool get_driver_info(const char *base_path, const char *name, driver_t *drv) 343 343 { 344 log_msg(L VL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")",344 log_msg(LOG_DEFAULT, LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")", 345 345 base_path, name); 346 346 … … 374 374 struct stat s; 375 375 if (stat(drv->binary_path, &s) == ENOENT) { /* FIXME!! */ 376 log_msg(L VL_ERROR, "Driver not found at path `%s'.",376 log_msg(LOG_DEFAULT, LVL_ERROR, "Driver not found at path `%s'.", 377 377 drv->binary_path); 378 378 goto cleanup; … … 402 402 int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path) 403 403 { 404 log_msg(L VL_DEBUG, "lookup_available_drivers(dir=\"%s\")", dir_path);404 log_msg(LOG_DEFAULT, LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")", dir_path); 405 405 406 406 int drv_cnt = 0; … … 436 436 dev_node_t *dev; 437 437 438 log_msg(L VL_DEBUG, "create_root_nodes()");438 log_msg(LOG_DEFAULT, LVL_DEBUG, "create_root_nodes()"); 439 439 440 440 fibril_rwlock_write_lock(&tree->rwlock); … … 523 523 void attach_driver(dev_tree_t *tree, dev_node_t *dev, driver_t *drv) 524 524 { 525 log_msg(L VL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")",525 log_msg(LOG_DEFAULT, LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")", 526 526 dev->pfun->pathname, drv->name); 527 527 … … 548 548 assert(drv != NULL); 549 549 550 log_msg(L VL_DEBUG, "detach_driver(dev=\"%s\",drv=\"%s\")",550 log_msg(LOG_DEFAULT, LVL_DEBUG, "detach_driver(dev=\"%s\",drv=\"%s\")", 551 551 dev->pfun->pathname, drv->name); 552 552 … … 573 573 assert(fibril_mutex_is_locked(&drv->driver_mutex)); 574 574 575 log_msg(L VL_DEBUG, "start_driver(drv=\"%s\")", drv->name);575 log_msg(LOG_DEFAULT, LVL_DEBUG, "start_driver(drv=\"%s\")", drv->name); 576 576 577 577 rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL); 578 578 if (rc != EOK) { 579 log_msg(L VL_ERROR, "Spawning driver `%s' (%s) failed: %s.",579 log_msg(LOG_DEFAULT, LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.", 580 580 drv->name, drv->binary_path, str_error(rc)); 581 581 return false; … … 622 622 link_t *link; 623 623 624 log_msg(L VL_DEBUG, "pass_devices_to_driver(driver=\"%s\")",624 log_msg(LOG_DEFAULT, LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")", 625 625 driver->name); 626 626 … … 642 642 } 643 643 644 log_msg(L VL_DEBUG, "pass_devices_to_driver: dev->refcnt=%d\n",644 log_msg(LOG_DEFAULT, LVL_DEBUG, "pass_devices_to_driver: dev->refcnt=%d\n", 645 645 (int)atomic_get(&dev->refcnt)); 646 646 dev_add_ref(dev); … … 678 678 * immediately and possibly started here as well. 679 679 */ 680 log_msg(L VL_DEBUG, "Driver `%s' enters running state.", driver->name);680 log_msg(LOG_DEFAULT, LVL_DEBUG, "Driver `%s' enters running state.", driver->name); 681 681 driver->state = DRIVER_RUNNING; 682 682 … … 695 695 void initialize_running_driver(driver_t *driver, dev_tree_t *tree) 696 696 { 697 log_msg(L VL_DEBUG, "initialize_running_driver(driver=\"%s\")",697 log_msg(LOG_DEFAULT, LVL_DEBUG, "initialize_running_driver(driver=\"%s\")", 698 698 driver->name); 699 699 … … 789 789 * access any structures that would affect driver_t. 790 790 */ 791 log_msg(L VL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")",791 log_msg(LOG_DEFAULT, LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")", 792 792 drv->name, dev->pfun->name); 793 793 … … 855 855 driver_t *drv = find_best_match_driver(drivers_list, dev); 856 856 if (drv == NULL) { 857 log_msg(L VL_ERROR, "No driver found for device `%s'.",857 log_msg(LOG_DEFAULT, LVL_ERROR, "No driver found for device `%s'.", 858 858 dev->pfun->pathname); 859 859 return false; … … 895 895 assert(dev != NULL); 896 896 897 log_msg(L VL_DEBUG, "driver_dev_remove(%p)", dev);897 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_dev_remove(%p)", dev); 898 898 899 899 fibril_rwlock_read_lock(&tree->rwlock); … … 918 918 assert(dev != NULL); 919 919 920 log_msg(L VL_DEBUG, "driver_dev_gone(%p)", dev);920 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_dev_gone(%p)", dev); 921 921 922 922 fibril_rwlock_read_lock(&tree->rwlock); … … 939 939 devman_handle_t handle; 940 940 941 log_msg(L VL_DEBUG, "driver_fun_online(%p)", fun);941 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_fun_online(%p)", fun); 942 942 943 943 fibril_rwlock_read_lock(&tree->rwlock); … … 967 967 devman_handle_t handle; 968 968 969 log_msg(L VL_DEBUG, "driver_fun_offline(%p)", fun);969 log_msg(LOG_DEFAULT, LVL_DEBUG, "driver_fun_offline(%p)", fun); 970 970 971 971 fibril_rwlock_read_lock(&tree->rwlock); … … 998 998 bool init_device_tree(dev_tree_t *tree, driver_list_t *drivers_list) 999 999 { 1000 log_msg(L VL_DEBUG, "init_device_tree()");1000 log_msg(LOG_DEFAULT, LVL_DEBUG, "init_device_tree()"); 1001 1001 1002 1002 tree->current_handle = 0; … … 1278 1278 fun->pathname = (char *) malloc(pathsize); 1279 1279 if (fun->pathname == NULL) { 1280 log_msg(L VL_ERROR, "Failed to allocate device path.");1280 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to allocate device path."); 1281 1281 return false; 1282 1282 } … … 1306 1306 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 1307 1307 1308 log_msg(L VL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])",1308 log_msg(LOG_DEFAULT, LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])", 1309 1309 dev, pfun, pfun->pathname); 1310 1310 … … 1329 1329 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 1330 1330 1331 log_msg(L VL_DEBUG, "remove_dev_node(dev=%p)", dev);1331 log_msg(LOG_DEFAULT, LVL_DEBUG, "remove_dev_node(dev=%p)", dev); 1332 1332 1333 1333 /* Remove node from the handle-to-node map. */
Note:
See TracChangeset
for help on using the changeset viewer.
