mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-07 05:53:06 +00:00
rtl8188eu: Fix sparse issues in core/rtw_mp.c
For the most part, these are endian related. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
8a098e4f68
commit
80c723e738
4 changed files with 45 additions and 97 deletions
|
@ -345,107 +345,55 @@ struct ieee_ibss_seq {
|
|||
_list list;
|
||||
};
|
||||
|
||||
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) || defined(PLATFORM_FREEBSD)
|
||||
|
||||
struct rtw_ieee80211_hdr {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
__le16 seq_ctl;
|
||||
u8 addr4[ETH_ALEN];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct rtw_ieee80211_hdr_3addr {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
__le16 seq_ctl;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
struct rtw_ieee80211_hdr_qos {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
__le16 seq_ctl;
|
||||
u8 addr4[ETH_ALEN];
|
||||
u16 qc;
|
||||
__le16 qc;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct rtw_ieee80211_hdr_3addr_qos {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
__le16 frame_ctl;
|
||||
__le16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
u16 qc;
|
||||
__le16 seq_ctl;
|
||||
__le16 qc;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct eapol {
|
||||
u8 snap[6];
|
||||
u16 ethertype;
|
||||
__le16 ethertype;
|
||||
u8 version;
|
||||
u8 type;
|
||||
u16 length;
|
||||
__le16 length;
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
||||
#pragma pack(1)
|
||||
struct rtw_ieee80211_hdr {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
u8 addr4[ETH_ALEN];
|
||||
};
|
||||
|
||||
struct rtw_ieee80211_hdr_3addr {
|
||||
u16 frame_ctl;
|
||||
u16 duration_id;
|
||||
u8 addr1[ETH_ALEN];
|
||||
u8 addr2[ETH_ALEN];
|
||||
u8 addr3[ETH_ALEN];
|
||||
u16 seq_ctl;
|
||||
};
|
||||
|
||||
|
||||
struct rtw_ieee80211_hdr_qos {
|
||||
struct rtw_ieee80211_hdr wlan_hdr;
|
||||
u16 qc;
|
||||
};
|
||||
|
||||
struct rtw_ieee80211_hdr_3addr_qos {
|
||||
struct rtw_ieee80211_hdr_3addr wlan_hdr;
|
||||
u16 qc;
|
||||
};
|
||||
|
||||
struct eapol {
|
||||
u8 snap[6];
|
||||
u16 ethertype;
|
||||
u8 version;
|
||||
u8 type;
|
||||
u16 length;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
enum eap_type {
|
||||
EAP_PACKET = 0,
|
||||
EAPOL_START,
|
||||
|
|
|
@ -257,43 +257,43 @@ struct tx_buf_desc {
|
|||
#elif (defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B)) && defined(CONFIG_PCI_HCI) /* 8192ee or 8814ae */
|
||||
/* 8192EE_TODO */
|
||||
struct tx_desc {
|
||||
unsigned int txdw0;
|
||||
unsigned int txdw1;
|
||||
unsigned int txdw2;
|
||||
unsigned int txdw3;
|
||||
unsigned int txdw4;
|
||||
unsigned int txdw5;
|
||||
unsigned int txdw6;
|
||||
unsigned int txdw7;
|
||||
__le32 txdw0;
|
||||
__le32 txdw1;
|
||||
__le32 txdw2;
|
||||
__le32 txdw3;
|
||||
__le32 txdw4;
|
||||
__le32 txdw5;
|
||||
__le32 txdw6;
|
||||
__le32 txdw7;
|
||||
};
|
||||
#else
|
||||
struct tx_desc {
|
||||
unsigned int txdw0;
|
||||
unsigned int txdw1;
|
||||
unsigned int txdw2;
|
||||
unsigned int txdw3;
|
||||
unsigned int txdw4;
|
||||
unsigned int txdw5;
|
||||
unsigned int txdw6;
|
||||
unsigned int txdw7;
|
||||
__le32 txdw0;
|
||||
__le32 txdw1;
|
||||
__le32 txdw2;
|
||||
__le32 txdw3;
|
||||
__le32 txdw4;
|
||||
__le32 txdw5;
|
||||
__le32 txdw6;
|
||||
__le32 txdw7;
|
||||
|
||||
#if defined(TXDESC_40_BYTES) || defined(TXDESC_64_BYTES)
|
||||
unsigned int txdw8;
|
||||
unsigned int txdw9;
|
||||
__le32 txdw8;
|
||||
__le32 txdw9;
|
||||
#endif /* TXDESC_40_BYTES */
|
||||
|
||||
#ifdef TXDESC_64_BYTES
|
||||
unsigned int txdw10;
|
||||
unsigned int txdw11;
|
||||
__le32 txdw10;
|
||||
__le32 txdw11;
|
||||
|
||||
/* 2008/05/15 MH Because PCIE HW memory R/W 4K limit. And now, our descriptor */
|
||||
/* size is 40 bytes. If you use more than 102 descriptor( 103*40>4096), HW will execute */
|
||||
/* memoryR/W CRC error. And then all DMA fetch will fail. We must decrease descriptor */
|
||||
/* number or enlarge descriptor size as 64 bytes. */
|
||||
unsigned int txdw12;
|
||||
unsigned int txdw13;
|
||||
unsigned int txdw14;
|
||||
unsigned int txdw15;
|
||||
__le32 txdw12;
|
||||
__le32 txdw13;
|
||||
__le32 txdw14;
|
||||
__le32 txdw15;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -374,8 +374,8 @@ enum WIFI_REG_DOMAIN {
|
|||
|
||||
#define set_frame_sub_type(pbuf, type) \
|
||||
do { \
|
||||
*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
|
||||
*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
|
||||
*(__le16 *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
|
||||
*(__le16 *)(pbuf) |= cpu_to_le16(type); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue