Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 08d9c4e6 in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2010-02-15T21:04:59Z (12 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master
Children:
e85920d
Parents:
e2b9a993
Message:

device manager - initialization of the list of available drivers

File:
1 edited

Legend:

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

    re2b9a993 r08d9c4e6  
    4141driver_t * create_driver()
    4242{
     43        printf(NAME ": create_driver\n");
     44       
    4345        driver_t *res = malloc(sizeof(driver_t));
    4446        if(res != NULL) {
    45                 clean_driver(res);
     47                init_driver(res);
    4648        }
    4749        return res;
     
    102104bool read_match_ids(const char *conf_path, match_id_list_t *ids)
    103105{       
     106        printf(NAME ": read_match_ids conf_path = %s.\n", conf_path);
     107       
    104108        bool suc = false;       
    105109        char *buf = NULL;
     
    150154bool get_driver_info(const char *base_path, const char *name, driver_t *drv)
    151155{
     156        printf(NAME ": get_driver_info base_path = %s, name = %s.\n", base_path, name);
     157       
    152158        assert(base_path != NULL && name != NULL && drv != NULL);
    153159       
     
    160166                goto cleanup;
    161167        }       
     168       
     169        printf(NAME ": get_driver_info - path to match id list = %s.\n", match_path);
    162170       
    163171        if (!read_match_ids(match_path, &drv->match_ids)) {
     
    208216int lookup_available_drivers(link_t *drivers_list, const char *dir_path)
    209217{
     218        printf(NAME ": lookup_available_drivers \n");
     219       
    210220        int drv_cnt = 0;
    211221        DIR *dir = NULL;
     
    213223
    214224        dir = opendir(dir_path);
     225        printf(NAME ": lookup_available_drivers has opened directory %s for driver search.\n", dir_path);
     226       
    215227        if (dir != NULL) {
    216228                driver_t *drv = create_driver();
     229                printf(NAME ": lookup_available_drivers has created driver structure.\n");
    217230                while ((diren = readdir(dir))) {                       
    218231                        if (get_driver_info(dir_path, diren->d_name, drv)) {
    219232                                add_driver(drivers_list, drv);
     233                                drv_cnt++;
    220234                                drv = create_driver();
    221235                        }       
     
    318332bool init_device_tree(dev_tree_t *tree, link_t *drivers_list)
    319333{
     334        printf(NAME ": init_device_tree.");
    320335        // create root node and add it to the device tree
    321336        if (NULL == (tree->root_node = create_root_node())) {
Note: See TracChangeset for help on using the changeset viewer.