Ignore:
Timestamp:
2010-04-02T13:37:58Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9a66bc2e
Parents:
57937dd
Message:

device interfaces and driver cooperation - parts of code

File:
1 edited

Legend:

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

    r57937dd r5cd136ab  
    4949#include <devman.h>
    5050#include <ipc/devman.h>
     51#include <ipc/dev_iface.h>
    5152
    5253#define NAME "rootia32"
     54
     55typedef struct rootia32_dev_data {
     56        hw_resource_list_t hw_resources;       
     57} rootia32_dev_data_t;
    5358
    5459static bool rootia32_add_device(device_t *dev);
     
    6873};
    6974
    70 // TODO HW resources
    71 static bool rootia32_add_child(device_t *parent, const char *name, const char *str_match_id) {
     75static hw_resource_t pci_conf_regs = {
     76        .type = REGISTER,
     77        .res.reg = {
     78                .address = (void *)0xCF8,
     79                .size = 8,
     80                .endianness = LITTLE_ENDIAN     
     81        }       
     82};
     83
     84static rootia32_dev_data_t pci_data = {
     85        .hw_resources = {
     86                1,
     87                &pci_conf_regs
     88        }
     89};
     90
     91static bool rootia32_add_child(
     92        device_t *parent, const char *name, const char *str_match_id,
     93        rootia32_dev_data_t *drv_data)
     94{
    7295        printf(NAME ": adding new child device '%s'.\n", name);
    7396       
     
    81104       
    82105        child->name = name;
     106        child->driver_data = drv_data;
    83107       
    84108        // initialize match id list
     
    112136}
    113137
    114 static bool rootia32_add_children(dev)
     138static bool rootia32_add_children(device_t *dev)
    115139{
    116         return rootia32_add_child(dev, "pci0", "intel_pci");
     140        return rootia32_add_child(dev, "pci0", "intel_pci", &pci_data);
    117141}
    118142
Note: See TracChangeset for help on using the changeset viewer.