rtl8723ds: Make fixes for more Sparse errors

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger
2017-10-25 11:34:05 -05:00
parent 525d5256f5
commit 1621248cc1
12 changed files with 73 additions and 89 deletions

View File

@@ -43,7 +43,7 @@ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
u8 maskfileBuffer[64];
/*------------------------Define local variable------------------------------*/
BOOLEAN rtw_file_efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
static BOOLEAN rtw_file_efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
{
int r = Offset / 16;
int c = (Offset % 16) / 2;
@@ -60,7 +60,7 @@ BOOLEAN rtw_file_efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
return (result > 0) ? 0 : 1;
}
BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
static BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
@@ -1506,7 +1506,7 @@ Efuse_PgPacketWrite(IN PADAPTER pAdapter,
}
int
static int
Efuse_PgPacketWrite_BT(IN PADAPTER pAdapter,
IN u8 offset,
IN u8 word_en,

View File

@@ -4233,9 +4233,9 @@ static void session_tracker_cmd_hdl(_adapter *adapter, struct st_cmd_parm *parm)
} else if (cmd == ST_CMD_ADD || cmd == ST_CMD_DEL) {
struct st_ctl_t *st_ctl;
u32 local_naddr = parm->local_naddr;
u16 local_port = parm->local_port;
__be16 local_port = parm->local_port;
u32 remote_naddr = parm->remote_naddr;
u16 remote_port = parm->remote_port;
__be16 remote_port = parm->remote_port;
struct session_tracker *st = NULL;
_irqL irqL;
_list *plist, *phead;

View File

@@ -23,7 +23,7 @@
#include <hal_data.h>
#ifdef CONFIG_RTW_DEBUG
const char *rtw_log_level_str[] = {
static const char *rtw_log_level_str[] = {
"_DRV_NONE_ = 0",
"_DRV_ALWAYS_ = 1",
"_DRV_ERR_ = 2",
@@ -358,7 +358,7 @@ void rtw_sink_rtp_seq_dbg(_adapter *adapter, _pkt *pkt)
{
struct recv_priv *precvpriv = &(adapter->recvpriv);
if (precvpriv->sink_udpport > 0) {
if (*((u16 *)((pkt->data) + 0x24)) == cpu_to_be16(precvpriv->sink_udpport)) {
if (*((__be16 *)((pkt->data) + 0x24)) == cpu_to_be16(precvpriv->sink_udpport)) {
precvpriv->pre_rtp_rxseq = precvpriv->cur_rtp_rxseq;
precvpriv->cur_rtp_rxseq = be16_to_cpu(*((u16 *)((pkt->data) + 0x2C)));
if (precvpriv->pre_rtp_rxseq + 1 != precvpriv->cur_rtp_rxseq)

View File

@@ -442,20 +442,20 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
ie += sz;
/* beacon interval : 2bytes */
*(u16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod); /* BCN_INTERVAL; */
*(__le16 *)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod); /* BCN_INTERVAL; */
sz += 2;
ie += 2;
/* capability info */
*(u16 *)ie = 0;
*(u16 *)ie |= cpu_to_le16(cap_IBSS);
*(__le16 *)ie |= cpu_to_le16(cap_IBSS);
if (pregistrypriv->preamble == PREAMBLE_SHORT)
*(u16 *)ie |= cpu_to_le16(cap_ShortPremble);
*(__le16 *)ie |= cpu_to_le16(cap_ShortPremble);
if (pdev_network->Privacy)
*(u16 *)ie |= cpu_to_le16(cap_Privacy);
*(__le16 *)ie |= cpu_to_le16(cap_Privacy);
sz += 2;
ie += 2;
@@ -1447,7 +1447,7 @@ void dump_ht_cap_ie_content(void *sel, u8 *buf, u32 buf_len)
, HT_SUP_MCS_SET_ARG(HT_CAP_ELE_SUP_MCS_SET(buf)));
}
void dump_ht_cap_ie(void *sel, u8 *ie, u32 ie_len)
static void dump_ht_cap_ie(void *sel, u8 *ie, u32 ie_len)
{
u8 *pos = (u8 *)ie;
u16 id;
@@ -2487,7 +2487,7 @@ int ieee80211_get_hdrlen(u16 fc)
return hdrlen;
}
int rtw_get_cipher_info(struct wlan_network *pnetwork)
static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{
u32 wpa_ielen;
unsigned char *pbuf;

View File

@@ -4521,7 +4521,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_STATUS;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0001);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(0x0001);
p2pielen += 2;
/* Value: */
@@ -4532,7 +4532,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0002);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(0x0002);
p2pielen += 2;
/* Value: */
@@ -4559,7 +4559,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_GO_INTENT;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0001);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(0x0001);
p2pielen += 2;
/* Value: */
@@ -4577,7 +4577,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_CONF_TIMEOUT;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0002);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(0x0002);
p2pielen += 2;
/* Value: */
@@ -4589,7 +4589,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_OPERATING_CH;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0005);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(0x0005);
p2pielen += 2;
/* Value: */
@@ -4621,7 +4621,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_INTENDED_IF_ADDR;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN);
p2pielen += 2;
/* Value: */
@@ -4641,11 +4641,11 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
#ifdef CONFIG_CONCURRENT_MODE
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(5 + 1);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(5 + 1);
else
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
#else
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
#endif
p2pielen += 2;
@@ -4721,7 +4721,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
/* Length: */
/* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */
/* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len);
*(__be16 *)(p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len);
p2pielen += 2;
/* Value: */
@@ -4732,21 +4732,21 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
/* Config Method */
/* This field should be big endian. Noted by P2P specification. */
*(u16 *)(p2pie + p2pielen) = cpu_to_be16(pwdinfo->supported_wps_cm);
*(__be16 *)(p2pie + p2pielen) = cpu_to_be16(pwdinfo->supported_wps_cm);
p2pielen += 2;
/* Primary Device Type */
/* Category ID */
*(u16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA);
*(__be16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA);
p2pielen += 2;
/* OUI */
*(u32 *)(p2pie + p2pielen) = cpu_to_be32(WPSOUI);
*(__be32 *)(p2pie + p2pielen) = cpu_to_be32(WPSOUI);
p2pielen += 4;
/* Sub Category ID */
*(u16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER);
*(__be16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER);
p2pielen += 2;
/* Number of Secondary Device Types */
@@ -4754,11 +4754,11 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
/* Device Name */
/* Type: */
*(u16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME);
*(__be16 *)(p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME);
p2pielen += 2;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len);
*(__be16 *)(p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len);
p2pielen += 2;
/* Value: */
@@ -4771,7 +4771,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l
p2pie[p2pielen++] = P2P_ATTR_GROUP_ID;
/* Length: */
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + pwdinfo->nego_ssidlen);
*(__le16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + pwdinfo->nego_ssidlen);
p2pielen += 2;
/* Value: */
@@ -5056,7 +5056,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr)
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
__le16 *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);

View File

@@ -278,7 +278,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length));
*((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length));
arcfour_init(&mycontext, wepkey, 3 + keylength);
arcfour_encrypt(&mycontext, payload, payload, length);
@@ -286,7 +286,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
} else {
length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len ;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length));
*((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length));
arcfour_init(&mycontext, wepkey, 3 + keylength);
arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload + length, crc, 4);
@@ -337,7 +337,7 @@ void rtw_wep_decrypt(_adapter *padapter, u8 *precvframe)
arcfour_encrypt(&mycontext, payload, payload, length);
/* calculate icv and compare the icv */
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4));
*((__le32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4));
WEP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra);
@@ -761,7 +761,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
if ((curfragnum + 1) == pattrib->nr_frags) { /* 4 the last fragment */
length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); /* modified by Amy*/
*((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length)); /* modified by Amy*/
arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length);
@@ -769,7 +769,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
} else {
length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len ;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); /* modified by Amy*/
*((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length)); /* modified by Amy*/
arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload + length, crc, 4);
@@ -887,7 +887,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length);
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4));
*((__le32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4));
if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] || crc[1] != payload[length - 3] || crc[0] != payload[length - 4]) {
res = _FAIL;
@@ -1373,8 +1373,8 @@ static sint aes_cipher(u8 *key, uint hdrlen,
u8 padded_buffer[16];
u8 mic[8];
/* uint offset = 0; */
uint frtype = GetFrameType(pframe);
uint frsubtype = GetFrameSubType(pframe);
__le16 frtype = GetFrameType(pframe);
__le16 frsubtype = GetFrameSubType(pframe);
frsubtype = frsubtype >> 4;
@@ -1682,8 +1682,8 @@ static sint aes_decipher(u8 *key, uint hdrlen,
/* uint offset = 0; */
uint frtype = GetFrameType(pframe);
uint frsubtype = GetFrameSubType(pframe);
__le16 frtype = GetFrameType(pframe);
__le16 frsubtype = GetFrameSubType(pframe);
frsubtype = frsubtype >> 4;
@@ -2840,7 +2840,7 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem,
* OMAC1 was standardized with the name CMAC by NIST in a Special Publication
* (SP) 800-38B.
*/ /* modify for CONFIG_IEEE80211W */
int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac)
static int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac)
{
return omac1_aes_128_vector(key, 1, &data, &data_len, mac);
}