Lines Matching refs:pos

25 #define PCI_word_BAD (pos & 1)
26 #define PCI_dword_BAD (pos & 3)
30 (struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
37 res = bus->ops->read(bus, devfn, pos, len, &data); \
45 (struct pci_bus *bus, unsigned int devfn, int pos, type value) \
51 res = bus->ops->write(bus, devfn, pos, len, value); \
93 * @pos: offset in vpd space
98 ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf)
102 return dev->vpd->ops->read(dev, pos, count, buf);
109 * @pos: offset in vpd space
114 ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf)
118 return dev->vpd->ops->write(dev, pos, count, buf);
149 (struct pci_dev *dev, int pos, type *val) \
159 pos, sizeof(type), &data); \
169 (struct pci_dev *dev, int pos, type val) \
178 pos, sizeof(type), val); \
244 static ssize_t pci_vpd_pci22_read(struct pci_dev *dev, loff_t pos, size_t count,
250 loff_t end = pos + count;
253 if (pos < 0 || pos > vpd->base.len || end > vpd->base.len)
263 while (pos < end) {
268 pos & ~3);
281 skip = pos & 3;
285 if (++pos == end)
296 static ssize_t pci_vpd_pci22_write(struct pci_dev *dev, loff_t pos, size_t count,
302 loff_t end = pos + count;
305 if (pos < 0 || (pos & 3) || (count & 3) || end > vpd->base.len)
315 while (pos < end) {
327 pos | PCI_VPD_ADDR_F);
337 pos += sizeof(u32);
477 static bool pcie_capability_reg_implemented(struct pci_dev *dev, int pos)
482 switch (pos) {
517 int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val)
522 if (pos & 1)
525 if (pcie_capability_reg_implemented(dev, pos)) {
526 ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
544 if (pci_is_pcie(dev) && pos == PCI_EXP_SLTSTA &&
553 int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val)
558 if (pos & 3)
561 if (pcie_capability_reg_implemented(dev, pos)) {
562 ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
573 if (pci_is_pcie(dev) && pos == PCI_EXP_SLTCTL &&
582 int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val)
584 if (pos & 1)
587 if (!pcie_capability_reg_implemented(dev, pos))
590 return pci_write_config_word(dev, pci_pcie_cap(dev) + pos, val);
594 int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val)
596 if (pos & 3)
599 if (!pcie_capability_reg_implemented(dev, pos))
602 return pci_write_config_dword(dev, pci_pcie_cap(dev) + pos, val);
606 int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
612 ret = pcie_capability_read_word(dev, pos, &val);
616 ret = pcie_capability_write_word(dev, pos, val);
623 int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos,
629 ret = pcie_capability_read_dword(dev, pos, &val);
633 ret = pcie_capability_write_dword(dev, pos, val);