1 /****************************************************************************** 2 * 3 * Copyright(c) 2019 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef __PLATFORM_OPS_H__ 16 #define __PLATFORM_OPS_H__ 17 18 /* 19 * Return: 20 *0: power on successfully 21 *others: power on failed 22 */ 23 24 #ifdef CONFIG_PLATFORM_OPS 25 int platform_wifi_power_on(void); 26 void platform_wifi_power_off(void); 27 void pci_cache_wback(struct pci_dev *hwdev, 28 dma_addr_t *bus_addr, size_t size, int direction); 29 void pci_cache_inv(struct pci_dev *hwdev, 30 dma_addr_t *bus_addr, size_t size, int direction); 31 void pci_get_bus_addr(struct pci_dev *hwdev, 32 void *vir_addr, dma_addr_t *bus_addr, size_t size, int direction); 33 void pci_unmap_bus_addr(struct pci_dev *hwdev, 34 dma_addr_t *bus_addr, size_t size, int direction); 35 void *pci_alloc_cache_mem(struct pci_dev *pdev, 36 dma_addr_t *bus_addr, size_t size, int direction); 37 void *pci_alloc_noncache_mem(struct pci_dev *pdev, 38 dma_addr_t *bus_addr, size_t size); 39 void pci_free_cache_mem(struct pci_dev *pdev, void *vir_addr, 40 dma_addr_t *bus_addr, size_t size, int direction); 41 void pci_free_noncache_mem(struct pci_dev *pdev, void *vir_addr, 42 dma_addr_t *bus_addr, size_t size); 43 struct dma_pool *pci_create_dma_pool(struct pci_dev *pdev, char *name, size_t size); 44 void pci_destory_dma_pool(struct pci_dev *pdev, struct dma_pool *pool); 45 void *pci_zalloc_pool_mem(struct pci_dev *pdev, struct dma_pool *pool, dma_addr_t *bus_addr); 46 void pci_free_pool_mem(struct pci_dev *pdev, struct dma_pool *pool, void *vir_addr, dma_addr_t *bus_addr); 47 #else 48 #define platform_wifi_power_on(void) 0 49 #define platform_wifi_power_off(void) 50 #endif 51 52 #endif /* __PLATFORM_OPS_H__ */ 53