Lines Matching refs:base
51 * pci_cap_probe: returns the capid and base based upon a given index
58 uint16_t base, pcix_cmd, status;
67 for (i = 0, base = pci_config_get8(h, PCI_CONF_CAP_PTR);
68 base && i < index; base = pci_config_get8(h, base
71 if ((id = pci_config_get8(h, base)) == 0xff)
77 if ((pcix_cmd = pci_config_get16(h, base +
85 if (base && i == index) {
86 if ((id = pci_config_get8(h, base)) != 0xff)
93 for (base = PCIE_EXT_CAP; base && i < index; i++) {
94 if ((xcaps_hdr = pci_config_get32(h, base)) == PCI_CAP_EINVAL32)
99 base = (xcaps_hdr >> PCIE_EXT_CAP_NEXT_PTR_SHIFT)
103 if (!base || i < index)
106 if ((xcaps_hdr = pci_config_get32(h, base)) == PCI_CAP_EINVAL32)
112 PCI_CAP_DBG("pci_cap_probe: index=%x, id=%x, base=%x\n",
113 index, id, base);
116 *base_p = base;
122 * pci_lcap_locate: Helper function locates a base in conventional config space.
128 uint16_t status, base;
138 base = PCI_CONF_CAP_PTR;
141 base = PCI_BCNF_CAP_PTR;
144 base = PCI_CBUS_CAP_PTR;
152 for (base = pci_config_get8(h, base); base;
153 base = pci_config_get8(h, base + PCI_CAP_NEXT_PTR)) {
154 if (pci_config_get8(h, base) == id) {
155 *base_p = base;
165 * pci_xcap_locate: Helper function locates a base in extended config space.
170 uint16_t status, base;
178 for (base = PCIE_EXT_CAP; base; base = (xcaps_hdr >>
181 if ((xcaps_hdr = pci_config_get32(h, base)) == PCI_CAP_EINVAL32)
186 *base_p = base;
210 uint16_t status, base;
220 base = PCI_CONF_CAP_PTR;
223 base = PCI_BCNF_CAP_PTR;
231 for (base = pci_config_get8(h, base); base;
232 base = pci_config_get8(h, base + PCI_CAP_NEXT_PTR)) {
233 if (pci_config_get8(h, base) == PCI_CAP_ID_HT &&
234 (pci_config_get16(h, base + PCI_CAP_ID_REGS_OFF) &
236 *base_p = base;
246 * pci_cap_get: This function uses the base or capid to get a byte, word,
248 * locate the base. Access by a base results in better performance
253 uint32_t id, uint16_t base, uint16_t offset)
257 if (PCI_CAP_BASE(h, id, &base) != DDI_SUCCESS)
266 offset += base;
289 * locate the base. Access by base results in better performance
294 uint32_t id, uint16_t base, uint16_t offset,
301 if (PCI_CAP_BASE(h, id, &base) != DDI_SUCCESS)
304 offset += base;
329 pci_cap_read(ddi_acc_handle_t h, uint32_t id, uint16_t base,
338 if (PCI_CAP_BASE(h, id, &base) != DDI_SUCCESS)
341 for (ptr = buf_p, i = 0; i < nwords; i++, base += 4) {
342 if ((*ptr++ = pci_config_get32(h, base)) == PCI_CAP_EINVAL32)