Changeset ebcb05a in mainline for uspace/srv/devman/main.c
- Timestamp:
- 2011-04-01T19:00:51Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 969585f, ea53529
- Parents:
- bdbb6f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/main.c
rbdbb6f6 rebcb05a 73 73 driver_t *driver = NULL; 74 74 75 log_msg(LVL_DEBUG, "devman_driver_register \n");75 log_msg(LVL_DEBUG, "devman_driver_register"); 76 76 77 77 iid = async_get_call(&icall); … … 90 90 } 91 91 92 log_msg(LVL_DEBUG, "The `%s' driver is trying to register. \n",92 log_msg(LVL_DEBUG, "The `%s' driver is trying to register.", 93 93 drv_name); 94 94 … … 97 97 98 98 if (driver == NULL) { 99 log_msg(LVL_ERROR, "No driver named `%s' was found. \n", drv_name);99 log_msg(LVL_ERROR, "No driver named `%s' was found.", drv_name); 100 100 free(drv_name); 101 101 drv_name = NULL; … … 108 108 109 109 /* Create connection to the driver. */ 110 log_msg(LVL_DEBUG, "Creating connection to the `%s' driver. \n",110 log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.", 111 111 driver->name); 112 112 ipc_call_t call; … … 122 122 123 123 log_msg(LVL_NOTE, 124 "The `%s' driver was successfully registered as running. \n",124 "The `%s' driver was successfully registered as running.", 125 125 driver->name); 126 126 … … 147 147 if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) { 148 148 log_msg(LVL_ERROR, 149 "Invalid protocol when trying to receive match id. \n");149 "Invalid protocol when trying to receive match id."); 150 150 async_answer_0(callid, EINVAL); 151 151 delete_match_id(match_id); … … 154 154 155 155 if (match_id == NULL) { 156 log_msg(LVL_ERROR, "Failed to allocate match id. \n");156 log_msg(LVL_ERROR, "Failed to allocate match id."); 157 157 async_answer_0(callid, ENOMEM); 158 158 return ENOMEM; … … 168 168 if (rc != EOK) { 169 169 delete_match_id(match_id); 170 log_msg(LVL_ERROR, "Failed to receive match id string: %s. \n",170 log_msg(LVL_ERROR, "Failed to receive match id string: %s.", 171 171 str_error(rc)); 172 172 return rc; … … 175 175 list_append(&match_id->link, &match_ids->ids); 176 176 177 log_msg(LVL_DEBUG, "Received match id `%s', score %d. \n",177 log_msg(LVL_DEBUG, "Received match id `%s', score %d.", 178 178 match_id->id, match_id->score); 179 179 return rc; … … 232 232 /* Unknown function type */ 233 233 log_msg(LVL_ERROR, 234 "Unknown function type %d provided by driver. \n",234 "Unknown function type %d provided by driver.", 235 235 (int) ftype); 236 236 … … 280 280 fibril_rwlock_write_unlock(&tree->rwlock); 281 281 282 log_msg(LVL_DEBUG, "devman_add_function(fun=\"%s\") \n", fun->pathname);282 log_msg(LVL_DEBUG, "devman_add_function(fun=\"%s\")", fun->pathname); 283 283 284 284 devman_receive_match_ids(match_count, &fun->match_ids); … … 362 362 devmap_register_class_dev(class_info); 363 363 364 log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'. \n",364 log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'.", 365 365 fun->pathname, class_name, class_info->dev_name); 366 366 … … 378 378 379 379 initialize_running_driver(driver, &device_tree); 380 log_msg(LVL_DEBUG, "The `%s` driver was successfully initialized. \n",380 log_msg(LVL_DEBUG, "The `%s` driver was successfully initialized.", 381 381 driver->name); 382 382 return 0; … … 401 401 if (fid == 0) { 402 402 log_msg(LVL_ERROR, "Failed to create initialization fibril " \ 403 "for driver `%s' .\n", driver->name);403 "for driver `%s'.", driver->name); 404 404 return; 405 405 } … … 537 537 if (dev == NULL) { 538 538 log_msg(LVL_ERROR, "IPC forwarding failed - no device or " 539 "function with handle %" PRIun " was found. \n", handle);539 "function with handle %" PRIun " was found.", handle); 540 540 async_answer_0(iid, ENOENT); 541 541 return; … … 544 544 if (fun == NULL && !drv_to_parent) { 545 545 log_msg(LVL_ERROR, NAME ": devman_forward error - cannot " 546 "connect to handle %" PRIun ", refers to a device. \n",546 "connect to handle %" PRIun ", refers to a device.", 547 547 handle); 548 548 async_answer_0(iid, ENOENT); … … 567 567 if (driver == NULL) { 568 568 log_msg(LVL_ERROR, "IPC forwarding refused - " \ 569 "the device %" PRIun " is not in usable state. \n", handle);569 "the device %" PRIun " is not in usable state.", handle); 570 570 async_answer_0(iid, ENOENT); 571 571 return; … … 580 580 if (driver->phone <= 0) { 581 581 log_msg(LVL_ERROR, 582 "Could not forward to driver `%s' (phone is %d). \n",582 "Could not forward to driver `%s' (phone is %d).", 583 583 driver->name, (int) driver->phone); 584 584 async_answer_0(iid, EINVAL); … … 588 588 if (fun != NULL) { 589 589 log_msg(LVL_DEBUG, 590 "Forwarding request for `%s' function to driver `%s'. \n",590 "Forwarding request for `%s' function to driver `%s'.", 591 591 fun->pathname, driver->name); 592 592 } else { 593 593 log_msg(LVL_DEBUG, 594 "Forwarding request for `%s' device to driver `%s'. \n",594 "Forwarding request for `%s' device to driver `%s'.", 595 595 dev->pfun->pathname, driver->name); 596 596 } … … 626 626 IPC_FF_NONE); 627 627 log_msg(LVL_DEBUG, 628 "Forwarding devmapper request for `%s' function to driver `%s'. \n",628 "Forwarding devmapper request for `%s' function to driver `%s'.", 629 629 fun->pathname, dev->drv->name); 630 630 } … … 662 662 static bool devman_init(void) 663 663 { 664 log_msg(LVL_DEBUG, "devman_init - looking for available drivers. \n");664 log_msg(LVL_DEBUG, "devman_init - looking for available drivers."); 665 665 666 666 /* Initialize list of available drivers. */ … … 668 668 if (lookup_available_drivers(&drivers_list, 669 669 DRIVER_DEFAULT_STORE) == 0) { 670 log_msg(LVL_FATAL, " no drivers found.");670 log_msg(LVL_FATAL, "No drivers found."); 671 671 return false; 672 672 } 673 673 674 log_msg(LVL_DEBUG, "devman_init - list of drivers has been initialized. \n");674 log_msg(LVL_DEBUG, "devman_init - list of drivers has been initialized."); 675 675 676 676 /* Create root device node. */ … … 703 703 704 704 if (!devman_init()) { 705 log_msg(LVL_ERROR, "Error while initializing service. \n");705 log_msg(LVL_ERROR, "Error while initializing service."); 706 706 return -1; 707 707 } … … 712 712 /* Register device manager at naming service. */ 713 713 if (service_register(SERVICE_DEVMAN) != EOK) { 714 log_msg(LVL_ERROR, "Failed registering as a service. \n");714 log_msg(LVL_ERROR, "Failed registering as a service."); 715 715 return -1; 716 716 }
Note:
See TracChangeset
for help on using the changeset viewer.