Changes in / [5759975a:4c9b28a] in mainline


Ignore:
Location:
uspace
Files:
5 deleted
9 edited

Legend:

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

    r5759975a r4c9b28a  
    6767
    6868#include <device/hw_res.h>
    69 #include <device/pio_window.h>
    7069
    7170#include "i8237.h"
     
    8079        ddf_dev_t *dev;
    8180        ddf_fun_t *fctl;
    82         pio_window_t pio_win;
    8381        list_t functions;
    8482} isa_bus_t;
     
    407405        hw_resource_t *resources = fun->hw_resources.resources;
    408406
    409         isa_bus_t *isa = isa_bus(ddf_fun_get_dev(fun->fnode));
    410 
    411407        if (count < ISA_MAX_HW_RES) {
    412408                resources[count].type = IO_RANGE;
    413409                resources[count].res.io_range.address = addr;
    414                 resources[count].res.io_range.address += isa->pio_win.io.base;
    415410                resources[count].res.io_range.size = len;
    416411                resources[count].res.io_range.endianness = LITTLE_ENDIAN;
     
    609604static int isa_dev_add(ddf_dev_t *dev)
    610605{
    611         async_sess_t *sess;
    612         int rc;
    613 
    614606        ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d",
    615607            (int) ddf_dev_get_handle(dev));
     
    622614        isa->dev = dev;
    623615        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         }       
    638616
    639617        /* Make the bus device more visible. Does not do anything. */
  • uspace/drv/bus/pci/pciintel/pci.c

    r5759975a r4c9b28a  
    5757#include <ops/hw_res.h>
    5858#include <device/hw_res.h>
    59 #include <ops/pio_window.h>
    60 #include <device/pio_window.h>
    6159#include <ddi.h>
    6260#include <pci_dev_iface.h>
     
    143141}
    144142
    145 static pio_window_t *pciintel_get_pio_window(ddf_fun_t *fnode)
    146 {
    147         pci_fun_t *fun = pci_fun(fnode);
    148        
    149         if (fun == NULL)
    150                 return NULL;
    151         return &fun->pio_window;
    152 }
    153 
    154 
    155143static int pci_config_space_write_32(ddf_fun_t *fun, uint32_t address,
    156144    uint32_t data)
     
    210198        .get_resource_list = &pciintel_get_resources,
    211199        .enable_interrupt = &pciintel_enable_interrupt,
    212 };
    213 
    214 static pio_window_ops_t pciintel_pio_window_ops = {
    215         .get_pio_window = &pciintel_get_pio_window
    216200};
    217201
     
    227211static ddf_dev_ops_t pci_fun_ops = {
    228212        .interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops,
    229         .interfaces[PIO_WINDOW_DEV_IFACE] = &pciintel_pio_window_ops,
    230213        .interfaces[PCI_DEV_IFACE] = &pci_dev_ops
    231214};
     
    634617                        pci_read_bars(fun);
    635618                        pci_read_interrupt(fun);
    636 
    637                         /* Propagate the PIO window to the function. */
    638                         fun->pio_window = bus->pio_win;
    639619                       
    640620                        ddf_fun_set_ops(fun->fnode, &pci_fun_ops);
     
    667647static int pci_dev_add(ddf_dev_t *dnode)
    668648{
    669         hw_resource_list_t hw_resources;
    670649        pci_bus_t *bus = NULL;
    671650        ddf_fun_t *ctl = NULL;
     
    693672                goto fail;
    694673        }
    695 
    696         rc = pio_window_get(sess, &bus->pio_win);
    697         if (rc != EOK) {
    698                 ddf_msg(LVL_ERROR, "pci_dev_add failed to get PIO window "
    699                     "for the device.");
    700                 goto fail;
    701         }
     674       
     675        hw_resource_list_t hw_resources;
    702676       
    703677        rc = hw_res_get_resource_list(sess, &hw_resources);
     
    789763{
    790764        ddf_log_init(NAME);
     765        pci_fun_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops;
     766        pci_fun_ops.interfaces[PCI_DEV_IFACE] = &pci_dev_ops;
    791767}
    792768
  • uspace/drv/bus/pci/pciintel/pci.h

    r5759975a r4c9b28a  
    4040#include "pci_regs.h"
    4141
    42 #define PCI_MAX_HW_RES 10
     42#define PCI_MAX_HW_RES 8
    4343
    4444typedef struct pciintel_bus {
     
    4949        void *conf_data_port;
    5050        void *conf_addr_port;
    51         pio_window_t pio_win;
    5251        fibril_mutex_t conf_mutex;
    5352} pci_bus_t;
     
    6968        hw_resource_list_t hw_resources;
    7069        hw_resource_t resources[PCI_MAX_HW_RES];
    71         pio_window_t pio_window;
    7270} pci_fun_t;
    7371
  • uspace/drv/infrastructure/rootmalta/rootmalta.c

    r5759975a r4c9b28a  
    5353#include <ops/hw_res.h>
    5454#include <device/hw_res.h>
    55 #include <ops/pio_window.h>
    56 #include <device/pio_window.h>
    5755#include <byteorder.h>
    5856
     
    6866#define GT_PCI_CMD_MBYTESWAP    0x1
    6967
    70 #define GT_PCI_MEMBASE  UINT32_C(0x10000000)
    71 #define GT_PCI_MEMSIZE  UINT32_C(0x08000000)
    72 
    73 #define GT_PCI_IOBASE   UINT32_C(0x18000000)
    74 #define GT_PCI_IOSIZE   UINT32_C(0x00200000)
    75 
    7668typedef struct rootmalta_fun {
    7769        hw_resource_list_t hw_resources;
    78         pio_window_t pio_window;
    7970} rootmalta_fun_t;
    8071
     
    116107                sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]),
    117108                pci_conf_regs
    118         },
    119         .pio_window = {
    120                 .mem = {
    121                         .base = GT_PCI_MEMBASE,
    122                         .size = GT_PCI_MEMSIZE
    123                 },
    124                 .io = {
    125                         .base = GT_PCI_IOBASE,
    126                         .size = GT_PCI_IOSIZE
    127                 }
    128109        }
    129110};
     
    148129       
    149130        return false;
    150 }
    151 
    152 static pio_window_t *rootmalta_get_pio_window(ddf_fun_t *fnode)
    153 {
    154         rootmalta_fun_t *fun = rootmalta_fun(fnode);
    155 
    156         assert(fun != NULL);
    157         return &fun->pio_window;
    158131}
    159132
     
    161134        .get_resource_list = &rootmalta_get_resources,
    162135        .enable_interrupt = &rootmalta_enable_interrupt,
    163 };
    164 
    165 static pio_window_ops_t fun_pio_window_ops = {
    166         .get_pio_window = &rootmalta_get_pio_window
    167136};
    168137
     
    259228        ddf_log_init(NAME);
    260229        rootmalta_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
    261         rootmalta_fun_ops.interfaces[PIO_WINDOW_DEV_IFACE] = &fun_pio_window_ops;
    262230}
    263231
  • uspace/drv/infrastructure/rootpc/rootpc.c

    r5759975a r4c9b28a  
    5151#include <ops/hw_res.h>
    5252#include <device/hw_res.h>
    53 #include <ops/pio_window.h>
    54 #include <device/pio_window.h>
    5553
    5654#define NAME "rootpc"
     
    5856typedef struct rootpc_fun {
    5957        hw_resource_list_t hw_resources;
    60         pio_window_t pio_window;
    6158} rootpc_fun_t;
    6259
     
    9693static rootpc_fun_t pci_data = {
    9794        .hw_resources = {
    98                 sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]),
     95                sizeof(pci_conf_regs)/sizeof(pci_conf_regs[0]),
    9996                pci_conf_regs
    100         },
    101         .pio_window = {
    102                 .mem = {
    103                         .base = UINT32_C(0),
    104                         .size = UINT32_C(0xffffffff) /* practical maximum */
    105                 },
    106                 .io = {
    107                         .base = UINT32_C(0),
    108                         .size = UINT32_C(0x10000)
    109                 }
    11097        }
    11198};
     
    130117       
    131118        return false;
    132 }
    133 
    134 static pio_window_t *rootpc_get_pio_window(ddf_fun_t *fnode)
    135 {
    136         rootpc_fun_t *fun = rootpc_fun(fnode);
    137        
    138         assert(fun != NULL);
    139         return &fun->pio_window;
    140119}
    141120
     
    143122        .get_resource_list = &rootpc_get_resources,
    144123        .enable_interrupt = &rootpc_enable_interrupt,
    145 };
    146 
    147 static pio_window_ops_t fun_pio_window_ops = {
    148         .get_pio_window = &rootpc_get_pio_window
    149124};
    150125
     
    222197        ddf_log_init(NAME);
    223198        rootpc_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
    224         rootpc_fun_ops.interfaces[PIO_WINDOW_DEV_IFACE] = &fun_pio_window_ops;
    225199}
    226200
  • uspace/lib/c/Makefile

    r5759975a r4c9b28a  
    6969        generic/device/hw_res.c \
    7070        generic/device/hw_res_parsed.c \
    71         generic/device/pio_window.c \
    7271        generic/device/char_dev.c \
    7372        generic/device/clock_dev.c \
  • uspace/lib/c/include/ipc/dev_iface.h

    r5759975a r4c9b28a  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
    38         PIO_WINDOW_DEV_IFACE,
    3938
    4039        /** Character device interface */
  • uspace/lib/drv/Makefile

    r5759975a r4c9b28a  
    4141        generic/remote_audio_pcm.c \
    4242        generic/remote_hw_res.c \
    43         generic/remote_pio_window.c \
    4443        generic/remote_char_dev.c \
    4544        generic/remote_graph_dev.c \
  • uspace/lib/drv/generic/dev_iface.c

    r5759975a r4c9b28a  
    4040#include "dev_iface.h"
    4141#include "remote_hw_res.h"
    42 #include "remote_pio_window.h"
    4342#include "remote_char_dev.h"
    4443#include "remote_clock_dev.h"
     
    5958                [AUDIO_PCM_BUFFER_IFACE] = &remote_audio_pcm_iface,
    6059                [HW_RES_DEV_IFACE] = &remote_hw_res_iface,
    61                 [PIO_WINDOW_DEV_IFACE] = &remote_pio_window_iface,
    6260                [CHAR_DEV_IFACE] = &remote_char_dev_iface,
    6361                [GRAPH_DEV_IFACE] = &remote_graph_dev_iface,
Note: See TracChangeset for help on using the changeset viewer.