Use kernel headers for __le* types to avoid potential conflicts
resulting in redefinition errors during Linux builds. Add check
for BSD builds.

Fixes: 38dff79ba736 ("net/bnx2x: update HSI")

Signed-off-by: Rasesh Mody <rm...@marvell.com>
Tested-by: Dharmik Thakkar <dharmik.thak...@arm.com>
Tested-by: Gavin Hu <gavin...@arm.com>
---
 drivers/net/bnx2x/bnx2x_osal.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnx2x/bnx2x_osal.h b/drivers/net/bnx2x/bnx2x_osal.h
index 7cd293259..72e4b6d6b 100644
--- a/drivers/net/bnx2x/bnx2x_osal.h
+++ b/drivers/net/bnx2x/bnx2x_osal.h
@@ -8,7 +8,11 @@
 #ifndef BNX2X_OSAL_H
 #define BNX2X_OSAL_H
 
+#ifdef __FreeBSD__
 #include <sys/stat.h>
+#else
+#include <linux/types.h>
+#endif
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 #ifndef __LITTLE_ENDIAN
@@ -22,8 +26,10 @@
 #undef __LITTLE_ENDIAN
 #endif
 
+#ifdef __FreeBSD__
 #define __le16         uint16_t
 #define __le32         uint32_t
 #define __le64         uint64_t
+#endif
 
 #endif /* BNX2X_OSAL_H */
-- 
2.18.0

Reply via email to