Changes in uspace/drv/pciintel/pci.c [fc51296:af6b5157] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
rfc51296 raf6b5157 48 48 49 49 #include <ddf/driver.h> 50 #include <ddf/log.h>51 50 #include <devman.h> 52 51 #include <ipc/devman.h> … … 226 225 227 226 if (match_id_str == NULL) { 228 ddf_msg(LVL_ERROR, "Out of memory creating match ID.\n");227 printf(NAME ": out of memory creating match ID.\n"); 229 228 return; 230 229 } … … 232 231 rc = ddf_fun_add_match_id(fun->fnode, match_id_str, 90); 233 232 if (rc != EOK) { 234 ddf_msg(LVL_ERROR, "Failedadding match ID: %s\n",233 printf(NAME ": error adding match ID: %s\n", 235 234 str_error(rc)); 236 235 } … … 324 323 325 324 if (range_addr != 0) { 326 ddf_msg(LVL_DEBUG, "Function %s : address = %" PRIx64327 ", size = %x\n", fun->fnode->name, range_addr,328 325 printf(NAME ": function %s : ", fun->fnode->name); 326 printf("address = %" PRIx64, range_addr); 327 printf(", size = %x\n", (unsigned int) range_size); 329 328 } 330 329 … … 351 350 hw_res_list->count++; 352 351 353 ddf_msg(LVL_NOTE, "Function %s uses irq %x.\n", fun->fnode->name, irq);352 printf(NAME ": function %s uses irq %x.\n", fun->fnode->name, irq); 354 353 } 355 354 … … 407 406 char *fun_name = pci_fun_create_name(fun); 408 407 if (fun_name == NULL) { 409 ddf_msg(LVL_ERROR, "Out of memory.\n");408 printf(NAME ": out of memory.\n"); 410 409 return; 411 410 } … … 413 412 fnode = ddf_fun_create(bus->dnode, fun_inner, fun_name); 414 413 if (fnode == NULL) { 415 ddf_msg(LVL_ERROR, "Failedcreating function.\n");414 printf(NAME ": error creating function.\n"); 416 415 return; 417 416 } … … 427 426 fnode->driver_data = fun; 428 427 429 ddf_msg(LVL_DEBUG, "Adding new function %s.\n",428 printf(NAME ": adding new function %s.\n", 430 429 fnode->name); 431 430 … … 444 443 child_bus = pci_conf_read_8(fun, 445 444 PCI_BRIDGE_SEC_BUS_NUM); 446 ddf_msg(LVL_DEBUG, "Device is pci-to-pci " 447 "bridge, secondary bus number = %d.\n", 448 bus_num); 445 printf(NAME ": device is pci-to-pci bridge, " 446 "secondary bus number = %d.\n", bus_num); 449 447 if (child_bus > bus_num) 450 448 pci_bus_scan(bus, child_bus); … … 468 466 int rc; 469 467 470 ddf_msg(LVL_DEBUG, "pci_add_device\n");468 printf(NAME ": pci_add_device\n"); 471 469 dnode->parent_phone = -1; 472 470 473 471 bus = pci_bus_new(); 474 472 if (bus == NULL) { 475 ddf_msg(LVL_ERROR, "pci_add_device allocation failed.\n");473 printf(NAME ": pci_add_device allocation failed.\n"); 476 474 rc = ENOMEM; 477 475 goto fail; … … 483 481 IPC_FLAG_BLOCKING); 484 482 if (dnode->parent_phone < 0) { 485 ddf_msg(LVL_ERROR, "pci_add_device failed to connect to the "483 printf(NAME ": pci_add_device failed to connect to the " 486 484 "parent's driver.\n"); 487 485 rc = dnode->parent_phone; … … 493 491 rc = hw_res_get_resource_list(dnode->parent_phone, &hw_resources); 494 492 if (rc != EOK) { 495 ddf_msg(LVL_ERROR, "pci_add_device failed to get hw resources"496 " forthe device.\n");493 printf(NAME ": pci_add_device failed to get hw resources for " 494 "the device.\n"); 497 495 goto fail; 498 496 } 499 497 got_res = true; 500 498 501 ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".\n",499 printf(NAME ": conf_addr = %" PRIx64 ".\n", 502 500 hw_resources.resources[0].res.io_range.address); 503 501 … … 511 509 if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8, 512 510 &bus->conf_addr_port)) { 513 ddf_msg(LVL_ERROR, "Failed to enable configuration ports.\n");511 printf(NAME ": failed to enable configuration ports.\n"); 514 512 rc = EADDRNOTAVAIL; 515 513 goto fail; … … 518 516 519 517 /* Make the bus device more visible. It has no use yet. */ 520 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function\n");518 printf(NAME ": adding a 'ctl' function\n"); 521 519 522 520 ctl = ddf_fun_create(bus->dnode, fun_exposed, "ctl"); … … 534 532 535 533 /* Enumerate functions. */ 536 ddf_msg(LVL_DEBUG, "Scanning the bus\n");534 printf(NAME ": scanning the bus\n"); 537 535 pci_bus_scan(bus, 0); 538 536 … … 556 554 static void pciintel_init(void) 557 555 { 558 ddf_log_init(NAME, LVL_ERROR);559 556 pci_fun_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops; 560 557 }
Note:
See TracChangeset
for help on using the changeset viewer.