u32 mbox_addr)
{
for ( ; nflit; nflit--, mbox_addr += 8)
- *rpl++ = htobe64(t4_read_reg64(adap, mbox_addr));
+ *rpl++ = cpu_to_be64(t4_read_reg64(adap, mbox_addr));
}
/*
return -EINVAL;
}
- bzero(p, size);
+ memset(p, 0, size);
memcpy(p, (const __be64 *)cmd, size);
/*
#include <rte_spinlock.h>
#include <rte_log.h>
#include <rte_io.h>
+#include <rte_net.h>
#define dev_printf(level, fmt, ...) \
RTE_LOG(level, PMD, "rte_cxgbe_pmd: " fmt, ##__VA_ARGS__)
#define false 0
#define true 1
+#ifndef min
#define min(a, b) RTE_MIN(a, b)
+#endif
+
+#ifndef max
#define max(a, b) RTE_MAX(a, b)
+#endif
/*
* round up val _p to a power of 2 size _s
*/
#define cxgbe_roundup(_p, _s) (((unsigned long)(_p) + (_s - 1)) & ~(_s - 1))
-#undef container_of
+#ifndef container_of
#define container_of(ptr, type, member) ({ \
typeof(((type *)0)->member)(*__mptr) = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); })
+#endif
#define ARRAY_SIZE(arr) RTE_DIM(arr)
#define be64_to_cpu(o) rte_be_to_cpu_64(o)
#define le32_to_cpu(o) rte_le_to_cpu_32(o)
+#ifndef ntohs
+#define ntohs(o) be16_to_cpu(o)
+#endif
+
+#ifndef ntohl
+#define ntohl(o) be32_to_cpu(o)
+#endif
+
+#ifndef htons
+#define htons(o) cpu_to_be16(o)
+#endif
+
+#ifndef htonl
+#define htonl(o) cpu_to_be32(o)
+#endif
+
+#ifndef caddr_t
+typedef char *caddr_t;
+#endif
+
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#define DELAY(x) rte_delay_us(x)
#define udelay(x) DELAY(x)