Changeset 357b5f5 in mainline for uspace/drv/pciintel/pci.c


Ignore:
Timestamp:
2011-01-23T20:09:13Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fdb9982c
Parents:
cead2aa (diff), 7e36c8d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rcead2aa r357b5f5  
    4949#include <ipc/devman.h>
    5050#include <ipc/dev_iface.h>
    51 #include <resource.h>
     51#include <ops/hw_res.h>
    5252#include <device/hw_res.h>
    5353#include <ddi.h>
     
    7777}
    7878
    79 static resource_iface_t pciintel_child_res_iface = {
     79static hw_res_ops_t pciintel_child_hw_res_ops = {
    8080        &pciintel_get_child_resources,
    8181        &pciintel_enable_child_interrupt
     
    324324                printf(NAME ": device %s : ", dev->name);
    325325                printf("address = %" PRIx64, range_addr);
    326                 printf(", size = %x\n", range_size);
     326                printf(", size = %x\n", (unsigned int) range_size);
    327327        }
    328328       
     
    452452static int pci_add_device(device_t *dev)
    453453{
     454        int rc;
     455
    454456        printf(NAME ": pci_add_device\n");
    455457       
     
    466468                    "parent's driver.\n");
    467469                delete_pci_bus_data(bus_data);
    468                 return EPARTY;  /* FIXME: use another EC */
     470                return dev->parent_phone;
    469471        }
    470472       
    471473        hw_resource_list_t hw_resources;
    472474       
    473         if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
     475        rc = hw_res_get_resource_list(dev->parent_phone, &hw_resources);
     476        if (rc != EOK) {
    474477                printf(NAME ": pci_add_device failed to get hw resources for "
    475478                    "the device.\n");
    476479                delete_pci_bus_data(bus_data);
    477480                ipc_hangup(dev->parent_phone);
    478                 return EPARTY;  /* FIXME: use another EC */
     481                return rc;
    479482        }       
    480483       
     
    489492            (uint32_t) hw_resources.resources[0].res.io_range.address;
    490493       
    491         if (pio_enable((void *)bus_data->conf_io_addr, 8,
     494        if (pio_enable((void *)(uintptr_t)bus_data->conf_io_addr, 8,
    492495            &bus_data->conf_addr_port)) {
    493496                printf(NAME ": failed to enable configuration ports.\n");
    494497                delete_pci_bus_data(bus_data);
    495498                ipc_hangup(dev->parent_phone);
    496                 clean_hw_resource_list(&hw_resources);
     499                hw_res_clean_resource_list(&hw_resources);
    497500                return EADDRNOTAVAIL;
    498501        }
     
    505508        pci_bus_scan(dev, 0);
    506509       
    507         clean_hw_resource_list(&hw_resources);
     510        hw_res_clean_resource_list(&hw_resources);
    508511       
    509512        return EOK;
     
    512515static void pciintel_init(void)
    513516{
    514         pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_res_iface;
     517        pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_hw_res_ops;
    515518}
    516519
     
    534537{
    535538        if (dev_data != NULL) {
    536                 clean_hw_resource_list(&dev_data->hw_resources);
     539                hw_res_clean_resource_list(&dev_data->hw_resources);
    537540                free(dev_data);
    538541        }
Note: See TracChangeset for help on using the changeset viewer.