cregit-Linux how code gets into the kernel

Release 4.7 drivers/pci/host-bridge.c

Directory: drivers/pci
/*
 * host bridge related code
 */

#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/module.h>

#include "pci.h"


static struct pci_bus *find_pci_root_bus(struct pci_bus *bus) { while (bus->parent) bus = bus->parent; return bus; }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu28100.00%3100.00%
Total28100.00%3100.00%


struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus) { struct pci_bus *root_bus = find_pci_root_bus(bus); return to_pci_host_bridge(root_bus->bridge); }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu2996.67%480.00%
aaron luaaron lu13.33%120.00%
Total30100.00%5100.00%


struct device *pci_get_host_bridge_device(struct pci_dev *dev) { struct pci_bus *root_bus = find_pci_root_bus(dev->bus); struct device *bridge = root_bus->bridge; kobject_get(&bridge->kobj); return bridge; }

Contributors

PersonTokensPropCommitsCommitProp
murali karicherimurali karicheri44100.00%1100.00%
Total44100.00%1100.00%


void pci_put_host_bridge_device(struct device *dev) { kobject_put(&dev->kobj); }

Contributors

PersonTokensPropCommitsCommitProp
murali karicherimurali karicheri18100.00%1100.00%
Total18100.00%1100.00%


void pci_set_host_bridge_release(struct pci_host_bridge *bridge, void (*release_fn)(struct pci_host_bridge *), void *release_data) { bridge->release_fn = release_fn; bridge->release_data = release_data; }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu37100.00%1100.00%
Total37100.00%1100.00%


void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, struct resource *res) { struct pci_host_bridge *bridge = pci_find_host_bridge(bus); struct resource_entry *window; resource_size_t offset = 0; resource_list_for_each_entry(window, &bridge->windows) { if (resource_contains(window->res, res)) { offset = window->offset; break; } } region->start = res->start - offset; region->end = res->end - offset; }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu8596.59%250.00%
jiang liujiang liu22.27%125.00%
aaron luaaron lu11.14%125.00%
Total88100.00%4100.00%

EXPORT_SYMBOL(pcibios_resource_to_bus);
static bool region_contains(struct pci_bus_region *region1, struct pci_bus_region *region2) { return region1->start <= region2->start && region1->end >= region2->end; }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu33100.00%1100.00%
Total33100.00%1100.00%


void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, struct pci_bus_region *region) { struct pci_host_bridge *bridge = pci_find_host_bridge(bus); struct resource_entry *window; resource_size_t offset = 0; resource_list_for_each_entry(window, &bridge->windows) { struct pci_bus_region bus_region; if (resource_type(res) != resource_type(window->res)) continue; bus_region.start = window->res->start - window->offset; bus_region.end = window->res->end - window->offset; if (region_contains(&bus_region, region)) { offset = window->offset; break; } } res->start = region->start + offset; res->end = region->end + offset; }

Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu13197.76%360.00%
jiang liujiang liu21.49%120.00%
aaron luaaron lu10.75%120.00%
Total134100.00%5100.00%

EXPORT_SYMBOL(pcibios_bus_to_resource);

Overall Contributors

PersonTokensPropCommitsCommitProp
yinghai luyinghai lu36684.14%562.50%
murali karicherimurali karicheri6214.25%112.50%
jiang liujiang liu40.92%112.50%
aaron luaaron lu30.69%112.50%
Total435100.00%8100.00%
Directory: drivers/pci
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}