Changeset 99e6bfb in mainline


Ignore:
Timestamp:
2011-02-28T20:06:28Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab414a6
Parents:
d79a101f
Message:

Implement access to device config space

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/pciintel/pci.c

    rd79a101f r99e6bfb  
    5959#include <ddi.h>
    6060#include <libarch/ddi.h>
     61#include <pci_dev_iface.h>
    6162
    6263#include "pci.h"
     
    121122}
    122123
     124static int pci_config_space_write_16(ddf_fun_t *fun, uint32_t address, uint16_t data)
     125{
     126        if (address > 254)
     127                return EINVAL;
     128        pci_conf_write_16(PCI_FUN(fun), address, data);
     129        return EOK;
     130}
     131
     132
    123133static hw_res_ops_t pciintel_hw_res_ops = {
    124134        &pciintel_get_resources,
     
    126136};
    127137
    128 static ddf_dev_ops_t pci_fun_ops;
     138static pci_dev_iface_t pci_dev_ops = {
     139        .config_space_read_8 = NULL,
     140        .config_space_read_16 = NULL,
     141        .config_space_read_32 = NULL,
     142        .config_space_write_8 = NULL,
     143        .config_space_write_16 = &pci_config_space_write_16,
     144        .config_space_write_32 = NULL
     145};
     146
     147static ddf_dev_ops_t pci_fun_ops = {
     148        .interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops,
     149        .interfaces[PCI_DEV_IFACE] = &pci_dev_ops
     150};
    129151
    130152static int pci_add_device(ddf_dev_t *);
     
    593615{
    594616        pci_fun_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops;
     617        pci_fun_ops.interfaces[PCI_DEV_IFACE] = &pci_dev_ops;
    595618}
    596619
Note: See TracChangeset for help on using the changeset viewer.