Ignore:
Timestamp:
2010-04-09T13:54:06Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
892e4e1
Parents:
3a5909f
Message:

device classes as interface sets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/drivers/rootia32/rootia32.c

    r3a5909f r3843ecb  
    5151#include <ipc/dev_iface.h>
    5252#include <resource.h>
     53#include <device/hw_res.h>
    5354
    5455#define NAME "rootia32"
     
    111112};
    112113
     114// initialized in root_ia32_init() function
     115static device_class_t rootia32_child_class;
     116
    113117static bool rootia32_add_child(
    114118        device_t *parent, const char *name, const char *str_match_id,
     
    136140        add_match_id(&child->match_ids, match_id);     
    137141       
    138         // add an interface to the device
    139         device_set_iface(child, HW_RES_DEV_IFACE, &child_res_iface);
     142        // set class to the device
     143        child->class = &rootia32_child_class;
    140144       
    141145        // register child  device
     
    181185}
    182186
     187static void root_ia32_init() {
     188        // initialize child device class               
     189        rootia32_child_class.id = 0;    // TODO
     190        rootia32_child_class.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
     191}
     192
    183193int main(int argc, char *argv[])
    184194{
    185195        printf(NAME ": HelenOS root device driver\n"); 
     196        root_ia32_init();
    186197        return driver_main(&rootia32_driver);
    187198}
Note: See TracChangeset for help on using the changeset viewer.