Changes in uspace/drv/bus/pci/pciintel/pci.c [d51838f:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
rd51838f rb7fd2a0 99 99 } 100 100 101 static intpciintel_fun_owns_interrupt(pci_fun_t *fun, int irq)101 static bool pciintel_fun_owns_interrupt(pci_fun_t *fun, int irq) 102 102 { 103 103 size_t i; … … 114 114 } 115 115 116 static int pciintel_enable_interrupt(ddf_fun_t *fnode, int irq)116 static errno_t pciintel_enable_interrupt(ddf_fun_t *fnode, int irq) 117 117 { 118 118 pci_fun_t *fun = pci_fun(fnode); … … 124 124 } 125 125 126 static int pciintel_disable_interrupt(ddf_fun_t *fnode, int irq)126 static errno_t pciintel_disable_interrupt(ddf_fun_t *fnode, int irq) 127 127 { 128 128 pci_fun_t *fun = pci_fun(fnode); … … 134 134 } 135 135 136 static int pciintel_clear_interrupt(ddf_fun_t *fnode, int irq)136 static errno_t pciintel_clear_interrupt(ddf_fun_t *fnode, int irq) 137 137 { 138 138 pci_fun_t *fun = pci_fun(fnode); … … 154 154 155 155 156 static int config_space_write_32(ddf_fun_t *fun, uint32_t address,156 static errno_t config_space_write_32(ddf_fun_t *fun, uint32_t address, 157 157 uint32_t data) 158 158 { … … 163 163 } 164 164 165 static int config_space_write_16(165 static errno_t config_space_write_16( 166 166 ddf_fun_t *fun, uint32_t address, uint16_t data) 167 167 { … … 172 172 } 173 173 174 static int config_space_write_8(174 static errno_t config_space_write_8( 175 175 ddf_fun_t *fun, uint32_t address, uint8_t data) 176 176 { … … 181 181 } 182 182 183 static int config_space_read_32(183 static errno_t config_space_read_32( 184 184 ddf_fun_t *fun, uint32_t address, uint32_t *data) 185 185 { … … 190 190 } 191 191 192 static int config_space_read_16(192 static errno_t config_space_read_16( 193 193 ddf_fun_t *fun, uint32_t address, uint16_t *data) 194 194 { … … 199 199 } 200 200 201 static int config_space_read_8(201 static errno_t config_space_read_8( 202 202 ddf_fun_t *fun, uint32_t address, uint8_t *data) 203 203 { … … 234 234 }; 235 235 236 static int pci_dev_add(ddf_dev_t *);237 static int pci_fun_online(ddf_fun_t *);238 static int pci_fun_offline(ddf_fun_t *);236 static errno_t pci_dev_add(ddf_dev_t *); 237 static errno_t pci_fun_online(ddf_fun_t *); 238 static errno_t pci_fun_offline(ddf_fun_t *); 239 239 240 240 /** PCI bus driver standard operations */ … … 293 293 const uint32_t conf_addr = CONF_ADDR(fun->bus, fun->dev, fun->fn, reg); 294 294 pci_bus_t *bus = pci_bus_from_fun(fun); 295 uint32_t val ;295 uint32_t val = 0; 296 296 297 297 fibril_mutex_lock(&bus->conf_mutex); … … 382 382 void pci_fun_create_match_ids(pci_fun_t *fun) 383 383 { 384 int rc; 384 errno_t rc; 385 int ret; 385 386 char match_id_str[ID_MAX_STR_LEN]; 386 387 387 388 /* Vendor ID & Device ID, length(incl \0) 22 */ 388 r c= snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04"389 ret = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04" 389 390 PRIx16 "&dev=%04" PRIx16, fun->vendor_id, fun->device_id); 390 if (rc < 0) { 391 ddf_msg(LVL_ERROR, "Failed creating match ID str: %s", 392 str_error(rc)); 391 if (ret < 0) { 392 ddf_msg(LVL_ERROR, "Failed creating match ID str"); 393 393 } 394 394 … … 399 399 400 400 /* Class, subclass, prog IF, revision, length(incl \0) 47 */ 401 r c= snprintf(match_id_str, ID_MAX_STR_LEN,401 ret = snprintf(match_id_str, ID_MAX_STR_LEN, 402 402 "pci/class=%02x&subclass=%02x&progif=%02x&revision=%02x", 403 403 fun->class_code, fun->subclass_code, fun->prog_if, fun->revision); 404 if (rc < 0) { 405 ddf_msg(LVL_ERROR, "Failed creating match ID str: %s", 406 str_error(rc)); 404 if (ret < 0) { 405 ddf_msg(LVL_ERROR, "Failed creating match ID str"); 407 406 } 408 407 … … 413 412 414 413 /* Class, subclass, prog IF, length(incl \0) 35 */ 415 r c= snprintf(match_id_str, ID_MAX_STR_LEN,414 ret = snprintf(match_id_str, ID_MAX_STR_LEN, 416 415 "pci/class=%02x&subclass=%02x&progif=%02x", 417 416 fun->class_code, fun->subclass_code, fun->prog_if); 418 if (rc < 0) { 419 ddf_msg(LVL_ERROR, "Failed creating match ID str: %s", 420 str_error(rc)); 417 if (ret < 0) { 418 ddf_msg(LVL_ERROR, "Failed creating match ID str"); 421 419 } 422 420 … … 427 425 428 426 /* Class, subclass, length(incl \0) 25 */ 429 r c= snprintf(match_id_str, ID_MAX_STR_LEN,427 ret = snprintf(match_id_str, ID_MAX_STR_LEN, 430 428 "pci/class=%02x&subclass=%02x", 431 429 fun->class_code, fun->subclass_code); 432 if (rc < 0) { 433 ddf_msg(LVL_ERROR, "Failed creating match ID str: %s", 434 str_error(rc)); 430 if (ret < 0) { 431 ddf_msg(LVL_ERROR, "Failed creating match ID str"); 435 432 } 436 433 … … 441 438 442 439 /* Class, length(incl \0) 13 */ 443 r c= snprintf(match_id_str, ID_MAX_STR_LEN, "pci/class=%02x",440 ret = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/class=%02x", 444 441 fun->class_code); 445 if (rc < 0) { 446 ddf_msg(LVL_ERROR, "Failed creating match ID str: %s", 447 str_error(rc)); 442 if (ret < 0) { 443 ddf_msg(LVL_ERROR, "Failed creating match ID str"); 448 444 } 449 445 … … 514 510 #define MEM_MASK (~0xf) 515 511 516 io = ( bool) (val & 1);512 io = (val & 1) != 0; 517 513 if (io) { 518 514 addrw64 = false; … … 606 602 { 607 603 pci_fun_t *fun; 608 int rc;604 errno_t rc; 609 605 610 606 int child_bus = 0; … … 688 684 } 689 685 690 static int pci_dev_add(ddf_dev_t *dnode)686 static errno_t pci_dev_add(ddf_dev_t *dnode) 691 687 { 692 688 hw_resource_list_t hw_resources; … … 695 691 bool got_res = false; 696 692 async_sess_t *sess; 697 int rc;693 errno_t rc; 698 694 699 695 ddf_msg(LVL_DEBUG, "pci_dev_add"); … … 814 810 } 815 811 816 static int pci_fun_online(ddf_fun_t *fun)812 static errno_t pci_fun_online(ddf_fun_t *fun) 817 813 { 818 814 ddf_msg(LVL_DEBUG, "pci_fun_online()"); … … 820 816 } 821 817 822 static int pci_fun_offline(ddf_fun_t *fun)818 static errno_t pci_fun_offline(ddf_fun_t *fun) 823 819 { 824 820 ddf_msg(LVL_DEBUG, "pci_fun_offline()");
Note:
See TracChangeset
for help on using the changeset viewer.