Changeset c05642d in mainline for uspace/drv/bus/pci/pciintel/pci.c


Ignore:
Timestamp:
2011-09-07T00:03:26Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rbb74dabe rc05642d  
    203203
    204204static int pci_add_device(ddf_dev_t *);
     205static int pci_fun_online(ddf_fun_t *);
     206static int pci_fun_offline(ddf_fun_t *);
    205207
    206208/** PCI bus driver standard operations */
    207209static 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,
    209213};
    210214
     
    214218        .driver_ops = &pci_ops
    215219};
    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 }
    234220
    235221static void pci_conf_read(pci_fun_t *fun, int reg, uint8_t *buf, size_t len)
     
    584570        dnode->parent_sess = NULL;
    585571       
    586         bus = pci_bus_new();
     572        bus = ddf_dev_data_alloc(dnode, sizeof(pci_bus_t));
    587573        if (bus == NULL) {
    588574                ddf_msg(LVL_ERROR, "pci_add_device allocation failed.");
     
    590576                goto fail;
    591577        }
     578        fibril_mutex_initialize(&bus->conf_mutex);
     579
    592580        bus->dnode = dnode;
    593581        dnode->driver_data = bus;
     
    655643       
    656644fail:
    657         if (bus != NULL)
    658                 pci_bus_delete(bus);
    659        
    660645        if (dnode->parent_sess)
    661646                async_hangup(dnode->parent_sess);
     
    668653       
    669654        return rc;
     655}
     656
     657static 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
     663static int pci_fun_offline(ddf_fun_t *fun)
     664{
     665        ddf_msg(LVL_DEBUG, "pci_fun_offline()");
     666        return ddf_fun_offline(fun);
    670667}
    671668
Note: See TracChangeset for help on using the changeset viewer.