Changeset c05642d in mainline for uspace/drv/bus/pci/pciintel/pci.c
- Timestamp:
- 2011-09-07T00:03:26Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5081276
- Parents:
- bb74dabe (diff), 038b289 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
rbb74dabe rc05642d 203 203 204 204 static int pci_add_device(ddf_dev_t *); 205 static int pci_fun_online(ddf_fun_t *); 206 static int pci_fun_offline(ddf_fun_t *); 205 207 206 208 /** PCI bus driver standard operations */ 207 209 static driver_ops_t pci_ops = { 208 .add_device = &pci_add_device 210 .add_device = &pci_add_device, 211 .fun_online = &pci_fun_online, 212 .fun_offline = &pci_fun_offline, 209 213 }; 210 214 … … 214 218 .driver_ops = &pci_ops 215 219 }; 216 217 static pci_bus_t *pci_bus_new(void)218 {219 pci_bus_t *bus;220 221 bus = (pci_bus_t *) calloc(1, sizeof(pci_bus_t));222 if (bus == NULL)223 return NULL;224 225 fibril_mutex_initialize(&bus->conf_mutex);226 return bus;227 }228 229 static void pci_bus_delete(pci_bus_t *bus)230 {231 assert(bus != NULL);232 free(bus);233 }234 220 235 221 static void pci_conf_read(pci_fun_t *fun, int reg, uint8_t *buf, size_t len) … … 584 570 dnode->parent_sess = NULL; 585 571 586 bus = pci_bus_new();572 bus = ddf_dev_data_alloc(dnode, sizeof(pci_bus_t)); 587 573 if (bus == NULL) { 588 574 ddf_msg(LVL_ERROR, "pci_add_device allocation failed."); … … 590 576 goto fail; 591 577 } 578 fibril_mutex_initialize(&bus->conf_mutex); 579 592 580 bus->dnode = dnode; 593 581 dnode->driver_data = bus; … … 655 643 656 644 fail: 657 if (bus != NULL)658 pci_bus_delete(bus);659 660 645 if (dnode->parent_sess) 661 646 async_hangup(dnode->parent_sess); … … 668 653 669 654 return rc; 655 } 656 657 static int pci_fun_online(ddf_fun_t *fun) 658 { 659 ddf_msg(LVL_DEBUG, "pci_fun_online()"); 660 return ddf_fun_online(fun); 661 } 662 663 static int pci_fun_offline(ddf_fun_t *fun) 664 { 665 ddf_msg(LVL_DEBUG, "pci_fun_offline()"); 666 return ddf_fun_offline(fun); 670 667 } 671 668
Note:
See TracChangeset
for help on using the changeset viewer.