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:
Larry Finger 2018-10-14 23:29:18 -05:00
parent 8a098e4f68
commit 80c723e738
4 changed files with 45 additions and 97 deletions

View file

@ -392,7 +392,7 @@ static VOID PHY_SetRFPathSwitch_default(
}
void mpt_InitHWConfig(PADAPTER Adapter)
static void mpt_InitHWConfig(PADAPTER Adapter)
{
if (IS_HARDWARE_TYPE_8723B(Adapter)) {
/* TODO: <20130114, Kordan> The following setting is only for DPDT and Fixed board type. */
@ -1247,7 +1247,7 @@ int SetTxPower(PADAPTER pAdapter)
return _TRUE;
}
void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset)
static void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset)
{
u32 TxAGCOffset_B, TxAGCOffset_C, TxAGCOffset_D, tmpAGC;
@ -1427,7 +1427,7 @@ void fill_txdesc_for_mp(PADAPTER padapter, u8 *ptxdesc)
}
#if defined(CONFIG_RTL8188E)
void fill_tx_desc_8188e(PADAPTER padapter)
static void fill_tx_desc_8188e(PADAPTER padapter)
{
struct mp_priv *pmp_priv = &padapter->mppriv;
struct tx_desc *desc = (struct tx_desc *)&(pmp_priv->tx.desc);

View file

@ -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,

View file

@ -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

View file

@ -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)