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);
118 int pci_epc_mem_init(struct pci_epc *epc, phys_addr_t base,
127 return pci_epc_multi_mem_init(epc, &mem_window, 1);
133 * @epc: the EPC device that invoked pci_epc_mem_exit
138 void pci_epc_mem_exit(struct pci_epc *epc)
143 if (!epc->num_windows)
146 for (i = 0; i < epc->num_windows; i++) {
147 mem = epc->windows[i];
151 kfree(epc->windows);
153 epc->windows = NULL;
154 epc->mem = NULL;
155 epc->num_windows = 0;
161 * @epc: the EPC device on which memory has to be allocated
168 void __iomem *pci_epc_mem_alloc_addr(struct pci_epc *epc,
179 for (i = 0; i < epc->num_windows; i++) {
180 mem = epc->windows[i];
208 static struct pci_epc_mem *pci_epc_get_matching_window(struct pci_epc *epc,
214 for (i = 0; i < epc->num_windows; i++) {
215 mem = epc->windows[i];
227 * @epc: the EPC device on which memory was allocated
234 void pci_epc_mem_free_addr(struct pci_epc *epc, phys_addr_t phys_addr,
243 mem = pci_epc_get_matching_window(epc, phys_addr);