Changeset 0a428943 in mainline


Ignore:
Timestamp:
2013-09-11T17:35:48Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26bc0fd1
Parents:
6dbc500
Message:

PIO_WINDOW_DEV_IFACE support for isa.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/isa/isa.c

    r6dbc500 r0a428943  
    6767
    6868#include <device/hw_res.h>
     69#include <device/pio_window.h>
    6970
    7071#include "i8237.h"
     
    7980        ddf_dev_t *dev;
    8081        ddf_fun_t *fctl;
     82        pio_window_t pio_win;
    8183        list_t functions;
    8284} isa_bus_t;
     
    405407        hw_resource_t *resources = fun->hw_resources.resources;
    406408
     409        isa_bus_t *isa = isa_bus(ddf_fun_get_dev(fun->fnode));
     410
    407411        if (count < ISA_MAX_HW_RES) {
    408412                resources[count].type = IO_RANGE;
    409413                resources[count].res.io_range.address = addr;
     414                resources[count].res.io_range.address += isa->pio_win.io.base;
    410415                resources[count].res.io_range.size = len;
    411416                resources[count].res.io_range.endianness = LITTLE_ENDIAN;
     
    604609static int isa_dev_add(ddf_dev_t *dev)
    605610{
     611        async_sess_t *sess;
     612        int rc;
     613
    606614        ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d",
    607615            (int) ddf_dev_get_handle(dev));
     
    614622        isa->dev = dev;
    615623        list_initialize(&isa->functions);
     624
     625        sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE);
     626        if (sess == NULL) {
     627                ddf_msg(LVL_ERROR, "isa_dev_add failed to connect to the "
     628                    "parent driver.");
     629                return ENOENT;
     630        }
     631
     632        rc = pio_window_get(sess, &isa->pio_win);
     633        if (rc != EOK) {
     634                ddf_msg(LVL_ERROR, "isa_dev_add failed to get PIO window "
     635                    "for the device.");
     636                return rc;
     637        }       
    616638
    617639        /* Make the bus device more visible. Does not do anything. */
Note: See TracChangeset for help on using the changeset viewer.