Changeset 40dc422 in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2010-12-18T11:07:32Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
557c7d0, 78ffb70
Parents:
bbc74af7 (diff), 6e50466 (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.
Message:

Merge from lp:~vojtech-horky/helenos/ddf-fixes.

File:
1 edited

Legend:

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

    rbbc74af7 r40dc422  
    6262}
    6363
     64static int devmap_devices_class_compare(unsigned long key[], hash_count_t keys,
     65    link_t *item)
     66{
     67        dev_class_info_t *class_info
     68            = hash_table_get_instance(item, dev_class_info_t, devmap_link);
     69        assert(class_info != NULL);
     70
     71        return (class_info->devmap_handle == (devmap_handle_t) key[0]);
     72}
     73
    6474static void devices_remove_callback(link_t *item)
    6575{
     
    7585        .hash = devices_hash,
    7686        .compare = devmap_devices_compare,
     87        .remove_callback = devices_remove_callback
     88};
     89
     90static hash_table_operations_t devmap_devices_class_ops = {
     91        .hash = devices_hash,
     92        .compare = devmap_devices_class_compare,
    7793        .remove_callback = devices_remove_callback
    7894};
     
    670686        }
    671687       
    672         devmap_device_register(devmap_pathname, &node->devmap_handle);
     688        devmap_device_register_with_iface(devmap_pathname,
     689            &node->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP);
    673690       
    674691        tree_add_devmap_device(tree, node);
     
    10421059       
    10431060        info = (dev_class_info_t *) malloc(sizeof(dev_class_info_t));
    1044         if (info != NULL)
     1061        if (info != NULL) {
    10451062                memset(info, 0, sizeof(dev_class_info_t));
     1063                list_initialize(&info->dev_classes);
     1064                list_initialize(&info->devmap_link);
     1065                list_initialize(&info->link);
     1066        }
    10461067       
    10471068        return info;
     
    11671188        fibril_rwlock_initialize(&class_list->rwlock);
    11681189        hash_table_create(&class_list->devmap_devices, DEVICE_BUCKETS, 1,
    1169             &devmap_devices_ops);
     1190            &devmap_devices_class_ops);
    11701191}
    11711192
     
    12151236        hash_table_insert(&class_list->devmap_devices, &key, &cli->devmap_link);
    12161237        fibril_rwlock_write_unlock(&class_list->rwlock);
     1238
     1239        assert(find_devmap_class_device(class_list, cli->devmap_handle) != NULL);
    12171240}
    12181241
Note: See TracChangeset for help on using the changeset viewer.