mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-30 00:47:38 +00:00
Use endian macros from kernel instead hardcoded
This commit is contained in:
parent
100b73747b
commit
d664d7e949
1
Makefile
1
Makefile
@ -1296,7 +1296,6 @@ endif
|
|||||||
EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
|
EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
|
||||||
|
|
||||||
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
|
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
|
||||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
|
||||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||||
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||||
ARCH ?= $(SUBARCH)
|
ARCH ?= $(SUBARCH)
|
||||||
|
@ -225,9 +225,9 @@ enum rt_spinlock_type {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
#if defined(__LITTLE_ENDIAN)
|
||||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||||
#elif defined(CONFIG_BIG_ENDIAN)
|
#else
|
||||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ struct rsn_ie_hdr {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct wme_ac_parameter {
|
struct wme_ac_parameter {
|
||||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
#if defined(__LITTLE_ENDIAN)
|
||||||
/* byte 1 */
|
/* byte 1 */
|
||||||
u8 aifsn:4,
|
u8 aifsn:4,
|
||||||
acm:1,
|
acm:1,
|
||||||
@ -68,7 +68,7 @@ struct wme_ac_parameter {
|
|||||||
/* byte 2 */
|
/* byte 2 */
|
||||||
u8 eCWmin:4,
|
u8 eCWmin:4,
|
||||||
eCWmax:4;
|
eCWmax:4;
|
||||||
#elif defined(CONFIG_BIG_ENDIAN)
|
#else
|
||||||
/* byte 1 */
|
/* byte 1 */
|
||||||
u8 reserved:1,
|
u8 reserved:1,
|
||||||
aci:2,
|
aci:2,
|
||||||
@ -78,8 +78,6 @@ struct wme_ac_parameter {
|
|||||||
/* byte 2 */
|
/* byte 2 */
|
||||||
u8 eCWmax:4,
|
u8 eCWmax:4,
|
||||||
eCWmin:4;
|
eCWmin:4;
|
||||||
#else
|
|
||||||
#error "Please fix <endian.h>"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* bytes 3 & 4 */
|
/* bytes 3 & 4 */
|
||||||
|
@ -16,18 +16,10 @@
|
|||||||
#define _RTL871X_BYTEORDER_H_
|
#define _RTL871X_BYTEORDER_H_
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN)
|
#if defined(__LITTLE_ENDIAN)
|
||||||
#error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n"
|
#include <byteorder/little_endian.h>
|
||||||
#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>
|
|
||||||
#else
|
#else
|
||||||
# error "Must be LITTLE/BIG Endian Host"
|
#include <byteorder/big_endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _RTL871X_BYTEORDER_H_ */
|
#endif /* _RTL871X_BYTEORDER_H_ */
|
||||||
|
@ -192,7 +192,7 @@ struct intf_hdl {
|
|||||||
|
|
||||||
struct reg_protocol_rd {
|
struct reg_protocol_rd {
|
||||||
|
|
||||||
#ifdef CONFIG_LITTLE_ENDIAN
|
#ifdef __LITTLE_ENDIAN
|
||||||
|
|
||||||
/* DW1 */
|
/* DW1 */
|
||||||
u32 NumOfTrans:4;
|
u32 NumOfTrans:4;
|
||||||
@ -250,7 +250,7 @@ struct reg_protocol_rd {
|
|||||||
struct reg_protocol_wt {
|
struct reg_protocol_wt {
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_LITTLE_ENDIAN
|
#ifdef __LITTLE_ENDIAN
|
||||||
|
|
||||||
/* DW1 */
|
/* DW1 */
|
||||||
u32 NumOfTrans:4;
|
u32 NumOfTrans:4;
|
||||||
|
@ -1205,21 +1205,17 @@ struct cmd_hdl wlancmds[] = {
|
|||||||
|
|
||||||
struct C2HEvent_Header {
|
struct C2HEvent_Header {
|
||||||
|
|
||||||
#ifdef CONFIG_LITTLE_ENDIAN
|
#ifdef __LITTLE_ENDIAN
|
||||||
|
|
||||||
unsigned int len:16;
|
unsigned int len:16;
|
||||||
unsigned int ID:8;
|
unsigned int ID:8;
|
||||||
unsigned int seq:8;
|
unsigned int seq:8;
|
||||||
|
|
||||||
#elif defined(CONFIG_BIG_ENDIAN)
|
|
||||||
|
|
||||||
unsigned int seq:8;
|
|
||||||
unsigned int ID:8;
|
|
||||||
unsigned int len:16;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# error "Must be LITTLE or BIG Endian"
|
unsigned int seq:8;
|
||||||
|
unsigned int ID:8;
|
||||||
|
unsigned int len:16;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ union pn48 {
|
|||||||
|
|
||||||
u64 val;
|
u64 val;
|
||||||
|
|
||||||
#ifdef CONFIG_LITTLE_ENDIAN
|
#ifdef __LITTLE_ENDIAN
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u8 TSC0;
|
u8 TSC0;
|
||||||
@ -87,7 +87,7 @@ struct {
|
|||||||
u8 TSC7;
|
u8 TSC7;
|
||||||
} _byte_;
|
} _byte_;
|
||||||
|
|
||||||
#elif defined(CONFIG_BIG_ENDIAN)
|
#else
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u8 TSC7;
|
u8 TSC7;
|
||||||
|
@ -11660,10 +11660,10 @@ static void printdata(u8 *pbuf, u32 len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i < len) {
|
if (i < len) {
|
||||||
#ifdef CONFIG_BIG_ENDIAN
|
#ifdef __BIG_ENDIAN
|
||||||
for (; i < len, i++)
|
for (; i < len, i++)
|
||||||
printk("%02X", pbuf + i);
|
printk("%02X", pbuf + i);
|
||||||
#else /* CONFIG_LITTLE_ENDIAN */
|
#else /* __LITTLE_ENDIAN */
|
||||||
#if 0
|
#if 0
|
||||||
val = 0;
|
val = 0;
|
||||||
_rtw_memcpy(&val, pbuf + i, len - i);
|
_rtw_memcpy(&val, pbuf + i, len - i);
|
||||||
@ -11678,7 +11678,7 @@ static void printdata(u8 *pbuf, u32 len)
|
|||||||
n = (4 - n) * 2;
|
n = (4 - n) * 2;
|
||||||
printk("%8s", str + n);
|
printk("%8s", str + n);
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_LITTLE_ENDIAN */
|
#endif /* __LITTLE_ENDIAN */
|
||||||
}
|
}
|
||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user