1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-29 16:37:40 +00:00

Use endian macros from kernel instead hardcoded

This commit is contained in:
kimocoder 2019-08-16 16:50:59 +02:00
parent 100b73747b
commit d664d7e949
8 changed files with 18 additions and 33 deletions

View File

@ -1296,7 +1296,6 @@ endif
EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
ARCH ?= $(SUBARCH)

View File

@ -225,9 +225,9 @@ enum rt_spinlock_type {
#endif
#if defined(CONFIG_LITTLE_ENDIAN)
#if defined(__LITTLE_ENDIAN)
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
#elif defined(CONFIG_BIG_ENDIAN)
#else
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
#endif

View File

@ -58,7 +58,7 @@ struct rsn_ie_hdr {
} __attribute__((packed));
struct wme_ac_parameter {
#if defined(CONFIG_LITTLE_ENDIAN)
#if defined(__LITTLE_ENDIAN)
/* byte 1 */
u8 aifsn:4,
acm:1,
@ -68,7 +68,7 @@ struct wme_ac_parameter {
/* byte 2 */
u8 eCWmin:4,
eCWmax:4;
#elif defined(CONFIG_BIG_ENDIAN)
#else
/* byte 1 */
u8 reserved:1,
aci:2,
@ -78,8 +78,6 @@ struct wme_ac_parameter {
/* byte 2 */
u8 eCWmax:4,
eCWmin:4;
#else
#error "Please fix <endian.h>"
#endif
/* bytes 3 & 4 */

View File

@ -16,18 +16,10 @@
#define _RTL871X_BYTEORDER_H_
#if defined(CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN)
#error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n"
#endif
#if defined(CONFIG_LITTLE_ENDIAN)
#ifndef CONFIG_PLATFORM_MSTAR389
#include <byteorder/little_endian.h>
#endif
#elif defined (CONFIG_BIG_ENDIAN)
#include <byteorder/big_endian.h>
#if defined(__LITTLE_ENDIAN)
#include <byteorder/little_endian.h>
#else
# error "Must be LITTLE/BIG Endian Host"
#include <byteorder/big_endian.h>
#endif
#endif /* _RTL871X_BYTEORDER_H_ */

View File

@ -192,7 +192,7 @@ struct intf_hdl {
struct reg_protocol_rd {
#ifdef CONFIG_LITTLE_ENDIAN
#ifdef __LITTLE_ENDIAN
/* DW1 */
u32 NumOfTrans:4;
@ -250,7 +250,7 @@ struct reg_protocol_rd {
struct reg_protocol_wt {
#ifdef CONFIG_LITTLE_ENDIAN
#ifdef __LITTLE_ENDIAN
/* DW1 */
u32 NumOfTrans:4;

View File

@ -1205,21 +1205,17 @@ struct cmd_hdl wlancmds[] = {
struct C2HEvent_Header {
#ifdef CONFIG_LITTLE_ENDIAN
#ifdef __LITTLE_ENDIAN
unsigned int len:16;
unsigned int ID:8;
unsigned int seq:8;
#elif defined(CONFIG_BIG_ENDIAN)
unsigned int seq:8;
unsigned int ID:8;
unsigned int len:16;
#else
# error "Must be LITTLE or BIG Endian"
unsigned int seq:8;
unsigned int ID:8;
unsigned int len:16;
#endif

View File

@ -74,7 +74,7 @@ union pn48 {
u64 val;
#ifdef CONFIG_LITTLE_ENDIAN
#ifdef __LITTLE_ENDIAN
struct {
u8 TSC0;
@ -87,7 +87,7 @@ struct {
u8 TSC7;
} _byte_;
#elif defined(CONFIG_BIG_ENDIAN)
#else
struct {
u8 TSC7;

View File

@ -11660,10 +11660,10 @@ static void printdata(u8 *pbuf, u32 len)
}
if (i < len) {
#ifdef CONFIG_BIG_ENDIAN
#ifdef __BIG_ENDIAN
for (; i < len, i++)
printk("%02X", pbuf + i);
#else /* CONFIG_LITTLE_ENDIAN */
#else /* __LITTLE_ENDIAN */
#if 0
val = 0;
_rtw_memcpy(&val, pbuf + i, len - i);
@ -11678,7 +11678,7 @@ static void printdata(u8 *pbuf, u32 len)
n = (4 - n) * 2;
printk("%8s", str + n);
#endif
#endif /* CONFIG_LITTLE_ENDIAN */
#endif /* __LITTLE_ENDIAN */
}
printk("\n");
}