rtl8188eu: Fix more sparse warnings

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-10-25 14:23:42 -05:00
parent e36aed3385
commit 7c7b83836e
43 changed files with 677 additions and 862 deletions

View file

@ -58,15 +58,9 @@ static void update_BCNTIM(_adapter *padapter)
WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network); WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network);
unsigned char *pie = pnetwork_mlmeext->IEs; unsigned char *pie = pnetwork_mlmeext->IEs;
#if 0
/* update TIM IE */
/* if(pstapriv->tim_bitmap) */
#endif
if (_TRUE) { if (_TRUE) {
u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL;
u16 tim_bitmap_le; __le16 tim_bitmap_le;
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap); tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap);
@ -1102,25 +1096,10 @@ static void update_hw_ht_param(_adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len));
/* */
/* Config SM Power Save setting */ /* Config SM Power Save setting */
/* */ pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2;
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) {
#if 0
u8 i;
/* update the MCS rates */
for (i = 0; i < 16; i++)
pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
#endif
RTW_INFO("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__); RTW_INFO("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__);
}
/* */
/* Config current HT Protection mode. */
/* */
/* pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; */
} }
static void rtw_ap_check_scan(_adapter *padapter) static void rtw_ap_check_scan(_adapter *padapter)
@ -1759,19 +1738,19 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
/* Update HT Capabilities Info field */ /* Update HT Capabilities Info field */
if (pmlmepriv->htpriv.sgi_20m == _FALSE) if (pmlmepriv->htpriv.sgi_20m == _FALSE)
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_SGI_20); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_20));
if (pmlmepriv->htpriv.sgi_40m == _FALSE) if (pmlmepriv->htpriv.sgi_40m == _FALSE)
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_SGI_40); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_40));
if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX)) if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX))
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_LDPC_CODING); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_LDPC_CODING));
if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_TX)) if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_TX))
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_TX_STBC); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_TX_STBC));
if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_RX)) if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_RX))
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_RX_STBC_3R); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_RX_STBC_3R));
/* Update A-MPDU Parameters field */ /* Update A-MPDU Parameters field */
pht_cap->ampdu_params_info &= ~(IEEE80211_HT_CAP_AMPDU_FACTOR | IEEE80211_HT_CAP_AMPDU_DENSITY); pht_cap->ampdu_params_info &= ~(IEEE80211_HT_CAP_AMPDU_FACTOR | IEEE80211_HT_CAP_AMPDU_DENSITY);
@ -1995,7 +1974,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
} }
#if CONFIG_RTW_MACADDR_ACL #if CONFIG_RTW_MACADDR_ACL
void rtw_macaddr_acl_init(_adapter *adapter) static void rtw_macaddr_acl_init(_adapter *adapter)
{ {
struct sta_priv *stapriv = &adapter->stapriv; struct sta_priv *stapriv = &adapter->stapriv;
struct wlan_acl_pool *acl = &stapriv->acl_list; struct wlan_acl_pool *acl = &stapriv->acl_list;
@ -2014,7 +1993,7 @@ void rtw_macaddr_acl_init(_adapter *adapter)
_exit_critical_bh(&(acl_node_q->lock), &irqL); _exit_critical_bh(&(acl_node_q->lock), &irqL);
} }
void rtw_macaddr_acl_deinit(_adapter *adapter) static void rtw_macaddr_acl_deinit(_adapter *adapter)
{ {
struct sta_priv *stapriv = &adapter->stapriv; struct sta_priv *stapriv = &adapter->stapriv;
struct wlan_acl_pool *acl = &stapriv->acl_list; struct wlan_acl_pool *acl = &stapriv->acl_list;
@ -2290,7 +2269,7 @@ int rtw_ap_set_wep_key(_adapter *padapter, u8 *key, u8 keylen, int keyid, u8 set
return rtw_ap_set_key(padapter, key, alg, keyid, set_tx); return rtw_ap_set_key(padapter, key, alg, keyid, set_tx);
} }
u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) static u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
{ {
#define HIQ_XMIT_COUNTS (6) #define HIQ_XMIT_COUNTS (6)
_irqL irqL; _irqL irqL;
@ -2577,7 +2556,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
} }
/* to update ht_op_mode*/ /* to update ht_op_mode*/
*(u16 *)(pht_info->infos + 1) = cpu_to_le16(pmlmepriv->ht_op_mode); *(__le16 *)(pht_info->infos + 1) = cpu_to_le16(pmlmepriv->ht_op_mode);
} }
@ -2942,7 +2921,7 @@ int rtw_ht_operation_update(_adapter *padapter)
if (pmlmepriv->num_sta_no_ht /*|| if (pmlmepriv->num_sta_no_ht /*||
(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/) (pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/)
new_op_mode = OP_MODE_MIXED; new_op_mode = OP_MODE_MIXED;
else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH) else if ((phtpriv_ap->ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
&& pmlmepriv->num_sta_ht_20mhz) && pmlmepriv->num_sta_ht_20mhz)
new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED; new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
else if (ATOMIC_READ(&pmlmepriv->olbc_ht)) else if (ATOMIC_READ(&pmlmepriv->olbc_ht))
@ -3434,7 +3413,8 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
psta->htpriv.ht_option = _TRUE; psta->htpriv.ht_option = _TRUE;
psta->qos_option = 1; psta->qos_option = 1;
psta->htpriv.smps_cap = (psta->htpriv.ht_cap.cap_info & IEEE80211_HT_CAP_SM_PS) >> 2; psta->htpriv.smps_cap = (le16_to_cpu(psta->htpriv.ht_cap.cap_info) &
IEEE80211_HT_CAP_SM_PS) >> 2;
} else } else
psta->htpriv.ht_option = _FALSE; psta->htpriv.ht_option = _FALSE;

View file

@ -1518,11 +1518,11 @@ struct dhcpMessage {
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb) void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
{ {
if (skb == NULL) if (!skb)
return; return;
if (!priv->ethBrExtInfo.dhcp_bcst_disable) { if (!priv->ethBrExtInfo.dhcp_bcst_disable) {
unsigned short protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN)); __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
if (protocol == __constant_htons(ETH_P_IP)) { /* IP */ if (protocol == __constant_htons(ETH_P_IP)) { /* IP */
struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN); struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);
@ -1556,7 +1556,6 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
} }
} }
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
unsigned char *ipAddr) unsigned char *ipAddr)
{ {

View file

@ -2114,7 +2114,7 @@ exit:
return res; return res;
} }
u8 _rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, const struct country_chplan *country_ent, u8 swconfig) static u8 _rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, const struct country_chplan *country_ent, u8 swconfig)
{ {
struct cmd_obj *cmdobj; struct cmd_obj *cmdobj;
struct SetChannelPlan_param *parm; struct SetChannelPlan_param *parm;
@ -2659,7 +2659,7 @@ void rtw_iface_dynamic_chk_wk_hdl(_adapter *padapter)
#endif #endif
} }
void rtw_dynamic_chk_wk_hdl(_adapter *padapter) static void rtw_dynamic_chk_wk_hdl(_adapter *padapter)
{ {
rtw_mi_dynamic_chk_wk_hdl(padapter); rtw_mi_dynamic_chk_wk_hdl(padapter);
@ -2819,7 +2819,7 @@ exit:
} }
void rtw_dm_in_lps_hdl(_adapter *padapter) static void rtw_dm_in_lps_hdl(_adapter *padapter)
{ {
rtw_hal_set_hwreg(padapter, HW_VAR_DM_IN_LPS, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_DM_IN_LPS, NULL);
} }
@ -2860,7 +2860,7 @@ exit:
} }
void rtw_lps_change_dtim_hdl(_adapter *padapter, u8 dtim) static void rtw_lps_change_dtim_hdl(_adapter *padapter, u8 dtim)
{ {
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
@ -2942,7 +2942,7 @@ exit:
} }
#if (RATE_ADAPTIVE_SUPPORT == 1) #if (RATE_ADAPTIVE_SUPPORT == 1)
void rpt_timer_setting_wk_hdl(_adapter *padapter, u16 minRptTime) static void rpt_timer_setting_wk_hdl(_adapter *padapter, u16 minRptTime)
{ {
rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime)); rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime));
} }
@ -3039,7 +3039,7 @@ exit:
} }
#endif #endif
void rtw_dm_ra_mask_hdl(_adapter *padapter, struct sta_info *psta) static void rtw_dm_ra_mask_hdl(_adapter *padapter, struct sta_info *psta)
{ {
if (psta) if (psta)
set_sta_rate(padapter, psta); set_sta_rate(padapter, psta);
@ -3081,18 +3081,18 @@ exit:
} }
void power_saving_wk_hdl(_adapter *padapter) static void power_saving_wk_hdl(_adapter *padapter)
{ {
rtw_ps_processor(padapter); rtw_ps_processor(padapter);
} }
/* add for CONFIG_IEEE80211W, none 11w can use it */ /* add for CONFIG_IEEE80211W, none 11w can use it */
void reset_securitypriv_hdl(_adapter *padapter) static void reset_securitypriv_hdl(_adapter *padapter)
{ {
rtw_reset_securitypriv(padapter); rtw_reset_securitypriv(padapter);
} }
void free_assoc_resources_hdl(_adapter *padapter) static void free_assoc_resources_hdl(_adapter *padapter)
{ {
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
} }
@ -3140,12 +3140,11 @@ exit:
} }
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
static u8 _p2p_roch_cmd(_adapter *adapter static u8 _p2p_roch_cmd(_adapter *adapter, u64 cookie,
, u64 cookie, struct wireless_dev *wdev struct wireless_dev *wdev,
, struct ieee80211_channel *ch, enum nl80211_channel_type ch_type struct ieee80211_channel *ch,
, unsigned int duration enum nl80211_channel_type ch_type,
, u8 flags unsigned int duration, u8 flags)
)
{ {
struct cmd_obj *cmdobj; struct cmd_obj *cmdobj;
struct drvextra_cmd_parm *parm; struct drvextra_cmd_parm *parm;
@ -4065,7 +4064,7 @@ inline u8 rtw_customer_str_write_cmd(_adapter *adapter, const u8 *cstr)
} }
#endif /* CONFIG_RTW_CUSTOMER_STR */ #endif /* CONFIG_RTW_CUSTOMER_STR */
u8 rtw_c2h_wk_cmd(PADAPTER padapter, u8 *pbuf, u16 length, u8 type) static u8 rtw_c2h_wk_cmd(PADAPTER padapter, u8 *pbuf, u16 length, u8 type)
{ {
struct cmd_obj *ph2c; struct cmd_obj *ph2c;
struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct drvextra_cmd_parm *pdrvextra_cmd_parm;
@ -4183,7 +4182,7 @@ exit:
} }
#endif /* CONFIG_FW_C2H_REG */ #endif /* CONFIG_FW_C2H_REG */
u8 session_tracker_cmd(_adapter *adapter, u8 cmd, struct sta_info *sta, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port) static u8 session_tracker_cmd(_adapter *adapter, u8 cmd, struct sta_info *sta, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port)
{ {
struct cmd_priv *cmdpriv = &adapter->cmdpriv; struct cmd_priv *cmdpriv = &adapter->cmdpriv;
struct cmd_obj *cmdobj; struct cmd_obj *cmdobj;
@ -4249,7 +4248,7 @@ inline u8 session_tracker_del_cmd(_adapter *adapter, struct sta_info *sta, u8 *l
return session_tracker_cmd(adapter, ST_CMD_DEL, sta, local_naddr, local_port, remote_naddr, remote_port); return session_tracker_cmd(adapter, ST_CMD_DEL, sta, local_naddr, local_port, remote_naddr, remote_port);
} }
void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta) static void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta)
{ {
struct st_ctl_t *st_ctl = &sta->st_ctl; struct st_ctl_t *st_ctl = &sta->st_ctl;
int i; int i;
@ -4331,7 +4330,7 @@ exit:
return; return;
} }
void session_tracker_chk_for_adapter(_adapter *adapter) static void session_tracker_chk_for_adapter(_adapter *adapter)
{ {
struct sta_priv *stapriv = &adapter->stapriv; struct sta_priv *stapriv = &adapter->stapriv;
struct sta_info *sta; struct sta_info *sta;
@ -4363,7 +4362,7 @@ void session_tracker_chk_for_adapter(_adapter *adapter)
#endif #endif
} }
void session_tracker_cmd_hdl(_adapter *adapter, struct st_cmd_parm *parm) static void session_tracker_cmd_hdl(_adapter *adapter, struct st_cmd_parm *parm)
{ {
u8 cmd = parm->cmd; u8 cmd = parm->cmd;
struct sta_info *sta = parm->sta; struct sta_info *sta = parm->sta;

View file

@ -23,7 +23,7 @@
#include <hal_data.h> #include <hal_data.h>
#ifdef CONFIG_RTW_DEBUG #ifdef CONFIG_RTW_DEBUG
const char *rtw_log_level_str[] = { static const char *rtw_log_level_str[] = {
"_DRV_NONE_ = 0", "_DRV_NONE_ = 0",
"_DRV_ALWAYS_ = 1", "_DRV_ALWAYS_ = 1",
"_DRV_ERR_ = 2", "_DRV_ERR_ = 2",
@ -382,9 +382,9 @@ void rtw_sink_rtp_seq_dbg(_adapter *adapter, _pkt *pkt)
{ {
struct recv_priv *precvpriv = &(adapter->recvpriv); struct recv_priv *precvpriv = &(adapter->recvpriv);
if (precvpriv->sink_udpport > 0) { 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->pre_rtp_rxseq = precvpriv->cur_rtp_rxseq;
precvpriv->cur_rtp_rxseq = be16_to_cpu(*((u16 *)((pkt->data) + 0x2C))); precvpriv->cur_rtp_rxseq = be16_to_cpu(*((__be16 *)((pkt->data) + 0x2C)));
if (precvpriv->pre_rtp_rxseq + 1 != precvpriv->cur_rtp_rxseq) if (precvpriv->pre_rtp_rxseq + 1 != precvpriv->cur_rtp_rxseq)
RTW_INFO("%s : RTP Seq num from %d to %d\n", __FUNCTION__, precvpriv->pre_rtp_rxseq, precvpriv->cur_rtp_rxseq); RTW_INFO("%s : RTP Seq num from %d to %d\n", __FUNCTION__, precvpriv->pre_rtp_rxseq, precvpriv->cur_rtp_rxseq);
} }
@ -1354,10 +1354,10 @@ int proc_get_survey_info(struct seq_file *m, void *v)
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
if (!phead) if (!phead)
return 0; goto exit;
plist = get_next(phead); plist = get_next(phead);
if (!plist) if (!plist)
return 0; goto exit;
RTW_PRINT_SEL(m, "%5s %-17s %3s %-3s %-4s %-4s %5s %32s %32s\n", "index", "bssid", "ch", "RSSI", "SdBm", "Noise", "age", "flag", "ssid"); RTW_PRINT_SEL(m, "%5s %-17s %3s %-3s %-4s %-4s %5s %32s %32s\n", "index", "bssid", "ch", "RSSI", "SdBm", "Noise", "age", "flag", "ssid");
while (1) { while (1) {
@ -1405,6 +1405,7 @@ int proc_get_survey_info(struct seq_file *m, void *v)
pnetwork->network.Ssid.Ssid); pnetwork->network.Ssid.Ssid);
plist = get_next(plist); plist = get_next(plist);
} }
exit:
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
return 0; return 0;

View file

@ -442,20 +442,20 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
ie += sz; ie += sz;
/* beacon interval : 2bytes */ /* 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; sz += 2;
ie += 2; ie += 2;
/* capability info */ /* capability info */
*(u16 *)ie = 0; *(__le16 *)ie = 0;
*(u16 *)ie |= cpu_to_le16(cap_IBSS); *(__le16 *)ie |= cpu_to_le16(cap_IBSS);
if (pregistrypriv->preamble == PREAMBLE_SHORT) if (pregistrypriv->preamble == PREAMBLE_SHORT)
*(u16 *)ie |= cpu_to_le16(cap_ShortPremble); *(__le16 *)ie |= cpu_to_le16(cap_ShortPremble);
if (pdev_network->Privacy) if (pdev_network->Privacy)
*(u16 *)ie |= cpu_to_le16(cap_Privacy); *(__le16 *)ie |= cpu_to_le16(cap_Privacy);
sz += 2; sz += 2;
ie += 2; ie += 2;
@ -506,37 +506,28 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
} }
#endif /* CONFIG_80211N_HT */ #endif /* CONFIG_80211N_HT */
/* pdev_network->IELength = sz; */ /* update IELength */
/* return _SUCCESS; */
return sz; return sz;
} }
unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
{ {
int len; int len;
u16 val16; u16 val16;
__le16 leval16;
unsigned char wpa_oui_type[] = {0x00, 0x50, 0xf2, 0x01}; unsigned char wpa_oui_type[] = {0x00, 0x50, 0xf2, 0x01};
u8 *pbuf = pie; u8 *pbuf = pie;
int limit_new = limit; int limit_new = limit;
while (1) { while (1) {
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new); pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
if (pbuf) { if (pbuf) {
/* check if oui matches... */ /* check if oui matches... */
if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)) == _FALSE) if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)) == _FALSE)
goto check_next_ie; goto check_next_ie;
/* check version... */ /* check version... */
_rtw_memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16)); _rtw_memcpy((u8 *)&leval16, (pbuf + 6), sizeof(val16));
val16 = le16_to_cpu(val16); val16 = le16_to_cpu(leval16);
if (val16 != 0x0001) if (val16 != 0x0001)
goto check_next_ie; goto check_next_ie;
@ -545,7 +536,6 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
return pbuf; return pbuf;
} else { } else {
*wpa_ie_len = 0; *wpa_ie_len = 0;
return NULL; return NULL;
} }
@ -1447,7 +1437,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))); , 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; u8 *pos = (u8 *)ie;
u16 id; u16 id;
@ -2487,7 +2477,7 @@ int ieee80211_get_hdrlen(u16 fc)
return hdrlen; return hdrlen;
} }
int rtw_get_cipher_info(struct wlan_network *pnetwork) static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{ {
u32 wpa_ielen; u32 wpa_ielen;
unsigned char *pbuf; unsigned char *pbuf;
@ -2523,6 +2513,7 @@ int rtw_get_cipher_info(struct wlan_network *pnetwork)
void rtw_get_bcn_info(struct wlan_network *pnetwork) void rtw_get_bcn_info(struct wlan_network *pnetwork)
{ {
unsigned short cap = 0; unsigned short cap = 0;
__le16 le_cap;
u8 bencrypt = 0; u8 bencrypt = 0;
/* u8 wpa_ie[255],rsn_ie[255]; */ /* u8 wpa_ie[255],rsn_ie[255]; */
u16 wpa_len = 0, rsn_len = 0; u16 wpa_len = 0, rsn_len = 0;
@ -2531,8 +2522,8 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
unsigned int len; unsigned int len;
unsigned char *p; unsigned char *p;
_rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2); _rtw_memcpy((u8 *)&le_cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
cap = le16_to_cpu(cap); cap = le16_to_cpu(le_cap);
if (cap & WLAN_CAPABILITY_PRIVACY) { if (cap & WLAN_CAPABILITY_PRIVACY) {
bencrypt = 1; bencrypt = 1;
pnetwork->network.Privacy = 1; pnetwork->network.Privacy = 1;

View file

@ -80,29 +80,28 @@ u8 _rtw_read8(_adapter *adapter, u32 addr)
u16 _rtw_read16(_adapter *adapter, u32 addr) u16 _rtw_read16(_adapter *adapter, u32 addr)
{ {
u16 r_val; __le16 r_val;
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
u16(*_read16)(struct intf_hdl *pintfhdl, u32 addr); __le16(*_read16)(struct intf_hdl *pintfhdl, u32 addr);
_read16 = pintfhdl->io_ops._read16; _read16 = pintfhdl->io_ops._read16;
r_val = _read16(pintfhdl, addr); r_val = _read16(pintfhdl, addr);
return rtw_le16_to_cpu(r_val); return le16_to_cpu(r_val);
} }
u32 _rtw_read32(_adapter *adapter, u32 addr) u32 _rtw_read32(_adapter *adapter, u32 addr)
{ {
u32 r_val; __le32 r_val;
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32(*_read32)(struct intf_hdl *pintfhdl, u32 addr); __le32(*_read32)(struct intf_hdl *pintfhdl, u32 addr);
_read32 = pintfhdl->io_ops._read32; _read32 = pintfhdl->io_ops._read32;
r_val = _read32(pintfhdl, addr); r_val = _read32(pintfhdl, addr);
return rtw_le32_to_cpu(r_val); return rtw_le32_to_cpu(r_val);
} }
int _rtw_write8(_adapter *adapter, u32 addr, u8 val) int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
@ -123,12 +122,14 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
int ret; int ret;
__le16 outval;
_write16 = pintfhdl->io_ops._write16; _write16 = pintfhdl->io_ops._write16;
val = rtw_cpu_to_le16(val); outval = rtw_cpu_to_le16(val);
ret = _write16(pintfhdl, addr, val); ret = _write16(pintfhdl, addr, outval);
return RTW_STATUS_CODE(ret); return RTW_STATUS_CODE(ret);
} }
@ -137,12 +138,14 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
int ret; int ret;
__le32 outval;
_write32 = pintfhdl->io_ops._write32; _write32 = pintfhdl->io_ops._write32;
val = rtw_cpu_to_le32(val); outval = rtw_cpu_to_le32(val);
ret = _write32(pintfhdl, addr, val); ret = _write32(pintfhdl, addr, outval);
return RTW_STATUS_CODE(ret); return RTW_STATUS_CODE(ret);
} }
@ -303,11 +306,13 @@ int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
int ret; int ret;
__le16 outval;
_write16_async = pintfhdl->io_ops._write16_async; _write16_async = pintfhdl->io_ops._write16_async;
val = rtw_cpu_to_le16(val); outval = rtw_cpu_to_le16(val);
ret = _write16_async(pintfhdl, addr, val); ret = _write16_async(pintfhdl, addr, outval);
return RTW_STATUS_CODE(ret); return RTW_STATUS_CODE(ret);
} }
@ -316,11 +321,13 @@ int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv; struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf); struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
int ret; int ret;
__le32 outval;
_write32_async = pintfhdl->io_ops._write32_async; _write32_async = pintfhdl->io_ops._write32_async;
val = rtw_cpu_to_le32(val); outval = rtw_cpu_to_le32(val);
ret = _write32_async(pintfhdl, addr, val); ret = _write32_async(pintfhdl, addr, outval);
return RTW_STATUS_CODE(ret); return RTW_STATUS_CODE(ret);
} }

View file

@ -33,7 +33,7 @@ void rtw_mi_update_union_chan_inf(_adapter *adapter, u8 ch, u8 offset , u8 bw)
} }
/* Find union about ch, bw, ch_offset of all linked/linking interfaces */ /* Find union about ch, bw, ch_offset of all linked/linking interfaces */
int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset, bool include_self) static int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset, bool include_self)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
_adapter *iface; _adapter *iface;
@ -111,7 +111,7 @@ inline int rtw_mi_get_ch_setting_union_no_self(_adapter *adapter, u8 *ch, u8 *bw
} }
/* For now, not return union_ch/bw/offset */ /* For now, not return union_ch/bw/offset */
void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, bool include_self) static void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, bool include_self)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
_adapter *iface; _adapter *iface;
@ -667,7 +667,7 @@ void rtw_mi_buddy_xmit_tasklet_schedule(_adapter *padapter)
} }
#endif #endif
u8 _rtw_mi_busy_traffic_check(_adapter *padapter, void *data) static u8 _rtw_mi_busy_traffic_check(_adapter *padapter, void *data)
{ {
u32 passtime; u32 passtime;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -1118,7 +1118,7 @@ _adapter *rtw_get_iface_by_hwport(_adapter *padapter, u8 hw_port)
/*#define CONFIG_SKB_ALLOCATED*/ /*#define CONFIG_SKB_ALLOCATED*/
#define DBG_SKB_PROCESS #define DBG_SKB_PROCESS
#ifdef DBG_SKB_PROCESS #ifdef DBG_SKB_PROCESS
void rtw_dbg_skb_process(_adapter *padapter, union recv_frame *precvframe, union recv_frame *pcloneframe) static void rtw_dbg_skb_process(_adapter *padapter, union recv_frame *precvframe, union recv_frame *pcloneframe)
{ {
_pkt *pkt_copy, *pkt_org; _pkt *pkt_copy, *pkt_org;

View file

@ -25,7 +25,7 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter);
extern u8 rtw_do_join(_adapter *padapter); extern u8 rtw_do_join(_adapter *padapter);
sint _rtw_init_mlme_priv(_adapter *padapter) static sint _rtw_init_mlme_priv(_adapter *padapter)
{ {
sint i; sint i;
u8 *pbuf; u8 *pbuf;
@ -33,14 +33,6 @@ sint _rtw_init_mlme_priv(_adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
sint res = _SUCCESS; sint res = _SUCCESS;
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */
/*qos_priv*/
/*pmlmepriv->qospriv.qos_option = pregistrypriv->wmm_enable;*/
/*ht_priv*/ /*ht_priv*/
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
pmlmepriv->htpriv.ampdu_enable = _FALSE;/*set to disabled*/ pmlmepriv->htpriv.ampdu_enable = _FALSE;/*set to disabled*/
@ -274,7 +266,7 @@ exit:
} }
#endif /* defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211) */ #endif /* defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211) */
void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) static void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
{ {
if (NULL == pmlmepriv) { if (NULL == pmlmepriv) {
rtw_warn_on(1); rtw_warn_on(1);
@ -292,7 +284,7 @@ exit:
return; return;
} }
sint _rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork) static sint _rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork)
{ {
_irqL irqL; _irqL irqL;
@ -553,10 +545,9 @@ u8 *rtw_get_capability_from_ie(u8 *ie)
u16 rtw_get_capability(WLAN_BSSID_EX *bss) u16 rtw_get_capability(WLAN_BSSID_EX *bss)
{ {
u16 val; __le16 val;
_rtw_memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2); _rtw_memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
return le16_to_cpu(val); return le16_to_cpu(val);
} }
@ -668,18 +659,15 @@ inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b)
int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature) int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature)
{ {
u16 s_cap, d_cap; u16 s_cap, d_cap;
__le16 le_tmp;
if (rtw_bug_check(dst, src, &s_cap, &d_cap) == _FALSE) if (rtw_bug_check(dst, src, &s_cap, &d_cap) == _FALSE)
return _FALSE; return _FALSE;
_rtw_memcpy((u8 *)&s_cap, rtw_get_capability_from_ie(src->IEs), 2); _rtw_memcpy((u8 *)&le_tmp, rtw_get_capability_from_ie(src->IEs), 2);
_rtw_memcpy((u8 *)&d_cap, rtw_get_capability_from_ie(dst->IEs), 2); s_cap = le16_to_cpu(le_tmp);
_rtw_memcpy((u8 *)&le_tmp, rtw_get_capability_from_ie(dst->IEs), 2);
d_cap = le16_to_cpu(le_tmp);
s_cap = le16_to_cpu(s_cap);
d_cap = le16_to_cpu(d_cap);
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if ((feature == 1) && /* 1: P2P supported */ if ((feature == 1) && /* 1: P2P supported */
@ -696,7 +684,6 @@ int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature)
(d_cap & WLAN_CAPABILITY_IBSS)) && (d_cap & WLAN_CAPABILITY_IBSS)) &&
((s_cap & WLAN_CAPABILITY_BSS) == ((s_cap & WLAN_CAPABILITY_BSS) ==
(d_cap & WLAN_CAPABILITY_BSS))); (d_cap & WLAN_CAPABILITY_BSS)));
} }
struct wlan_network *_rtw_find_same_network(_queue *scanned_queue, struct wlan_network *network) struct wlan_network *_rtw_find_same_network(_queue *scanned_queue, struct wlan_network *network)
@ -1405,7 +1392,7 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
} }
void rtw_reset_rx_info(struct debug_priv *pdbgpriv) static void rtw_reset_rx_info(struct debug_priv *pdbgpriv)
{ {
pdbgpriv->dbg_rx_ampdu_drop_count = 0; pdbgpriv->dbg_rx_ampdu_drop_count = 0;
pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0; pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0;
@ -1506,8 +1493,6 @@ void rtw_free_assoc_resources(_adapter *adapter, int lock_scanned_queue)
adapter->securitypriv.key_mask = 0; adapter->securitypriv.key_mask = 0;
rtw_reset_rx_info(pdbgpriv); rtw_reset_rx_info(pdbgpriv);
} }
/* /*
@ -1940,39 +1925,13 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL; struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
unsigned int the_same_macaddr = _FALSE; unsigned int the_same_macaddr = _FALSE;
#ifdef CONFIG_RTL8712
/* endian_convert */
pnetwork->join_res = le32_to_cpu(pnetwork->join_res);
pnetwork->network_type = le32_to_cpu(pnetwork->network_type);
pnetwork->network.Length = le32_to_cpu(pnetwork->network.Length);
pnetwork->network.Ssid.SsidLength = le32_to_cpu(pnetwork->network.Ssid.SsidLength);
pnetwork->network.Privacy = le32_to_cpu(pnetwork->network.Privacy);
pnetwork->network.Rssi = le32_to_cpu(pnetwork->network.Rssi);
pnetwork->network.NetworkTypeInUse = le32_to_cpu(pnetwork->network.NetworkTypeInUse) ;
pnetwork->network.Configuration.ATIMWindow = le32_to_cpu(pnetwork->network.Configuration.ATIMWindow);
pnetwork->network.Configuration.BeaconPeriod = le32_to_cpu(pnetwork->network.Configuration.BeaconPeriod);
pnetwork->network.Configuration.DSConfig = le32_to_cpu(pnetwork->network.Configuration.DSConfig);
pnetwork->network.Configuration.FHConfig.DwellTime = le32_to_cpu(pnetwork->network.Configuration.FHConfig.DwellTime);
pnetwork->network.Configuration.FHConfig.HopPattern = le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopPattern);
pnetwork->network.Configuration.FHConfig.HopSet = le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopSet);
pnetwork->network.Configuration.FHConfig.Length = le32_to_cpu(pnetwork->network.Configuration.FHConfig.Length);
pnetwork->network.Configuration.Length = le32_to_cpu(pnetwork->network.Configuration.Length);
pnetwork->network.InfrastructureMode = le32_to_cpu(pnetwork->network.InfrastructureMode);
pnetwork->network.IELength = le32_to_cpu(pnetwork->network.IELength);
#endif
rtw_get_encrypt_decrypt_from_registrypriv(adapter); rtw_get_encrypt_decrypt_from_registrypriv(adapter);
the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN); the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN);
pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network); pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network);
if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX)) { if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX))
goto ignore_joinbss_callback; return;
}
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
@ -2446,7 +2405,7 @@ err_2:
} }
#endif #endif
void rtw_sta_mstatus_disc_rpt(_adapter *adapter, u8 mac_id) static void rtw_sta_mstatus_disc_rpt(_adapter *adapter, u8 mac_id)
{ {
struct macid_ctl_t *macid_ctl = &adapter->dvobj->macid_ctl; struct macid_ctl_t *macid_ctl = &adapter->dvobj->macid_ctl;
@ -3164,7 +3123,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
if (mlme->cur_network_scanned == NULL) { if (mlme->cur_network_scanned == NULL) {
rtw_warn_on(1); rtw_warn_on(1);
goto exit; return ret;
} }
_enter_critical_bh(&(mlme->scanned_queue.lock), &irqL); _enter_critical_bh(&(mlme->scanned_queue.lock), &irqL);
@ -3978,10 +3937,10 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
_rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); _rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap));
ht_capie.cap_info = IEEE80211_HT_CAP_DSSSCCK40; ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_DSSSCCK40);
if (phtpriv->sgi_20m) if (phtpriv->sgi_20m)
ht_capie.cap_info |= IEEE80211_HT_CAP_SGI_20; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_SGI_20);
/* Get HT BW */ /* Get HT BW */
if (in_ie == NULL) { if (in_ie == NULL) {
@ -4024,23 +3983,23 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
} }
if ((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) { if ((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) {
ht_capie.cap_info |= IEEE80211_HT_CAP_SUP_WIDTH; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH);
if (phtpriv->sgi_40m) if (phtpriv->sgi_40m)
ht_capie.cap_info |= IEEE80211_HT_CAP_SGI_40; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_SGI_40);
} }
/* todo: disable SM power save mode */ /* todo: disable SM power save mode */
ht_capie.cap_info |= IEEE80211_HT_CAP_SM_PS; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_SM_PS);
/* RX LDPC */ /* RX LDPC */
if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_RX)) { if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_RX)) {
ht_capie.cap_info |= IEEE80211_HT_CAP_LDPC_CODING; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_LDPC_CODING);
RTW_INFO("[HT] Declare supporting RX LDPC\n"); RTW_INFO("[HT] Declare supporting RX LDPC\n");
} }
/* TX STBC */ /* TX STBC */
if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX)) { if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX)) {
ht_capie.cap_info |= IEEE80211_HT_CAP_TX_STBC; ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_TX_STBC);
RTW_INFO("[HT] Declare supporting TX STBC\n"); RTW_INFO("[HT] Declare supporting TX STBC\n");
} }
@ -4086,13 +4045,11 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
RTW_WARN("rf_type:%d or rx_nss:%u is not expected\n", rf_type, hal_spec->rx_nss_num); RTW_WARN("rf_type:%d or rx_nss:%u is not expected\n", rf_type, hal_spec->rx_nss_num);
} }
{
rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset); rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset);
rtw_hal_get_def_var(padapter, HAL_DEF_MAX_RECVBUF_SZ, &max_recvbuf_sz); rtw_hal_get_def_var(padapter, HAL_DEF_MAX_RECVBUF_SZ, &max_recvbuf_sz);
if (max_recvbuf_sz - rx_packet_offset >= (8191 - 256)) { if (max_recvbuf_sz - rx_packet_offset >= (8191 - 256)) {
RTW_INFO("%s IEEE80211_HT_CAP_MAX_AMSDU is set\n", __FUNCTION__); RTW_INFO("%s IEEE80211_HT_CAP_MAX_AMSDU is set\n", __FUNCTION__);
ht_capie.cap_info = ht_capie.cap_info | IEEE80211_HT_CAP_MAX_AMSDU; ht_capie.cap_info = ht_capie.cap_info | cpu_to_le16(IEEE80211_HT_CAP_MAX_AMSDU);
}
} }
/* /*
AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
@ -4244,7 +4201,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
/* update cur_bwmode & cur_ch_offset */ /* update cur_bwmode & cur_ch_offset */
if ((cbw40_enable) && if ((cbw40_enable) &&
(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & BIT(1)) && (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & BIT(1)) &&
(pmlmeinfo->HT_info.infos[0] & BIT(2))) { (pmlmeinfo->HT_info.infos[0] & BIT(2))) {
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter); struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
int i; int i;
@ -4301,61 +4258,12 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
/* */ /* */
/* Config SM Power Save setting */ /* Config SM Power Save setting */
/* */ /* */
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2; pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2;
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) { if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
#if 0
u8 i;
/* update the MCS rates */
for (i = 0; i < 16; i++)
pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
#endif
RTW_INFO("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__); RTW_INFO("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__);
}
/* */
/* Config current HT Protection mode. */ /* Config current HT Protection mode. */
/* */
pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3;
#if 0 /* move to rtw_update_sta_info_client() */
/* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */
/* if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff */
/* todo: check if AP can send A-MPDU packets */
bmc_sta = rtw_get_bcmc_stainfo(padapter);
if (bmc_sta) {
for (i = 0; i < 16 ; i++) {
/* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */
preorder_ctrl = &bmc_sta->recvreorder_ctrl[i];
preorder_ctrl->enable = _FALSE;
preorder_ctrl->indicate_seq = 0xffff;
#ifdef DBG_RX_SEQ
RTW_INFO("DBG_RX_SEQ %s:%d indicate_seq:%u\n", __FUNCTION__, __LINE__,
preorder_ctrl->indicate_seq);
#endif
preorder_ctrl->wend_b = 0xffff;
preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; */ /* ex. 32(kbytes) -> wsize_b=32 */
}
}
psta = rtw_get_stainfo(&padapter->stapriv, pcur_network->network.MacAddress);
if (psta) {
for (i = 0; i < 16 ; i++) {
/* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */
preorder_ctrl = &psta->recvreorder_ctrl[i];
preorder_ctrl->enable = _FALSE;
preorder_ctrl->indicate_seq = 0xffff;
#ifdef DBG_RX_SEQ
RTW_INFO("DBG_RX_SEQ %s:%d indicate_seq:%u\n", __FUNCTION__, __LINE__,
preorder_ctrl->indicate_seq);
#endif
preorder_ctrl->wend_b = 0xffff;
preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; */ /* ex. 32(kbytes) -> wsize_b=32 */
}
}
#endif
} }
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
@ -4645,9 +4553,9 @@ static bool wfd_st_match_rule(_adapter *adapter, u8 *local_naddr, u8 *local_port
{ {
struct wifi_display_info *wfdinfo = &adapter->wfd_info; struct wifi_display_info *wfdinfo = &adapter->wfd_info;
if (ntohs(*((u16 *)local_port)) == wfdinfo->rtsp_ctrlport if (ntohs(*((__be16 *)local_port)) == wfdinfo->rtsp_ctrlport ||
|| ntohs(*((u16 *)local_port)) == wfdinfo->tdls_rtsp_ctrlport ntohs(*((__be16 *)local_port)) == wfdinfo->tdls_rtsp_ctrlport ||
|| ntohs(*((u16 *)remote_port)) == wfdinfo->peer_rtsp_ctrlport) ntohs(*((__be16 *)remote_port)) == wfdinfo->peer_rtsp_ctrlport)
return _TRUE; return _TRUE;
return _FALSE; return _FALSE;
} }

File diff suppressed because it is too large Load diff

View file

@ -210,7 +210,7 @@ exit:
return; return;
} }
static u32 getcrc32(u8 *buf, sint len) static __le32 getcrc32(u8 *buf, sint len)
{ {
u8 *p; u8 *p;
u32 crc; u32 crc;
@ -221,7 +221,7 @@ static u32 getcrc32(u8 *buf, sint len)
for (p = buf; len > 0; ++p, --len) for (p = buf; len > 0; ++p, --len)
crc = crc32_table[(crc ^ *p) & 0xff] ^ (crc >> 8); crc = crc32_table[(crc ^ *p) & 0xff] ^ (crc >> 8);
return ~crc; /* transmit complement, per CRC-32 spec */ return cpu_to_le32(~crc); /* transmit complement, per CRC-32 spec */
} }
@ -231,7 +231,6 @@ static u32 getcrc32(u8 *buf, sint len)
void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe) void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
{ {
/* exclude ICV */ /* exclude ICV */
unsigned char crc[4]; unsigned char crc[4];
struct arc4context mycontext; struct arc4context mycontext;
@ -278,7 +277,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); *((__le32 *)crc) = getcrc32(payload, length);
arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_init(&mycontext, wepkey, 3 + keylength);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
@ -286,7 +285,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
} else { } else {
length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len ; length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len ;
*((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); *((__le32 *)crc) = getcrc32(payload, length);
arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_init(&mycontext, wepkey, 3 + keylength);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload + length, crc, 4); arcfour_encrypt(&mycontext, payload + length, crc, 4);
@ -337,15 +336,12 @@ void rtw_wep_decrypt(_adapter *padapter, u8 *precvframe)
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
/* calculate icv and compare the icv */ /* calculate icv and compare the icv */
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4)); *((__le32 *)crc) = getcrc32(payload, length - 4);
WEP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra); WEP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra);
} }
return; return;
} }
/* 3 =====TKIP related===== */ /* 3 =====TKIP related===== */
@ -761,7 +757,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
if ((curfragnum + 1) == pattrib->nr_frags) { /* 4 the last fragment */ if ((curfragnum + 1) == pattrib->nr_frags) { /* 4 the last fragment */
length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; 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) = getcrc32(payload, length); /* modified by Amy*/
arcfour_init(&mycontext, rc4key, 16); arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
@ -769,7 +765,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
} else { } else {
length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len ; 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) = getcrc32(payload, length); /* modified by Amy*/
arcfour_init(&mycontext, rc4key, 16); arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload + length, crc, 4); arcfour_encrypt(&mycontext, payload + length, crc, 4);
@ -887,7 +883,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
arcfour_init(&mycontext, rc4key, 16); arcfour_init(&mycontext, rc4key, 16);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4)); *((__le32 *)crc) = 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]) { if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] || crc[1] != payload[length - 3] || crc[0] != payload[length - 4]) {
res = _FAIL; res = _FAIL;
@ -1373,7 +1369,7 @@ static sint aes_cipher(u8 *key, uint hdrlen,
u8 padded_buffer[16]; u8 padded_buffer[16];
u8 mic[8]; u8 mic[8];
/* uint offset = 0; */ /* uint offset = 0; */
uint frtype = GetFrameType(pframe); u16 frtype = GetFrameType(pframe);
uint frsubtype = get_frame_sub_type(pframe); uint frsubtype = get_frame_sub_type(pframe);
frsubtype = frsubtype >> 4; frsubtype = frsubtype >> 4;
@ -2797,7 +2793,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 * OMAC1 was standardized with the name CMAC by NIST in a Special Publication
* (SP) 800-38B. * (SP) 800-38B.
*/ /* modify for CONFIG_IEEE80211W */ */ /* 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); return omac1_aes_128_vector(key, 1, &data, &data_len, mac);
} }

View file

@ -29,25 +29,22 @@
#define IP_OFFSET 30 #define IP_OFFSET 30
#endif #endif
unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f}; static unsigned char ATHEROS_OUI1[] = {0x00, 0x03, 0x7f};
unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74}; static unsigned char ATHEROS_OUI2[] = {0x00, 0x13, 0x74};
unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18}; static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7}; static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5}; static unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96}; static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43}; static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43}; static unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c}; static unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5}; static unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
extern unsigned char RTW_WPA_OUI[]; extern unsigned char RTW_WPA_OUI[];
extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4];
#define R2T_PHY_DELAY (0) #define R2T_PHY_DELAY (0)
@ -105,7 +102,7 @@ int cckratesonly_included(unsigned char *rate, int ratelen)
} }
#ifdef CONFIG_GET_RAID_BY_DRV #ifdef CONFIG_GET_RAID_BY_DRV
s8 rtw_get_tx_nss(_adapter *adapter, struct sta_info *psta) static s8 rtw_get_tx_nss(_adapter *adapter, struct sta_info *psta)
{ {
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter); struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
u8 rf_type = RF_1T1R, custom_rf_type; u8 rf_type = RF_1T1R, custom_rf_type;
@ -813,11 +810,10 @@ __inline u8 *get_my_bssid(WLAN_BSSID_EX *pnetwork)
u16 get_beacon_interval(WLAN_BSSID_EX *bss) u16 get_beacon_interval(WLAN_BSSID_EX *bss)
{ {
unsigned short val; __le16 val;
_rtw_memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2); _rtw_memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);
return le16_to_cpu(val); return le16_to_cpu(val);
} }
int is_client_associated_to_ap(_adapter *padapter) int is_client_associated_to_ap(_adapter *padapter)
@ -1151,7 +1147,7 @@ inline bool rtw_sec_camid_is_drv_forbid(struct cam_ctl_t *cam_ctl, u8 id)
return 1; return 1;
} }
bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id) static bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id)
{ {
bool ret = _FALSE; bool ret = _FALSE;
@ -1239,7 +1235,7 @@ inline bool rtw_camid_is_gk(_adapter *adapter, u8 cam_id)
return ret; return ret;
} }
bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk) static bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
bool ret = _FALSE; bool ret = _FALSE;
@ -1257,7 +1253,7 @@ exit:
return ret; return ret;
} }
s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk) static s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1297,7 +1293,7 @@ s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk)
return cam_id; return cam_id;
} }
s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid) static s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1411,7 +1407,7 @@ bitmap_handle:
return cam_id; return cam_id;
} }
void rtw_camid_set(_adapter *adapter, u8 cam_id) static void rtw_camid_set(_adapter *adapter, u8 cam_id)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1494,7 +1490,7 @@ inline void rtw_sec_cam_swap(_adapter *adapter, u8 cam_id_a, u8 cam_id_b)
} }
} }
s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid) static s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid)
{ {
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1959,8 +1955,8 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
/* Commented by Albert 2010/07/12 */ /* Commented by Albert 2010/07/12 */
/* Have to handle the endian issue after copying. */ /* Have to handle the endian issue after copying. */
/* HT_ext_caps didn't be used yet. */ /* HT_ext_caps didn't be used yet. */
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info); pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info;
pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps); pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps;
/* update the MCS set */ /* update the MCS set */
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
@ -2259,7 +2255,7 @@ void update_ldpc_stbc_cap(struct sta_info *psta)
#endif /* CONFIG_80211N_HT */ #endif /* CONFIG_80211N_HT */
} }
int check_ielen(u8 *start, uint len) static int check_ielen(u8 *start, uint len)
{ {
int left = len; int left = len;
u8 *pos = start; u8 *pos = start;
@ -2325,7 +2321,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
_rtw_memset(recv_beacon, 0, sizeof(*recv_beacon)); _rtw_memset(recv_beacon, 0, sizeof(*recv_beacon));
/* checking capabilities */ /* checking capabilities */
capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); capability = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 10));
/* checking IEs */ /* checking IEs */
left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_;
@ -2339,7 +2335,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
return _FALSE; return _FALSE;
pht_cap = (struct rtw_ieee80211_ht_cap *) elems.ht_capabilities; pht_cap = (struct rtw_ieee80211_ht_cap *) elems.ht_capabilities;
recv_beacon->ht_cap_info = pht_cap->cap_info; recv_beacon->ht_cap_info = le16_to_cpu(pht_cap->cap_info);
} }
if (elems.ht_operation) { if (elems.ht_operation) {
@ -2715,10 +2711,9 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
/* to update WMM paramter set while receiving beacon */ /* to update WMM paramter set while receiving beacon */
if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */ if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */
(WMM_param_handler(padapter, pIE)) ? report_wmm_edca_update(padapter) : 0; if (WMM_param_handler(padapter, pIE))
report_wmm_edca_update(padapter);
break; break;
case _HT_EXTRA_INFO_IE_: /* HT info */ case _HT_EXTRA_INFO_IE_: /* HT info */
/* HT_info_handler(padapter, pIE); */ /* HT_info_handler(padapter, pIE); */
bwmode_update_check(padapter, pIE); bwmode_update_check(padapter, pIE);
@ -2887,7 +2882,6 @@ unsigned int is_ap_in_wep(_adapter *padapter)
} }
int wifirate2_ratetbl_inx(unsigned char rate);
int wifirate2_ratetbl_inx(unsigned char rate) int wifirate2_ratetbl_inx(unsigned char rate)
{ {
int inx = 0; int inx = 0;
@ -2983,7 +2977,7 @@ int support_short_GI(_adapter *padapter, struct HT_caps_element *pHT_caps, u8 bw
bit_offset = (bwmode & CHANNEL_WIDTH_40) ? 6 : 5; bit_offset = (bwmode & CHANNEL_WIDTH_40) ? 6 : 5;
if (pHT_caps->u.HT_cap_element.HT_caps_info & (0x1 << bit_offset)) if (le16_to_cpu(pHT_caps->u.HT_cap_element.HT_caps_info) & (0x1 << bit_offset))
return _SUCCESS; return _SUCCESS;
else else
return _FAIL; return _FAIL;
@ -3065,7 +3059,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if ((_rtw_memcmp(pIE->data, ARTHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ARTHEROS_OUI2, 3))) { if ((_rtw_memcmp(pIE->data, ATHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ATHEROS_OUI2, 3))) {
RTW_INFO("link to Artheros AP\n"); RTW_INFO("link to Artheros AP\n");
return HT_IOT_PEER_ATHEROS; return HT_IOT_PEER_ATHEROS;
} else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3)) } else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3))
@ -3369,10 +3363,10 @@ exit:
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{ {
u8 *pIE; u8 *pIE;
u32 *pbuf; __le32 *pbuf;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pbuf = (u32 *)pIE; pbuf = (__le32 *)pIE;
pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1)); pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1));
@ -3383,23 +3377,22 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext) void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext)
{ {
rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, 0); rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
} }
void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{ {
int i; int i;
u8 *pIE; u8 *pIE;
u32 *pbuf; __le32 *pbuf;
u64 tsf = 0; u64 tsf = 0;
u32 delay_ms; u32 delay_ms;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
pmlmeext->bcn_cnt++; pmlmeext->bcn_cnt++;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pbuf = (u32 *)pIE; pbuf = (__le32 *)pIE;
tsf = le32_to_cpu(*(pbuf + 1)); tsf = le32_to_cpu(*(pbuf + 1));
tsf = tsf << 32; tsf = tsf << 32;

View file

@ -3677,7 +3677,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
_irqL irqL; _irqL irqL;
/* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) */ /* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) */
{ {
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb);
int res, is_vlan_tag = 0, i, do_nat25 = 1; int res, is_vlan_tag = 0, i, do_nat25 = 1;
unsigned short vlan_hdr = 0; unsigned short vlan_hdr = 0;
void *br_port = NULL; void *br_port = NULL;
@ -3721,7 +3720,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)) { if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)) {
if (memcmp(padapter->scdb_mac, skb->data + MACADDRLEN, MACADDRLEN)) { if (memcmp(padapter->scdb_mac, skb->data + MACADDRLEN, MACADDRLEN)) {
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, unsigned char *ipAddr);
padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter, padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter,
skb->data + MACADDRLEN, skb->data + WLAN_ETHHDR_LEN + 12); skb->data + MACADDRLEN, skb->data + WLAN_ETHHDR_LEN + 12);

View file

@ -30,7 +30,7 @@
* MUSB.TXT * MUSB.TXT
******************************************************************************/ ******************************************************************************/
u1Byte Array_MP_8188E_MUSB[] = { static u1Byte Array_MP_8188E_MUSB[] = {
0xFF, 0xFF,
0xF3, 0xF3,
0x00, 0x00,

View file

@ -119,7 +119,7 @@ check_negative(
* AGC_TAB.TXT * AGC_TAB.TXT
******************************************************************************/ ******************************************************************************/
u32 array_mp_8188e_agc_tab[] = { static u32 array_mp_8188e_agc_tab[] = {
0x88000001, 0x00000000, 0x40000000, 0x00000000, 0x88000001, 0x00000000, 0x40000000, 0x00000000,
0xC78, 0xF6000001, 0xC78, 0xF6000001,
0xC78, 0xF5010001, 0xC78, 0xF5010001,
@ -1117,7 +1117,7 @@ odm_get_version_mp_8188e_agc_tab(void)
* PHY_REG.TXT * PHY_REG.TXT
******************************************************************************/ ******************************************************************************/
u32 array_mp_8188e_phy_reg[] = { static u32 array_mp_8188e_phy_reg[] = {
0x800, 0x80040000, 0x800, 0x80040000,
0x804, 0x00000003, 0x804, 0x00000003,
0x808, 0x0000FC00, 0x808, 0x0000FC00,
@ -1711,7 +1711,7 @@ odm_get_version_mp_8188e_phy_reg(void)
* PHY_REG_PG.TXT * PHY_REG_PG.TXT
******************************************************************************/ ******************************************************************************/
u32 array_mp_8188e_phy_reg_pg[] = { static u32 array_mp_8188e_phy_reg_pg[] = {
0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003800, 0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003800,
0, 0, 0, 0x0000086c, 0xffffff00, 0x32343600, 0, 0, 0, 0x0000086c, 0xffffff00, 0x32343600,
0, 0, 0, 0x00000e00, 0xffffffff, 0x40424446, 0, 0, 0, 0x00000e00, 0xffffffff, 0x40424446,

View file

@ -119,7 +119,7 @@ check_negative(
* MAC_REG.TXT * MAC_REG.TXT
******************************************************************************/ ******************************************************************************/
u32 array_mp_8188e_mac_reg[] = { static u32 array_mp_8188e_mac_reg[] = {
0x026, 0x00000041, 0x026, 0x00000041,
0x027, 0x00000035, 0x027, 0x00000035,
0x80000002, 0x00000000, 0x40000000, 0x00000000, 0x80000002, 0x00000000, 0x40000000, 0x00000000,

View file

@ -718,7 +718,7 @@ u8 odm_get_right_chnl_place_for_iqk(u8 chnl)
} }
#endif #endif
void static void
odm_iq_calibrate( odm_iq_calibrate(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )

View file

@ -25,7 +25,7 @@
#include "mp_precomp.h" #include "mp_precomp.h"
#include "phydm_precomp.h" #include "phydm_precomp.h"
const u16 db_invert_table[12][8] = { static const u16 db_invert_table[12][8] = {
{ 1, 1, 1, 2, 2, 2, 2, 3}, { 1, 1, 1, 2, 2, 2, 2, 3},
{ 3, 3, 4, 4, 4, 5, 6, 6}, { 3, 3, 4, 4, 4, 5, 6, 6},
{ 7, 8, 9, 10, 11, 13, 14, 16}, { 7, 8, 9, 10, 11, 13, 14, 16},
@ -164,7 +164,7 @@ odm_init_mp_driver_status(
} }
void static void
odm_update_mp_driver_status( odm_update_mp_driver_status(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -175,7 +175,7 @@ odm_update_mp_driver_status(
p_dm_odm->mp_mode = (bool)adapter->registrypriv.mp_mode; p_dm_odm->mp_mode = (bool)adapter->registrypriv.mp_mode;
} }
void static void
phydm_init_trx_antenna_setting( phydm_init_trx_antenna_setting(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -197,7 +197,7 @@ phydm_init_trx_antenna_setting(
/*#endif*/ /*#endif*/
} }
void static void
phydm_traffic_load_decision( phydm_traffic_load_decision(
void *p_dm_void void *p_dm_void
) )
@ -248,7 +248,7 @@ phydm_traffic_load_decision(
} }
} }
void static void
phydm_config_ofdm_tx_path( phydm_config_ofdm_tx_path(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
u32 path u32 path
@ -338,7 +338,7 @@ phydm_config_ofdm_rx_path(
#endif #endif
} }
void static void
phydm_config_cck_rx_antenna_init( phydm_config_cck_rx_antenna_init(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -358,7 +358,7 @@ phydm_config_cck_rx_antenna_init(
#endif #endif
} }
void static void
phydm_config_cck_rx_path( phydm_config_cck_rx_path(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
u8 path, u8 path,
@ -460,7 +460,7 @@ phydm_config_trx_path(
} }
void static void
phydm_init_cck_setting( phydm_init_cck_setting(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -506,7 +506,7 @@ phydm_init_cck_setting(
} }
void static void
phydm_init_soft_ml_setting( phydm_init_soft_ml_setting(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -519,7 +519,7 @@ phydm_init_soft_ml_setting(
#endif #endif
} }
void static void
phydm_init_hw_info_by_rfe( phydm_init_hw_info_by_rfe(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -538,7 +538,7 @@ phydm_init_hw_info_by_rfe(
#endif #endif
} }
void static void
odm_common_info_self_init( odm_common_info_self_init(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -580,7 +580,7 @@ odm_common_info_self_init(
} }
void static void
odm_common_info_self_update( odm_common_info_self_update(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -627,7 +627,7 @@ odm_common_info_self_update(
p_dm_odm->phydm_sys_up_time += p_dm_odm->phydm_period; p_dm_odm->phydm_sys_up_time += p_dm_odm->phydm_period;
} }
void static void
odm_common_info_self_reset( odm_common_info_self_reset(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -683,7 +683,7 @@ phydm_get_structure(
return p_struct; return p_struct;
} }
void static void
odm_hw_setting( odm_hw_setting(
struct PHY_DM_STRUCT *p_dm_odm struct PHY_DM_STRUCT *p_dm_odm
) )
@ -709,7 +709,7 @@ odm_hw_setting(
#endif #endif
} }
#if SUPPORTABLITY_PHYDMLIZE #if SUPPORTABLITY_PHYDMLIZE
void static void
phydm_supportability_init( phydm_supportability_init(
void *p_dm_void void *p_dm_void
) )
@ -2055,7 +2055,7 @@ phydm_set_ext_switch(
} }
} }
void static void
phydm_csi_mask_enable( phydm_csi_mask_enable(
void *p_dm_void, void *p_dm_void,
u32 enable u32 enable
@ -2079,7 +2079,7 @@ phydm_csi_mask_enable(
} }
void static void
phydm_clean_all_csi_mask( phydm_clean_all_csi_mask(
void *p_dm_void void *p_dm_void
) )
@ -2106,7 +2106,7 @@ phydm_clean_all_csi_mask(
} }
} }
void static void
phydm_set_csi_mask_reg( phydm_set_csi_mask_reg(
void *p_dm_void, void *p_dm_void,
u32 tone_idx_tmp, u32 tone_idx_tmp,
@ -2169,7 +2169,7 @@ phydm_set_csi_mask_reg(
ODM_RT_TRACE(p_dm_odm, ODM_COMP_API, ODM_DBG_LOUD, ("New Mask tone idx[%d]: Reg0x%x = ((0x%x))\n", (tone_idx_tmp + tone_num_shift), target_reg, reg_tmp_value)); ODM_RT_TRACE(p_dm_odm, ODM_COMP_API, ODM_DBG_LOUD, ("New Mask tone idx[%d]: Reg0x%x = ((0x%x))\n", (tone_idx_tmp + tone_num_shift), target_reg, reg_tmp_value));
} }
void static void
phydm_set_nbi_reg( phydm_set_nbi_reg(
void *p_dm_void, void *p_dm_void,
u32 tone_idx_tmp, u32 tone_idx_tmp,
@ -2239,7 +2239,7 @@ phydm_set_nbi_reg(
} }
void static void
phydm_nbi_enable( phydm_nbi_enable(
void *p_dm_void, void *p_dm_void,
u32 enable u32 enable
@ -2262,7 +2262,7 @@ phydm_nbi_enable(
} }
} }
u8 static u8
phydm_calculate_fc( phydm_calculate_fc(
void *p_dm_void, void *p_dm_void,
u32 channel, u32 channel,
@ -2342,7 +2342,7 @@ phydm_calculate_fc(
} }
u8 static u8
phydm_calculate_intf_distance( phydm_calculate_intf_distance(
void *p_dm_void, void *p_dm_void,
u32 bw, u32 bw,
@ -2376,7 +2376,7 @@ phydm_calculate_intf_distance(
} }
u8 static u8
phydm_csi_mask_setting( phydm_csi_mask_setting(
void *p_dm_void, void *p_dm_void,
u32 enable, u32 enable,

View file

@ -48,7 +48,7 @@ odm_get_auto_channel_select_result(
} }
void static void
odm_auto_channel_select_setting( odm_auto_channel_select_setting(
void *p_dm_void, void *p_dm_void,
bool is_enable bool is_enable

View file

@ -240,7 +240,7 @@ phydm_set_edcca_threshold(
} }
void static void
phydm_set_lna( phydm_set_lna(
void *p_dm_void, void *p_dm_void,
enum phydm_set_lna type enum phydm_set_lna type
@ -596,7 +596,7 @@ phydm_search_pwdb_lower_bound(
phydm_set_edcca_threshold(p_dm_odm, 0x7f, 0x7f); /*resume to no link state*/ phydm_set_edcca_threshold(p_dm_odm, 0x7f, 0x7f); /*resume to no link state*/
} }
bool static bool
phydm_re_search_condition( phydm_re_search_condition(
void *p_dm_void void *p_dm_void
) )

View file

@ -285,10 +285,7 @@ phydm_check_nhm_ready(
return ret; return ret;
} }
void static void phydm_store_nhm_setting(void *p_dm_void)
phydm_store_nhm_setting(
void *p_dm_void
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct _CCX_INFO *ccx_info = &p_dm_odm->dm_ccx_info; struct _CCX_INFO *ccx_info = &p_dm_odm->dm_ccx_info;

View file

@ -20,7 +20,7 @@
#include "mp_precomp.h" #include "mp_precomp.h"
#include "phydm_precomp.h" #include "phydm_precomp.h"
void static void
odm_set_crystal_cap( odm_set_crystal_cap(
void *p_dm_void, void *p_dm_void,
u8 crystal_cap u8 crystal_cap
@ -65,7 +65,7 @@ odm_set_crystal_cap(
#endif #endif
} }
u8 static u8
odm_get_default_crytaltal_cap( odm_get_default_crytaltal_cap(
void *p_dm_void void *p_dm_void
) )
@ -90,7 +90,7 @@ odm_get_default_crytaltal_cap(
return crystal_cap; return crystal_cap;
} }
void static void
odm_set_atc_status( odm_set_atc_status(
void *p_dm_void, void *p_dm_void,
bool atc_status bool atc_status
@ -106,7 +106,7 @@ odm_set_atc_status(
p_cfo_track->is_atc_status = atc_status; p_cfo_track->is_atc_status = atc_status;
} }
bool static bool
odm_get_atc_status( odm_get_atc_status(
void *p_dm_void void *p_dm_void
) )

View file

@ -79,7 +79,7 @@ phydm_init_debug_setting(
} }
#if CONFIG_PHYDM_DEBUG_FUNCTION #if CONFIG_PHYDM_DEBUG_FUNCTION
void static void
phydm_bb_rx_hang_info( phydm_bb_rx_hang_info(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -256,7 +256,7 @@ phydm_bb_rx_hang_info(
} }
void static void
phydm_bb_debug_info_n_series( phydm_bb_debug_info_n_series(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -427,7 +427,7 @@ phydm_bb_debug_info_n_series(
} }
void static void
phydm_bb_debug_info( phydm_bb_debug_info(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -1430,7 +1430,7 @@ phydm_api_trx_mode(
} }
#endif #endif
void static void
phydm_get_per_path_txagc( phydm_get_per_path_txagc(
void *p_dm_void, void *p_dm_void,
u8 path, u8 path,
@ -1481,7 +1481,7 @@ phydm_get_per_path_txagc(
} }
void static void
phydm_get_txagc( phydm_get_txagc(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -1511,7 +1511,7 @@ phydm_get_txagc(
} }
void static void
phydm_set_txagc( phydm_set_txagc(
void *p_dm_void, void *p_dm_void,
u32 *const dm_value, u32 *const dm_value,
@ -1564,7 +1564,7 @@ phydm_set_txagc(
#endif #endif
} }
void static void
phydm_debug_trace( phydm_debug_trace(
void *p_dm_void, void *p_dm_void,
u32 *const dm_value, u32 *const dm_value,
@ -1629,7 +1629,7 @@ phydm_debug_trace(
PHYDM_SNPRINTF((output + used, out_len - used, "%s\n", "================================")); PHYDM_SNPRINTF((output + used, out_len - used, "%s\n", "================================"));
} }
void static void
phydm_fw_debug_trace( phydm_fw_debug_trace(
void *p_dm_void, void *p_dm_void,
u32 *const dm_value, u32 *const dm_value,
@ -1681,7 +1681,7 @@ phydm_fw_debug_trace(
} }
} }
void static void
phydm_dump_bb_reg( phydm_dump_bb_reg(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -1726,7 +1726,7 @@ phydm_dump_bb_reg(
} }
} }
void static void
phydm_dump_all_reg( phydm_dump_all_reg(
void *p_dm_void, void *p_dm_void,
u32 *_used, u32 *_used,
@ -1775,7 +1775,7 @@ phydm_dump_all_reg(
} }
} }
void static void
phydm_enable_big_jump( phydm_enable_big_jump(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
bool state bool state
@ -1878,7 +1878,7 @@ enum PHYDM_CMD_ID {
PHYDM_DYNAMIC_RA_PATH PHYDM_DYNAMIC_RA_PATH
}; };
struct _PHYDM_COMMAND phy_dm_ary[] = { static struct _PHYDM_COMMAND phy_dm_ary[] = {
{"-h", PHYDM_HELP}, /*do not move this element to other position*/ {"-h", PHYDM_HELP}, /*do not move this element to other position*/
{"demo", PHYDM_DEMO}, /*do not move this element to other position*/ {"demo", PHYDM_DEMO}, /*do not move this element to other position*/
{"ra", PHYDM_RA}, {"ra", PHYDM_RA},
@ -3016,7 +3016,7 @@ phydm_fw_trace_handler_8051(
int i = 0; int i = 0;
u8 extend_c2h_sub_id = 0, extend_c2h_dbg_len = 0, extend_c2h_dbg_seq = 0; u8 extend_c2h_sub_id = 0, extend_c2h_dbg_len = 0, extend_c2h_dbg_seq = 0;
u8 fw_debug_trace[128]; u8 fw_debug_trace[128];
u8 *extend_c2h_dbg_content = 0; u8 *extend_c2h_dbg_content = NULL;
if (cmd_len > 127) if (cmd_len > 127)
return; return;

View file

@ -58,7 +58,7 @@ odm_change_dynamic_init_gain_thresh(
} }
} /* dm_change_dynamic_init_gain_thresh */ } /* dm_change_dynamic_init_gain_thresh */
int static int
get_igi_for_diff(int value_IGI) get_igi_for_diff(int value_IGI)
{ {
#define ONERCCA_LOW_TH 0x30 #define ONERCCA_LOW_TH 0x30
@ -73,7 +73,7 @@ get_igi_for_diff(int value_IGI)
return value_IGI; return value_IGI;
} }
void static void
odm_fa_threshold_check( odm_fa_threshold_check(
void *p_dm_void, void *p_dm_void,
bool is_dfs_band, bool is_dfs_band,
@ -121,7 +121,7 @@ odm_fa_threshold_check(
return; return;
} }
u8 static u8
odm_forbidden_igi_check( odm_forbidden_igi_check(
void *p_dm_void, void *p_dm_void,
u8 dig_dynamic_min, u8 dig_dynamic_min,
@ -226,7 +226,7 @@ odm_forbidden_igi_check(
} }
void static void
odm_inband_noise_calculate( odm_inband_noise_calculate(
void *p_dm_void void *p_dm_void
) )
@ -337,7 +337,7 @@ odm_inband_noise_calculate(
return; return;
} }
void static void
odm_dig_for_bt_hs_mode( odm_dig_for_bt_hs_mode(
void *p_dm_void void *p_dm_void
) )
@ -369,7 +369,7 @@ odm_dig_for_bt_hs_mode(
#endif #endif
} }
void static void
phydm_set_big_jump_step( phydm_set_big_jump_step(
void *p_dm_void, void *p_dm_void,
u8 current_igi u8 current_igi
@ -612,7 +612,7 @@ odm_pause_dig(
} }
bool static bool
odm_dig_abort( odm_dig_abort(
void *p_dm_void void *p_dm_void
) )

View file

@ -126,7 +126,7 @@ odm_dynamic_tx_power_write_power_index(
} }
void static void
odm_dynamic_tx_power_nic_ce( odm_dynamic_tx_power_nic_ce(
void *p_dm_void void *p_dm_void
) )

View file

@ -62,7 +62,7 @@
#define GET_VERSION(ic, txt) GET_VERSION_MP(ic, txt) #define GET_VERSION(ic, txt) GET_VERSION_MP(ic, txt)
#endif #endif
u8 static u8
odm_query_rx_pwr_percentage( odm_query_rx_pwr_percentage(
s8 ant_power s8 ant_power
) )
@ -79,7 +79,7 @@ odm_query_rx_pwr_percentage(
* 2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. * 2012/01/12 MH MOve some signal strength smooth method to MP HAL layer.
* IF other SW team do not support the feature, remove this section.?? * IF other SW team do not support the feature, remove this section.??
* */ * */
s32 static s32
odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_lenovo( odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_lenovo(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
s32 curr_sig s32 curr_sig
@ -117,7 +117,7 @@ odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_lenovo(
return ret_sig; return ret_sig;
} }
s32 static s32
odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_netcore( odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_netcore(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
s32 curr_sig s32 curr_sig
@ -155,7 +155,7 @@ odm_signal_scale_mapping_92c_series_patch_rt_cid_819x_netcore(
return ret_sig; return ret_sig;
} }
s32 static s32
odm_signal_scale_mapping_92c_series( odm_signal_scale_mapping_92c_series(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
s32 curr_sig s32 curr_sig
@ -482,7 +482,7 @@ odm_cfo(
return ret_val; return ret_val;
} }
u8 static u8
phydm_rate_to_num_ss( phydm_rate_to_num_ss(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
u8 data_rate u8 data_rate
@ -598,7 +598,7 @@ odm_CCKRSSI_8192E(
#endif #endif
#if (RTL8188E_SUPPORT == 1) #if (RTL8188E_SUPPORT == 1)
s8 static s8
odm_CCKRSSI_8188E( odm_CCKRSSI_8188E(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
u16 LNA_idx, u16 LNA_idx,
@ -621,7 +621,7 @@ odm_CCKRSSI_8188E(
} }
#endif #endif
void static void
odm_rx_phy_status92c_series_parsing( odm_rx_phy_status92c_series_parsing(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
struct _odm_phy_status_info_ *p_phy_info, struct _odm_phy_status_info_ *p_phy_info,
@ -1420,7 +1420,7 @@ odm_init_rssi_for_dm(
} }
void static void
odm_process_rssi_for_dm( odm_process_rssi_for_dm(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
struct _odm_phy_status_info_ *p_phy_info, struct _odm_phy_status_info_ *p_phy_info,
@ -1721,7 +1721,7 @@ odm_process_rssi_for_dm(
/* /*
* Endianness before calling this API * Endianness before calling this API
* */ * */
void static void
odm_phy_status_query_92c_series( odm_phy_status_query_92c_series(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
struct _odm_phy_status_info_ *p_phy_info, struct _odm_phy_status_info_ *p_phy_info,

View file

@ -630,7 +630,7 @@ odm_release_timer(
} }
u8 static u8
phydm_trans_h2c_id( phydm_trans_h2c_id(
struct PHY_DM_STRUCT *p_dm_odm, struct PHY_DM_STRUCT *p_dm_odm,
u8 phydm_h2c_id u8 phydm_h2c_id

View file

@ -28,12 +28,7 @@
/*<YuChen, 150720> Add for KFree Feature Requested by RF David.*/ /*<YuChen, 150720> Add for KFree Feature Requested by RF David.*/
/*This is a phydm API*/ /*This is a phydm API*/
void static void phydm_set_kfree_to_rf_8814a(void *p_dm_void, u8 e_rf_path, u8 data)
phydm_set_kfree_to_rf_8814a(
void *p_dm_void,
u8 e_rf_path,
u8 data
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;
struct odm_rf_calibration_structure *p_rf_calibrate_info = &(p_dm_odm->rf_calibrate_info); struct odm_rf_calibration_structure *p_rf_calibrate_info = &(p_dm_odm->rf_calibrate_info);
@ -119,12 +114,7 @@ phydm_set_kfree_to_rf_8814a(
} }
void static void phydm_set_kfree_to_rf(void *p_dm_void, u8 e_rf_path, u8 data)
phydm_set_kfree_to_rf(
void *p_dm_void,
u8 e_rf_path,
u8 data
)
{ {
struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void;

View file

@ -41,7 +41,7 @@
#if (DM_ODM_SUPPORT_TYPE & (ODM_CE | ODM_WIN)) #if (DM_ODM_SUPPORT_TYPE & (ODM_CE | ODM_WIN))
s16 odm_inband_noise_monitor_n_series(struct PHY_DM_STRUCT *p_dm_odm, u8 is_pause_dig, u8 igi_value, u32 max_time) static s16 odm_inband_noise_monitor_n_series(struct PHY_DM_STRUCT *p_dm_odm, u8 is_pause_dig, u8 igi_value, u32 max_time)
{ {
u32 tmp4b; u32 tmp4b;
u8 max_rf_path = 0, rf_path; u8 max_rf_path = 0, rf_path;
@ -167,7 +167,7 @@ s16 odm_inband_noise_monitor_n_series(struct PHY_DM_STRUCT *p_dm_odm, u8 is_paus
} }
s16 static s16
odm_inband_noise_monitor_ac_series(struct PHY_DM_STRUCT *p_dm_odm, u8 is_pause_dig, u8 igi_value, u32 max_time odm_inband_noise_monitor_ac_series(struct PHY_DM_STRUCT *p_dm_odm, u8 is_pause_dig, u8 igi_value, u32 max_time
) )
{ {

View file

@ -480,7 +480,7 @@ odm_txpowertracking_init(
odm_txpowertracking_thermal_meter_init(p_dm_odm); odm_txpowertracking_thermal_meter_init(p_dm_odm);
} }
u8 static u8
get_swing_index( get_swing_index(
void *p_dm_void void *p_dm_void
) )

View file

@ -33,52 +33,51 @@ void rtl8188e_query_rx_desc_status(
/* phdr = &precvframe->u.hdr; */ /* phdr = &precvframe->u.hdr; */
report.rxdw0 = le32_to_cpu(prxstat->rxdw0); report.rxdw0 = prxstat->rxdw0;
report.rxdw1 = le32_to_cpu(prxstat->rxdw1); report.rxdw1 = prxstat->rxdw1;
report.rxdw2 = le32_to_cpu(prxstat->rxdw2); report.rxdw2 = prxstat->rxdw2;
report.rxdw3 = le32_to_cpu(prxstat->rxdw3); report.rxdw3 = prxstat->rxdw3;
report.rxdw4 = le32_to_cpu(prxstat->rxdw4); report.rxdw4 = prxstat->rxdw4;
report.rxdw5 = le32_to_cpu(prxstat->rxdw5); report.rxdw5 = prxstat->rxdw5;
prxreport = (PRXREPORT)&report; prxreport = (PRXREPORT)&report;
pattrib = &precvframe->u.hdr.attrib; pattrib = &precvframe->u.hdr.attrib;
_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib)); _rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
pattrib->crc_err = (u8)((report.rxdw0 >> 14) & 0x1);;/* (u8)prxreport->crc32; */ pattrib->crc_err = (u8)((le32_to_cpu(report.rxdw0) >> 14) & 0x1);;/* (u8)prxreport->crc32; */
/* update rx report to recv_frame attribute */ /* update rx report to recv_frame attribute */
pattrib->pkt_rpt_type = (u8)((report.rxdw3 >> 14) & 0x3);/* prxreport->rpt_sel; */ pattrib->pkt_rpt_type = (u8)((le32_to_cpu(report.rxdw3) >> 14) & 0x3);/* prxreport->rpt_sel; */
if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */ if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */
pattrib->pkt_len = (u16)(report.rxdw0 & 0x00003fff); /* (u16)prxreport->pktlen; */ pattrib->pkt_len = cpu_to_le16(le32_to_cpu(report.rxdw0) & 0x00003fff); /* (u16)prxreport->pktlen; */
pattrib->drvinfo_sz = (u8)((report.rxdw0 >> 16) & 0xf) * 8;/* (u8)(prxreport->drvinfosize << 3); */ pattrib->drvinfo_sz = (u8)((le32_to_cpu(report.rxdw0) >> 16) & 0xf) * 8;/* (u8)(prxreport->drvinfosize << 3); */
pattrib->physt = (u8)((report.rxdw0 >> 26) & 0x1); /* (u8)prxreport->physt; */ pattrib->physt = (u8)((le32_to_cpu(report.rxdw0) >> 26) & 0x1); /* (u8)prxreport->physt; */
pattrib->bdecrypted = (report.rxdw0 & BIT(27)) ? 0 : 1; /* (u8)(prxreport->swdec ? 0 : 1); */ pattrib->bdecrypted = (le32_to_cpu(report.rxdw0) & BIT(27)) ? 0 : 1; /* (u8)(prxreport->swdec ? 0 : 1); */
pattrib->encrypt = (u8)((report.rxdw0 >> 20) & 0x7);/* (u8)prxreport->security; */ pattrib->encrypt = (u8)((le32_to_cpu(report.rxdw0) >> 20) & 0x7);/* (u8)prxreport->security; */
pattrib->qos = (u8)((report.rxdw0 >> 23) & 0x1);/* (u8)prxreport->qos; */ pattrib->qos = (u8)((le32_to_cpu(report.rxdw0) >> 23) & 0x1);/* (u8)prxreport->qos; */
pattrib->priority = (u8)((report.rxdw1 >> 8) & 0xf);/* (u8)prxreport->tid; */ pattrib->priority = (u8)((le32_to_cpu(report.rxdw1) >> 8) & 0xf);/* (u8)prxreport->tid; */
pattrib->amsdu = (u8)((report.rxdw1 >> 13) & 0x1);/* (u8)prxreport->amsdu; */ pattrib->amsdu = (u8)((le32_to_cpu(report.rxdw1) >> 13) & 0x1);/* (u8)prxreport->amsdu; */
pattrib->seq_num = (u16)(report.rxdw2 & 0x00000fff);/* (u16)prxreport->seq; */ pattrib->seq_num = cpu_to_le16(le32_to_cpu(report.rxdw2) & 0x00000fff);/* (u16)prxreport->seq; */
pattrib->frag_num = (u8)((report.rxdw2 >> 12) & 0xf);/* (u8)prxreport->frag; */ pattrib->frag_num = (u8)((le32_to_cpu(report.rxdw2) >> 12) & 0xf);/* (u8)prxreport->frag; */
pattrib->mfrag = (u8)((report.rxdw1 >> 27) & 0x1);/* (u8)prxreport->mf; */ pattrib->mfrag = (u8)((le32_to_cpu(report.rxdw1) >> 27) & 0x1);/* (u8)prxreport->mf; */
pattrib->mdata = (u8)((report.rxdw1 >> 26) & 0x1);/* (u8)prxreport->md; */ pattrib->mdata = (u8)((le32_to_cpu(report.rxdw1) >> 26) & 0x1);/* (u8)prxreport->md; */
pattrib->data_rate = (u8)(report.rxdw3 & 0x3f);/* (u8)prxreport->rxmcs; */ pattrib->data_rate = (u8)(le32_to_cpu(report.rxdw3) & 0x3f);/* (u8)prxreport->rxmcs; */
pattrib->icv_err = (u8)((report.rxdw0 >> 15) & 0x1);/* (u8)prxreport->icverr; */
pattrib->shift_sz = (u8)((report.rxdw0 >> 24) & 0x3);
pattrib->icv_err = (u8)((le32_to_cpu(report.rxdw0) >> 15) & 0x1);/* (u8)prxreport->icverr; */
pattrib->shift_sz = (u8)((le32_to_cpu(report.rxdw0) >> 24) & 0x3);
} else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */ } else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */
pattrib->pkt_len = TX_RPT1_PKT_LEN; pattrib->pkt_len = cpu_to_le16(TX_RPT1_PKT_LEN);
pattrib->drvinfo_sz = 0; pattrib->drvinfo_sz = 0;
} else if (pattrib->pkt_rpt_type == TX_REPORT2) { /* TX RPT */ } else if (pattrib->pkt_rpt_type == TX_REPORT2) { /* TX RPT */
pattrib->pkt_len = (u16)(report.rxdw0 & 0x3FF); /* Rx length[9:0] */ pattrib->pkt_len = cpu_to_le16(le32_to_cpu(report.rxdw0) & 0x3FF); /* Rx length[9:0] */
pattrib->drvinfo_sz = 0; pattrib->drvinfo_sz = 0;
/* */ /* */
@ -86,9 +85,8 @@ void rtl8188e_query_rx_desc_status(
/* */ /* */
pattrib->MacIDValidEntry[0] = report.rxdw4; pattrib->MacIDValidEntry[0] = report.rxdw4;
pattrib->MacIDValidEntry[1] = report.rxdw5; pattrib->MacIDValidEntry[1] = report.rxdw5;
} else if (pattrib->pkt_rpt_type == HIS_REPORT) { /* USB HISR RPT */ } else if (pattrib->pkt_rpt_type == HIS_REPORT) { /* USB HISR RPT */
pattrib->pkt_len = (u16)(report.rxdw0 & 0x00003fff); /* (u16)prxreport->pktlen; */ pattrib->pkt_len = cpu_to_le16(le32_to_cpu(report.rxdw0) & 0x00003fff); /* (u16)prxreport->pktlen; */
} }
} }

View file

@ -42,7 +42,7 @@ void rtl8188eu_free_xmit_priv(_adapter *padapter)
{ {
} }
u8 urb_zero_packet_chk(_adapter *padapter, int sz) static u8 urb_zero_packet_chk(_adapter *padapter, int sz)
{ {
u8 blnSetTxDescOffset; u8 blnSetTxDescOffset;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
@ -51,9 +51,9 @@ u8 urb_zero_packet_chk(_adapter *padapter, int sz)
return blnSetTxDescOffset; return blnSetTxDescOffset;
} }
void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc) static void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
{ {
u16 *usPtr = (u16 *)ptxdesc; __le16 *usPtr = (__le16 *)ptxdesc;
u32 count = 16; /* (32 bytes / 2 bytes per XOR) => 16 times */ u32 count = 16; /* (32 bytes / 2 bytes per XOR) => 16 times */
u32 index; u32 index;
u16 checksum = 0; u16 checksum = 0;
@ -147,7 +147,7 @@ void rtl8188e_fill_fake_txdesc(
#endif #endif
} }
void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc) static void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc)
{ {
if ((pattrib->encrypt > 0) && !pattrib->bswenc) { if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
@ -182,7 +182,7 @@ void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc)
} }
void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw) static void fill_txdesc_vcs(struct pkt_attrib *pattrib, __le32 *pdw)
{ {
/* RTW_INFO("cvs_mode=%d\n", pattrib->vcs_mode); */ /* RTW_INFO("cvs_mode=%d\n", pattrib->vcs_mode); */
@ -217,7 +217,7 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw)
} }
} }
void fill_txdesc_phy(struct pkt_attrib *pattrib, u32 *pdw) static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)
{ {
/* RTW_INFO("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset); */ /* RTW_INFO("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset); */
@ -321,14 +321,15 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba
if (pattrib->ampdu_en == _TRUE) { if (pattrib->ampdu_en == _TRUE) {
ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);/* AGG EN */ ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);/* AGG EN */
ptxdesc->txdw2 |= (pattrib->ampdu_spacing << AMPDU_DENSITY_SHT) & 0x00700000; ptxdesc->txdw2 |= cpu_to_le32((pattrib->ampdu_spacing <<
AMPDU_DENSITY_SHT) & 0x00700000);
/* SET_TX_DESC_MAX_AGG_NUM_88E(pDesc, 0x1F); */ /* SET_TX_DESC_MAX_AGG_NUM_88E(pDesc, 0x1F); */
/* SET_TX_DESC_MCSG1_MAX_LEN_88E(pDesc, 0x6); */ /* SET_TX_DESC_MCSG1_MAX_LEN_88E(pDesc, 0x6); */
/* SET_TX_DESC_MCSG2_MAX_LEN_88E(pDesc, 0x6); */ /* SET_TX_DESC_MCSG2_MAX_LEN_88E(pDesc, 0x6); */
/* SET_TX_DESC_MCSG3_MAX_LEN_88E(pDesc, 0x6); */ /* SET_TX_DESC_MCSG3_MAX_LEN_88E(pDesc, 0x6); */
/* SET_TX_DESC_MCS7_SGI_MAX_LEN_88E(pDesc, 0x6); */ /* SET_TX_DESC_MCS7_SGI_MAX_LEN_88E(pDesc, 0x6); */
ptxdesc->txdw6 = 0x6666f800; ptxdesc->txdw6 = cpu_to_le32(0x6666f800);
} else { } else {
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);/* AGG BK */ ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);/* AGG BK */
} }

View file

@ -86,7 +86,7 @@ static BOOLEAN HalUsbSetQueuePipeMapping8188EUsb(
} }
void rtl8188eu_interface_configure(_adapter *padapter) static void rtl8188eu_interface_configure(_adapter *padapter)
{ {
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
@ -874,7 +874,8 @@ InitUsbAggregationSetting(
/* 201/12/10 MH Add for USB agg mode dynamic switch. */ /* 201/12/10 MH Add for USB agg mode dynamic switch. */
pHalData->UsbRxHighSpeedMode = _FALSE; pHalData->UsbRxHighSpeedMode = _FALSE;
} }
VOID
static VOID
HalRxAggr8188EUsb( HalRxAggr8188EUsb(
IN PADAPTER Adapter, IN PADAPTER Adapter,
IN BOOLEAN Value IN BOOLEAN Value
@ -901,7 +902,7 @@ HalRxAggr8188EUsb(
* 12/10/2010 MHC Create Version 0. * 12/10/2010 MHC Create Version 0.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
VOID static VOID
USB_AggModeSwitch( USB_AggModeSwitch(
IN PADAPTER Adapter IN PADAPTER Adapter
) )
@ -1054,7 +1055,7 @@ rt_rf_power_state RfOnOffDetect(IN PADAPTER pAdapter)
void _ps_open_RF(_adapter *padapter); void _ps_open_RF(_adapter *padapter);
u32 rtl8188eu_hal_init(PADAPTER Adapter) static u32 rtl8188eu_hal_init(PADAPTER Adapter)
{ {
u8 value8 = 0; u8 value8 = 0;
u16 value16; u16 value16;
@ -1489,13 +1490,13 @@ void _ps_open_RF(_adapter *padapter)
/* phy_SsPwrSwitch92CU(padapter, rf_on, 1); */ /* phy_SsPwrSwitch92CU(padapter, rf_on, 1); */
} }
void _ps_close_RF(_adapter *padapter) static void _ps_close_RF(_adapter *padapter)
{ {
/* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2 needs to be verified */ /* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2 needs to be verified */
/* phy_SsPwrSwitch92CU(padapter, rf_off, 1); */ /* phy_SsPwrSwitch92CU(padapter, rf_off, 1); */
} }
VOID static void
hal_poweroff_8188eu( hal_poweroff_8188eu(
IN PADAPTER Adapter IN PADAPTER Adapter
) )
@ -1582,7 +1583,7 @@ static void rtl8188eu_hw_power_down(_adapter *padapter)
rtw_write16(padapter, REG_APS_FSMCO, 0x8812); rtw_write16(padapter, REG_APS_FSMCO, 0x8812);
} }
u32 rtl8188eu_hal_deinit(PADAPTER Adapter) static u32 rtl8188eu_hal_deinit(PADAPTER Adapter)
{ {
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(Adapter); struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(Adapter);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
@ -1613,7 +1614,7 @@ u32 rtl8188eu_hal_deinit(PADAPTER Adapter)
return _SUCCESS; return _SUCCESS;
} }
unsigned int rtl8188eu_inirp_init(PADAPTER Adapter) static unsigned int rtl8188eu_inirp_init(PADAPTER Adapter)
{ {
u8 i; u8 i;
struct recv_buf *precvbuf; struct recv_buf *precvbuf;
@ -1663,7 +1664,7 @@ exit:
} }
unsigned int rtl8188eu_inirp_deinit(PADAPTER Adapter) static unsigned int rtl8188eu_inirp_deinit(PADAPTER Adapter)
{ {
rtw_read_port_cancel(Adapter); rtw_read_port_cancel(Adapter);
@ -1850,7 +1851,7 @@ static u8 ReadAdapterInfo8188EU(PADAPTER Adapter)
return _SUCCESS; return _SUCCESS;
} }
void UpdateInterruptMask8188EU(PADAPTER padapter, u8 bHIMR0 , u32 AddMSR, u32 RemoveMSR) static void UpdateInterruptMask8188EU(PADAPTER padapter, u8 bHIMR0 , u32 AddMSR, u32 RemoveMSR)
{ {
HAL_DATA_TYPE *pHalData; HAL_DATA_TYPE *pHalData;
@ -1875,7 +1876,7 @@ void UpdateInterruptMask8188EU(PADAPTER padapter, u8 bHIMR0 , u32 AddMSR, u32 Re
} }
void SetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val) static void SetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val)
{ {
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
@ -1913,7 +1914,7 @@ void SetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val)
} }
void GetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val) static void GetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val)
{ {
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
@ -1929,7 +1930,7 @@ void GetHwReg8188EU(PADAPTER Adapter, u8 variable, u8 *val)
* Description: * Description:
* Query setting of specified variable. * Query setting of specified variable.
* */ * */
u8 static u8
GetHalDefVar8188EUsb( GetHalDefVar8188EUsb(
IN PADAPTER Adapter, IN PADAPTER Adapter,
IN HAL_DEF_VARIABLE eVariable, IN HAL_DEF_VARIABLE eVariable,
@ -1966,7 +1967,7 @@ GetHalDefVar8188EUsb(
* Description: * Description:
* Change default setting of specified variable. * Change default setting of specified variable.
* */ * */
u8 static u8
SetHalDefVar8188EUsb( SetHalDefVar8188EUsb(
IN PADAPTER Adapter, IN PADAPTER Adapter,
IN HAL_DEF_VARIABLE eVariable, IN HAL_DEF_VARIABLE eVariable,
@ -1985,7 +1986,7 @@ SetHalDefVar8188EUsb(
return bResult; return bResult;
} }
void _update_response_rate(_adapter *padapter, unsigned int mask) static void _update_response_rate(_adapter *padapter, unsigned int mask)
{ {
u8 RateIndex = 0; u8 RateIndex = 0;
/* Set RRSR rate table. */ /* Set RRSR rate table. */
@ -2000,7 +2001,7 @@ void _update_response_rate(_adapter *padapter, unsigned int mask)
rtw_write8(padapter, REG_INIRTS_RATE_SEL, RateIndex); rtw_write8(padapter, REG_INIRTS_RATE_SEL, RateIndex);
} }
void SetBeaconRelatedRegisters8188EUsb(PADAPTER padapter) static void SetBeaconRelatedRegisters8188EUsb(PADAPTER padapter)
{ {
u32 value32; u32 value32;
/* HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); */ /* HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); */

View file

@ -108,43 +108,43 @@
/* /*
* Read LE data from memory to host byte order * Read LE data from memory to host byte order
*/ */
#define ReadLE4Byte(_ptr) le32_to_cpu(*((u32 *)(_ptr))) #define ReadLE4Byte(_ptr) le32_to_cpu(*((__le32 *)(_ptr)))
#define ReadLE2Byte(_ptr) le16_to_cpu(*((u16 *)(_ptr))) #define ReadLE2Byte(_ptr) le16_to_cpu(*((__le16 *)(_ptr)))
#define ReadLE1Byte(_ptr) (*((u8 *)(_ptr))) #define ReadLE1Byte(_ptr) (*((u8 *)(_ptr)))
/* /*
* Read BE data from memory to host byte order * Read BE data from memory to host byte order
*/ */
#define ReadBEE4Byte(_ptr) be32_to_cpu(*((u32 *)(_ptr))) #define ReadBEE4Byte(_ptr) be32_to_cpu(*((__be32 *)(_ptr)))
#define ReadBE2Byte(_ptr) be16_to_cpu(*((u16 *)(_ptr))) #define ReadBE2Byte(_ptr) be16_to_cpu(*((__be16 *)(_ptr)))
#define ReadBE1Byte(_ptr) (*((u8 *)(_ptr))) #define ReadBE1Byte(_ptr) (*((u8 *)(_ptr)))
/* /*
* Write host byte order data to memory in LE order * Write host byte order data to memory in LE order
*/ */
#define WriteLE4Byte(_ptr, _val) ((*((u32 *)(_ptr))) = cpu_to_le32(_val)) #define WriteLE4Byte(_ptr, _val) ((*((__le32 *)(_ptr))) = cpu_to_le32(_val))
#define WriteLE2Byte(_ptr, _val) ((*((u16 *)(_ptr))) = cpu_to_le16(_val)) #define WriteLE2Byte(_ptr, _val) ((*((i__le16 *)(_ptr))) = cpu_to_le16(_val))
#define WriteLE1Byte(_ptr, _val) ((*((u8 *)(_ptr))) = ((u8)(_val))) #define WriteLE1Byte(_ptr, _val) ((*((u8 *)(_ptr))) = ((u8)(_val)))
/* /*
* Write host byte order data to memory in BE order * Write host byte order data to memory in BE order
*/ */
#define WriteBE4Byte(_ptr, _val) ((*((u32 *)(_ptr))) = cpu_to_be32(_val)) #define WriteBE4Byte(_ptr, _val) ((*((__be32 *)(_ptr))) = cpu_to_be32(_val))
#define WriteBE2Byte(_ptr, _val) ((*((u16 *)(_ptr))) = cpu_to_be16(_val)) #define WriteBE2Byte(_ptr, _val) ((*((__be16 *)(_ptr))) = cpu_to_be16(_val))
#define WriteBE1Byte(_ptr, _val) ((*((u8 *)(_ptr))) = ((u8)(_val))) #define WriteBE1Byte(_ptr, _val) ((*((u8 *)(_ptr))) = ((u8)(_val)))
/* /*
* Return 4-byte value in host byte ordering from 4-byte pointer in litten-endian system. * Return 4-byte value in host byte ordering from 4-byte pointer in litten-endian system.
*/ */
#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) (le32_to_cpu(*((u32 *)(__pStart)))) #define LE_P4BYTE_TO_HOST_4BYTE(__pStart) (le32_to_cpu(*((__le32 *)(__pStart))))
#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) (le16_to_cpu(*((u16 *)(__pStart)))) #define LE_P2BYTE_TO_HOST_2BYTE(__pStart) (le16_to_cpu(*((__le16 *)(__pStart))))
#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) ((*((u8 *)(__pStart)))) #define LE_P1BYTE_TO_HOST_1BYTE(__pStart) ((*((u8 *)(__pStart))))
/* /*
* Return 4-byte value in host byte ordering from 4-byte pointer in big-endian system. * Return 4-byte value in host byte ordering from 4-byte pointer in big-endian system.
*/ */
#define BE_P4BYTE_TO_HOST_4BYTE(__pStart) (be32_to_cpu(*((u32 *)(__pStart)))) #define BE_P4BYTE_TO_HOST_4BYTE(__pStart) (be32_to_cpu(*((__be32 *)(__pStart))))
#define BE_P2BYTE_TO_HOST_2BYTE(__pStart) (be16_to_cpu(*((u16 *)(__pStart)))) #define BE_P2BYTE_TO_HOST_2BYTE(__pStart) (be16_to_cpu(*((__be16 *)(__pStart))))
#define BE_P1BYTE_TO_HOST_1BYTE(__pStart) ((*((u8 *)(__pStart)))) #define BE_P1BYTE_TO_HOST_1BYTE(__pStart) ((*((u8 *)(__pStart))))
/* /*

View file

@ -1473,7 +1473,12 @@ int rtw_dev_pno_set(struct net_device *net, pno_ssid_t *ssid, int num,
#endif /* CONFIG_PNO_SET_DEBUG */ #endif /* CONFIG_PNO_SET_DEBUG */
#endif /* CONFIG_PNO_SUPPORT */ #endif /* CONFIG_PNO_SUPPORT */
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
unsigned char *ipAddr);
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb);
int rtw_suspend_free_assoc_resource(_adapter *padapter); int rtw_suspend_free_assoc_resource(_adapter *padapter);
int recvbuf2recvframe(PADAPTER padapter, void *ptr);
#ifdef CONFIG_WOWLAN #ifdef CONFIG_WOWLAN
int rtw_suspend_wow(_adapter *padapter); int rtw_suspend_wow(_adapter *padapter);
int rtw_resume_process_wow(_adapter *padapter); int rtw_resume_process_wow(_adapter *padapter);

View file

@ -1040,11 +1040,11 @@ int rtw_halmac_deinit_adapter(struct dvobj_priv *);
#define rf_mode_table_data0 RF_ModeTableData0 #define rf_mode_table_data0 RF_ModeTableData0
#define rf_mode_table_data1 RF_ModeTableData1 #define rf_mode_table_data1 RF_ModeTableData1
#define RX_SMOOTH_FACTOR Rx_Smooth_Factor #define RX_SMOOTH_FACTOR Rx_Smooth_Factor
extern int new_bcn_max;
extern u8 REALTEK_96B_IE[];
extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4];
#endif /* __HAL_DATA_H__ */ #endif /* __HAL_DATA_H__ */

View file

@ -1230,7 +1230,7 @@ enum rtw_h2c_cmd {
#define _SetRFReg_CMD_ _Write_RFREG_CMD_ #define _SetRFReg_CMD_ _Write_RFREG_CMD_
#ifdef _RTW_CMD_C_ #ifdef _RTW_CMD_C_
struct _cmd_callback rtw_cmd_callback[] = { static struct _cmd_callback rtw_cmd_callback[] = {
{GEN_CMD_CODE(_Read_MACREG), &rtw_getmacreg_cmdrsp_callback}, /*0*/ {GEN_CMD_CODE(_Read_MACREG), &rtw_getmacreg_cmdrsp_callback}, /*0*/
{GEN_CMD_CODE(_Write_MACREG), NULL}, {GEN_CMD_CODE(_Write_MACREG), NULL},
{GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback}, {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},

View file

@ -91,17 +91,17 @@ struct io_queue;
struct _io_ops { struct _io_ops {
u8(*_read8)(struct intf_hdl *pintfhdl, u32 addr); u8(*_read8)(struct intf_hdl *pintfhdl, u32 addr);
u16(*_read16)(struct intf_hdl *pintfhdl, u32 addr); __le16(*_read16)(struct intf_hdl *pintfhdl, u32 addr);
u32(*_read32)(struct intf_hdl *pintfhdl, u32 addr); __le32(*_read32)(struct intf_hdl *pintfhdl, u32 addr);
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val); int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata); int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata);
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val); int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val); int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val); int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);

View file

@ -1108,7 +1108,7 @@ u8 rtw_getmacreg_hdl(_adapter *padapter, u8 *pbuf);
#ifdef _RTW_CMD_C_ #ifdef _RTW_CMD_C_
struct cmd_hdl wlancmds[] = { static struct cmd_hdl wlancmds[] = {
GEN_DRV_CMD_HANDLER(sizeof(struct readMAC_parm), rtw_getmacreg) /*0*/ GEN_DRV_CMD_HANDLER(sizeof(struct readMAC_parm), rtw_getmacreg) /*0*/
GEN_DRV_CMD_HANDLER(0, NULL) GEN_DRV_CMD_HANDLER(0, NULL)
GEN_DRV_CMD_HANDLER(0, NULL) GEN_DRV_CMD_HANDLER(0, NULL)

View file

@ -94,27 +94,8 @@ struct recv_reorder_ctrl {
struct stainfo_rxcache { struct stainfo_rxcache {
u16 tid_rxseq[16]; u16 tid_rxseq[16];
u8 iv[16][8]; u8 iv[16][8];
#if 0
unsigned short tid0_rxseq;
unsigned short tid1_rxseq;
unsigned short tid2_rxseq;
unsigned short tid3_rxseq;
unsigned short tid4_rxseq;
unsigned short tid5_rxseq;
unsigned short tid6_rxseq;
unsigned short tid7_rxseq;
unsigned short tid8_rxseq;
unsigned short tid9_rxseq;
unsigned short tid10_rxseq;
unsigned short tid11_rxseq;
unsigned short tid12_rxseq;
unsigned short tid13_rxseq;
unsigned short tid14_rxseq;
unsigned short tid15_rxseq;
#endif
}; };
struct smooth_rssi_data { struct smooth_rssi_data {
u32 elements[100]; /* array to store values */ u32 elements[100]; /* array to store values */
u32 index; /* index to current array to store */ u32 index; /* index to current array to store */
@ -170,9 +151,8 @@ struct rx_raw_rssi {
u8 ofdm_snr[4]; u8 ofdm_snr[4];
}; };
struct rx_pkt_attrib { struct rx_pkt_attrib {
u16 pkt_len; __le16 pkt_len;
u8 physt; u8 physt;
u8 drvinfo_sz; u8 drvinfo_sz;
u8 shift_sz; u8 shift_sz;
@ -183,7 +163,7 @@ struct rx_pkt_attrib {
u8 priority; u8 priority;
u8 pw_save; u8 pw_save;
u8 mdata; u8 mdata;
u16 seq_num; __le16 seq_num;
u8 frag_num; u8 frag_num;
u8 mfrag; u8 mfrag;
u8 order; u8 order;
@ -195,7 +175,7 @@ struct rx_pkt_attrib {
u8 crc_err; u8 crc_err;
u8 icv_err; u8 icv_err;
u16 eth_type; __le16 eth_type;
u8 dst[ETH_ALEN]; u8 dst[ETH_ALEN];
u8 src[ETH_ALEN]; u8 src[ETH_ALEN];
@ -219,16 +199,9 @@ struct rx_pkt_attrib {
u8 ldpc; u8 ldpc;
u8 sgi; u8 sgi;
u8 pkt_rpt_type; u8 pkt_rpt_type;
u32 tsfl; __le32 tsfl;
u32 MacIDValidEntry[2]; /* 64 bits present 64 entry. */ __le32 MacIDValidEntry[2]; /* 64 bits present 64 entry. */
#if 0
u8 signal_qual;
s8 rx_mimo_signal_qual[2];
u8 signal_strength;
u32 RxPWDBAll;
s32 RecvSignalPower;
#endif
struct phy_info phy_info; struct phy_info phy_info;
}; };
@ -266,26 +239,21 @@ struct recv_stat {
}; };
#else #else
struct recv_stat { struct recv_stat {
unsigned int rxdw0; __le32 rxdw0;
unsigned int rxdw1; __le32 rxdw1;
#if !((defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) && defined(CONFIG_PCI_HCI)) /* exclude 8192ee, 8814ae, 8822be, 8821ce */ #if !((defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) && defined(CONFIG_PCI_HCI)) /* exclude 8192ee, 8814ae, 8822be, 8821ce */
unsigned int rxdw2; __le32 rxdw2;
unsigned int rxdw3; __le32 rxdw3;
#endif #endif
#ifndef BUF_DESC_ARCH #ifndef BUF_DESC_ARCH
unsigned int rxdw4; __le32 rxdw4;
unsigned int rxdw5; __le32 rxdw5;
#ifdef CONFIG_PCI_HCI
unsigned int rxdw6;
unsigned int rxdw7;
#endif
#endif /* if BUF_DESC_ARCH is defined, rx_buf_desc occupy 4 double words */ #endif /* if BUF_DESC_ARCH is defined, rx_buf_desc occupy 4 double words */
}; };
#endif #endif

View file

@ -273,26 +273,26 @@ enum WIFI_REG_DOMAIN {
#define SetToDs(pbuf) \ #define SetToDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_); \
} while (0) } while (0)
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0) #define GetToDs(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf)) & (_TO_DS_)) != 0)
#define ClearToDs(pbuf) \ #define ClearToDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
} while (0) } while (0)
#define SetFrDs(pbuf) \ #define SetFrDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
} while (0) } while (0)
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0) #define GetFrDs(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf)) & (_FROM_DS_)) != 0)
#define ClearFrDs(pbuf) \ #define ClearFrDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
} while (0) } while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -300,76 +300,76 @@ enum WIFI_REG_DOMAIN {
#define SetMFrag(pbuf) \ #define SetMFrag(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
} while (0) } while (0)
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0) #define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0)
#define ClearMFrag(pbuf) \ #define ClearMFrag(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
} while (0) } while (0)
#define SetRetry(pbuf) \ #define SetRetry(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_); \
} while (0) } while (0)
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0) #define GetRetry(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf)) & (_RETRY_)) != 0)
#define ClearRetry(pbuf) \ #define ClearRetry(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
} while (0) } while (0)
#define SetPwrMgt(pbuf) \ #define SetPwrMgt(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
} while (0) } while (0)
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0) #define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0)
#define ClearPwrMgt(pbuf) \ #define ClearPwrMgt(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
} while (0) } while (0)
#define SetMData(pbuf) \ #define SetMData(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
} while (0) } while (0)
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0) #define GetMData(pbuf) (((*(__le16 *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0)
#define ClearMData(pbuf) \ #define ClearMData(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
} while (0) } while (0)
#define SetPrivacy(pbuf) \ #define SetPrivacy(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
} while (0) } while (0)
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0) #define GetPrivacy(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf)) & (_PRIVACY_)) != 0)
#define ClearPrivacy(pbuf) \ #define ClearPrivacy(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \ *(__le16 *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
} while (0) } while (0)
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) #define GetOrder(pbuf) (((*(__le16 *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
#define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & (BIT(3) | BIT(2))) #define GetFrameType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2)))
#define SetFrameType(pbuf, type) \ #define SetFrameType(pbuf, type) \
do { \ do { \
*(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \ *(__le16 *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \
*(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \ *(__le16 *)(pbuf) |= __constant_cpu_to_le16(type); \
} while (0) } while (0)
#define get_frame_sub_type(pbuf) (cpu_to_le16(*(unsigned short *)(pbuf)) & (BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))) #define get_frame_sub_type(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2)))
#define set_frame_sub_type(pbuf, type) \ #define set_frame_sub_type(pbuf, type) \
@ -379,47 +379,47 @@ enum WIFI_REG_DOMAIN {
} while (0) } while (0)
#define GetSequence(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) >> 4) #define GetSequence(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) >> 4)
#define GetFragNum(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & 0x0f) #define GetFragNum(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & 0x0f)
#define GetTupleCache(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22))) #define GetTupleCache(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)))
#define SetFragNum(pbuf, num) \ #define SetFragNum(pbuf, num) \
do { \ do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \ *(__le16 *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \ ((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & cpu_to_le16(~(0x000f))) | \
cpu_to_le16(0x0f & (num)); \ cpu_to_le16(0x0f & (num)); \
} while (0) } while (0)
#define SetSeqNum(pbuf, num) \ #define SetSeqNum(pbuf, num) \
do { \ do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \ *(__le16 *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)~0xfff0)) | \ cpu_to_le16((le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & 0x000f) | \
le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \ (0xfff0 & (num << 4))); \
} while (0) } while (0)
#define set_duration(pbuf, dur) \ #define set_duration(pbuf, dur) \
do { \ do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \ *(__le16 *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
} while (0) } while (0)
#define SetPriority(pbuf, tid) \ #define SetPriority(pbuf, tid) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \ *(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf); \
} while (0) } while (0)
#define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf) #define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf)
#define SetEOSP(pbuf, eosp) \ #define SetEOSP(pbuf, eosp) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16((eosp & 1) << 4); \ *(__le16 *)(pbuf) |= cpu_to_le16((eosp & 1) << 4); \
} while (0) } while (0)
#define SetAckpolicy(pbuf, ack) \ #define SetAckpolicy(pbuf, ack) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16((ack & 3) << 5); \ *(__le16 *)(pbuf) |= cpu_to_le16((ack & 3) << 5); \
} while (0) } while (0)
#define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3) #define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3)
@ -428,7 +428,7 @@ enum WIFI_REG_DOMAIN {
#define SetAMsdu(pbuf, amsdu) \ #define SetAMsdu(pbuf, amsdu) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7); \ *(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7); \
} while (0) } while (0)
#define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff) #define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)
@ -760,7 +760,7 @@ typedef enum _ELEMENT_ID {
#define set_order_bit(pbuf) \ #define set_order_bit(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ *(__le16 *)(pbuf) |= cpu_to_le16(_ORDER_); \
} while (0) } while (0)
@ -776,12 +776,12 @@ typedef enum _ELEMENT_ID {
* described in 802.11n draft section 7.2.1.7.1 * described in 802.11n draft section 7.2.1.7.1
*/ */
struct rtw_ieee80211_bar { struct rtw_ieee80211_bar {
unsigned short frame_control; __le16 frame_control;
unsigned short duration; __le16 duration;
unsigned char ra[6]; unsigned char ra[6];
unsigned char ta[6]; unsigned char ta[6];
unsigned short control; __le16 control;
unsigned short start_seq_num; __le16 start_seq_num;
} __attribute__((packed)); } __attribute__((packed));
/* 802.11 BAR control masks */ /* 802.11 BAR control masks */
@ -796,11 +796,11 @@ struct rtw_ieee80211_bar {
*/ */
struct rtw_ieee80211_ht_cap { struct rtw_ieee80211_ht_cap {
unsigned short cap_info; __le16 cap_info;
unsigned char ampdu_params_info; unsigned char ampdu_params_info;
unsigned char supp_mcs_set[16]; unsigned char supp_mcs_set[16];
unsigned short extended_ht_cap_info; __le16 extended_ht_cap_info;
unsigned int tx_BF_cap_info; __le32 tx_BF_cap_info;
unsigned char antenna_selection_info; unsigned char antenna_selection_info;
} __attribute__((packed)); } __attribute__((packed));
@ -813,8 +813,8 @@ struct rtw_ieee80211_ht_cap {
struct ieee80211_ht_addt_info { struct ieee80211_ht_addt_info {
unsigned char control_chan; unsigned char control_chan;
unsigned char ht_param; unsigned char ht_param;
unsigned short operation_mode; __le16 operation_mode;
unsigned short stbc_param; __le16 stbc_param;
unsigned char basic_set[16]; unsigned char basic_set[16];
} __attribute__((packed)); } __attribute__((packed));
@ -822,11 +822,11 @@ struct ieee80211_ht_addt_info {
struct HT_caps_element { struct HT_caps_element {
union { union {
struct { struct {
unsigned short HT_caps_info; __le16 HT_caps_info;
unsigned char AMPDU_para; unsigned char AMPDU_para;
unsigned char MCS_rate[16]; unsigned char MCS_rate[16];
unsigned short HT_ext_caps; __le16 HT_ext_caps;
unsigned int Beamforming_caps; __le32 Beamforming_caps;
unsigned char ASEL_caps; unsigned char ASEL_caps;
} HT_cap_element; } HT_cap_element;
unsigned char HT_cap[26]; unsigned char HT_cap[26];
@ -842,7 +842,7 @@ struct HT_info_element {
struct AC_param { struct AC_param {
unsigned char ACI_AIFSN; unsigned char ACI_AIFSN;
unsigned char CW; unsigned char CW;
unsigned short TXOP_limit; __le16 TXOP_limit;
} __attribute__((packed)); } __attribute__((packed));
struct WMM_para_element { struct WMM_para_element {
@ -853,9 +853,9 @@ struct WMM_para_element {
struct ADDBA_request { struct ADDBA_request {
unsigned char dialog_token; unsigned char dialog_token;
unsigned short BA_para_set; __le16 BA_para_set;
unsigned short BA_timeout_value; __le16 BA_timeout_value;
unsigned short BA_starting_seqctrl; __le16 BA_starting_seqctrl;
} __attribute__((packed)); } __attribute__((packed));
typedef enum _HT_CAP_AMPDU_FACTOR { typedef enum _HT_CAP_AMPDU_FACTOR {

View file

@ -349,7 +349,11 @@ static const struct ieee80211_txrx_stypes
static u64 rtw_get_systime_us(void) static u64 rtw_get_systime_us(void)
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
ktime_t ts;
ts = ktime_get_boottime();
return ts / 1000;
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
struct timespec ts; struct timespec ts;
get_monotonic_boottime(&ts); get_monotonic_boottime(&ts);
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;

View file

@ -688,8 +688,6 @@ void usb_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf)
} }
int recvbuf2recvframe(PADAPTER padapter, void *ptr);
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
void usb_recv_tasklet(void *priv) void usb_recv_tasklet(void *priv)
{ {