search for: find_bus

Displaying 3 results from an estimated 3 matches for "find_bus".

Did you mean: find_bit
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...void get_addr(struct pci_dev *dev, int id, u8 *busnr, u8 *devfn) +{ + u16 addr; + + addr = (dev->bus->number << 8) + dev->devfn + + dev->iov->offset + dev->iov->stride * id; + *busnr = addr >> 8; + *devfn = addr & 0xff; +} + +static inline struct pci_bus *find_bus(struct pci_dev *dev, int busnr) +{ + struct pci_bus *bus; + + down_read(&pci_bus_sem); + list_for_each_entry(bus, &dev->bus->children, node) + if (bus->number == busnr) { + up_read(&pci_bus_sem); + return bus; + } + up_read(&pci_bus_sem); + + return NULL; +} + +static...
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...void get_addr(struct pci_dev *dev, int id, u8 *busnr, u8 *devfn) +{ + u16 addr; + + addr = (dev->bus->number << 8) + dev->devfn + + dev->iov->offset + dev->iov->stride * id; + *busnr = addr >> 8; + *devfn = addr & 0xff; +} + +static inline struct pci_bus *find_bus(struct pci_dev *dev, int busnr) +{ + struct pci_bus *bus; + + down_read(&pci_bus_sem); + list_for_each_entry(bus, &dev->bus->children, node) + if (bus->number == busnr) { + up_read(&pci_bus_sem); + return bus; + } + up_read(&pci_bus_sem); + + return NULL; +} + +static...
2008 Sep 01
2
[PATCH 3/4 v2] PCI: support SR-IOV capability
...void get_addr(struct pci_dev *dev, int id, u8 *busnr, u8 *devfn) +{ + u16 addr; + + addr = (dev->bus->number << 8) + dev->devfn + + dev->iov->offset + dev->iov->stride * id; + *busnr = addr >> 8; + *devfn = addr & 0xff; +} + +static inline struct pci_bus *find_bus(struct pci_dev *dev, int busnr) +{ + struct pci_bus *bus; + + down_read(&pci_bus_sem); + list_for_each_entry(bus, &dev->bus->children, node) + if (bus->number == busnr) { + up_read(&pci_bus_sem); + return bus; + } + up_read(&pci_bus_sem); + + return NULL; +} + +static...