Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r9b415c9 rdf147c7  
    3434#include <fcntl.h>
    3535#include <sys/stat.h>
    36 #include <io/log.h>
    3736#include <ipc/driver.h>
    3837#include <ipc/devman.h>
     
    147146        fibril_mutex_unlock(&drivers_list->drivers_mutex);
    148147
    149         log_msg(LVL_NOTE, "Driver `%s' was added to the list of available "
     148        printf(NAME": the '%s' driver was added to the list of available "
    150149            "drivers.\n", drv->name);
    151150}
     
    238237bool read_match_ids(const char *conf_path, match_id_list_t *ids)
    239238{
    240         log_msg(LVL_DEBUG, "read_match_ids(conf_path=\"%s\")\n", conf_path);
     239        printf(NAME ": read_match_ids conf_path = %s.\n", conf_path);
    241240       
    242241        bool suc = false;
     
    248247        fd = open(conf_path, O_RDONLY);
    249248        if (fd < 0) {
    250                 log_msg(LVL_ERROR, "Unable to open `%s' for reading: %s.\n",
    251                     conf_path, str_error(fd));
     249                printf(NAME ": unable to open %s\n", conf_path);
    252250                goto cleanup;
    253251        }
     
    257255        lseek(fd, 0, SEEK_SET);
    258256        if (len == 0) {
    259                 log_msg(LVL_ERROR, "Configuration file '%s' is empty.\n",
    260                     conf_path);
     257                printf(NAME ": configuration file '%s' is empty.\n", conf_path);
    261258                goto cleanup;
    262259        }
     
    264261        buf = malloc(len + 1);
    265262        if (buf == NULL) {
    266                 log_msg(LVL_ERROR, "Memory allocation failed when parsing file "
     263                printf(NAME ": memory allocation failed when parsing file "
    267264                    "'%s'.\n", conf_path);
    268265                goto cleanup;
     
    271268        ssize_t read_bytes = safe_read(fd, buf, len);
    272269        if (read_bytes <= 0) {
    273                 log_msg(LVL_ERROR, "Unable to read file '%s'.\n", conf_path);
     270                printf(NAME ": unable to read file '%s'.\n", conf_path);
    274271                goto cleanup;
    275272        }
     
    309306bool get_driver_info(const char *base_path, const char *name, driver_t *drv)
    310307{
    311         log_msg(LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")\n",
     308        printf(NAME ": get_driver_info base_path = %s, name = %s.\n",
    312309            base_path, name);
    313310       
     
    341338        struct stat s;
    342339        if (stat(drv->binary_path, &s) == ENOENT) { /* FIXME!! */
    343                 log_msg(LVL_ERROR, "Driver not found at path `%s'.",
    344                     drv->binary_path);
     340                printf(NAME ": driver not found at path %s.", drv->binary_path);
    345341                goto cleanup;
    346342        }
     
    369365int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path)
    370366{
    371         log_msg(LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")\n", dir_path);
     367        printf(NAME ": lookup_available_drivers, dir = %s \n", dir_path);
    372368       
    373369        int drv_cnt = 0;
     
    403399        dev_node_t *dev;
    404400       
    405         log_msg(LVL_DEBUG, "create_root_nodes()\n");
     401        printf(NAME ": create_root_nodes\n");
    406402       
    407403        fibril_rwlock_write_lock(&tree->rwlock);
     
    488484void attach_driver(dev_node_t *dev, driver_t *drv)
    489485{
    490         log_msg(LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")\n",
    491             dev->pfun->pathname, drv->name);
     486        printf(NAME ": attach_driver %s to device %s\n",
     487            drv->name, dev->pfun->pathname);
    492488       
    493489        fibril_mutex_lock(&drv->driver_mutex);
     
    511507        assert(fibril_mutex_is_locked(&drv->driver_mutex));
    512508       
    513         log_msg(LVL_DEBUG, "start_driver(drv=\"%s\")\n", drv->name);
     509        printf(NAME ": start_driver '%s'\n", drv->name);
    514510       
    515511        rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL);
    516512        if (rc != EOK) {
    517                 log_msg(LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.\n",
    518                     drv->name, drv->binary_path, str_error(rc));
     513                printf(NAME ": error spawning %s (%s)\n",
     514                    drv->name, str_error(rc));
    519515                return false;
    520516        }
     
    578574        int phone;
    579575
    580         log_msg(LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")\n",
    581             driver->name);
     576        printf(NAME ": pass_devices_to_driver(`%s')\n", driver->name);
    582577
    583578        fibril_mutex_lock(&driver->driver_mutex);
     
    646641         * immediately and possibly started here as well.
    647642         */
    648         log_msg(LVL_DEBUG, "Driver `%s' enters running state.\n", driver->name);
     643        printf(NAME ": driver %s goes into running state.\n", driver->name);
    649644        driver->state = DRIVER_RUNNING;
    650645
     
    663658void initialize_running_driver(driver_t *driver, dev_tree_t *tree)
    664659{
    665         log_msg(LVL_DEBUG, "initialize_running_driver(driver=\"%s\")\n",
    666             driver->name);
     660        printf(NAME ": initialize_running_driver (`%s')\n", driver->name);
    667661       
    668662        /*
     
    754748         * access any structures that would affect driver_t.
    755749         */
    756         log_msg(LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")\n",
    757             drv->name, dev->pfun->name);
     750        printf(NAME ": add_device (driver `%s', device `%s')\n", drv->name,
     751            dev->pfun->name);
    758752       
    759753        sysarg_t rc;
     
    816810        driver_t *drv = find_best_match_driver(drivers_list, dev);
    817811        if (drv == NULL) {
    818                 log_msg(LVL_ERROR, "No driver found for device `%s'.\n",
     812                printf(NAME ": no driver found for device '%s'.\n",
    819813                    dev->pfun->pathname);
    820814                return false;
     
    854848bool init_device_tree(dev_tree_t *tree, driver_list_t *drivers_list)
    855849{
    856         log_msg(LVL_DEBUG, "init_device_tree()\n");
     850        printf(NAME ": init_device_tree.\n");
    857851       
    858852        tree->current_handle = 0;
     
    10331027        fun->pathname = (char *) malloc(pathsize);
    10341028        if (fun->pathname == NULL) {
    1035                 log_msg(LVL_ERROR, "Failed to allocate device path.\n");
     1029                printf(NAME ": failed to allocate device path.\n");
    10361030                return false;
    10371031        }
     
    10641058        assert(fibril_rwlock_is_write_locked(&tree->rwlock));
    10651059       
    1066         log_msg(LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])\n",
    1067             dev, pfun, pfun->pathname);
    1068 
    10691060        /* Add the node to the handle-to-node map. */
    10701061        dev->handle = ++tree->current_handle;
     
    10731064
    10741065        /* Add the node to the list of its parent's children. */
     1066        printf("insert_dev_node: dev=%p, dev->pfun := %p\n", dev, pfun);
    10751067        dev->pfun = pfun;
    10761068        pfun->child = dev;
Note: See TracChangeset for help on using the changeset viewer.