* Copyright(c) 2017 Intel Corporation
*/
-#ifndef _AVF_OSDEP_H_
-#define _AVF_OSDEP_H_
+#ifndef _IAVF_OSDEP_H_
+#define _IAVF_OSDEP_H_
#include <string.h>
#include <stdint.h>
#define max(a,b) RTE_MAX(a,b)
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
-#define ASSERT(x) if(!(x)) rte_panic("AVF: x")
+#define ASSERT(x) if(!(x)) rte_panic("IAVF: x")
#define DEBUGOUT(S) PMD_DRV_LOG_RAW(DEBUG, S)
#define DEBUGOUT2(S, A...) PMD_DRV_LOG_RAW(DEBUG, S, ##A)
#define le32_to_cpu(c) rte_le_to_cpu_32(c)
#define le64_to_cpu(k) rte_le_to_cpu_64(k)
-#define avf_memset(a, b, c, d) memset((a), (b), (c))
-#define avf_memcpy(a, b, c, d) rte_memcpy((a), (b), (c))
+#define iavf_memset(a, b, c, d) memset((a), (b), (c))
+#define iavf_memcpy(a, b, c, d) rte_memcpy((a), (b), (c))
-#define avf_usec_delay(x) rte_delay_us_sleep(x)
-#define avf_msec_delay(x) avf_usec_delay(1000 * (x))
+#define iavf_usec_delay(x) rte_delay_us_sleep(x)
+#define iavf_msec_delay(x) iavf_usec_delay(1000 * (x))
-#define AVF_PCI_REG(reg) rte_read32(reg)
-#define AVF_PCI_REG_ADDR(a, reg) \
+#define IAVF_PCI_REG(reg) rte_read32(reg)
+#define IAVF_PCI_REG_ADDR(a, reg) \
((volatile uint32_t *)((char *)(a)->hw_addr + (reg)))
-#define AVF_PCI_REG_WRITE(reg, value) \
+#define IAVF_PCI_REG_WRITE(reg, value) \
rte_write32((rte_cpu_to_le_32(value)), reg)
-#define AVF_PCI_REG_WRITE_RELAXED(reg, value) \
+#define IAVF_PCI_REG_WRITE_RELAXED(reg, value) \
rte_write32_relaxed((rte_cpu_to_le_32(value)), reg)
static inline
-uint32_t avf_read_addr(volatile void *addr)
+uint32_t iavf_read_addr(volatile void *addr)
{
- return rte_le_to_cpu_32(AVF_PCI_REG(addr));
+ return rte_le_to_cpu_32(IAVF_PCI_REG(addr));
}
-#define AVF_READ_REG(hw, reg) \
- avf_read_addr(AVF_PCI_REG_ADDR((hw), (reg)))
-#define AVF_WRITE_REG(hw, reg, value) \
- AVF_PCI_REG_WRITE(AVF_PCI_REG_ADDR((hw), (reg)), (value))
-#define AVF_WRITE_FLUSH(a) \
- AVF_READ_REG(a, AVFGEN_RSTAT)
+#define IAVF_READ_REG(hw, reg) \
+ iavf_read_addr(IAVF_PCI_REG_ADDR((hw), (reg)))
+#define IAVF_WRITE_REG(hw, reg, value) \
+ IAVF_PCI_REG_WRITE(IAVF_PCI_REG_ADDR((hw), (reg)), (value))
+#define IAVF_WRITE_FLUSH(a) \
+ IAVF_READ_REG(a, IAVF_VFGEN_RSTAT)
-#define rd32(a, reg) avf_read_addr(AVF_PCI_REG_ADDR((a), (reg)))
+#define rd32(a, reg) iavf_read_addr(IAVF_PCI_REG_ADDR((a), (reg)))
#define wr32(a, reg, value) \
- AVF_PCI_REG_WRITE(AVF_PCI_REG_ADDR((a), (reg)), (value))
+ IAVF_PCI_REG_WRITE(IAVF_PCI_REG_ADDR((a), (reg)), (value))
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
-#define avf_debug(h, m, s, ...) \
+#define iavf_debug(h, m, s, ...) \
do { \
if (((m) & (h)->debug_mask)) \
- PMD_DRV_LOG_RAW(DEBUG, "avf %02x.%x " s, \
+ PMD_DRV_LOG_RAW(DEBUG, "iavf %02x.%x " s, \
(h)->bus.device, (h)->bus.func, \
##__VA_ARGS__); \
} while (0)
/* memory allocation tracking */
-struct avf_dma_mem {
+struct iavf_dma_mem {
void *va;
u64 pa;
u32 size;
const void *zone;
} __attribute__((packed));
-struct avf_virt_mem {
+struct iavf_virt_mem {
void *va;
u32 size;
} __attribute__((packed));
/* SW spinlock */
-struct avf_spinlock {
+struct iavf_spinlock {
rte_spinlock_t spinlock;
};
-#define avf_allocate_dma_mem(h, m, unused, s, a) \
- avf_allocate_dma_mem_d(h, m, s, a)
-#define avf_free_dma_mem(h, m) avf_free_dma_mem_d(h, m)
+#define iavf_allocate_dma_mem(h, m, unused, s, a) \
+ iavf_allocate_dma_mem_d(h, m, s, a)
+#define iavf_free_dma_mem(h, m) iavf_free_dma_mem_d(h, m)
-#define avf_allocate_virt_mem(h, m, s) avf_allocate_virt_mem_d(h, m, s)
-#define avf_free_virt_mem(h, m) avf_free_virt_mem_d(h, m)
+#define iavf_allocate_virt_mem(h, m, s) iavf_allocate_virt_mem_d(h, m, s)
+#define iavf_free_virt_mem(h, m) iavf_free_virt_mem_d(h, m)
static inline void
-avf_init_spinlock_d(struct avf_spinlock *sp)
+iavf_init_spinlock_d(struct iavf_spinlock *sp)
{
rte_spinlock_init(&sp->spinlock);
}
static inline void
-avf_acquire_spinlock_d(struct avf_spinlock *sp)
+iavf_acquire_spinlock_d(struct iavf_spinlock *sp)
{
rte_spinlock_lock(&sp->spinlock);
}
static inline void
-avf_release_spinlock_d(struct avf_spinlock *sp)
+iavf_release_spinlock_d(struct iavf_spinlock *sp)
{
rte_spinlock_unlock(&sp->spinlock);
}
static inline void
-avf_destroy_spinlock_d(__rte_unused struct avf_spinlock *sp)
+iavf_destroy_spinlock_d(__rte_unused struct iavf_spinlock *sp)
{
}
-#define avf_init_spinlock(_sp) avf_init_spinlock_d(_sp)
-#define avf_acquire_spinlock(_sp) avf_acquire_spinlock_d(_sp)
-#define avf_release_spinlock(_sp) avf_release_spinlock_d(_sp)
-#define avf_destroy_spinlock(_sp) avf_destroy_spinlock_d(_sp)
+#define iavf_init_spinlock(_sp) iavf_init_spinlock_d(_sp)
+#define iavf_acquire_spinlock(_sp) iavf_acquire_spinlock_d(_sp)
+#define iavf_release_spinlock(_sp) iavf_release_spinlock_d(_sp)
+#define iavf_destroy_spinlock(_sp) iavf_destroy_spinlock_d(_sp)
-#endif /* _AVF_OSDEP_H_ */
+#endif /* _IAVF_OSDEP_H_ */