Changes in uspace/drv/pciintel/pci.c [7e752b2:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
r7e752b2 rffa2c8ef 49 49 #include <ipc/devman.h> 50 50 #include <ipc/dev_iface.h> 51 #include < resource.h>51 #include <ops/hw_res.h> 52 52 #include <device/hw_res.h> 53 53 #include <ddi.h> … … 77 77 } 78 78 79 static resource_iface_t pciintel_child_res_iface= {79 static hw_res_ops_t pciintel_child_hw_res_ops = { 80 80 &pciintel_get_child_resources, 81 81 &pciintel_enable_child_interrupt … … 324 324 printf(NAME ": device %s : ", dev->name); 325 325 printf("address = %" PRIx64, range_addr); 326 printf(", size = %x\n", range_size);326 printf(", size = %x\n", (unsigned int) range_size); 327 327 } 328 328 … … 452 452 static int pci_add_device(device_t *dev) 453 453 { 454 int rc; 455 454 456 printf(NAME ": pci_add_device\n"); 455 457 … … 466 468 "parent's driver.\n"); 467 469 delete_pci_bus_data(bus_data); 468 return EPARTY; /* FIXME: use another EC */470 return dev->parent_phone; 469 471 } 470 472 471 473 hw_resource_list_t hw_resources; 472 474 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) { 474 477 printf(NAME ": pci_add_device failed to get hw resources for " 475 478 "the device.\n"); 476 479 delete_pci_bus_data(bus_data); 477 ipc_hangup(dev->parent_phone);478 return EPARTY; /* FIXME: use another EC */480 async_hangup(dev->parent_phone); 481 return rc; 479 482 } 480 483 … … 489 492 (uint32_t) hw_resources.resources[0].res.io_range.address; 490 493 491 if (pio_enable((void *) bus_data->conf_io_addr, 8,494 if (pio_enable((void *)(uintptr_t)bus_data->conf_io_addr, 8, 492 495 &bus_data->conf_addr_port)) { 493 496 printf(NAME ": failed to enable configuration ports.\n"); 494 497 delete_pci_bus_data(bus_data); 495 ipc_hangup(dev->parent_phone);496 clean_hw_resource_list(&hw_resources);498 async_hangup(dev->parent_phone); 499 hw_res_clean_resource_list(&hw_resources); 497 500 return EADDRNOTAVAIL; 498 501 } … … 505 508 pci_bus_scan(dev, 0); 506 509 507 clean_hw_resource_list(&hw_resources);510 hw_res_clean_resource_list(&hw_resources); 508 511 509 512 return EOK; … … 512 515 static void pciintel_init(void) 513 516 { 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; 515 518 } 516 519 … … 534 537 { 535 538 if (dev_data != NULL) { 536 clean_hw_resource_list(&dev_data->hw_resources);539 hw_res_clean_resource_list(&dev_data->hw_resources); 537 540 free(dev_data); 538 541 }
Note:
See TracChangeset
for help on using the changeset viewer.