Ignore:
File:
1 edited

Legend:

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

    rffa2c8ef r7e752b2  
    4949#include <ipc/devman.h>
    5050#include <ipc/dev_iface.h>
    51 #include <ops/hw_res.h>
     51#include <resource.h>
    5252#include <device/hw_res.h>
    5353#include <ddi.h>
     
    7777}
    7878
    79 static hw_res_ops_t pciintel_child_hw_res_ops = {
     79static resource_iface_t pciintel_child_res_iface = {
    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", (unsigned int) range_size);
     326                printf(", size = %x\n", range_size);
    327327        }
    328328       
     
    452452static int pci_add_device(device_t *dev)
    453453{
    454         int rc;
    455 
    456454        printf(NAME ": pci_add_device\n");
    457455       
     
    468466                    "parent's driver.\n");
    469467                delete_pci_bus_data(bus_data);
    470                 return dev->parent_phone;
     468                return EPARTY;  /* FIXME: use another EC */
    471469        }
    472470       
    473471        hw_resource_list_t hw_resources;
    474472       
    475         rc = hw_res_get_resource_list(dev->parent_phone, &hw_resources);
    476         if (rc != EOK) {
     473        if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
    477474                printf(NAME ": pci_add_device failed to get hw resources for "
    478475                    "the device.\n");
    479476                delete_pci_bus_data(bus_data);
    480                 async_hangup(dev->parent_phone);
    481                 return rc;
     477                ipc_hangup(dev->parent_phone);
     478                return EPARTY;  /* FIXME: use another EC */
    482479        }       
    483480       
     
    492489            (uint32_t) hw_resources.resources[0].res.io_range.address;
    493490       
    494         if (pio_enable((void *)(uintptr_t)bus_data->conf_io_addr, 8,
     491        if (pio_enable((void *)bus_data->conf_io_addr, 8,
    495492            &bus_data->conf_addr_port)) {
    496493                printf(NAME ": failed to enable configuration ports.\n");
    497494                delete_pci_bus_data(bus_data);
    498                 async_hangup(dev->parent_phone);
    499                 hw_res_clean_resource_list(&hw_resources);
     495                ipc_hangup(dev->parent_phone);
     496                clean_hw_resource_list(&hw_resources);
    500497                return EADDRNOTAVAIL;
    501498        }
     
    508505        pci_bus_scan(dev, 0);
    509506       
    510         hw_res_clean_resource_list(&hw_resources);
     507        clean_hw_resource_list(&hw_resources);
    511508       
    512509        return EOK;
     
    515512static void pciintel_init(void)
    516513{
    517         pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_hw_res_ops;
     514        pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_res_iface;
    518515}
    519516
     
    537534{
    538535        if (dev_data != NULL) {
    539                 hw_res_clean_resource_list(&dev_data->hw_resources);
     536                clean_hw_resource_list(&dev_data->hw_resources);
    540537                free(dev_data);
    541538        }
Note: See TracChangeset for help on using the changeset viewer.