Home | History | Annotate | Download | only in pci

Lines Matching refs:pi

326 	struct pci_iores *pi;
391 pi = &pd->pd_iores[res];
396 PCI_SBDF_FMT_ARGS(pr, pd), pi->pi_bar,
397 pi->pi_type == PCI_MAPREG_TYPE_MEM ? "mem" : "io ",
398 pi->pi_base, pi->pi_size);
400 if (pi->pi_type == PCI_MAPREG_TYPE_MEM) {
401 switch (pi->pi_mem.memtype) {
413 pi->pi_mem.prefetch ? "" : "non-");
434 struct pci_iores *pi;
476 pi = &pd->pd_iores[pd->pd_niores++];
477 pi->pi_type = PCI_MAPREG_TYPE_MEM;
478 pi->pi_base = addr;
479 pi->pi_size = size;
480 pi->pi_bar = (mapreg - mapreg_start) / 4;
481 pi->pi_mem.memtype =
483 pi->pi_mem.prefetch =
491 pi = &pd->pd_iores[pd->pd_niores++];
492 pi->pi_type = PCI_MAPREG_TYPE_IO;
493 pi->pi_base = addr;
494 pi->pi_size = size;
495 pi->pi_bar = (mapreg - mapreg_start) / 4;
732 struct pci_iores *pi;
763 pi = &pd->pd_iores[iores];
765 required |= __BIT(pi->pi_type);
769 PCI_BAR(pi->pi_bar), 0);
772 if ((enabled & __BIT(pi->pi_type)) == 0) {
776 if (pi->pi_type == PCI_MAPREG_TYPE_IO) {
778 pci_resource_claim(res_io, pi->pi_base,
779 pi->pi_base + pi->pi_size - 1);
785 pi->pi_base,
786 pi->pi_base + pi->pi_size - 1,
792 KASSERT(pi->pi_type == PCI_MAPREG_TYPE_MEM);
794 if (pi->pi_mem.prefetch) {
800 error = pci_resource_claim(res_pmem, pi->pi_base,
801 pi->pi_base + pi->pi_size - 1);
803 } else if (pi->pi_mem.memtype == PCI_MAPREG_MEM_TYPE_64BIT) {
810 error = pci_resource_claim(res_pmem, pi->pi_base,
811 pi->pi_base + pi->pi_size - 1);
814 error = pci_resource_claim(res_mem, pi->pi_base,
815 pi->pi_base + pi->pi_size - 1);
827 error = pci_resource_claim(res_mem, pi->pi_base,
828 pi->pi_base + pi->pi_size - 1);
831 error = pci_resource_claim(res_pmem, pi->pi_base,
832 pi->pi_base + pi->pi_size - 1);
841 pi->pi_mem.prefetch ? "" : "non-",
842 pi->pi_base,
843 pi->pi_base + pi->pi_size - 1,
989 struct pci_iores *pi;
1009 pi = &pd->pd_iores[res];
1011 if ((enabled & __BIT(pi->pi_type)) != 0) {
1015 if (pi->pi_type == PCI_MAPREG_TYPE_IO) {
1017 align = uimax(pi->pi_size, 4);
1019 KASSERT(pi->pi_type == PCI_MAPREG_TYPE_MEM);
1021 align = uimax(pi->pi_size, 16);
1022 if (pi->pi_mem.prefetch) {
1033 pi->pi_bar, pi->pi_size);
1036 error = pci_resource_alloc(arena, pi->pi_size, align, &addr);
1041 pi->pi_bar, pi->pi_size);
1047 pi->pi_bar, addr, addr + pi->pi_size - 1);
1049 if (pi->pi_type == PCI_MAPREG_TYPE_IO) {
1052 PCI_BAR(pi->pi_bar),
1057 PCI_BAR(pi->pi_bar));
1061 PCI_BAR(pi->pi_bar), base);
1062 if (pi->pi_mem.memtype == PCI_MAPREG_MEM_TYPE_64BIT) {
1066 PCI_BAR(pi->pi_bar + 1), base);