Lines Matching refs:epc
13 #include <linux/pci-epc.h>
40 * @epc: the EPC device that invoked pci_epc_mem_init
47 int pci_epc_multi_mem_init(struct pci_epc *epc,
60 epc->num_windows = 0;
65 epc->windows = kcalloc(num_windows, sizeof(*epc->windows), GFP_KERNEL);
66 if (!epc->windows)
98 epc->windows[i] = mem;
101 epc->mem = epc->windows[0];
102 epc->num_windows = num_windows;
108 mem = epc->windows[i];
112 kfree(epc->windows);
120 * @epc: the EPC device that invoked pci_epc_mem_init
128 int pci_epc_mem_init(struct pci_epc *epc, phys_addr_t base,
137 return pci_epc_multi_mem_init(epc, &mem_window, 1);
143 * @epc: the EPC device that invoked pci_epc_mem_exit
148 void pci_epc_mem_exit(struct pci_epc *epc)
153 if (!epc->num_windows)
156 for (i = 0; i < epc->num_windows; i++) {
157 mem = epc->windows[i];
161 kfree(epc->windows);
163 epc->windows = NULL;
164 epc->mem = NULL;
165 epc->num_windows = 0;
171 * @epc: the EPC device on which memory has to be allocated
178 void __iomem *pci_epc_mem_alloc_addr(struct pci_epc *epc,
189 for (i = 0; i < epc->num_windows; i++) {
190 mem = epc->windows[i];
218 static struct pci_epc_mem *pci_epc_get_matching_window(struct pci_epc *epc,
224 for (i = 0; i < epc->num_windows; i++) {
225 mem = epc->windows[i];
237 * @epc: the EPC device on which memory was allocated
244 void pci_epc_mem_free_addr(struct pci_epc *epc, phys_addr_t phys_addr,
253 mem = pci_epc_get_matching_window(epc, phys_addr);