mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Fix most errors from smatch
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
ee006634cb
commit
993b4435cb
40 changed files with 1508 additions and 2204 deletions
|
@ -1295,9 +1295,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
__nat25_db_print(priv);
|
||||
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
|
||||
skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
|
||||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||
hdr->icmp6_cksum = 0;
|
||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
||||
|
@ -1430,8 +1430,7 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
|
|||
if(skb == NULL)
|
||||
return;
|
||||
|
||||
if(!priv->ethBrExtInfo.dhcp_bcst_disable)
|
||||
{
|
||||
if(!priv->ethBrExtInfo.dhcp_bcst_disable) {
|
||||
__be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
|
||||
|
||||
if(protocol == __constant_htons(ETH_P_IP)) /* IP */
|
||||
|
|
|
@ -462,7 +462,7 @@ _next:
|
|||
|
||||
memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
||||
|
||||
if(pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
|
||||
if(pcmd->cmdcode < (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
|
||||
{
|
||||
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
|
||||
|
||||
|
@ -484,7 +484,7 @@ _next:
|
|||
post_process:
|
||||
|
||||
/* call callback function for post-processed */
|
||||
if(pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
if(pcmd->cmdcode < (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
{
|
||||
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
|
||||
if(pcmd_callback == NULL)
|
||||
|
@ -702,9 +702,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, NDIS_802_11_SSID *ssid, int ssi
|
|||
if (ssid[i].SsidLength) {
|
||||
memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(NDIS_802_11_SSID));
|
||||
psurveyPara->ssid_num++;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" ssid:(%s, %d)\n", FUNC_ADPT_ARG(padapter),
|
||||
psurveyPara->ssid[i].Ssid, psurveyPara->ssid[i].SsidLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -716,9 +713,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, NDIS_802_11_SSID *ssid, int ssi
|
|||
if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
|
||||
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
||||
psurveyPara->ch_num++;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter),
|
||||
psurveyPara->ch[i].hw_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -692,7 +692,6 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer,
|
|||
return count;
|
||||
|
||||
signal_strength = signal_strength>100?100:signal_strength;
|
||||
signal_strength = signal_strength<0?0:signal_strength;
|
||||
|
||||
padapter->recvpriv.is_signal_dbg = is_signal_dbg;
|
||||
padapter->recvpriv.signal_strength_dbg=signal_strength;
|
||||
|
|
|
@ -82,36 +82,28 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
|
|||
|
||||
uint rtw_is_cckrates_included(u8 *rate)
|
||||
{
|
||||
u32 i = 0;
|
||||
u32 i = 0;
|
||||
|
||||
while(rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
while(rate[i]!=0) {
|
||||
if ((((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return true;
|
||||
i++;
|
||||
}
|
||||
|
||||
return false;
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint rtw_is_cckratesonly_included(u8 *rate)
|
||||
{
|
||||
u32 i = 0;
|
||||
|
||||
|
||||
while(rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
||||
while (rate[i]!=0) {
|
||||
if ((((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
return false;
|
||||
|
||||
i++;
|
||||
i++;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
||||
|
|
|
@ -188,7 +188,7 @@ void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
|
||||
("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
|
||||
adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
_read_mem = pintfhdl->io_ops._read_mem;
|
||||
|
@ -262,8 +262,7 @@ u32 _rtw_write_port_and_wait(struct adapter *adapter, u32 addr, u32 cnt, u8 *pme
|
|||
|
||||
if (ret == _SUCCESS)
|
||||
ret = rtw_sctx_wait(&sctx);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _rtw_write_port_cancel(struct adapter *adapter)
|
||||
|
|
|
@ -684,23 +684,24 @@ u8 rtw_set_802_11_add_wep(struct adapter* padapter, NDIS_802_11_WEP *wep){
|
|||
goto exit;
|
||||
}
|
||||
|
||||
switch(wep->KeyLength)
|
||||
{
|
||||
case 5:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=5\n"));
|
||||
break;
|
||||
case 13:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=13\n"));
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_NO_PRIVACY_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n"));
|
||||
break;
|
||||
switch(wep->KeyLength) {
|
||||
case 5:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=5\n"));
|
||||
break;
|
||||
case 13:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=13\n"));
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_NO_PRIVACY_;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength=0x%x wep->KeyIndex=0x%x keyid =%x\n",wep->KeyLength,wep->KeyIndex,keyid));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,
|
||||
("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength=0x%x wep->KeyIndex=0x%x keyid =%x\n",
|
||||
wep->KeyLength,wep->KeyIndex,keyid));
|
||||
|
||||
memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]),&(wep->KeyMaterial),wep->KeyLength);
|
||||
|
||||
|
@ -856,7 +857,8 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){
|
|||
}
|
||||
|
||||
/* Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. */
|
||||
if( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
if ((encryptionalgo == _WEP40_ && key->KeyLength != 5) ||
|
||||
(encryptionalgo== _WEP104_ && key->KeyLength != 13)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
@ -871,14 +873,10 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, NDIS_802_11_KEY *key){
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key index: 0x%8x(0x%8x)\n", key->KeyIndex,(key->KeyIndex&0x3)));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key Length: %d\n", key->KeyLength));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* Group key - KeyIndex(BIT30==0) */
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n"));
|
||||
|
||||
|
||||
/* when add wep key through add key and didn't assigned encryption type before */
|
||||
if((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
{
|
||||
|
@ -1160,32 +1158,24 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, NDIS_802_11_REMOVE_KEY *k
|
|||
memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16);
|
||||
|
||||
/* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */
|
||||
|
||||
} else {
|
||||
|
||||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
if(stainfo !=NULL){
|
||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||
|
||||
/* clear key by BSSID */
|
||||
memset(&stainfo->dot118021x_UncstKey, 0, 16);
|
||||
/* clear key by BSSID */
|
||||
memset(&stainfo->dot118021x_UncstKey, 0, 16);
|
||||
|
||||
/* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */
|
||||
|
||||
}
|
||||
else{
|
||||
/* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */
|
||||
} else{
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -460,7 +460,7 @@ static void SwLedBlink2(PLED_871x pLed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pLed->bLedOn )
|
||||
if( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
@ -506,7 +506,7 @@ static void SwLedBlink2(PLED_871x pLed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pLed->bLedOn )
|
||||
if( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
@ -770,7 +770,7 @@ static void SwLedBlink4(PLED_871x pLed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pLed->bLedOn )
|
||||
if( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
@ -811,7 +811,7 @@ static void SwLedBlink4(PLED_871x pLed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pLed->bLedOn )
|
||||
if( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
@ -978,7 +978,7 @@ static void SwLedBlink5(PLED_871x pLed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pLed->bLedOn )
|
||||
if( pLed->bLedOn )
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
|
@ -1215,7 +1215,7 @@ SwLedControlMode1(
|
|||
if( pLed->bLedLinkBlinkInProgress == true )
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if(pLed->bLedBlinkInProgress ==true)
|
||||
{
|
||||
|
@ -1274,7 +1274,7 @@ SwLedControlMode1(
|
|||
if( pLed->bLedLinkBlinkInProgress == true )
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if(pLed->bLedBlinkInProgress ==true)
|
||||
{
|
||||
|
@ -1306,7 +1306,7 @@ SwLedControlMode1(
|
|||
if( pLed->bLedLinkBlinkInProgress == true )
|
||||
{
|
||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if(pLed->bLedBlinkInProgress ==true)
|
||||
{
|
||||
|
@ -2251,22 +2251,13 @@ LedControl871x(
|
|||
{
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
||||
if( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)
|
||||
||(padapter->hw_init_completed == false) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((padapter->bSurpriseRemoved) || ( padapter->bDriverStopped) ||
|
||||
(padapter->hw_init_completed == false) )
|
||||
return;
|
||||
|
||||
if( ledpriv->bRegUseLed == false)
|
||||
return;
|
||||
|
||||
/* if (!priv->up) */
|
||||
/* return; */
|
||||
|
||||
/* if(priv->bInHctTest) */
|
||||
/* return; */
|
||||
|
||||
if( (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on &&
|
||||
adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS) &&
|
||||
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||
|
||||
|
|
|
@ -580,8 +580,8 @@ inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
|
|||
|
||||
int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feature)
|
||||
{
|
||||
__le16 ls_cap, ld_cap;
|
||||
u16 s_cap, d_cap;
|
||||
__le16 ls_cap, ld_cap;
|
||||
u16 s_cap, d_cap;
|
||||
|
||||
memcpy((u8 *)&ls_cap, rtw_get_capability_from_ie(src->IEs), 2);
|
||||
memcpy((u8 *)&ld_cap, rtw_get_capability_from_ie(dst->IEs), 2);
|
||||
|
@ -1383,7 +1383,7 @@ void rtw_indicate_disconnect( struct adapter *padapter )
|
|||
/* set ips_deny_time to avoid enter IPS before LPS leave */
|
||||
adapter_to_pwrctl(padapter)->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(3000);
|
||||
|
||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||
|
||||
rtw_led_control(padapter, LED_CTL_NO_LINK);
|
||||
|
||||
|
@ -1452,7 +1452,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psta->aid = pnetwork->join_res;
|
||||
psta->mac_id=0;
|
||||
psta->mac_id=0;
|
||||
|
||||
/* sta mode */
|
||||
rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true);
|
||||
|
@ -2244,8 +2244,6 @@ inline void rtw_clear_scan_deny(struct adapter *adapter)
|
|||
{
|
||||
struct mlme_priv *mlmepriv = &adapter->mlmepriv;
|
||||
ATOMIC_SET(&mlmepriv->set_scan_deny, 0);
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
}
|
||||
|
||||
void rtw_set_scan_deny_timer_hdl(struct adapter *adapter)
|
||||
|
@ -2294,10 +2292,9 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
|
|||
}
|
||||
|
||||
/* check ssid, if needed */
|
||||
if(pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) {
|
||||
if( competitor->network.Ssid.SsidLength != pmlmepriv->assoc_ssid.SsidLength
|
||||
|| _rtw_memcmp(competitor->network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength) == false
|
||||
)
|
||||
if (pmlmepriv->assoc_ssid.SsidLength) {
|
||||
if (competitor->network.Ssid.SsidLength != pmlmepriv->assoc_ssid.SsidLength ||
|
||||
_rtw_memcmp(competitor->network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength) == false)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -556,18 +556,14 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl
|
|||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
u8 *pframe = precv_frame->u.hdr.rx_data;
|
||||
|
||||
if(ptable->func)
|
||||
{
|
||||
if(ptable->func) {
|
||||
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
|
||||
if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) &&
|
||||
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ptable->func(padapter, precv_frame);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
|
||||
|
@ -1813,25 +1809,17 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
|
||||
break;
|
||||
|
||||
/* if (pstat->aid > NUM_STA) { */
|
||||
if (pstat->aid > pstapriv->max_num_sta) {
|
||||
|
||||
pstat->aid = 0;
|
||||
|
||||
DBG_871X(" no room for more AIDs\n");
|
||||
|
||||
status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||
|
||||
goto OnAssocReqFail;
|
||||
|
||||
|
||||
} else {
|
||||
pstapriv->sta_aid[pstat->aid - 1] = pstat;
|
||||
DBG_871X("allocate new AID = (%d)\n", pstat->aid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pstat->state &= (~WIFI_FW_ASSOC_STATE);
|
||||
pstat->state |= WIFI_FW_ASSOC_SUCCESS;
|
||||
|
||||
|
@ -2999,7 +2987,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame
|
|||
p2pie[ p2pielen++ ] = P2P_ATTR_STATUS;
|
||||
|
||||
/* Length: */
|
||||
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
|
||||
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
|
||||
p2pielen += 2;
|
||||
|
||||
/* Value: */
|
||||
|
@ -4121,16 +4109,14 @@ static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profi
|
|||
|
||||
for( i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++ )
|
||||
{
|
||||
DBG_871X( "[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__,
|
||||
DBG_871X( "[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__,
|
||||
profileinfo->peermac[0], profileinfo->peermac[1],profileinfo->peermac[2],profileinfo->peermac[3],profileinfo->peermac[4],profileinfo->peermac[5]);
|
||||
if ( _rtw_memcmp( peermacaddr, profileinfo->peermac, ETH_ALEN ) )
|
||||
{
|
||||
if ( _rtw_memcmp( peermacaddr, profileinfo->peermac, ETH_ALEN ) ) {
|
||||
match_result = 1;
|
||||
DBG_871X( "[%s] Match!\n", __FUNCTION__ );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (match_result );
|
||||
}
|
||||
|
||||
|
@ -4923,7 +4909,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
|
|||
|
||||
/* Commented by Kurt 20120113 */
|
||||
/* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */
|
||||
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) );
|
||||
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) )
|
||||
memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);
|
||||
|
||||
result = process_p2p_group_negotation_req( pwdinfo, frame_body, len );
|
||||
|
@ -5613,7 +5599,7 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr
|
|||
pxmitbuf->sctx = NULL;
|
||||
_exit_critical(&pxmitpriv->lock_sctx, &irqL);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
||||
|
@ -5641,7 +5627,7 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg
|
|||
pxmitpriv->ack_tx = false;
|
||||
_exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode)
|
||||
|
@ -8627,9 +8613,10 @@ void start_clnt_join(struct adapter* padapter)
|
|||
for (pos = get_next(head);!rtw_end_of_queue_search(head, pos); pos = get_next(pos)) {
|
||||
|
||||
scanned = LIST_CONTAINOR(pos, struct wlan_network, list);
|
||||
if(scanned==NULL)
|
||||
if(scanned==NULL) {
|
||||
rtw_warn_on(1);
|
||||
|
||||
return;
|
||||
}
|
||||
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true
|
||||
&& _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true
|
||||
) {
|
||||
|
@ -9541,11 +9528,10 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter)
|
|||
Following are the functions for the timer handlers
|
||||
|
||||
*****************************************************************************/
|
||||
void _linked_rx_signal_strehgth_display(struct adapter *padapter);
|
||||
void _linked_rx_signal_strehgth_display(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 mac_id;
|
||||
int UndecoratedSmoothedPWDB;
|
||||
if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
|
||||
|
@ -10200,8 +10186,6 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
|
|||
/* acquire channels from in */
|
||||
j = 0;
|
||||
for (i=0;i<in_num;i++) {
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" "CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(&in[i]));
|
||||
if(in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED)
|
||||
&& (set_idx=rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value)) >=0
|
||||
)
|
||||
|
@ -10588,20 +10572,15 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
|
||||
peventbuf += 2;
|
||||
|
||||
if(peventbuf)
|
||||
{
|
||||
if(peventbuf) {
|
||||
event_callback = wlanevents[evt_code].event_callback;
|
||||
event_callback(padapter, (u8*)peventbuf);
|
||||
|
||||
pevt_priv->evt_done_cnt++;
|
||||
}
|
||||
|
||||
|
||||
_abort_event_:
|
||||
|
||||
|
||||
return H2C_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf)
|
||||
|
|
|
@ -113,8 +113,8 @@ int _rtw_odm_dbg_comp_msg(struct adapter *adapter, char *buf, int len)
|
|||
cnt += snprintf(buf+cnt, len-cnt, "odm.DebugComponents = 0x%016llx \n", dbg_comp);
|
||||
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
|
||||
if (odm_comp_str[i])
|
||||
cnt += snprintf(buf+cnt, len-cnt, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
cnt += snprintf(buf+cnt, len-cnt, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
|
|
@ -3217,25 +3217,16 @@ static void ro_ch_handler(struct adapter *padapter)
|
|||
u8 ch, bw, offset;
|
||||
|
||||
if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to linked union - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
else if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->listen_channel) {
|
||||
ch = pwdinfo->listen_channel;
|
||||
bw = HT_CHANNEL_WIDTH_20;
|
||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
else {
|
||||
ch = pcfg80211_wdinfo->restore_channel;
|
||||
bw = HT_CHANNEL_WIDTH_20;
|
||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, ch, offset, bw);
|
||||
|
|
|
@ -243,17 +243,10 @@ int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue)
|
|||
precvpriv->free_recvframe_cnt++;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pfree_recv_queue->lock);
|
||||
|
||||
;
|
||||
|
||||
spin_unlock_bh(&pfree_recv_queue->lock);
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sint _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue)
|
||||
{
|
||||
|
||||
|
@ -962,9 +955,8 @@ sint sta2sta_data_frame(
|
|||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
sta_addr = pattrib->bssid;
|
||||
}
|
||||
sta_addr = pattrib->bssid;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1784,7 +1776,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
u8 subtype;
|
||||
sint retval = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
|
||||
u8 bDumpRxPkt;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
u8 ver =(unsigned char) (*ptr)&0x3 ;
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
@ -1820,8 +1812,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
pattrib->privacy = GetPrivacy(ptr);
|
||||
pattrib->order = GetOrder(ptr);
|
||||
|
||||
{
|
||||
u8 bDumpRxPkt;
|
||||
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
|
||||
if(bDumpRxPkt ==1){/* dump all rx packets */
|
||||
int i;
|
||||
|
@ -1854,7 +1844,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
DBG_871X("############################# \n");
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case WIFI_MGT_TYPE: /* mgnt */
|
||||
|
@ -2327,7 +2316,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
}
|
||||
|
||||
/* Indicat the packets to upper layer */
|
||||
if (sub_skb) {
|
||||
{
|
||||
/* memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); */
|
||||
|
||||
#ifdef CONFIG_BR_EXT
|
||||
|
@ -2511,7 +2500,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
return true;
|
||||
}
|
||||
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
|
|
1558
core/rtw_security.c
1558
core/rtw_security.c
File diff suppressed because it is too large
Load diff
|
@ -29,20 +29,13 @@
|
|||
|
||||
#include <sta_info.h>
|
||||
|
||||
void _rtw_init_stainfo(struct sta_info *psta);
|
||||
void _rtw_init_stainfo(struct sta_info *psta)
|
||||
{
|
||||
|
||||
;
|
||||
|
||||
memset((u8 *)psta, 0, sizeof (struct sta_info));
|
||||
|
||||
spin_lock_init(&psta->lock);
|
||||
spin_lock_init(&psta->lock);
|
||||
_rtw_init_listhead(&psta->list);
|
||||
_rtw_init_listhead(&psta->hash_list);
|
||||
/* _rtw_init_listhead(&psta->asoc_list); */
|
||||
/* _rtw_init_listhead(&psta->sleep_list); */
|
||||
/* _rtw_init_listhead(&psta->wakeup_list); */
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
|
|
@ -77,11 +77,9 @@ int cckrates_included(unsigned char *rate, int ratelen)
|
|||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
int cckratesonly_included(unsigned char *rate, int ratelen)
|
||||
|
@ -92,9 +90,8 @@ int cckratesonly_included(unsigned char *rate, int ratelen)
|
|||
{
|
||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1505,27 +1502,19 @@ unsigned int should_forbid_n_rate(struct adapter * padapter)
|
|||
break;
|
||||
|
||||
case _RSN_IE_2_:
|
||||
if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) ||
|
||||
(_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
|
||||
return false;
|
||||
|
||||
if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) ||
|
||||
(_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
i += (pIE->Length + 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
unsigned int is_ap_in_wep(struct adapter *padapter)
|
||||
{
|
||||
u32 i;
|
||||
|
@ -1828,10 +1817,10 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
|
|||
}
|
||||
else if (_rtw_memcmp(pIE->data, EPIGRAM_OUI, 3))
|
||||
{
|
||||
epigram_vendor_flag = 1;
|
||||
epigram_vendor_flag = 1;
|
||||
if(ralink_vendor_flag) {
|
||||
DBG_871X("link to Tenda W311R AP\n");
|
||||
return HT_IOT_PEER_TENDA;
|
||||
return HT_IOT_PEER_TENDA;
|
||||
} else {
|
||||
DBG_871X("Capture EPIGRAM_OUI\n");
|
||||
}
|
||||
|
|
|
@ -316,8 +316,8 @@ void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv)
|
|||
|
||||
void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv)
|
||||
{
|
||||
int i;
|
||||
struct adapter *padapter = pxmitpriv->adapter;
|
||||
int i;
|
||||
struct adapter *padapter = pxmitpriv->adapter;
|
||||
struct xmit_frame *pxmitframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
|
||||
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
||||
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
|
@ -905,8 +905,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
rtw_secmicappend(&micdata, &pframe[24], 6);
|
||||
else
|
||||
rtw_secmicappend(&micdata, &pframe[10], 6);
|
||||
}
|
||||
else{ /* ToDS==0 */
|
||||
} else{ /* ToDS==0 */
|
||||
rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */
|
||||
if(pframe[1]&2) /* From Ds==1 */
|
||||
rtw_secmicappend(&micdata, &pframe[16], 6);
|
||||
|
@ -915,8 +914,8 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
|
||||
}
|
||||
|
||||
/* if(pqospriv->qos_option==1) */
|
||||
if(pattrib->qos_en)
|
||||
/* if(pqospriv->qos_option==1) */
|
||||
if(pattrib->qos_en)
|
||||
priority[0]=(u8)pxmitframe->attrib.priority;
|
||||
|
||||
|
||||
|
@ -1126,7 +1125,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
if(pattrib->ht_en && psta->htpriv.ampdu_enable)
|
||||
{
|
||||
if(psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority))
|
||||
pattrib->ampdu_en = true;
|
||||
pattrib->ampdu_en = true;
|
||||
}
|
||||
|
||||
/* re-check if enable ampdu by BA_starting_seqctrl */
|
||||
|
@ -2205,11 +2204,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
|
|||
ptxservq->qcnt--;
|
||||
|
||||
break;
|
||||
|
||||
pxmitframe = NULL;
|
||||
|
||||
}
|
||||
|
||||
return pxmitframe;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue