mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-25 22:13:41 +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);
|
__nat25_db_print(priv);
|
||||||
|
|
||||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
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),
|
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));
|
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||||
hdr->icmp6_cksum = 0;
|
hdr->icmp6_cksum = 0;
|
||||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
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)
|
if(skb == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!priv->ethBrExtInfo.dhcp_bcst_disable)
|
if(!priv->ethBrExtInfo.dhcp_bcst_disable) {
|
||||||
{
|
|
||||||
__be16 protocol = *((__be16 *)(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 */
|
||||||
|
|
|
@ -462,7 +462,7 @@ _next:
|
||||||
|
|
||||||
memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
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;
|
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ _next:
|
||||||
post_process:
|
post_process:
|
||||||
|
|
||||||
/* call callback function for post-processed */
|
/* 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;
|
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
|
||||||
if(pcmd_callback == NULL)
|
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) {
|
if (ssid[i].SsidLength) {
|
||||||
memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(NDIS_802_11_SSID));
|
memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(NDIS_802_11_SSID));
|
||||||
psurveyPara->ssid_num++;
|
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)) {
|
if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
|
||||||
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
||||||
psurveyPara->ch_num++;
|
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;
|
return count;
|
||||||
|
|
||||||
signal_strength = signal_strength>100?100:signal_strength;
|
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.is_signal_dbg = is_signal_dbg;
|
||||||
padapter->recvpriv.signal_strength_dbg=signal_strength;
|
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)
|
uint rtw_is_cckrates_included(u8 *rate)
|
||||||
{
|
{
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
|
||||||
while(rate[i]!=0)
|
while(rate[i]!=0) {
|
||||||
{
|
if ((((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
|
||||||
return true;
|
return true;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint rtw_is_cckratesonly_included(u8 *rate)
|
uint rtw_is_cckratesonly_included(u8 *rate)
|
||||||
{
|
{
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
|
||||||
|
while (rate[i]!=0) {
|
||||||
while(rate[i]!=0)
|
if ((((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||||
{
|
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
|
||||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
i++;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
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_,
|
RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
|
||||||
("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
|
("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
|
||||||
adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_read_mem = pintfhdl->io_ops._read_mem;
|
_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)
|
if (ret == _SUCCESS)
|
||||||
ret = rtw_sctx_wait(&sctx);
|
ret = rtw_sctx_wait(&sctx);
|
||||||
|
return ret;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _rtw_write_port_cancel(struct adapter *adapter)
|
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;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(wep->KeyLength)
|
switch(wep->KeyLength) {
|
||||||
{
|
case 5:
|
||||||
case 5:
|
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=5\n"));
|
||||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=5\n"));
|
break;
|
||||||
break;
|
case 13:
|
||||||
case 13:
|
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
||||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=13\n"));
|
||||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=13\n"));
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
psecuritypriv->dot11PrivacyAlgrthm=_NO_PRIVACY_;
|
||||||
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"));
|
||||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n"));
|
break;
|
||||||
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);
|
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. */
|
/* 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));
|
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||||
ret=_FAIL;
|
ret=_FAIL;
|
||||||
goto exit;
|
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 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_,("key Length: %d\n", key->KeyLength));
|
||||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
|
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Group key - KeyIndex(BIT30==0) */
|
/* Group key - KeyIndex(BIT30==0) */
|
||||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n"));
|
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 */
|
/* when add wep key through add key and didn't assigned encryption type before */
|
||||||
if((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
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);
|
memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16);
|
||||||
|
|
||||||
/* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */
|
/* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
pbssid=get_bssid(&padapter->mlmepriv);
|
pbssid=get_bssid(&padapter->mlmepriv);
|
||||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||||
if(stainfo !=NULL){
|
if(stainfo !=NULL){
|
||||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||||
|
|
||||||
/* clear key by BSSID */
|
/* clear key by BSSID */
|
||||||
memset(&stainfo->dot118021x_UncstKey, 0, 16);
|
memset(&stainfo->dot118021x_UncstKey, 0, 16);
|
||||||
|
|
||||||
/* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */
|
/* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */
|
||||||
|
} else{
|
||||||
}
|
|
||||||
else{
|
|
||||||
ret= _FAIL;
|
ret= _FAIL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -460,7 +460,7 @@ static void SwLedBlink2(PLED_871x pLed)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pLed->bLedOn )
|
if( pLed->bLedOn )
|
||||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||||
else
|
else
|
||||||
pLed->BlinkingLedState = RTW_LED_ON;
|
pLed->BlinkingLedState = RTW_LED_ON;
|
||||||
|
@ -506,7 +506,7 @@ static void SwLedBlink2(PLED_871x pLed)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pLed->bLedOn )
|
if( pLed->bLedOn )
|
||||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||||
else
|
else
|
||||||
pLed->BlinkingLedState = RTW_LED_ON;
|
pLed->BlinkingLedState = RTW_LED_ON;
|
||||||
|
@ -770,7 +770,7 @@ static void SwLedBlink4(PLED_871x pLed)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pLed->bLedOn )
|
if( pLed->bLedOn )
|
||||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||||
else
|
else
|
||||||
pLed->BlinkingLedState = RTW_LED_ON;
|
pLed->BlinkingLedState = RTW_LED_ON;
|
||||||
|
@ -811,7 +811,7 @@ static void SwLedBlink4(PLED_871x pLed)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pLed->bLedOn )
|
if( pLed->bLedOn )
|
||||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||||
else
|
else
|
||||||
pLed->BlinkingLedState = RTW_LED_ON;
|
pLed->BlinkingLedState = RTW_LED_ON;
|
||||||
|
@ -978,7 +978,7 @@ static void SwLedBlink5(PLED_871x pLed)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( pLed->bLedOn )
|
if( pLed->bLedOn )
|
||||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||||
else
|
else
|
||||||
pLed->BlinkingLedState = RTW_LED_ON;
|
pLed->BlinkingLedState = RTW_LED_ON;
|
||||||
|
@ -1215,7 +1215,7 @@ SwLedControlMode1(
|
||||||
if( pLed->bLedLinkBlinkInProgress == true )
|
if( pLed->bLedLinkBlinkInProgress == true )
|
||||||
{
|
{
|
||||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||||
pLed->bLedLinkBlinkInProgress = false;
|
pLed->bLedLinkBlinkInProgress = false;
|
||||||
}
|
}
|
||||||
if(pLed->bLedBlinkInProgress ==true)
|
if(pLed->bLedBlinkInProgress ==true)
|
||||||
{
|
{
|
||||||
|
@ -1274,7 +1274,7 @@ SwLedControlMode1(
|
||||||
if( pLed->bLedLinkBlinkInProgress == true )
|
if( pLed->bLedLinkBlinkInProgress == true )
|
||||||
{
|
{
|
||||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||||
pLed->bLedLinkBlinkInProgress = false;
|
pLed->bLedLinkBlinkInProgress = false;
|
||||||
}
|
}
|
||||||
if(pLed->bLedBlinkInProgress ==true)
|
if(pLed->bLedBlinkInProgress ==true)
|
||||||
{
|
{
|
||||||
|
@ -1306,7 +1306,7 @@ SwLedControlMode1(
|
||||||
if( pLed->bLedLinkBlinkInProgress == true )
|
if( pLed->bLedLinkBlinkInProgress == true )
|
||||||
{
|
{
|
||||||
_cancel_timer_ex(&(pLed->BlinkTimer));
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
||||||
pLed->bLedLinkBlinkInProgress = false;
|
pLed->bLedLinkBlinkInProgress = false;
|
||||||
}
|
}
|
||||||
if(pLed->bLedBlinkInProgress ==true)
|
if(pLed->bLedBlinkInProgress ==true)
|
||||||
{
|
{
|
||||||
|
@ -2251,22 +2251,13 @@ LedControl871x(
|
||||||
{
|
{
|
||||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||||
|
|
||||||
if( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)
|
if ((padapter->bSurpriseRemoved) || ( padapter->bDriverStopped) ||
|
||||||
||(padapter->hw_init_completed == false) )
|
(padapter->hw_init_completed == false) )
|
||||||
{
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( ledpriv->bRegUseLed == false)
|
if( ledpriv->bRegUseLed == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* if (!priv->up) */
|
|
||||||
/* return; */
|
|
||||||
|
|
||||||
/* if(priv->bInHctTest) */
|
|
||||||
/* return; */
|
|
||||||
|
|
||||||
if( (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on &&
|
if( (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on &&
|
||||||
adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS) &&
|
adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS) &&
|
||||||
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||
|
(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)
|
int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feature)
|
||||||
{
|
{
|
||||||
__le16 ls_cap, ld_cap;
|
__le16 ls_cap, ld_cap;
|
||||||
u16 s_cap, d_cap;
|
u16 s_cap, d_cap;
|
||||||
|
|
||||||
memcpy((u8 *)&ls_cap, rtw_get_capability_from_ie(src->IEs), 2);
|
memcpy((u8 *)&ls_cap, rtw_get_capability_from_ie(src->IEs), 2);
|
||||||
memcpy((u8 *)&ld_cap, rtw_get_capability_from_ie(dst->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 */
|
/* 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);
|
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);
|
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__);
|
DBG_871X("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
psta->aid = pnetwork->join_res;
|
psta->aid = pnetwork->join_res;
|
||||||
psta->mac_id=0;
|
psta->mac_id=0;
|
||||||
|
|
||||||
/* sta mode */
|
/* sta mode */
|
||||||
rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true);
|
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;
|
struct mlme_priv *mlmepriv = &adapter->mlmepriv;
|
||||||
ATOMIC_SET(&mlmepriv->set_scan_deny, 0);
|
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)
|
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 */
|
/* check ssid, if needed */
|
||||||
if(pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) {
|
if (pmlmepriv->assoc_ssid.SsidLength) {
|
||||||
if( competitor->network.Ssid.SsidLength != 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
|
_rtw_memcmp(competitor->network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength) == false)
|
||||||
)
|
|
||||||
goto exit;
|
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 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||||
u8 *pframe = precv_frame->u.hdr.rx_data;
|
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. */
|
/* 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) &&
|
if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) &&
|
||||||
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
|
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
ptable->func(padapter, precv_frame);
|
ptable->func(padapter, precv_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mgt_dispatcher(struct adapter *padapter, union recv_frame *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)
|
if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* if (pstat->aid > NUM_STA) { */
|
|
||||||
if (pstat->aid > pstapriv->max_num_sta) {
|
if (pstat->aid > pstapriv->max_num_sta) {
|
||||||
|
|
||||||
pstat->aid = 0;
|
pstat->aid = 0;
|
||||||
|
|
||||||
DBG_871X(" no room for more AIDs\n");
|
DBG_871X(" no room for more AIDs\n");
|
||||||
|
|
||||||
status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||||
|
|
||||||
goto OnAssocReqFail;
|
goto OnAssocReqFail;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
pstapriv->sta_aid[pstat->aid - 1] = pstat;
|
pstapriv->sta_aid[pstat->aid - 1] = pstat;
|
||||||
DBG_871X("allocate new AID = (%d)\n", pstat->aid);
|
DBG_871X("allocate new AID = (%d)\n", pstat->aid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pstat->state &= (~WIFI_FW_ASSOC_STATE);
|
pstat->state &= (~WIFI_FW_ASSOC_STATE);
|
||||||
pstat->state |= WIFI_FW_ASSOC_SUCCESS;
|
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;
|
p2pie[ p2pielen++ ] = P2P_ATTR_STATUS;
|
||||||
|
|
||||||
/* Length: */
|
/* Length: */
|
||||||
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
|
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
|
||||||
p2pielen += 2;
|
p2pielen += 2;
|
||||||
|
|
||||||
/* Value: */
|
/* 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++ )
|
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]);
|
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;
|
match_result = 1;
|
||||||
DBG_871X( "[%s] Match!\n", __FUNCTION__ );
|
DBG_871X( "[%s] Match!\n", __FUNCTION__ );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (match_result );
|
return (match_result );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4923,7 +4909,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
|
||||||
|
|
||||||
/* Commented by Kurt 20120113 */
|
/* Commented by Kurt 20120113 */
|
||||||
/* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */
|
/* 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);
|
memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);
|
||||||
|
|
||||||
result = process_p2p_group_negotation_req( pwdinfo, frame_body, len );
|
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;
|
pxmitbuf->sctx = NULL;
|
||||||
_exit_critical(&pxmitpriv->lock_sctx, &irqL);
|
_exit_critical(&pxmitpriv->lock_sctx, &irqL);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
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;
|
pxmitpriv->ack_tx = false;
|
||||||
_exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL);
|
_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)
|
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)) {
|
for (pos = get_next(head);!rtw_end_of_queue_search(head, pos); pos = get_next(pos)) {
|
||||||
|
|
||||||
scanned = LIST_CONTAINOR(pos, struct wlan_network, list);
|
scanned = LIST_CONTAINOR(pos, struct wlan_network, list);
|
||||||
if(scanned==NULL)
|
if(scanned==NULL) {
|
||||||
rtw_warn_on(1);
|
rtw_warn_on(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true
|
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
|
&& _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
|
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)
|
void _linked_rx_signal_strehgth_display(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
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;
|
u8 mac_id;
|
||||||
int UndecoratedSmoothedPWDB;
|
int UndecoratedSmoothedPWDB;
|
||||||
if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
|
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 */
|
/* acquire channels from in */
|
||||||
j = 0;
|
j = 0;
|
||||||
for (i=0;i<in_num;i++) {
|
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)
|
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
|
&& (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;
|
peventbuf += 2;
|
||||||
|
|
||||||
if(peventbuf)
|
if(peventbuf) {
|
||||||
{
|
|
||||||
event_callback = wlanevents[evt_code].event_callback;
|
event_callback = wlanevents[evt_code].event_callback;
|
||||||
event_callback(padapter, (u8*)peventbuf);
|
event_callback(padapter, (u8*)peventbuf);
|
||||||
|
|
||||||
pevt_priv->evt_done_cnt++;
|
pevt_priv->evt_done_cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_abort_event_:
|
_abort_event_:
|
||||||
|
|
||||||
|
|
||||||
return H2C_SUCCESS;
|
return H2C_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf)
|
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);
|
cnt += snprintf(buf+cnt, len-cnt, "odm.DebugComponents = 0x%016llx \n", dbg_comp);
|
||||||
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
|
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
|
||||||
if (odm_comp_str[i])
|
if (odm_comp_str[i])
|
||||||
cnt += snprintf(buf+cnt, len-cnt, "%cBIT%-2d %s\n",
|
cnt += snprintf(buf+cnt, len-cnt, "%cBIT%-2d %s\n",
|
||||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
|
|
|
@ -3217,25 +3217,16 @@ static void ro_ch_handler(struct adapter *padapter)
|
||||||
u8 ch, bw, offset;
|
u8 ch, bw, offset;
|
||||||
|
|
||||||
if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
|
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) {
|
else if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->listen_channel) {
|
||||||
ch = pwdinfo->listen_channel;
|
ch = pwdinfo->listen_channel;
|
||||||
bw = HT_CHANNEL_WIDTH_20;
|
bw = HT_CHANNEL_WIDTH_20;
|
||||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
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 {
|
else {
|
||||||
ch = pcfg80211_wdinfo->restore_channel;
|
ch = pcfg80211_wdinfo->restore_channel;
|
||||||
bw = HT_CHANNEL_WIDTH_20;
|
bw = HT_CHANNEL_WIDTH_20;
|
||||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
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);
|
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++;
|
precvpriv->free_recvframe_cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&pfree_recv_queue->lock);
|
spin_unlock_bh(&pfree_recv_queue->lock);
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sint _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue)
|
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"));
|
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n"));
|
||||||
ret= _FAIL;
|
ret= _FAIL;
|
||||||
goto exit;
|
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;
|
u8 subtype;
|
||||||
sint retval = _SUCCESS;
|
sint retval = _SUCCESS;
|
||||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||||
|
u8 bDumpRxPkt;
|
||||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||||
u8 ver =(unsigned char) (*ptr)&0x3 ;
|
u8 ver =(unsigned char) (*ptr)&0x3 ;
|
||||||
#ifdef CONFIG_AP_MODE
|
#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->privacy = GetPrivacy(ptr);
|
||||||
pattrib->order = GetOrder(ptr);
|
pattrib->order = GetOrder(ptr);
|
||||||
|
|
||||||
{
|
|
||||||
u8 bDumpRxPkt;
|
|
||||||
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
|
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
|
||||||
if(bDumpRxPkt ==1){/* dump all rx packets */
|
if(bDumpRxPkt ==1){/* dump all rx packets */
|
||||||
int i;
|
int i;
|
||||||
|
@ -1854,7 +1844,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
||||||
DBG_871X("############################# \n");
|
DBG_871X("############################# \n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case WIFI_MGT_TYPE: /* mgnt */
|
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 */
|
/* Indicat the packets to upper layer */
|
||||||
if (sub_skb) {
|
{
|
||||||
/* memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); */
|
/* memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); */
|
||||||
|
|
||||||
#ifdef CONFIG_BR_EXT
|
#ifdef CONFIG_BR_EXT
|
||||||
|
@ -2511,7 +2500,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||||
pattrib = &prframe->u.hdr.attrib;
|
pattrib = &prframe->u.hdr.attrib;
|
||||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||||
#ifdef DBG_RX_SEQ
|
#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>
|
#include <sta_info.h>
|
||||||
|
|
||||||
void _rtw_init_stainfo(struct sta_info *psta);
|
|
||||||
void _rtw_init_stainfo(struct sta_info *psta)
|
void _rtw_init_stainfo(struct sta_info *psta)
|
||||||
{
|
{
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
memset((u8 *)psta, 0, sizeof (struct sta_info));
|
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->list);
|
||||||
_rtw_init_listhead(&psta->hash_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);
|
_rtw_init_queue(&psta->sleep_q);
|
||||||
psta->sleepq_len = 0;
|
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) ||
|
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int cckratesonly_included(unsigned char *rate, int ratelen)
|
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) &&
|
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1505,27 +1502,19 @@ unsigned int should_forbid_n_rate(struct adapter * padapter)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _RSN_IE_2_:
|
case _RSN_IE_2_:
|
||||||
if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) ||
|
if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) ||
|
||||||
(_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
|
(_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
i += (pIE->Length + 2);
|
i += (pIE->Length + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
return false;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int is_ap_in_wep(struct adapter *padapter)
|
unsigned int is_ap_in_wep(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
@ -1828,10 +1817,10 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
|
||||||
}
|
}
|
||||||
else if (_rtw_memcmp(pIE->data, EPIGRAM_OUI, 3))
|
else if (_rtw_memcmp(pIE->data, EPIGRAM_OUI, 3))
|
||||||
{
|
{
|
||||||
epigram_vendor_flag = 1;
|
epigram_vendor_flag = 1;
|
||||||
if(ralink_vendor_flag) {
|
if(ralink_vendor_flag) {
|
||||||
DBG_871X("link to Tenda W311R AP\n");
|
DBG_871X("link to Tenda W311R AP\n");
|
||||||
return HT_IOT_PEER_TENDA;
|
return HT_IOT_PEER_TENDA;
|
||||||
} else {
|
} else {
|
||||||
DBG_871X("Capture EPIGRAM_OUI\n");
|
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)
|
void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct adapter *padapter = pxmitpriv->adapter;
|
struct adapter *padapter = pxmitpriv->adapter;
|
||||||
struct xmit_frame *pxmitframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
|
struct xmit_frame *pxmitframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
|
||||||
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
||||||
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
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);
|
rtw_secmicappend(&micdata, &pframe[24], 6);
|
||||||
else
|
else
|
||||||
rtw_secmicappend(&micdata, &pframe[10], 6);
|
rtw_secmicappend(&micdata, &pframe[10], 6);
|
||||||
}
|
} else{ /* ToDS==0 */
|
||||||
else{ /* ToDS==0 */
|
|
||||||
rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */
|
rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */
|
||||||
if(pframe[1]&2) /* From Ds==1 */
|
if(pframe[1]&2) /* From Ds==1 */
|
||||||
rtw_secmicappend(&micdata, &pframe[16], 6);
|
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(pqospriv->qos_option==1) */
|
||||||
if(pattrib->qos_en)
|
if(pattrib->qos_en)
|
||||||
priority[0]=(u8)pxmitframe->attrib.priority;
|
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(pattrib->ht_en && psta->htpriv.ampdu_enable)
|
||||||
{
|
{
|
||||||
if(psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority))
|
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 */
|
/* 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--;
|
ptxservq->qcnt--;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pxmitframe = NULL;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pxmitframe;
|
return pxmitframe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -453,14 +453,14 @@ odm_ARFBRefresh_8188E(
|
||||||
}
|
}
|
||||||
|
|
||||||
#if POWER_TRAINING_ACTIVE == 1
|
#if POWER_TRAINING_ACTIVE == 1
|
||||||
if (pRaInfo->HighestRate >0x13)
|
if (pRaInfo->HighestRate >0x13)
|
||||||
pRaInfo->PTModeSS=3;
|
pRaInfo->PTModeSS=3;
|
||||||
else if(pRaInfo->HighestRate >0x0b)
|
else if(pRaInfo->HighestRate >0x0b)
|
||||||
pRaInfo->PTModeSS=2;
|
pRaInfo->PTModeSS=2;
|
||||||
else if(pRaInfo->HighestRate >0x0b)
|
else if(pRaInfo->HighestRate >0x0b)
|
||||||
pRaInfo->PTModeSS=1;
|
pRaInfo->PTModeSS=1;
|
||||||
else
|
else
|
||||||
pRaInfo->PTModeSS=0;
|
pRaInfo->PTModeSS=0;
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
|
||||||
("ODM_ARFBRefresh_8188E(): PTModeSS=%d\n", pRaInfo->PTModeSS));
|
("ODM_ARFBRefresh_8188E(): PTModeSS=%d\n", pRaInfo->PTModeSS));
|
||||||
|
|
||||||
|
|
|
@ -540,12 +540,12 @@ ODM_ReadAndConfig_AGC_TAB_1T_ICUT_8188E(
|
||||||
u32 hex = 0;
|
u32 hex = 0;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
u16 count = 0;
|
u16 count = 0;
|
||||||
u32 * ptr_array = NULL;
|
u32 *ptr_array = NULL;
|
||||||
u8 platform = pDM_Odm->SupportPlatform;
|
u8 platform = pDM_Odm->SupportPlatform;
|
||||||
u8 _interface = pDM_Odm->SupportInterface;
|
u8 _interface = pDM_Odm->SupportInterface;
|
||||||
u8 board = pDM_Odm->BoardType;
|
u8 board = pDM_Odm->BoardType;
|
||||||
u32 ArrayLen = sizeof(Array_MP_8188E_AGC_TAB_1T_ICUT)/sizeof(u32);
|
u32 ArrayLen = sizeof(Array_MP_8188E_AGC_TAB_1T_ICUT)/sizeof(u32);
|
||||||
u32 * Array = Array_MP_8188E_AGC_TAB_1T_ICUT;
|
u32 *Array = Array_MP_8188E_AGC_TAB_1T_ICUT;
|
||||||
|
|
||||||
|
|
||||||
hex += board;
|
hex += board;
|
||||||
|
@ -554,50 +554,38 @@ ODM_ReadAndConfig_AGC_TAB_1T_ICUT_8188E(
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_AGC_TAB_1T_ICUT, hex = 0x%X\n", hex));
|
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_AGC_TAB_1T_ICUT, hex = 0x%X\n", hex));
|
||||||
|
|
||||||
for (i = 0; i < ArrayLen; i += 2 )
|
for (i = 0; i < ArrayLen; i += 2 ) {
|
||||||
{
|
u32 v1 = Array[i];
|
||||||
u32 v1 = Array[i];
|
u32 v2 = Array[i+1];
|
||||||
u32 v2 = Array[i+1];
|
|
||||||
|
|
||||||
/* This (offset, data) pair meets the condition. */
|
/* This (offset, data) pair meets the condition. */
|
||||||
if ( v1 < 0xCDCDCDCD )
|
if ( v1 < 0xCDCDCDCD ) {
|
||||||
{
|
odm_ConfigBB_AGC_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
odm_ConfigBB_AGC_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
continue;
|
||||||
continue;
|
} else { /* This line is the start line of branch. */
|
||||||
}
|
if ( !CheckCondition(Array[i], hex) )
|
||||||
else
|
{ /* Discard the following (offset, data) pairs. */
|
||||||
{ /* This line is the start line of branch. */
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
while (v2 != 0xDEAD &&
|
||||||
{ /* Discard the following (offset, data) pairs. */
|
v2 != 0xCDEF &&
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
v2 != 0xCDCD && i < ArrayLen -2)
|
||||||
while (v2 != 0xDEAD &&
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
v2 != 0xCDEF &&
|
i -= 2; /* prevent from for-loop += 2 */
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
} else /* Configure matched pairs and skip to end of if-else. */
|
||||||
{
|
{
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
while (v2 != 0xDEAD &&
|
||||||
i -= 2; /* prevent from for-loop += 2 */
|
v2 != 0xCDEF &&
|
||||||
}
|
v2 != 0xCDCD && i < ArrayLen -2) {
|
||||||
else /* Configure matched pairs and skip to end of if-else. */
|
odm_ConfigBB_AGC_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
}
|
||||||
while (v2 != 0xDEAD &&
|
|
||||||
v2 != 0xCDEF &&
|
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
odm_ConfigBB_AGC_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -845,53 +833,43 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
|
||||||
hex += platform << 16;
|
hex += platform << 16;
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
for (i = 0; i < ArrayLen; i += 2 ) {
|
for (i = 0; i < ArrayLen; i += 2 ) {
|
||||||
u32 v1 = Array[i];
|
u32 v1 = Array[i];
|
||||||
u32 v2 = Array[i+1];
|
u32 v2 = Array[i+1];
|
||||||
|
|
||||||
|
|
||||||
/* This (offset, data) pair meets the condition. */
|
/* This (offset, data) pair meets the condition. */
|
||||||
if ( v1 < 0xCDCDCDCD ) {
|
if ( v1 < 0xCDCDCDCD ) {
|
||||||
{
|
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* This line is the start line of branch. */
|
{ /* This line is the start line of branch. */
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
if ( !CheckCondition(Array[i], hex) )
|
||||||
{ /* Discard the following (offset, data) pairs. */
|
{ /* Discard the following (offset, data) pairs. */
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
while (v2 != 0xDEAD &&
|
while (v2 != 0xDEAD &&
|
||||||
v2 != 0xCDEF &&
|
v2 != 0xCDEF &&
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
v2 != 0xCDCD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
i -= 2; /* prevent from for-loop += 2 */
|
||||||
}
|
} else /* Configure matched pairs and skip to end of if-else. */
|
||||||
i -= 2; /* prevent from for-loop += 2 */
|
{
|
||||||
}
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
else /* Configure matched pairs and skip to end of if-else. */
|
while (v2 != 0xDEAD &&
|
||||||
{
|
v2 != 0xCDEF &&
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
v2 != 0xCDCD && i < ArrayLen -2) {
|
||||||
while (v2 != 0xDEAD &&
|
|
||||||
v2 != 0xCDEF &&
|
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rst;
|
return rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* PHY_REG_1T_ICUT.TXT
|
* PHY_REG_1T_ICUT.TXT
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
@ -1115,50 +1093,37 @@ ODM_ReadAndConfig_PHY_REG_1T_ICUT_8188E(
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_PHY_REG_1T_ICUT, hex = 0x%X\n", hex));
|
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_PHY_REG_1T_ICUT, hex = 0x%X\n", hex));
|
||||||
|
|
||||||
for (i = 0; i < ArrayLen; i += 2 )
|
for (i = 0; i < ArrayLen; i += 2 ) {
|
||||||
{
|
u32 v1 = Array[i];
|
||||||
u32 v1 = Array[i];
|
u32 v2 = Array[i+1];
|
||||||
u32 v2 = Array[i+1];
|
|
||||||
|
|
||||||
/* This (offset, data) pair meets the condition. */
|
/* This (offset, data) pair meets the condition. */
|
||||||
if ( v1 < 0xCDCDCDCD )
|
if ( v1 < 0xCDCDCDCD ) {
|
||||||
{
|
|
||||||
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
continue;
|
continue;
|
||||||
}
|
} else { /* This line is the start line of branch. */
|
||||||
else
|
if ( !CheckCondition(Array[i], hex) )
|
||||||
{ /* This line is the start line of branch. */
|
{ /* Discard the following (offset, data) pairs. */
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
{ /* Discard the following (offset, data) pairs. */
|
while (v2 != 0xDEAD &&
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
v2 != 0xCDEF &&
|
||||||
while (v2 != 0xDEAD &&
|
v2 != 0xCDCD && i < ArrayLen -2)
|
||||||
v2 != 0xCDEF &&
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
i -= 2; /* prevent from for-loop += 2 */
|
||||||
{
|
} else /* Configure matched pairs and skip to end of if-else. */ {
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
while (v2 != 0xDEAD &&
|
||||||
i -= 2; /* prevent from for-loop += 2 */
|
v2 != 0xCDEF &&
|
||||||
}
|
v2 != 0xCDCD && i < ArrayLen -2) {
|
||||||
else /* Configure matched pairs and skip to end of if-else. */
|
|
||||||
{
|
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
|
||||||
while (v2 != 0xDEAD &&
|
|
||||||
v2 != 0xCDEF &&
|
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
odm_ConfigBB_PHY_8188E(pDM_Odm, v1, bMaskDWord, v2);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1196,40 +1161,32 @@ ODM_ReadAndConfig_PHY_REG_PG_8188E(
|
||||||
hex += interfaceValue << 8;
|
hex += interfaceValue << 8;
|
||||||
hex += platform << 16;
|
hex += platform << 16;
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
for (i = 0; i < ArrayLen; i += 6 )
|
for (i = 0; i < ArrayLen; i += 6 ) {
|
||||||
{
|
u32 v1 = Array[i];
|
||||||
u32 v1 = Array[i];
|
u32 v2 = Array[i+1];
|
||||||
u32 v2 = Array[i+1];
|
u32 v3 = Array[i+2];
|
||||||
u32 v3 = Array[i+2];
|
u32 v4 = Array[i+3];
|
||||||
u32 v4 = Array[i+3];
|
u32 v5 = Array[i+4];
|
||||||
u32 v5 = Array[i+4];
|
u32 v6 = Array[i+5];
|
||||||
u32 v6 = Array[i+5];
|
|
||||||
|
|
||||||
/* this line is a line of pure_body */
|
|
||||||
if ( v1 < 0xCDCDCDCD )
|
|
||||||
{
|
|
||||||
|
|
||||||
|
/* this line is a line of pure_body */
|
||||||
|
if ( v1 < 0xCDCDCDCD ) {
|
||||||
odm_ConfigBB_PHY_REG_PG_8188E(pDM_Odm, v1, v2, v3);
|
odm_ConfigBB_PHY_REG_PG_8188E(pDM_Odm, v1, v2, v3);
|
||||||
|
continue;
|
||||||
continue;
|
} else { /* this line is the start of branch */
|
||||||
}
|
if ( !CheckCondition(Array[i], hex) )
|
||||||
else
|
{ /* don't need the hw_body */
|
||||||
{ /* this line is the start of branch */
|
i += 2; /* skip the pair of expression */
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
v1 = Array[i];
|
||||||
{ /* don't need the hw_body */
|
v2 = Array[i+1];
|
||||||
i += 2; /* skip the pair of expression */
|
v3 = Array[i+2];
|
||||||
v1 = Array[i];
|
while (v2 != 0xDEAD) {
|
||||||
v2 = Array[i+1];
|
i += 3;
|
||||||
v3 = Array[i+2];
|
v1 = Array[i];
|
||||||
while (v2 != 0xDEAD)
|
v2 = Array[i+1];
|
||||||
{
|
v3 = Array[i+1];
|
||||||
i += 3;
|
}
|
||||||
v1 = Array[i];
|
}
|
||||||
v2 = Array[i+1];
|
}
|
||||||
v3 = Array[i+1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,48 +337,37 @@ ODM_ReadAndConfig_MAC_REG_ICUT_8188E(
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_MAC_REG_ICUT, hex = 0x%X\n", hex));
|
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8188E_MAC_REG_ICUT, hex = 0x%X\n", hex));
|
||||||
|
|
||||||
for (i = 0; i < ArrayLen; i += 2 )
|
for (i = 0; i < ArrayLen; i += 2 ) {
|
||||||
{
|
u32 v1 = Array[i];
|
||||||
u32 v1 = Array[i];
|
u32 v2 = Array[i+1];
|
||||||
u32 v2 = Array[i+1];
|
|
||||||
|
|
||||||
/* This (offset, data) pair meets the condition. */
|
/* This (offset, data) pair meets the condition. */
|
||||||
if ( v1 < 0xCDCDCDCD )
|
if ( v1 < 0xCDCDCDCD ) {
|
||||||
{
|
|
||||||
odm_ConfigMAC_8188E(pDM_Odm, v1, (u8)v2);
|
odm_ConfigMAC_8188E(pDM_Odm, v1, (u8)v2);
|
||||||
continue;
|
continue;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{ /* This line is the start line of branch. */
|
{ /* This line is the start line of branch. */
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
if ( !CheckCondition(Array[i], hex) )
|
||||||
{ /* Discard the following (offset, data) pairs. */
|
{ /* Discard the following (offset, data) pairs. */
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
while (v2 != 0xDEAD &&
|
while (v2 != 0xDEAD &&
|
||||||
v2 != 0xCDEF &&
|
v2 != 0xCDEF &&
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
v2 != 0xCDCD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
i -= 2; /* prevent from for-loop += 2 */
|
||||||
}
|
} else /* Configure matched pairs and skip to end of if-else. */
|
||||||
i -= 2; /* prevent from for-loop += 2 */
|
{
|
||||||
}
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
else /* Configure matched pairs and skip to end of if-else. */
|
while (v2 != 0xDEAD &&
|
||||||
{
|
v2 != 0xCDEF &&
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
v2 != 0xCDCD && i < ArrayLen -2) {
|
||||||
while (v2 != 0xDEAD &&
|
|
||||||
v2 != 0xCDEF &&
|
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
odm_ConfigMAC_8188E(pDM_Odm, v1, (u8)v2);
|
odm_ConfigMAC_8188E(pDM_Odm, v1, (u8)v2);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||||
{
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,7 +399,7 @@ ODM_ReadAndConfig_RadioA_1T_ICUT_8188E(
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
v2 != 0xCDCD && i < ArrayLen -2)
|
||||||
{
|
{
|
||||||
odm_ConfigRF_RadioA_8188E(pDM_Odm, v1, v2);
|
odm_ConfigRF_RadioA_8188E(pDM_Odm, v1, v2);
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||||
|
|
|
@ -76,39 +76,35 @@ static void setIqkMatrix(
|
||||||
ele_C = ((IqkResult_Y * ele_D)>>8)&0x000003FF;
|
ele_C = ((IqkResult_Y * ele_D)>>8)&0x000003FF;
|
||||||
|
|
||||||
if (RFPath == RF_PATH_A)
|
if (RFPath == RF_PATH_A)
|
||||||
switch (RFPath)
|
switch (RFPath) {
|
||||||
{
|
case RF_PATH_A:
|
||||||
case RF_PATH_A:
|
/* wirte new elements A, C, D to regC80 and regC94, element B is always 0 */
|
||||||
/* wirte new elements A, C, D to regC80 and regC94, element B is always 0 */
|
value32 = (ele_D<<22)|((ele_C&0x3F)<<16)|ele_A;
|
||||||
value32 = (ele_D<<22)|((ele_C&0x3F)<<16)|ele_A;
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XATxIQImbalance, bMaskDWord, value32);
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XATxIQImbalance, bMaskDWord, value32);
|
|
||||||
|
|
||||||
value32 = (ele_C&0x000003C0)>>6;
|
value32 = (ele_C&0x000003C0)>>6;
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XCTxAFE, bMaskH4Bits, value32);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XCTxAFE, bMaskH4Bits, value32);
|
||||||
|
|
||||||
value32 = ((IqkResult_X * ele_D)>>7)&0x01;
|
value32 = ((IqkResult_X * ele_D)>>7)&0x01;
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT24, value32);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT24, value32);
|
||||||
break;
|
break;
|
||||||
case RF_PATH_B:
|
case RF_PATH_B:
|
||||||
/* wirte new elements A, C, D to regC88 and regC9C, element B is always 0 */
|
/* wirte new elements A, C, D to regC88 and regC9C, element B is always 0 */
|
||||||
value32=(ele_D<<22)|((ele_C&0x3F)<<16) |ele_A;
|
value32=(ele_D<<22)|((ele_C&0x3F)<<16) |ele_A;
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XBTxIQImbalance, bMaskDWord, value32);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XBTxIQImbalance, bMaskDWord, value32);
|
||||||
|
|
||||||
value32 = (ele_C&0x000003C0)>>6;
|
value32 = (ele_C&0x000003C0)>>6;
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XDTxAFE, bMaskH4Bits, value32);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XDTxAFE, bMaskH4Bits, value32);
|
||||||
|
|
||||||
value32 = ((IqkResult_X * ele_D)>>7)&0x01;
|
value32 = ((IqkResult_X * ele_D)>>7)&0x01;
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT28, value32);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT28, value32);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
switch (RFPath) {
|
||||||
{
|
|
||||||
switch (RFPath)
|
|
||||||
{
|
|
||||||
case RF_PATH_A:
|
case RF_PATH_A:
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XATxIQImbalance, bMaskDWord, OFDMSwingTable[OFDM_index]);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XATxIQImbalance, bMaskDWord, OFDMSwingTable[OFDM_index]);
|
||||||
ODM_SetBBReg(pDM_Odm, rOFDM0_XCTxAFE, bMaskH4Bits, 0x00);
|
ODM_SetBBReg(pDM_Odm, rOFDM0_XCTxAFE, bMaskH4Bits, 0x00);
|
||||||
|
@ -126,8 +122,9 @@ static void setIqkMatrix(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxPwrTracking path B: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x 0xeb4 = 0x%x 0xebc = 0x%x\n",
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||||
(u32)IqkResult_X, (u32)IqkResult_Y, (u32)ele_A, (u32)ele_C, (u32)ele_D, (u32)IqkResult_X, (u32)IqkResult_Y));
|
("TxPwrTracking path B: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x 0xeb4 = 0x%x 0xebc = 0x%x\n",
|
||||||
|
(u32)IqkResult_X, (u32)IqkResult_Y, (u32)ele_A, (u32)ele_C, (u32)ele_D, (u32)IqkResult_X, (u32)IqkResult_Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -358,7 +355,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||||
|
|
||||||
u8 OFDM_min_index = 6, rf = (is2T) ? 2 : 1; /* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */
|
u8 OFDM_min_index = 6, rf = (is2T) ? 2 : 1; /* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */
|
||||||
u8 Indexforchannel = 0;/*GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/
|
u8 Indexforchannel = 0;/*GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/
|
||||||
enum _POWER_DEC_INC { POWER_DEC, POWER_INC };
|
enum _POWER_DEC_INC { POWER_DEC, POWER_INC };
|
||||||
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
||||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||||
|
|
||||||
|
@ -384,8 +381,8 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("===>odm_TXPowerTrackingCallback_ThermalMeter_8188E, pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase: %d \n", pDM_Odm->BbSwingIdxCckBase, pDM_Odm->BbSwingIdxOfdmBase));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("===>odm_TXPowerTrackingCallback_ThermalMeter_8188E, pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase: %d \n", pDM_Odm->BbSwingIdxCckBase, pDM_Odm->BbSwingIdxOfdmBase));
|
||||||
ThermalValue = (u8)ODM_GetRFReg(pDM_Odm, RF_PATH_A, RF_T_METER_88E, 0xfc00); /* 0x42: RF Reg[15:10] 88E */
|
ThermalValue = (u8)ODM_GetRFReg(pDM_Odm, RF_PATH_A, RF_T_METER_88E, 0xfc00); /* 0x42: RF Reg[15:10] 88E */
|
||||||
if( ! ThermalValue || ! pDM_Odm->RFCalibrateInfo.TxPowerTrackControl)
|
if (!ThermalValue || ! pDM_Odm->RFCalibrateInfo.TxPowerTrackControl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* 4 3. Initialize ThermalValues of RFCalibrateInfo */
|
/* 4 3. Initialize ThermalValues of RFCalibrateInfo */
|
||||||
|
|
||||||
|
@ -462,8 +459,8 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||||
else
|
else
|
||||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast;
|
pDM_Odm->RFCalibrateInfo.PowerIndexOffset = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast;
|
||||||
|
|
||||||
for(i = 0; i < rf; i++)
|
for(i = 0; i < rf; i++)
|
||||||
pDM_Odm->RFCalibrateInfo.OFDM_index[i] = pDM_Odm->BbSwingIdxOfdmBase + pDM_Odm->RFCalibrateInfo.PowerIndexOffset;
|
pDM_Odm->RFCalibrateInfo.OFDM_index[i] = pDM_Odm->BbSwingIdxOfdmBase + pDM_Odm->RFCalibrateInfo.PowerIndexOffset;
|
||||||
pDM_Odm->RFCalibrateInfo.CCK_index = pDM_Odm->BbSwingIdxCckBase + pDM_Odm->RFCalibrateInfo.PowerIndexOffset;
|
pDM_Odm->RFCalibrateInfo.CCK_index = pDM_Odm->BbSwingIdxCckBase + pDM_Odm->RFCalibrateInfo.PowerIndexOffset;
|
||||||
|
|
||||||
pDM_Odm->BbSwingIdxCck = pDM_Odm->RFCalibrateInfo.CCK_index;
|
pDM_Odm->BbSwingIdxCck = pDM_Odm->RFCalibrateInfo.CCK_index;
|
||||||
|
@ -475,8 +472,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||||
/* 4 7.1 Handle boundary conditions of index. */
|
/* 4 7.1 Handle boundary conditions of index. */
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < rf; i++)
|
for(i = 0; i < rf; i++) {
|
||||||
{
|
|
||||||
if(pDM_Odm->RFCalibrateInfo.OFDM_index[i] > OFDM_TABLE_SIZE_92D-1)
|
if(pDM_Odm->RFCalibrateInfo.OFDM_index[i] > OFDM_TABLE_SIZE_92D-1)
|
||||||
{
|
{
|
||||||
pDM_Odm->RFCalibrateInfo.OFDM_index[i] = OFDM_TABLE_SIZE_92D-1;
|
pDM_Odm->RFCalibrateInfo.OFDM_index[i] = OFDM_TABLE_SIZE_92D-1;
|
||||||
|
@ -489,11 +485,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||||
|
|
||||||
if(pDM_Odm->RFCalibrateInfo.CCK_index > CCK_TABLE_SIZE-1)
|
if(pDM_Odm->RFCalibrateInfo.CCK_index > CCK_TABLE_SIZE-1)
|
||||||
pDM_Odm->RFCalibrateInfo.CCK_index = CCK_TABLE_SIZE-1;
|
pDM_Odm->RFCalibrateInfo.CCK_index = CCK_TABLE_SIZE-1;
|
||||||
else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0)
|
} else {
|
||||||
pDM_Odm->RFCalibrateInfo.CCK_index = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||||
("The thermal meter is unchanged or TxPowerTracking OFF: ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d)\n", ThermalValue, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
("The thermal meter is unchanged or TxPowerTracking OFF: ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d)\n", ThermalValue, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset = 0;
|
pDM_Odm->RFCalibrateInfo.PowerIndexOffset = 0;
|
||||||
|
@ -1190,32 +1182,31 @@ phy_SimularityCompare_8188E(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(SimularityBitMap & 0x03)) /* path A TX OK */
|
if (!(SimularityBitMap & 0x03)) /* path A TX OK */
|
||||||
{
|
{
|
||||||
for(i = 0; i < 2; i++)
|
for(i = 0; i < 2; i++)
|
||||||
result[3][i] = result[c1][i];
|
result[3][i] = result[c1][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(SimularityBitMap & 0x0c)) /* path A RX OK */
|
if (!(SimularityBitMap & 0x0c)) /* path A RX OK */
|
||||||
{
|
{
|
||||||
for(i = 2; i < 4; i++)
|
for(i = 2; i < 4; i++)
|
||||||
result[3][i] = result[c1][i];
|
result[3][i] = result[c1][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(SimularityBitMap & 0x30)) /* path B TX OK */
|
if (!(SimularityBitMap & 0x30)) /* path B TX OK */
|
||||||
{
|
{
|
||||||
for(i = 4; i < 6; i++)
|
for(i = 4; i < 6; i++)
|
||||||
result[3][i] = result[c1][i];
|
result[3][i] = result[c1][i];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if (!(SimularityBitMap & 0xc0)) /* path B RX OK */
|
||||||
|
{
|
||||||
|
for(i = 6; i < 8; i++)
|
||||||
|
result[3][i] = result[c1][i];
|
||||||
|
}
|
||||||
|
|
||||||
if (!(SimularityBitMap & 0xc0)) /* path B RX OK */
|
return false;
|
||||||
{
|
|
||||||
for(i = 6; i < 8; i++)
|
|
||||||
result[3][i] = result[c1][i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1258,15 +1249,14 @@ phy_IQCalibrate_8188E(
|
||||||
#else
|
#else
|
||||||
u32 retryCount = 2;
|
u32 retryCount = 2;
|
||||||
#endif
|
#endif
|
||||||
if ( *(pDM_Odm->mp_mode) == 1)
|
if ( *(pDM_Odm->mp_mode) == 1)
|
||||||
retryCount = 9;
|
retryCount = 9;
|
||||||
else
|
else
|
||||||
retryCount = 2;
|
retryCount = 2;
|
||||||
/* Note: IQ calibration must be performed after loading */
|
/* Note: IQ calibration must be performed after loading */
|
||||||
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
||||||
|
|
||||||
if(t==0)
|
if(t==0) {
|
||||||
{
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
|
||||||
|
|
||||||
/* Save ADDA parameters, turn Path A ADDA on */
|
/* Save ADDA parameters, turn Path A ADDA on */
|
||||||
|
@ -1605,22 +1595,17 @@ if ( *(pDM_Odm->mp_mode) == 1)
|
||||||
/* and value will cause RF internal PA to be unpredictably disabled by HW, such that RF Tx signal */
|
/* and value will cause RF internal PA to be unpredictably disabled by HW, such that RF Tx signal */
|
||||||
/* will disappear after disable/enable card many times on 88CU. RF SD and DD have not find the */
|
/* will disappear after disable/enable card many times on 88CU. RF SD and DD have not find the */
|
||||||
/* root cause, so we remove these actions temporarily. Added by tynli and SD3 Allen. 2010.05.31. */
|
/* root cause, so we remove these actions temporarily. Added by tynli and SD3 Allen. 2010.05.31. */
|
||||||
/* if MP_DRIVER != 1 */
|
if (*(pDM_Odm->mp_mode) != 1)
|
||||||
if (*(pDM_Odm->mp_mode) != 1)
|
return;
|
||||||
return;
|
|
||||||
/* endif */
|
|
||||||
/* settings adjust for normal chip */
|
/* settings adjust for normal chip */
|
||||||
for(index = 0; index < PATH_NUM; index ++)
|
for(index = 0; index < PATH_NUM; index ++) {
|
||||||
{
|
|
||||||
APK_offset[index] = APK_normal_offset[index];
|
APK_offset[index] = APK_normal_offset[index];
|
||||||
APK_value[index] = APK_normal_value[index];
|
APK_value[index] = APK_normal_value[index];
|
||||||
AFE_on_off[index] = 0x6fdb25a4;
|
AFE_on_off[index] = 0x6fdb25a4;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(index = 0; index < APK_BB_REG_NUM; index ++)
|
for(index = 0; index < APK_BB_REG_NUM; index ++) {
|
||||||
{
|
for(path = 0; path < pathbound; path++) {
|
||||||
for(path = 0; path < pathbound; path++)
|
|
||||||
{
|
|
||||||
APK_RF_init_value[path][index] = APK_normal_RF_init_value[path][index];
|
APK_RF_init_value[path][index] = APK_normal_RF_init_value[path][index];
|
||||||
APK_RF_value_0[path][index] = APK_normal_RF_value_0[path][index];
|
APK_RF_value_0[path][index] = APK_normal_RF_value_0[path][index];
|
||||||
}
|
}
|
||||||
|
@ -1630,8 +1615,7 @@ if (*(pDM_Odm->mp_mode) != 1)
|
||||||
apkbound = 6;
|
apkbound = 6;
|
||||||
|
|
||||||
/* save BB default value */
|
/* save BB default value */
|
||||||
for(index = 0; index < APK_BB_REG_NUM ; index++)
|
for(index = 0; index < APK_BB_REG_NUM ; index++) {
|
||||||
{
|
|
||||||
if(index == 0) /* skip */
|
if(index == 0) /* skip */
|
||||||
continue;
|
continue;
|
||||||
BB_backup[index] = ODM_GetBBReg(pDM_Odm, BB_REG[index], bMaskDWord);
|
BB_backup[index] = ODM_GetBBReg(pDM_Odm, BB_REG[index], bMaskDWord);
|
||||||
|
@ -2089,7 +2073,7 @@ if (*(pDM_Odm->mp_mode) == 1)
|
||||||
_PHY_PathBFillIQKMatrix(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0));
|
_PHY_PathBFillIQKMatrix(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
Indexforchannel = ODM_GetRightChnlPlaceforIQK(pHalData->CurrentChannel);
|
Indexforchannel = ODM_GetRightChnlPlaceforIQK(pHalData->CurrentChannel);
|
||||||
|
|
||||||
/* To Fix BSOD when final_candidate is 0xff */
|
/* To Fix BSOD when final_candidate is 0xff */
|
||||||
/* by sherry 20120321 */
|
/* by sherry 20120321 */
|
||||||
|
@ -2178,29 +2162,6 @@ PHY_APCalibrate_8188E(
|
||||||
IN s8 delta
|
IN s8 delta
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
|
||||||
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
|
||||||
#if DISABLE_BB_RF
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return;
|
|
||||||
if(!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
|
|
||||||
return;
|
|
||||||
|
|
||||||
#if FOR_BRAZIL_PRETEST != 1
|
|
||||||
if(pDM_Odm->RFCalibrateInfo.bAPKdone)
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(pDM_Odm->RFType == ODM_2T2R){
|
|
||||||
phy_APCalibrate_8188E(pAdapter, delta, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* For 88C 1T1R */
|
|
||||||
phy_APCalibrate_8188E(pAdapter, delta, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void phy_SetRFPathSwitch_8188E(
|
static void phy_SetRFPathSwitch_8188E(
|
||||||
|
|
189
hal/odm.c
189
hal/odm.c
|
@ -640,7 +640,7 @@ ODM_DMWatchdog(
|
||||||
else if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
else if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||||
{
|
{
|
||||||
ODM_TXPowerTrackingCheck(pDM_Odm);
|
ODM_TXPowerTrackingCheck(pDM_Odm);
|
||||||
odm_EdcaTurboCheck(pDM_Odm);
|
odm_EdcaTurboCheck(pDM_Odm);
|
||||||
odm_DynamicTxPower(pDM_Odm);
|
odm_DynamicTxPower(pDM_Odm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1167,32 +1167,28 @@ ODM_Write_DIG(
|
||||||
|
|
||||||
if(pDM_DigTable->CurIGValue != CurrentIGI)/* if(pDM_DigTable->PreIGValue != CurrentIGI) */
|
if(pDM_DigTable->CurIGValue != CurrentIGI)/* if(pDM_DigTable->PreIGValue != CurrentIGI) */
|
||||||
{
|
{
|
||||||
if(pDM_Odm->SupportPlatform & (ODM_CE|ODM_MP))
|
if(pDM_Odm->SupportPlatform & (ODM_CE|ODM_MP)) {
|
||||||
{
|
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
}
|
} else if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL)) {
|
||||||
else if(pDM_Odm->SupportPlatform & (ODM_AP|ODM_ADSL))
|
switch(*(pDM_Odm->pOnePathCCA)) {
|
||||||
{
|
|
||||||
switch(*(pDM_Odm->pOnePathCCA))
|
|
||||||
{
|
|
||||||
case ODM_CCA_2R:
|
case ODM_CCA_2R:
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
break;
|
break;
|
||||||
case ODM_CCA_1R_A:
|
case ODM_CCA_1R_A:
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI));
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI));
|
||||||
break;
|
break;
|
||||||
case ODM_CCA_1R_B:
|
case ODM_CCA_1R_B:
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI));
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_A,pDM_Odm), ODM_BIT(IGI,pDM_Odm), getIGIForDiff(CurrentIGI));
|
||||||
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
if(pDM_Odm->SupportICType != ODM_RTL8188E)
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
ODM_SetBBReg(pDM_Odm, ODM_REG(IGI_B,pDM_Odm), ODM_BIT(IGI,pDM_Odm), CurrentIGI);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("CurrentIGI(0x%02x). \n",CurrentIGI));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("CurrentIGI(0x%02x). \n",CurrentIGI));
|
||||||
/* pDM_DigTable->PreIGValue = pDM_DigTable->CurIGValue; */
|
/* pDM_DigTable->PreIGValue = pDM_DigTable->CurIGValue; */
|
||||||
|
@ -1250,9 +1246,9 @@ odm_DIGbyRSSI_LPS(
|
||||||
RSSI_Lower =DM_DIG_MIN_NIC;
|
RSSI_Lower =DM_DIG_MIN_NIC;
|
||||||
|
|
||||||
/* Upper and Lower Bound checking */
|
/* Upper and Lower Bound checking */
|
||||||
if(CurrentIGI > DM_DIG_MAX_NIC)
|
if(CurrentIGI > DM_DIG_MAX_NIC)
|
||||||
CurrentIGI=DM_DIG_MAX_NIC;
|
CurrentIGI=DM_DIG_MAX_NIC;
|
||||||
else if(CurrentIGI < RSSI_Lower)
|
else if(CurrentIGI < RSSI_Lower)
|
||||||
CurrentIGI =RSSI_Lower;
|
CurrentIGI =RSSI_Lower;
|
||||||
|
|
||||||
ODM_Write_DIG(pDM_Odm, CurrentIGI);/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */
|
ODM_Write_DIG(pDM_Odm, CurrentIGI);/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */
|
||||||
|
@ -1904,51 +1900,47 @@ odm_FalseAlarmCounterStatistics(
|
||||||
if(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))
|
if(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES) {
|
||||||
{
|
/* hold ofdm counter */
|
||||||
|
|
||||||
/* hold ofdm counter */
|
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 1); /* hold page C counter */
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 1); /* hold page C counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 1); /* hold page D counter */
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 1); /* hold page D counter */
|
||||||
|
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
|
FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
|
||||||
FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16);
|
FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16);
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
|
FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
|
||||||
FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
|
FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
|
FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
|
||||||
FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
|
FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
|
FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
|
||||||
|
|
||||||
FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal +
|
FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal +
|
||||||
FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail +
|
FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail +
|
||||||
FalseAlmCnt->Cnt_Fast_Fsync + FalseAlmCnt->Cnt_SB_Search_fail;
|
FalseAlmCnt->Cnt_Fast_Fsync + FalseAlmCnt->Cnt_SB_Search_fail;
|
||||||
|
|
||||||
if(pDM_Odm->SupportICType == ODM_RTL8188E)
|
if(pDM_Odm->SupportICType == ODM_RTL8188E)
|
||||||
{
|
{
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_SC_CNT_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_SC_CNT_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff);
|
FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff);
|
||||||
FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16);
|
FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
/* hold cck counter */
|
/* hold cck counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT12, 1);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT12, 1);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT14, 1);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT14, 1);
|
||||||
|
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_LSB_11N, bMaskByte0);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_LSB_11N, bMaskByte0);
|
||||||
FalseAlmCnt->Cnt_Cck_fail = ret_value;
|
FalseAlmCnt->Cnt_Cck_fail = ret_value;
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_MSB_11N, bMaskByte3);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_FA_MSB_11N, bMaskByte3);
|
||||||
FalseAlmCnt->Cnt_Cck_fail += (ret_value& 0xff)<<8;
|
FalseAlmCnt->Cnt_Cck_fail += (ret_value& 0xff)<<8;
|
||||||
|
|
||||||
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11N, bMaskDWord);
|
ret_value = ODM_GetBBReg(pDM_Odm, ODM_REG_CCK_CCA_CNT_11N, bMaskDWord);
|
||||||
FalseAlmCnt->Cnt_CCK_CCA = ((ret_value&0xFF)<<8) |((ret_value&0xFF00)>>8);
|
FalseAlmCnt->Cnt_CCK_CCA = ((ret_value&0xFF)<<8) |((ret_value&0xFF00)>>8);
|
||||||
}
|
|
||||||
|
|
||||||
FalseAlmCnt->Cnt_all = ( FalseAlmCnt->Cnt_Fast_Fsync +
|
FalseAlmCnt->Cnt_all = ( FalseAlmCnt->Cnt_Fast_Fsync +
|
||||||
FalseAlmCnt->Cnt_SB_Search_fail +
|
FalseAlmCnt->Cnt_SB_Search_fail +
|
||||||
FalseAlmCnt->Cnt_Parity_Fail +
|
FalseAlmCnt->Cnt_Parity_Fail +
|
||||||
FalseAlmCnt->Cnt_Rate_Illegal +
|
FalseAlmCnt->Cnt_Rate_Illegal +
|
||||||
|
@ -1956,33 +1948,33 @@ odm_FalseAlarmCounterStatistics(
|
||||||
FalseAlmCnt->Cnt_Mcs_fail +
|
FalseAlmCnt->Cnt_Mcs_fail +
|
||||||
FalseAlmCnt->Cnt_Cck_fail);
|
FalseAlmCnt->Cnt_Cck_fail);
|
||||||
|
|
||||||
FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA;
|
FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA;
|
||||||
|
|
||||||
if(pDM_Odm->SupportICType >=ODM_RTL8723A)
|
if(pDM_Odm->SupportICType >=ODM_RTL8723A)
|
||||||
{
|
{
|
||||||
/* reset false alarm counter registers */
|
/* reset false alarm counter registers */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 1);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 1);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 0);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT31, 0);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 1);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 1);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 0);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT27, 0);
|
||||||
/* update ofdm counter */
|
/* update ofdm counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 0); /* update page C counter */
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_HOLDC_11N, BIT31, 0); /* update page C counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 0); /* update page D counter */
|
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTD_11N, BIT31, 0); /* update page D counter */
|
||||||
|
|
||||||
/* reset CCK CCA counter */
|
/* reset CCK CCA counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 0);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 0);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 2);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT13|BIT12, 2);
|
||||||
/* reset CCK FA counter */
|
/* reset CCK FA counter */
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 0);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 0);
|
||||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 2);
|
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11N, BIT15|BIT14, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Enter odm_FalseAlarmCounterStatistics\n"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Enter odm_FalseAlarmCounterStatistics\n"));
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Fast_Fsync=%d, Cnt_SB_Search_fail=%d\n",
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Fast_Fsync=%d, Cnt_SB_Search_fail=%d\n",
|
||||||
FalseAlmCnt->Cnt_Fast_Fsync, FalseAlmCnt->Cnt_SB_Search_fail));
|
FalseAlmCnt->Cnt_Fast_Fsync, FalseAlmCnt->Cnt_SB_Search_fail));
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Parity_Fail=%d, Cnt_Rate_Illegal=%d\n",
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Parity_Fail=%d, Cnt_Rate_Illegal=%d\n",
|
||||||
FalseAlmCnt->Cnt_Parity_Fail, FalseAlmCnt->Cnt_Rate_Illegal));
|
FalseAlmCnt->Cnt_Parity_Fail, FalseAlmCnt->Cnt_Rate_Illegal));
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Crc8_fail=%d, Cnt_Mcs_fail=%d\n",
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Crc8_fail=%d, Cnt_Mcs_fail=%d\n",
|
||||||
FalseAlmCnt->Cnt_Crc8_fail, FalseAlmCnt->Cnt_Mcs_fail));
|
FalseAlmCnt->Cnt_Crc8_fail, FalseAlmCnt->Cnt_Mcs_fail));
|
||||||
}
|
}
|
||||||
else /* FOR ODM_IC_11AC_SERIES */
|
else /* FOR ODM_IC_11AC_SERIES */
|
||||||
|
@ -3180,28 +3172,24 @@ odm_SetRxIdleAnt(
|
||||||
{
|
{
|
||||||
SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
|
SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
|
||||||
|
|
||||||
if(Ant != pDM_SWAT_Table->RxIdleAnt)
|
if(Ant != pDM_SWAT_Table->RxIdleAnt) {
|
||||||
{
|
/* for path-A */
|
||||||
/* for path-A */
|
if(Ant==1)
|
||||||
if(Ant==1)
|
|
||||||
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x65a9); /* right-side antenna */
|
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x65a9); /* right-side antenna */
|
||||||
else
|
else
|
||||||
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x569a); /* left-side antenna */
|
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x569a); /* left-side antenna */
|
||||||
|
|
||||||
/* for path-B */
|
/* for path-B */
|
||||||
if(bDualPath){
|
if(bDualPath){
|
||||||
if(Ant==0)
|
if(Ant==0)
|
||||||
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x65a9); /* right-side antenna */
|
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x65a9); /* right-side antenna */
|
||||||
else
|
else
|
||||||
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x569a); /* left-side antenna */
|
ODM_SetBBReg(pDM_Odm,ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x569a); /* left-side antenna */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pDM_SWAT_Table->RxIdleAnt = Ant;
|
pDM_SWAT_Table->RxIdleAnt = Ant;
|
||||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("RxIdleAnt: %s Reg858=0x%x\n",(Ant==1)?"Ant1":"Ant2",(Ant==1)?0x65a9:0x569a));
|
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("RxIdleAnt: %s Reg858=0x%x\n",(Ant==1)?"Ant1":"Ant2",(Ant==1)?0x65a9:0x569a));
|
||||||
|
}
|
||||||
/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("<==============odm_SetRxIdleAnt\n")); */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ODM_AntselStatistics_88C(
|
ODM_AntselStatistics_88C(
|
||||||
|
@ -3800,61 +3788,42 @@ ODM_SingleDualAntennaDetection(
|
||||||
if(pDM_Odm->SupportICType == ODM_RTL8723A)
|
if(pDM_Odm->SupportICType == ODM_RTL8723A)
|
||||||
{
|
{
|
||||||
/* 2 Test Ant B based on Ant A is ON */
|
/* 2 Test Ant B based on Ant A is ON */
|
||||||
if(mode==ANTTESTB)
|
if(mode==ANTTESTB) {
|
||||||
{
|
if(AntA_report >= 100) {
|
||||||
if(AntA_report >= 100)
|
if(AntB_report > (AntA_report+1)) {
|
||||||
{
|
pDM_SWAT_Table->ANTB_ON=false;
|
||||||
if(AntB_report > (AntA_report+1))
|
|
||||||
{
|
|
||||||
pDM_SWAT_Table->ANTB_ON=false;
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Single Antenna A\n"));
|
||||||
}
|
} else {
|
||||||
else
|
pDM_SWAT_Table->ANTB_ON=true;
|
||||||
{
|
|
||||||
pDM_SWAT_Table->ANTB_ON=true;
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna is A and B\n"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Dual Antenna is A and B\n"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n"));
|
||||||
|
pDM_SWAT_Table->ANTB_ON=false; /* Set Antenna B off as default */
|
||||||
|
bResult = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/* 2 Test Ant A and B based on DPDT Open */
|
||||||
else
|
else if(mode==ANTTESTALL) {
|
||||||
{
|
if((AntO_report >=100)&(AntO_report <118)) {
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_SingleDualAntennaDetection(): Need to check again\n"));
|
if(AntA_report > (AntO_report+1)) {
|
||||||
pDM_SWAT_Table->ANTB_ON=false; /* Set Antenna B off as default */
|
pDM_SWAT_Table->ANTA_ON=false;
|
||||||
bResult = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* 2 Test Ant A and B based on DPDT Open */
|
|
||||||
else if(mode==ANTTESTALL)
|
|
||||||
{
|
|
||||||
if((AntO_report >=100)&(AntO_report <118))
|
|
||||||
{
|
|
||||||
if(AntA_report > (AntO_report+1))
|
|
||||||
{
|
|
||||||
pDM_SWAT_Table->ANTA_ON=false;
|
|
||||||
/* RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("ODM_AntennaDetection(): Antenna A is OFF\n")); */
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is OFF"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is OFF"));
|
||||||
}
|
} else {
|
||||||
else
|
pDM_SWAT_Table->ANTA_ON=true;
|
||||||
{
|
|
||||||
pDM_SWAT_Table->ANTA_ON=true;
|
|
||||||
/* RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("ODM_AntennaDetection(): Antenna A is ON\n")); */
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is ON"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant A is ON"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AntB_report > (AntO_report+2))
|
if(AntB_report > (AntO_report+2)) {
|
||||||
{
|
pDM_SWAT_Table->ANTB_ON=false;
|
||||||
pDM_SWAT_Table->ANTB_ON=false;
|
|
||||||
/* RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("ODM_AntennaDetection(): Antenna B is OFF\n")); */
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is OFF"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is OFF"));
|
||||||
}
|
} else {
|
||||||
else
|
pDM_SWAT_Table->ANTB_ON=true;
|
||||||
{
|
|
||||||
pDM_SWAT_Table->ANTB_ON=true;
|
|
||||||
/* RT_TRACE(COMP_ANTENNA, DBG_LOUD, ("ODM_AntennaDetection(): Antenna B is ON\n")); */
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is ON"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("Ant B is ON"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if(pDM_Odm->SupportICType == ODM_RTL8192C)
|
else if(pDM_Odm->SupportICType == ODM_RTL8192C)
|
||||||
{
|
{
|
||||||
if(AntA_report >= 100)
|
if(AntA_report >= 100)
|
||||||
|
|
|
@ -255,71 +255,63 @@ odm_RxPhyStatus92CSeries_Parsing(
|
||||||
|
|
||||||
PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus;
|
PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus;
|
||||||
|
|
||||||
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M ) && (pPktinfo->Rate <= DESC92C_RATE11M ))?true :false;
|
isCCKrate = (pPktinfo->Rate <= DESC92C_RATE11M) ? true : false;
|
||||||
|
|
||||||
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1;
|
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1;
|
||||||
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
|
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
|
||||||
|
|
||||||
|
|
||||||
if(isCCKrate)
|
if(isCCKrate) {
|
||||||
{
|
|
||||||
u8 report;
|
u8 report;
|
||||||
u8 cck_agc_rpt;
|
u8 cck_agc_rpt;
|
||||||
|
|
||||||
pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK++;
|
pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK++;
|
||||||
/* */
|
|
||||||
/* (1)Hardware does not provide RSSI for CCK */
|
/* (1)Hardware does not provide RSSI for CCK */
|
||||||
/* (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) */
|
/* (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) */
|
||||||
/* */
|
|
||||||
|
|
||||||
/* if(pHalData->eRFPowerState == eRfOn) */
|
cck_highpwr = pDM_Odm->bCckHighPower;
|
||||||
cck_highpwr = pDM_Odm->bCckHighPower;
|
|
||||||
/* else */
|
|
||||||
/* cck_highpwr = false; */
|
|
||||||
|
|
||||||
cck_agc_rpt = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a ;
|
cck_agc_rpt = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a ;
|
||||||
|
|
||||||
/* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */
|
/* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */
|
||||||
/* The RSSI formula should be modified according to the gain table */
|
/* The RSSI formula should be modified according to the gain table */
|
||||||
/* In 88E, cck_highpwr is always set to 1 */
|
/* In 88E, cck_highpwr is always set to 1 */
|
||||||
if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812))
|
if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812)) {
|
||||||
{
|
|
||||||
LNA_idx = ((cck_agc_rpt & 0xE0) >>5);
|
LNA_idx = ((cck_agc_rpt & 0xE0) >>5);
|
||||||
VGA_idx = (cck_agc_rpt & 0x1F);
|
VGA_idx = (cck_agc_rpt & 0x1F);
|
||||||
switch(LNA_idx)
|
switch(LNA_idx) {
|
||||||
{
|
case 7:
|
||||||
case 7:
|
if(VGA_idx <= 27)
|
||||||
if(VGA_idx <= 27)
|
rx_pwr_all = -100 + 2*(27-VGA_idx); /* VGA_idx = 27~2 */
|
||||||
rx_pwr_all = -100 + 2*(27-VGA_idx); /* VGA_idx = 27~2 */
|
else
|
||||||
else
|
rx_pwr_all = -100;
|
||||||
rx_pwr_all = -100;
|
break;
|
||||||
break;
|
case 6:
|
||||||
case 6:
|
rx_pwr_all = -48 + 2*(2-VGA_idx); /* VGA_idx = 2~0 */
|
||||||
rx_pwr_all = -48 + 2*(2-VGA_idx); /* VGA_idx = 2~0 */
|
break;
|
||||||
break;
|
case 5:
|
||||||
case 5:
|
rx_pwr_all = -42 + 2*(7-VGA_idx); /* VGA_idx = 7~5 */
|
||||||
rx_pwr_all = -42 + 2*(7-VGA_idx); /* VGA_idx = 7~5 */
|
break;
|
||||||
break;
|
case 4:
|
||||||
case 4:
|
rx_pwr_all = -36 + 2*(7-VGA_idx); /* VGA_idx = 7~4 */
|
||||||
rx_pwr_all = -36 + 2*(7-VGA_idx); /* VGA_idx = 7~4 */
|
break;
|
||||||
break;
|
case 3:
|
||||||
case 3:
|
rx_pwr_all = -24 + 2*(7-VGA_idx); /* VGA_idx = 7~0 */
|
||||||
rx_pwr_all = -24 + 2*(7-VGA_idx); /* VGA_idx = 7~0 */
|
break;
|
||||||
break;
|
case 2:
|
||||||
case 2:
|
if(cck_highpwr)
|
||||||
if(cck_highpwr)
|
rx_pwr_all = -12 + 2*(5-VGA_idx); /* VGA_idx = 5~0 */
|
||||||
rx_pwr_all = -12 + 2*(5-VGA_idx); /* VGA_idx = 5~0 */
|
else
|
||||||
else
|
rx_pwr_all = -6+ 2*(5-VGA_idx);
|
||||||
rx_pwr_all = -6+ 2*(5-VGA_idx);
|
break;
|
||||||
break;
|
case 1:
|
||||||
case 1:
|
rx_pwr_all = 8-2*VGA_idx;
|
||||||
rx_pwr_all = 8-2*VGA_idx;
|
break;
|
||||||
break;
|
case 0:
|
||||||
case 0:
|
rx_pwr_all = 14-2*VGA_idx;
|
||||||
rx_pwr_all = 14-2*VGA_idx;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
rx_pwr_all += 6;
|
rx_pwr_all += 6;
|
||||||
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
||||||
|
@ -449,11 +441,8 @@ odm_RxPhyStatus92CSeries_Parsing(
|
||||||
{
|
{
|
||||||
pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM++;
|
pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM++;
|
||||||
|
|
||||||
/* */
|
|
||||||
/* (1)Get RSSI for HT rate */
|
/* (1)Get RSSI for HT rate */
|
||||||
/* */
|
for(i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++)
|
||||||
|
|
||||||
for(i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++)
|
|
||||||
{
|
{
|
||||||
/* 2008/01/30 MH we will judge RF RX path now. */
|
/* 2008/01/30 MH we will judge RF RX path now. */
|
||||||
if (pDM_Odm->RFPathRxEnable & BIT(i))
|
if (pDM_Odm->RFPathRxEnable & BIT(i))
|
||||||
|
@ -601,15 +590,12 @@ odm_Process_RSSIForDM(
|
||||||
}
|
}
|
||||||
|
|
||||||
pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->StationID];
|
pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->StationID];
|
||||||
if(!IS_STA_VALID(pEntry) ){
|
if(!IS_STA_VALID(pEntry))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if((!pPktinfo->bPacketMatchBSSID) )
|
if((!pPktinfo->bPacketMatchBSSID) )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M ) && (pPktinfo->Rate <= DESC92C_RATE11M ))?true :false;
|
isCCKrate = (pPktinfo->Rate <= DESC92C_RATE11M) ? true : false;
|
||||||
if(pPktinfo->bPacketBeacon)
|
if(pPktinfo->bPacketBeacon)
|
||||||
pDM_Odm->PhyDbgInfo.NumQryBeaconPkt++;
|
pDM_Odm->PhyDbgInfo.NumQryBeaconPkt++;
|
||||||
|
|
||||||
|
@ -877,25 +863,18 @@ ODM_ConfigBBWithHeaderFile(
|
||||||
IN ODM_BB_Config_Type ConfigType
|
IN ODM_BB_Config_Type ConfigType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if(pDM_Odm->SupportICType == ODM_RTL8188E)
|
if(pDM_Odm->SupportICType == ODM_RTL8188E) {
|
||||||
{
|
if(ConfigType == CONFIG_BB_PHY_REG) {
|
||||||
|
|
||||||
if(ConfigType == CONFIG_BB_PHY_REG)
|
|
||||||
{
|
|
||||||
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
||||||
READ_AND_CONFIG(8188E,_PHY_REG_1T_ICUT_);
|
READ_AND_CONFIG(8188E,_PHY_REG_1T_ICUT_);
|
||||||
else
|
else
|
||||||
READ_AND_CONFIG(8188E,_PHY_REG_1T_);
|
READ_AND_CONFIG(8188E,_PHY_REG_1T_);
|
||||||
}
|
} else if(ConfigType == CONFIG_BB_AGC_TAB) {
|
||||||
else if(ConfigType == CONFIG_BB_AGC_TAB)
|
|
||||||
{
|
|
||||||
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
||||||
READ_AND_CONFIG(8188E,_AGC_TAB_1T_ICUT_);
|
READ_AND_CONFIG(8188E,_AGC_TAB_1T_ICUT_);
|
||||||
else
|
else
|
||||||
READ_AND_CONFIG(8188E,_AGC_TAB_1T_);
|
READ_AND_CONFIG(8188E,_AGC_TAB_1T_);
|
||||||
}
|
} else if(ConfigType == CONFIG_BB_PHY_REG_PG) {
|
||||||
else if(ConfigType == CONFIG_BB_PHY_REG_PG)
|
|
||||||
{
|
|
||||||
READ_AND_CONFIG(8188E,_PHY_REG_PG_);
|
READ_AND_CONFIG(8188E,_PHY_REG_PG_);
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> phy_ConfigBBWithHeaderFile() agc:Rtl8188EPHY_REG_PGArray\n"));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> phy_ConfigBBWithHeaderFile() agc:Rtl8188EPHY_REG_PGArray\n"));
|
||||||
}
|
}
|
||||||
|
@ -909,8 +888,7 @@ ODM_ConfigMACWithHeaderFile(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
u8 result = HAL_STATUS_SUCCESS;
|
u8 result = HAL_STATUS_SUCCESS;
|
||||||
if (pDM_Odm->SupportICType == ODM_RTL8188E)
|
if (pDM_Odm->SupportICType == ODM_RTL8188E) {
|
||||||
{
|
|
||||||
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
|
||||||
READ_AND_CONFIG(8188E,_MAC_REG_ICUT_);
|
READ_AND_CONFIG(8188E,_MAC_REG_ICUT_);
|
||||||
else
|
else
|
||||||
|
|
|
@ -140,18 +140,18 @@ odm_FastAntTrainingInit(
|
||||||
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
|
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
|
||||||
u32 AntCombination = 2;
|
u32 AntCombination = 2;
|
||||||
struct adapter * Adapter = pDM_Odm->Adapter;
|
struct adapter * Adapter = pDM_Odm->Adapter;
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_FastAntTrainingInit() \n"));
|
|
||||||
|
|
||||||
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_FastAntTrainingInit() \n"));
|
||||||
|
|
||||||
#if (MP_DRIVER == 1)
|
#if (MP_DRIVER == 1)
|
||||||
if (*(pDM_Odm->mp_mode) == 1)
|
if (*(pDM_Odm->mp_mode) == 1) {
|
||||||
{
|
|
||||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->AntDivType: %d\n", pDM_Odm->AntDivType));
|
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("pDM_Odm->AntDivType: %d\n", pDM_Odm->AntDivType));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(i=0; i<6; i++)
|
for(i=0; i<6; i++) {
|
||||||
{
|
|
||||||
pDM_FatTable->Bssid[i] = 0;
|
pDM_FatTable->Bssid[i] = 0;
|
||||||
pDM_FatTable->antSumRSSI[i] = 0;
|
pDM_FatTable->antSumRSSI[i] = 0;
|
||||||
pDM_FatTable->antRSSIcnt[i] = 0;
|
pDM_FatTable->antRSSIcnt[i] = 0;
|
||||||
|
@ -576,5 +576,5 @@ odm_DynamicPrimaryCCA(
|
||||||
u8 SecCHOffset;
|
u8 SecCHOffset;
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,9 +72,9 @@ odm_ConfigRF_RadioA_8188E(
|
||||||
u32 content = 0x1000; /* RF_Content: radioa_txt */
|
u32 content = 0x1000; /* RF_Content: radioa_txt */
|
||||||
u32 maskforPhySet= (u32)(content&0xE000);
|
u32 maskforPhySet= (u32)(content&0xE000);
|
||||||
|
|
||||||
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, ODM_RF_PATH_A, Addr|maskforPhySet);
|
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, ODM_RF_PATH_A, Addr|maskforPhySet);
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -87,7 +87,7 @@ odm_ConfigRF_RadioB_8188E(
|
||||||
u32 content = 0x1001; /* RF_Content: radiob_txt */
|
u32 content = 0x1001; /* RF_Content: radiob_txt */
|
||||||
u32 maskforPhySet= (u32)(content&0xE000);
|
u32 maskforPhySet= (u32)(content&0xE000);
|
||||||
|
|
||||||
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet);
|
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet);
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ odm_ConfigBB_AGC_8188E(
|
||||||
/* Add 1us delay between BB/RF register setting. */
|
/* Add 1us delay between BB/RF register setting. */
|
||||||
ODM_delay_us(1);
|
ODM_delay_us(1);
|
||||||
|
|
||||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -2762,16 +2762,15 @@ static u8 _LLTRead(struct adapter *padapter, u32 address)
|
||||||
void Read_LLT_Tab(struct adapter *padapter)
|
void Read_LLT_Tab(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
u32 addr,next_addr;
|
u32 addr,next_addr;
|
||||||
printk("############### %s ###################\n",__FUNCTION__);
|
|
||||||
for(addr=0;addr<176;addr++)
|
|
||||||
{
|
|
||||||
next_addr = _LLTRead(padapter,addr);
|
|
||||||
printk("%d->",next_addr);
|
|
||||||
if(((addr+1) %8) ==0)
|
|
||||||
printk("\n");
|
|
||||||
}
|
|
||||||
printk("\n##################################\n");
|
|
||||||
|
|
||||||
|
printk("############### %s ###################\n",__FUNCTION__);
|
||||||
|
for(addr=0;addr<176;addr++) {
|
||||||
|
next_addr = _LLTRead(padapter,addr);
|
||||||
|
printk("%d->",next_addr);
|
||||||
|
if(((addr+1) %8) ==0)
|
||||||
|
printk("\n");
|
||||||
|
}
|
||||||
|
printk("\n##################################\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
|
s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
|
||||||
|
|
|
@ -1454,15 +1454,12 @@ phy_TxPwrIdxToDbm(
|
||||||
/* The mapping may be different by different NICs. Do not use this formula for what needs accurate result. */
|
/* The mapping may be different by different NICs. Do not use this formula for what needs accurate result. */
|
||||||
/* By Bruce, 2008-01-29. */
|
/* By Bruce, 2008-01-29. */
|
||||||
/* */
|
/* */
|
||||||
switch(WirelessMode)
|
switch(WirelessMode) {
|
||||||
{
|
|
||||||
case WIRELESS_MODE_B:
|
case WIRELESS_MODE_B:
|
||||||
Offset = -7;
|
Offset = -7;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIRELESS_MODE_G:
|
case WIRELESS_MODE_G:
|
||||||
case WIRELESS_MODE_N_24G:
|
case WIRELESS_MODE_N_24G:
|
||||||
Offset = -8;
|
|
||||||
default:
|
default:
|
||||||
Offset = -8;
|
Offset = -8;
|
||||||
break;
|
break;
|
||||||
|
@ -1577,47 +1574,6 @@ static void getTxPowerIndex88E(
|
||||||
/* 2. BW40 */
|
/* 2. BW40 */
|
||||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
||||||
}
|
}
|
||||||
else if(TxCount==RF_PATH_C)
|
|
||||||
{
|
|
||||||
/* 1. CCK */
|
|
||||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
|
||||||
/* 2. OFDM */
|
|
||||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_B][index]+
|
|
||||||
pHalData->BW20_24G_Diff[TxCount][index];
|
|
||||||
/* 1. BW20 */
|
|
||||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_B][index]+
|
|
||||||
pHalData->BW20_24G_Diff[TxCount][index];
|
|
||||||
/* 2. BW40 */
|
|
||||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
|
||||||
}
|
|
||||||
else if(TxCount==RF_PATH_D)
|
|
||||||
{
|
|
||||||
/* 1. CCK */
|
|
||||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
|
||||||
/* 2. OFDM */
|
|
||||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_B][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_C][index]+
|
|
||||||
pHalData->BW20_24G_Diff[TxCount][index];
|
|
||||||
|
|
||||||
/* 1. BW20 */
|
|
||||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_A][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_B][index]+
|
|
||||||
pHalData->BW20_24G_Diff[RF_PATH_C][index]+
|
|
||||||
pHalData->BW20_24G_Diff[TxCount][index];
|
|
||||||
|
|
||||||
/* 2. BW40 */
|
|
||||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,14 +205,13 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)
|
||||||
|
|
||||||
static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bagg_pkt)
|
static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bagg_pkt)
|
||||||
{
|
{
|
||||||
int pull=0;
|
int pull=0;
|
||||||
uint qsel;
|
uint qsel;
|
||||||
u8 data_rate,pwr_status,offset;
|
u8 data_rate,pwr_status,offset;
|
||||||
struct adapter *padapter = pxmitframe->padapter;
|
struct adapter *padapter = pxmitframe->padapter;
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||||
/* struct dm_priv *pdmpriv = &pHalData->dmpriv; */
|
|
||||||
struct tx_desc *ptxdesc = (struct tx_desc *)pmem;
|
struct tx_desc *ptxdesc = (struct tx_desc *)pmem;
|
||||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||||
|
@ -249,17 +248,15 @@ if (padapter->registrypriv.mp_mode == 0)
|
||||||
if (bmcst) ptxdesc->txdw0 |= cpu_to_le32(BMC);
|
if (bmcst) ptxdesc->txdw0 |= cpu_to_le32(BMC);
|
||||||
|
|
||||||
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||||
if (padapter->registrypriv.mp_mode == 0)
|
if (padapter->registrypriv.mp_mode == 0)
|
||||||
{
|
{
|
||||||
if(!bagg_pkt){
|
if(!bagg_pkt){
|
||||||
if((pull) && (pxmitframe->pkt_offset>0)) {
|
if((pull) && (pxmitframe->pkt_offset>0)) {
|
||||||
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
|
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/* DBG_8192C("%s, pkt_offset=0x%02x\n",__FUNCTION__,pxmitframe->pkt_offset); */
|
|
||||||
|
|
||||||
/* pkt_offset, unit:8 bytes padding */
|
/* pkt_offset, unit:8 bytes padding */
|
||||||
if (pxmitframe->pkt_offset > 0)
|
if (pxmitframe->pkt_offset > 0)
|
||||||
ptxdesc->txdw1 |= cpu_to_le32((pxmitframe->pkt_offset << 26) & 0x7c000000);
|
ptxdesc->txdw1 |= cpu_to_le32((pxmitframe->pkt_offset << 26) & 0x7c000000);
|
||||||
|
@ -538,10 +535,9 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
|
||||||
rtw_issue_addbareq_cmd(padapter, pxmitframe);
|
rtw_issue_addbareq_cmd(padapter, pxmitframe);
|
||||||
mem_addr = pxmitframe->buf_addr;
|
mem_addr = pxmitframe->buf_addr;
|
||||||
|
|
||||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_dump_xframe()\n"));
|
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_dump_xframe()\n"));
|
||||||
|
|
||||||
for (t = 0; t < pattrib->nr_frags; t++)
|
for (t = 0; t < pattrib->nr_frags; t++) {
|
||||||
{
|
|
||||||
if (inner_ret != _SUCCESS && ret == _SUCCESS)
|
if (inner_ret != _SUCCESS && ret == _SUCCESS)
|
||||||
ret = _FAIL;
|
ret = _FAIL;
|
||||||
|
|
||||||
|
|
|
@ -1120,42 +1120,9 @@ HwSuspendModeEnable_88eu(
|
||||||
IN u8 Type
|
IN u8 Type
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* PRT_USB_DEVICE pDevice = GET_RT_USB_DEVICE(pAdapter); */
|
return;
|
||||||
u16 reg = rtw_read16(pAdapter, REG_GPIO_MUXCFG);
|
|
||||||
|
|
||||||
/* if (!pDevice->RegUsbSS) */
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* */
|
|
||||||
/* 2010/08/23 MH According to Alfred's suggestion, we need to to prevent HW */
|
|
||||||
/* to enter suspend mode automatically. Otherwise, it will shut down major power */
|
|
||||||
/* domain and 8051 will stop. When we try to enter selective suspend mode, we */
|
|
||||||
/* need to prevent HW to enter D2 mode aumotmatically. Another way, Host will */
|
|
||||||
/* issue a S10 signal to power domain. Then it will cleat SIC setting(from Yngli). */
|
|
||||||
/* We need to enable HW suspend mode when enter S3/S4 or disable. We need */
|
|
||||||
/* to disable HW suspend mode for IPS/radio_off. */
|
|
||||||
/* */
|
|
||||||
/* RT_TRACE(COMP_RF, DBG_LOUD, ("HwSuspendModeEnable92Cu = %d\n", Type)); */
|
|
||||||
if (Type == false)
|
|
||||||
{
|
|
||||||
reg |= BIT14;
|
|
||||||
/* RT_TRACE(COMP_RF, DBG_LOUD, ("REG_GPIO_MUXCFG = %x\n", reg)); */
|
|
||||||
rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg);
|
|
||||||
reg |= BIT12;
|
|
||||||
/* RT_TRACE(COMP_RF, DBG_LOUD, ("REG_GPIO_MUXCFG = %x\n", reg)); */
|
|
||||||
rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reg &= (~BIT12);
|
|
||||||
rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg);
|
|
||||||
reg &= (~BIT14);
|
|
||||||
rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* HwSuspendModeEnable92Cu */
|
} /* HwSuspendModeEnable92Cu */
|
||||||
|
|
||||||
rt_rf_power_state RfOnOffDetect(IN struct adapter *pAdapter )
|
rt_rf_power_state RfOnOffDetect(IN struct adapter *pAdapter )
|
||||||
{
|
{
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||||
|
@ -1270,11 +1237,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||||
#define HAL_INIT_PROFILE_TAG(stage) do {} while(0)
|
#define HAL_INIT_PROFILE_TAG(stage) do {} while(0)
|
||||||
#endif /* DBG_HAL_INIT_PROFILING */
|
#endif /* DBG_HAL_INIT_PROFILING */
|
||||||
|
|
||||||
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
|
|
||||||
|
|
||||||
if(pwrctrlpriv->bkeepfwalive)
|
if(pwrctrlpriv->bkeepfwalive)
|
||||||
{
|
{
|
||||||
|
@ -1296,7 +1259,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON);
|
||||||
status = InitPowerOn_rtl8188eu(Adapter);
|
status = InitPowerOn_rtl8188eu(Adapter);
|
||||||
if(status == _FAIL){
|
if(status == _FAIL){
|
||||||
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init power on!\n"));
|
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init power on!\n"));
|
||||||
|
@ -1324,38 +1287,33 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON);
|
||||||
txpktbuf_bndy = WMM_NORMAL_TX_PAGE_BOUNDARY_88E;
|
txpktbuf_bndy = WMM_NORMAL_TX_PAGE_BOUNDARY_88E;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC01);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC01);
|
||||||
_InitQueueReservedPage(Adapter);
|
_InitQueueReservedPage(Adapter);
|
||||||
_InitQueuePriority(Adapter);
|
_InitQueuePriority(Adapter);
|
||||||
_InitPageBoundary(Adapter);
|
_InitPageBoundary(Adapter);
|
||||||
_InitTransferPageSize(Adapter);
|
_InitTransferPageSize(Adapter);
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW);
|
||||||
#if (MP_DRIVER == 1)
|
#if (MP_DRIVER == 1)
|
||||||
if (Adapter->registrypriv.mp_mode == 1)
|
if (Adapter->registrypriv.mp_mode == 1)
|
||||||
{
|
{
|
||||||
_InitRxSetting(Adapter);
|
_InitRxSetting(Adapter);
|
||||||
}
|
}
|
||||||
#endif /* MP_DRIVER == 1 */
|
#endif /* MP_DRIVER == 1 */
|
||||||
{
|
status = rtl8188e_FirmwareDownload(Adapter);
|
||||||
status = rtl8188e_FirmwareDownload(Adapter);
|
if (status != _SUCCESS) {
|
||||||
if (status != _SUCCESS) {
|
DBG_871X("%s: Download Firmware failed!!\n", __FUNCTION__);
|
||||||
DBG_871X("%s: Download Firmware failed!!\n", __FUNCTION__);
|
Adapter->bFWReady = false;
|
||||||
Adapter->bFWReady = false;
|
pHalData->fw_ractrl = false;
|
||||||
pHalData->fw_ractrl = false;
|
return status;
|
||||||
return status;
|
} else {
|
||||||
} else {
|
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializepadapter8192CSdio(): Download Firmware Success!!\n"));
|
||||||
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializepadapter8192CSdio(): Download Firmware Success!!\n"));
|
Adapter->bFWReady = true;
|
||||||
Adapter->bFWReady = true;
|
pHalData->fw_ractrl = false;
|
||||||
pHalData->fw_ractrl = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rtl8188e_InitializeFirmwareVars(Adapter);
|
rtl8188e_InitializeFirmwareVars(Adapter);
|
||||||
|
|
||||||
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
|
|
||||||
#if (HAL_MAC_ENABLE == 1)
|
#if (HAL_MAC_ENABLE == 1)
|
||||||
status = PHY_MACConfig8188E(Adapter);
|
status = PHY_MACConfig8188E(Adapter);
|
||||||
if(status == _FAIL)
|
if(status == _FAIL)
|
||||||
|
@ -1368,7 +1326,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
|
||||||
/* */
|
/* */
|
||||||
/* d. Initialize BB related configurations. */
|
/* d. Initialize BB related configurations. */
|
||||||
/* */
|
/* */
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
|
||||||
#if (HAL_BB_ENABLE == 1)
|
#if (HAL_BB_ENABLE == 1)
|
||||||
status = PHY_BBConfig8188E(Adapter);
|
status = PHY_BBConfig8188E(Adapter);
|
||||||
if(status == _FAIL)
|
if(status == _FAIL)
|
||||||
|
@ -1379,7 +1337,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
|
||||||
#if (HAL_RF_ENABLE == 1)
|
#if (HAL_RF_ENABLE == 1)
|
||||||
status = PHY_RFConfig8188E(Adapter);
|
status = PHY_RFConfig8188E(Adapter);
|
||||||
if(status == _FAIL)
|
if(status == _FAIL)
|
||||||
|
@ -1389,7 +1347,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_EFUSE_PATCH);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_EFUSE_PATCH);
|
||||||
status = rtl8188e_iol_efuse_patch(Adapter);
|
status = rtl8188e_iol_efuse_patch(Adapter);
|
||||||
if(status == _FAIL){
|
if(status == _FAIL){
|
||||||
DBG_871X("%s rtl8188e_iol_efuse_patch failed \n",__FUNCTION__);
|
DBG_871X("%s rtl8188e_iol_efuse_patch failed \n",__FUNCTION__);
|
||||||
|
@ -1398,14 +1356,14 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_EFUSE_PATCH);
|
||||||
|
|
||||||
_InitTxBufferBoundary(Adapter, txpktbuf_bndy);
|
_InitTxBufferBoundary(Adapter, txpktbuf_bndy);
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_LLTT);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_LLTT);
|
||||||
status = InitLLTTable(Adapter, txpktbuf_bndy);
|
status = InitLLTTable(Adapter, txpktbuf_bndy);
|
||||||
if(status == _FAIL){
|
if(status == _FAIL){
|
||||||
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init LLT table\n"));
|
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init LLT table\n"));
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
||||||
/* Get Rx PHY status in order to report RSSI and others. */
|
/* Get Rx PHY status in order to report RSSI and others. */
|
||||||
_InitDriverInfoSize(Adapter, DRVINFO_SZ);
|
_InitDriverInfoSize(Adapter, DRVINFO_SZ);
|
||||||
|
|
||||||
|
@ -1439,15 +1397,14 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (RATE_ADAPTIVE_SUPPORT==1)
|
#if (RATE_ADAPTIVE_SUPPORT==1)
|
||||||
{/* Enable TX Report */
|
/* Enable TX Report */
|
||||||
/* Enable Tx Report Timer */
|
/* Enable Tx Report Timer */
|
||||||
value8 = rtw_read8(Adapter, REG_TX_RPT_CTRL);
|
value8 = rtw_read8(Adapter, REG_TX_RPT_CTRL);
|
||||||
rtw_write8(Adapter, REG_TX_RPT_CTRL, (value8|BIT1|BIT0));
|
rtw_write8(Adapter, REG_TX_RPT_CTRL, (value8|BIT1|BIT0));
|
||||||
/* Set MAX RPT MACID */
|
/* Set MAX RPT MACID */
|
||||||
rtw_write8(Adapter, REG_TX_RPT_CTRL+1, 2);/* FOR sta mode ,0: bc/mc ,1:AP */
|
rtw_write8(Adapter, REG_TX_RPT_CTRL+1, 2);/* FOR sta mode ,0: bc/mc ,1:AP */
|
||||||
/* Tx RPT Timer. Unit: 32us */
|
/* Tx RPT Timer. Unit: 32us */
|
||||||
rtw_write16(Adapter, REG_TX_RPT_TIME, 0xCdf0);
|
rtw_write16(Adapter, REG_TX_RPT_TIME, 0xCdf0);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL, 0);
|
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL, 0);
|
||||||
|
@ -1467,14 +1424,14 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
||||||
pHalData->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (RF_RADIO_PATH_E)0, RF_CHNLBW, bRFRegOffsetMask);
|
pHalData->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (RF_RADIO_PATH_E)0, RF_CHNLBW, bRFRegOffsetMask);
|
||||||
pHalData->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (RF_RADIO_PATH_E)1, RF_CHNLBW, bRFRegOffsetMask);
|
pHalData->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (RF_RADIO_PATH_E)1, RF_CHNLBW, bRFRegOffsetMask);
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
|
||||||
_BBTurnOnBlock(Adapter);
|
_BBTurnOnBlock(Adapter);
|
||||||
/* NicIFSetMacAddress(padapter, padapter->PermanentAddress); */
|
/* NicIFSetMacAddress(padapter, padapter->PermanentAddress); */
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);
|
||||||
invalidate_cam_all(Adapter);
|
invalidate_cam_all(Adapter);
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
|
||||||
/* 2010/12/17 MH We need to set TX power according to EFUSE content at first. */
|
/* 2010/12/17 MH We need to set TX power according to EFUSE content at first. */
|
||||||
PHY_SetTxPowerLevel8188E(Adapter, pHalData->CurrentChannel);
|
PHY_SetTxPowerLevel8188E(Adapter, pHalData->CurrentChannel);
|
||||||
|
|
||||||
|
@ -1499,7 +1456,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
|
||||||
/* Nav limit , suggest by scott */
|
/* Nav limit , suggest by scott */
|
||||||
rtw_write8(Adapter, 0x652, 0x0);
|
rtw_write8(Adapter, 0x652, 0x0);
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
|
||||||
rtl8188e_InitHalDm(Adapter);
|
rtl8188e_InitHalDm(Adapter);
|
||||||
|
|
||||||
#if (MP_DRIVER == 1)
|
#if (MP_DRIVER == 1)
|
||||||
|
@ -1535,25 +1492,23 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
|
||||||
/* enable tx DMA to drop the redundate data of packet */
|
/* enable tx DMA to drop the redundate data of packet */
|
||||||
rtw_write16(Adapter,REG_TXDMA_OFFSET_CHK, (rtw_read16(Adapter,REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN));
|
rtw_write16(Adapter,REG_TXDMA_OFFSET_CHK, (rtw_read16(Adapter,REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN));
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
|
||||||
/* 2010/08/26 MH Merge from 8192CE. */
|
/* 2010/08/26 MH Merge from 8192CE. */
|
||||||
if(pwrctrlpriv->rf_pwrstate == rf_on)
|
if(pwrctrlpriv->rf_pwrstate == rf_on)
|
||||||
{
|
{
|
||||||
if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
|
if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
|
||||||
PHY_IQCalibrate_8188E(Adapter,true);
|
PHY_IQCalibrate_8188E(Adapter,true);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
PHY_IQCalibrate_8188E(Adapter,false);
|
PHY_IQCalibrate_8188E(Adapter,false);
|
||||||
pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
|
pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK);
|
||||||
|
|
||||||
ODM_TXPowerTrackingCheck(&pHalData->odmpriv );
|
ODM_TXPowerTrackingCheck(&pHalData->odmpriv );
|
||||||
|
|
||||||
|
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
|
||||||
PHY_LCCalibrate_8188E(Adapter);
|
PHY_LCCalibrate_8188E(Adapter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1566,7 +1521,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
|
||||||
rtw_write32(Adapter, REG_FWHW_TXQ_CTRL, rtw_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12));
|
rtw_write32(Adapter, REG_FWHW_TXQ_CTRL, rtw_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12));
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
|
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
|
||||||
|
|
||||||
DBG_871X("%s in %dms\n", __FUNCTION__, rtw_get_passing_time_ms(init_start_time));
|
DBG_871X("%s in %dms\n", __FUNCTION__, rtw_get_passing_time_ms(init_start_time));
|
||||||
|
|
||||||
|
@ -1582,10 +1537,6 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1598,11 +1549,10 @@ static void hal_poweroff_rtl8188eu(
|
||||||
IN struct adapter * Adapter
|
IN struct adapter * Adapter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); */
|
|
||||||
u8 val8;
|
u8 val8;
|
||||||
u16 val16;
|
u16 val16;
|
||||||
u32 val32;
|
u32 val32;
|
||||||
u8 bMacPwrCtrlOn=false;
|
u8 bMacPwrCtrlOn=false;
|
||||||
|
|
||||||
rtw_hal_get_hwreg(Adapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
|
rtw_hal_get_hwreg(Adapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
|
||||||
if(bMacPwrCtrlOn == false)
|
if(bMacPwrCtrlOn == false)
|
||||||
|
|
|
@ -228,7 +228,7 @@ static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
||||||
|
|
||||||
data = val;
|
data = val;
|
||||||
|
|
||||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata
|
||||||
|
|
||||||
wvalue = (u16)(addr&0x0000ffff);
|
wvalue = (u16)(addr&0x0000ffff);
|
||||||
len = length;
|
len = length;
|
||||||
memcpy(buf, pdata, len );
|
memcpy(buf, pdata, len );
|
||||||
|
|
||||||
return usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
|
return usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
|
||||||
}
|
}
|
||||||
|
@ -779,9 +779,6 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||||
struct recv_priv *precvpriv = &adapter->recvpriv;
|
struct recv_priv *precvpriv = &adapter->recvpriv;
|
||||||
struct usb_device *pusbd = pdvobj->pusbdev;
|
struct usb_device *pusbd = pdvobj->pusbdev;
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||dvobj_to_pwrctl(pdvobj)->pnp_bstop_trx)
|
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||dvobj_to_pwrctl(pdvobj)->pnp_bstop_trx)
|
||||||
{
|
{
|
||||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n"));
|
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n"));
|
||||||
|
@ -793,61 +790,56 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||||
precvbuf->reuse = true;
|
precvbuf->reuse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (precvbuf != NULL) {
|
rtl8188eu_init_recvbuf(adapter, precvbuf);
|
||||||
rtl8188eu_init_recvbuf(adapter, precvbuf);
|
|
||||||
|
|
||||||
/* re-assign for linux based on skb */
|
/* re-assign for linux based on skb */
|
||||||
if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) {
|
if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) {
|
||||||
precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||||
|
|
||||||
if (precvbuf->pskb == NULL) {
|
if (precvbuf->pskb == NULL) {
|
||||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n"));
|
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n"));
|
||||||
DBG_8192C("#### usb_read_port() alloc_skb fail!#####\n");
|
DBG_8192C("#### usb_read_port() alloc_skb fail!#####\n");
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
|
tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
|
||||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
|
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
|
||||||
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||||
|
|
||||||
precvbuf->phead = precvbuf->pskb->head;
|
precvbuf->phead = precvbuf->pskb->head;
|
||||||
precvbuf->pdata = precvbuf->pskb->data;
|
precvbuf->pdata = precvbuf->pskb->data;
|
||||||
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
|
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
|
||||||
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
|
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
|
||||||
precvbuf->pbuf = precvbuf->pskb->data;
|
precvbuf->pbuf = precvbuf->pskb->data;
|
||||||
} else/* reuse skb */
|
} else/* reuse skb */
|
||||||
{
|
{
|
||||||
precvbuf->phead = precvbuf->pskb->head;
|
precvbuf->phead = precvbuf->pskb->head;
|
||||||
precvbuf->pdata = precvbuf->pskb->data;
|
precvbuf->pdata = precvbuf->pskb->data;
|
||||||
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
|
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
|
||||||
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
|
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
|
||||||
precvbuf->pbuf = precvbuf->pskb->data;
|
precvbuf->pbuf = precvbuf->pskb->data;
|
||||||
|
|
||||||
precvbuf->reuse = false;
|
precvbuf->reuse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
precvpriv->rx_pending_cnt++;
|
precvpriv->rx_pending_cnt++;
|
||||||
|
|
||||||
purb = precvbuf->purb;
|
purb = precvbuf->purb;
|
||||||
|
|
||||||
/* translate DMA FIFO addr to pipehandle */
|
/* translate DMA FIFO addr to pipehandle */
|
||||||
pipe = ffaddr2pipehdl(pdvobj, addr);
|
pipe = ffaddr2pipehdl(pdvobj, addr);
|
||||||
|
|
||||||
usb_fill_bulk_urb(purb, pusbd, pipe, precvbuf->pbuf,
|
usb_fill_bulk_urb(purb, pusbd, pipe, precvbuf->pbuf,
|
||||||
MAX_RECVBUF_SZ, usb_read_port_complete,
|
MAX_RECVBUF_SZ, usb_read_port_complete,
|
||||||
precvbuf);/* context is precvbuf */
|
precvbuf);/* context is precvbuf */
|
||||||
|
|
||||||
err = usb_submit_urb(purb, GFP_ATOMIC);
|
err = usb_submit_urb(purb, GFP_ATOMIC);
|
||||||
if ((err) && (err != (-EPERM))) {
|
if ((err) && (err != (-EPERM))) {
|
||||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,
|
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,
|
||||||
("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x",
|
("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x",
|
||||||
err, purb->status));
|
err, purb->status));
|
||||||
DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",
|
DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",
|
||||||
err, purb->status);
|
err, purb->status);
|
||||||
ret = _FAIL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:precvbuf ==NULL\n"));
|
|
||||||
ret = _FAIL;
|
ret = _FAIL;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
#define CL_IPV6_PASS 1
|
#define CL_IPV6_PASS 1
|
||||||
#define MACADDRLEN 6
|
#define MACADDRLEN 6
|
||||||
#define _DEBUG_ERR DBG_8192C
|
#define _DEBUG_ERR DBG_8192C
|
||||||
#define _DEBUG_INFO //DBG_8192C
|
#define _DEBUG_INFO DBG_8192C
|
||||||
#define DEBUG_WARN DBG_8192C
|
#define DEBUG_WARN DBG_8192C
|
||||||
#define DEBUG_INFO //DBG_8192C
|
#define DEBUG_INFO DBG_8192C
|
||||||
#define DEBUG_ERR DBG_8192C
|
#define DEBUG_ERR DBG_8192C
|
||||||
#define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr)
|
#define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr)
|
||||||
|
|
||||||
|
|
|
@ -549,23 +549,20 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
|
|
||||||
memcpy(&cur_network->network, pnetwork, sizeof(struct wlan_bssid_ex));
|
memcpy(&cur_network->network, pnetwork, sizeof(struct wlan_bssid_ex));
|
||||||
if(cur_network)
|
if(cur_network) {
|
||||||
{
|
|
||||||
if (!rtw_cfg80211_inform_bss(padapter,cur_network))
|
if (!rtw_cfg80211_inform_bss(padapter,cur_network))
|
||||||
DBG_871X(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter));
|
DBG_871X(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter));
|
||||||
else
|
else
|
||||||
DBG_871X(FUNC_ADPT_FMT" inform success !!\n", FUNC_ADPT_ARG(padapter));
|
DBG_871X(FUNC_ADPT_FMT" inform success !!\n", FUNC_ADPT_ARG(padapter));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
DBG_871X("cur_network is not exist!!!\n");
|
DBG_871X("cur_network is not exist!!!\n");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
if (scanned == NULL) {
|
||||||
{
|
|
||||||
if(scanned == NULL)
|
|
||||||
rtw_warn_on(1);
|
rtw_warn_on(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true
|
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
|
&& _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true
|
||||||
|
@ -819,20 +816,18 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
|
||||||
|
|
||||||
psetkeyparm->set_tx = 1;
|
psetkeyparm->set_tx = 1;
|
||||||
|
|
||||||
switch(alg)
|
switch(alg) {
|
||||||
{
|
case _WEP40_:
|
||||||
case _WEP40_:
|
keylen = 5;
|
||||||
keylen = 5;
|
break;
|
||||||
break;
|
case _WEP104_:
|
||||||
case _WEP104_:
|
keylen = 13;
|
||||||
keylen = 13;
|
break;
|
||||||
break;
|
case _TKIP_:
|
||||||
case _TKIP_:
|
case _TKIP_WTMIC_:
|
||||||
case _TKIP_WTMIC_:
|
case _AES_:
|
||||||
case _AES_:
|
default:
|
||||||
keylen = 16;
|
keylen = 16;
|
||||||
default:
|
|
||||||
keylen = 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&(psetkeyparm->key[0]), key, keylen);
|
memcpy(&(psetkeyparm->key[0]), key, keylen);
|
||||||
|
@ -1226,12 +1221,11 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
||||||
|
|
||||||
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
||||||
|
|
||||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
||||||
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
|
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
|
||||||
|
|
||||||
if(wep_key_len==13)
|
if(wep_key_len==13) {
|
||||||
{
|
|
||||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
||||||
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
|
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
|
||||||
}
|
}
|
||||||
|
@ -1531,13 +1525,13 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
|
||||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(ndev);
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(ndev);
|
||||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
|
||||||
DBG_871X(FUNC_NDEV_FMT" key_index=%d, unicast=%d, multicast=%d\n",
|
DBG_871X(FUNC_NDEV_FMT" key_index=%d, unicast=%d, multicast=%d\n",
|
||||||
FUNC_NDEV_ARG(ndev), key_index , unicast, multicast);
|
FUNC_NDEV_ARG(ndev), key_index , unicast, multicast);
|
||||||
#else
|
#else
|
||||||
DBG_871X(FUNC_NDEV_FMT" key_index=%d\n", FUNC_NDEV_ARG(ndev),
|
DBG_871X(FUNC_NDEV_FMT" key_index=%d\n", FUNC_NDEV_ARG(ndev),
|
||||||
key_index);
|
key_index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) /* set wep default key */
|
if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) /* set wep default key */
|
||||||
{
|
{
|
||||||
|
@ -2011,18 +2005,12 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
if( pwdinfo->driver_interface == DRIVER_CFG80211 )
|
if( pwdinfo->driver_interface == DRIVER_CFG80211 )
|
||||||
{
|
{
|
||||||
if(ssids->ssid != NULL
|
if (_rtw_memcmp(ssids->ssid, "DIRECT-", 7) &&
|
||||||
&& _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
|
rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)) {
|
||||||
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
|
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
|
||||||
)
|
|
||||||
{
|
|
||||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
|
||||||
{
|
|
||||||
rtw_p2p_enable(padapter, P2P_ROLE_DEVICE);
|
rtw_p2p_enable(padapter, P2P_ROLE_DEVICE);
|
||||||
wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = true;
|
wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
||||||
#ifdef CONFIG_DEBUG_CFG80211
|
#ifdef CONFIG_DEBUG_CFG80211
|
||||||
DBG_8192C("%s, role=%d, p2p_state=%d\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo));
|
DBG_8192C("%s, role=%d, p2p_state=%d\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo));
|
||||||
|
@ -2030,22 +2018,17 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
}
|
}
|
||||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
||||||
|
|
||||||
if(request->n_channels == 3 &&
|
if (request->n_channels == 3 &&
|
||||||
request->channels[0]->hw_value == 1 &&
|
request->channels[0]->hw_value == 1 &&
|
||||||
request->channels[1]->hw_value == 6 &&
|
request->channels[1]->hw_value == 6 &&
|
||||||
request->channels[2]->hw_value == 11
|
request->channels[2]->hw_value == 11)
|
||||||
)
|
|
||||||
{
|
|
||||||
social_channel = 1;
|
social_channel = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_P2P */
|
#endif /* CONFIG_P2P */
|
||||||
|
|
||||||
if(request->ie && request->ie_len>0)
|
if(request->ie && request->ie_len>0)
|
||||||
{
|
|
||||||
rtw_cfg80211_set_probe_req_wpsp2pie(padapter, (u8 *)request->ie, request->ie_len );
|
rtw_cfg80211_set_probe_req_wpsp2pie(padapter, (u8 *)request->ie, request->ie_len );
|
||||||
}
|
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
|
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
|
||||||
DBG_8192C("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state);
|
DBG_8192C("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state);
|
||||||
|
@ -2057,8 +2040,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
goto check_need_indicate_scan_done;
|
goto check_need_indicate_scan_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == true)
|
if (pmlmepriv->LinkDetectInfo.bBusyTraffic) {
|
||||||
{
|
|
||||||
DBG_8192C("%s, bBusyTraffic == true\n", __func__);
|
DBG_8192C("%s, bBusyTraffic == true\n", __func__);
|
||||||
need_indicate_scan_done = true;
|
need_indicate_scan_done = true;
|
||||||
goto check_need_indicate_scan_done;
|
goto check_need_indicate_scan_done;
|
||||||
|
@ -2071,10 +2053,9 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
if( pwdinfo->driver_interface == DRIVER_CFG80211 )
|
if( pwdinfo->driver_interface == DRIVER_CFG80211 ) {
|
||||||
{
|
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) &&
|
||||||
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
!rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) {
|
||||||
{
|
|
||||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
|
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
|
||||||
rtw_free_network_queue(padapter, true);
|
rtw_free_network_queue(padapter, true);
|
||||||
|
|
||||||
|
@ -2086,7 +2067,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_P2P */
|
#endif /* CONFIG_P2P */
|
||||||
|
|
||||||
|
|
||||||
memset(ssid, 0, sizeof(NDIS_802_11_SSID)*RTW_SSID_SCAN_AMOUNT);
|
memset(ssid, 0, sizeof(NDIS_802_11_SSID)*RTW_SSID_SCAN_AMOUNT);
|
||||||
/* parsing request ssids, n_ssids */
|
/* parsing request ssids, n_ssids */
|
||||||
for (i = 0; i < request->n_ssids && i < RTW_SSID_SCAN_AMOUNT; i++) {
|
for (i = 0; i < request->n_ssids && i < RTW_SSID_SCAN_AMOUNT; i++) {
|
||||||
|
@ -2115,9 +2095,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
} else if (request->n_channels <= 4) {
|
} else if (request->n_channels <= 4) {
|
||||||
for(j=request->n_channels-1;j>=0;j--)
|
for(j=request->n_channels-1;j>=0;j--)
|
||||||
for(i=0;i<survey_times;i++)
|
for(i=0;i<survey_times;i++)
|
||||||
{
|
memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel));
|
||||||
memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel));
|
|
||||||
}
|
|
||||||
_status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels);
|
_status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels);
|
||||||
} else {
|
} else {
|
||||||
_status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0);
|
_status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0);
|
||||||
|
@ -2126,9 +2104,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
||||||
|
|
||||||
|
|
||||||
if(_status == false)
|
if(_status == false)
|
||||||
{
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
|
||||||
|
|
||||||
check_need_indicate_scan_done:
|
check_need_indicate_scan_done:
|
||||||
if(need_indicate_scan_done)
|
if(need_indicate_scan_done)
|
||||||
|
@ -2137,7 +2113,6 @@ check_need_indicate_scan_done:
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
|
static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
|
||||||
|
@ -2146,8 +2121,6 @@ static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 wpa_version)
|
static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 wpa_version)
|
||||||
{
|
{
|
||||||
DBG_8192C("%s, wpa_version=%d\n", __func__, wpa_version);
|
DBG_8192C("%s, wpa_version=%d\n", __func__, wpa_version);
|
||||||
|
@ -2157,21 +2130,10 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2))
|
if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2))
|
||||||
{
|
|
||||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK;
|
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (wpa_version & NL80211_WPA_VERSION_2)
|
|
||||||
{
|
|
||||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPA2PSK;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
||||||
|
@ -2182,30 +2144,23 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
||||||
|
|
||||||
switch (sme_auth_type) {
|
switch (sme_auth_type) {
|
||||||
case NL80211_AUTHTYPE_AUTOMATIC:
|
case NL80211_AUTHTYPE_AUTOMATIC:
|
||||||
|
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NL80211_AUTHTYPE_OPEN_SYSTEM:
|
case NL80211_AUTHTYPE_OPEN_SYSTEM:
|
||||||
|
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||||
|
|
||||||
if(psecuritypriv->ndisauthtype>Ndis802_11AuthModeWPA)
|
if(psecuritypriv->ndisauthtype>Ndis802_11AuthModeWPA)
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||||
break;
|
break;
|
||||||
case NL80211_AUTHTYPE_SHARED_KEY:
|
case NL80211_AUTHTYPE_SHARED_KEY:
|
||||||
|
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
|
||||||
|
|
||||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||||
/* return -ENOTSUPP; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast)
|
static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast)
|
||||||
|
@ -2217,7 +2172,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
|
||||||
|
|
||||||
DBG_8192C("%s, ucast=%d, cipher=0x%x\n", __func__, ucast, cipher);
|
DBG_8192C("%s, ucast=%d, cipher=0x%x\n", __func__, ucast, cipher);
|
||||||
|
|
||||||
|
|
||||||
if (!cipher) {
|
if (!cipher) {
|
||||||
*profile_cipher = _NO_PRIVACY_;
|
*profile_cipher = _NO_PRIVACY_;
|
||||||
psecuritypriv->ndisencryptstatus = ndisencryptstatus;
|
psecuritypriv->ndisencryptstatus = ndisencryptstatus;
|
||||||
|
@ -3030,8 +2984,9 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
|
||||||
|
|
||||||
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||||
|
|
||||||
if (skb)
|
if (!skb)
|
||||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
return -1;
|
||||||
|
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||||
|
|
||||||
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
|
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -5014,18 +4969,11 @@ static void rtw_cfg80211_preinit_wiphy(struct adapter *padapter, struct wiphy *w
|
||||||
wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR);
|
wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
wiphy->iface_combinations = &rtw_combinations;
|
|
||||||
wiphy->n_iface_combinations = 1;
|
|
||||||
*/
|
|
||||||
|
|
||||||
wiphy->cipher_suites = rtw_cipher_suites;
|
wiphy->cipher_suites = rtw_cipher_suites;
|
||||||
wiphy->n_cipher_suites = ARRAY_SIZE(rtw_cipher_suites);
|
wiphy->n_cipher_suites = ARRAY_SIZE(rtw_cipher_suites);
|
||||||
|
|
||||||
/* if (padapter->registrypriv.wireless_mode & WIRELESS_11G) */
|
wiphy->bands[IEEE80211_BAND_2GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_2GHZ);
|
||||||
wiphy->bands[IEEE80211_BAND_2GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_2GHZ);
|
wiphy->bands[IEEE80211_BAND_5GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_5GHZ);
|
||||||
/* if (padapter->registrypriv.wireless_mode & WIRELESS_11A) */
|
|
||||||
wiphy->bands[IEEE80211_BAND_5GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_5GHZ);
|
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) && LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) && LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0))
|
||||||
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS;
|
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS;
|
||||||
|
@ -5105,14 +5053,13 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rtw_mfree((u8*)wdev, sizeof(struct wireless_dev));
|
// rtw_mfree((u8*)wdev, sizeof(struct wireless_dev));
|
||||||
unregister_wiphy:
|
unregister_wiphy:
|
||||||
wiphy_unregister(wiphy);
|
wiphy_unregister(wiphy);
|
||||||
free_wiphy:
|
free_wiphy:
|
||||||
wiphy_free(wiphy);
|
wiphy_free(wiphy);
|
||||||
exit:
|
exit:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_wdev_free(struct wireless_dev *wdev)
|
void rtw_wdev_free(struct wireless_dev *wdev)
|
||||||
|
|
|
@ -226,6 +226,8 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
struct iw_request_info* info, struct wlan_network *pnetwork,
|
struct iw_request_info* info, struct wlan_network *pnetwork,
|
||||||
char *start, char *stop)
|
char *start, char *stop)
|
||||||
{
|
{
|
||||||
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||||
|
u8 ss, sq;
|
||||||
struct iw_event iwe;
|
struct iw_event iwe;
|
||||||
u16 cap;
|
u16 cap;
|
||||||
__le16 le_cap;
|
__le16 le_cap;
|
||||||
|
@ -529,10 +531,6 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
||||||
u8 ss, sq;
|
|
||||||
|
|
||||||
/* Add quality statistics */
|
/* Add quality statistics */
|
||||||
iwe.cmd = IWEVQUAL;
|
iwe.cmd = IWEVQUAL;
|
||||||
iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID;
|
iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID;
|
||||||
|
@ -557,7 +555,6 @@ static char *translate_scan(struct adapter *padapter,
|
||||||
iwe.u.qual.noise = 0; /* noise level */
|
iwe.u.qual.noise = 0; /* noise level */
|
||||||
|
|
||||||
start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN);
|
start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
u8 buf[MAX_WPA_IE_LEN];
|
u8 buf[MAX_WPA_IE_LEN];
|
||||||
|
@ -728,8 +725,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
|
||||||
ret = -EOPNOTSUPP ;
|
ret = -EOPNOTSUPP ;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
||||||
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
|
||||||
psecuritypriv->dot11DefKeylen[wep_key_idx]=pwep->KeyLength;
|
psecuritypriv->dot11DefKeylen[wep_key_idx]=pwep->KeyLength;
|
||||||
rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0,true);
|
rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0,true);
|
||||||
}
|
}
|
||||||
|
@ -1190,34 +1186,18 @@ static int rtw_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
|
||||||
|
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,(" rtw_wx_get_mode \n"));
|
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,(" rtw_wx_get_mode \n"));
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
|
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
|
||||||
{
|
|
||||||
wrqu->mode = IW_MODE_INFRA;
|
wrqu->mode = IW_MODE_INFRA;
|
||||||
}
|
|
||||||
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
|
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
|
||||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
|
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
|
||||||
|
|
||||||
{
|
|
||||||
wrqu->mode = IW_MODE_ADHOC;
|
wrqu->mode = IW_MODE_ADHOC;
|
||||||
}
|
|
||||||
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
||||||
{
|
|
||||||
wrqu->mode = IW_MODE_MASTER;
|
wrqu->mode = IW_MODE_MASTER;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
wrqu->mode = IW_MODE_AUTO;
|
wrqu->mode = IW_MODE_AUTO;
|
||||||
}
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int rtw_wx_set_pmkid(struct net_device *dev,
|
static int rtw_wx_set_pmkid(struct net_device *dev,
|
||||||
struct iw_request_info *a,
|
struct iw_request_info *a,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
|
@ -1232,22 +1212,16 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
||||||
u8 strIssueBssid[ ETH_ALEN ] = { 0x00 };
|
u8 strIssueBssid[ ETH_ALEN ] = { 0x00 };
|
||||||
|
|
||||||
memcpy( strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
|
memcpy( strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
|
||||||
if ( pPMK->cmd == IW_PMKSA_ADD )
|
if ( pPMK->cmd == IW_PMKSA_ADD ) {
|
||||||
{
|
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );
|
||||||
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );
|
if ( _rtw_memcmp( strIssueBssid, strZeroMacAddress, ETH_ALEN ) == true )
|
||||||
if ( _rtw_memcmp( strIssueBssid, strZeroMacAddress, ETH_ALEN ) == true )
|
return( intReturn );
|
||||||
{
|
else
|
||||||
return( intReturn );
|
intReturn = true;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
intReturn = true;
|
|
||||||
}
|
|
||||||
blInserted = false;
|
blInserted = false;
|
||||||
|
|
||||||
/* overwrite PMKID */
|
/* overwrite PMKID */
|
||||||
for(j=0 ; j<NUM_PMKID_CACHE; j++)
|
for(j=0 ; j<NUM_PMKID_CACHE; j++) {
|
||||||
{
|
|
||||||
if( _rtw_memcmp( psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true )
|
if( _rtw_memcmp( psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true )
|
||||||
{ /* BSSID is matched, the same AP => rewrite with new PMKID. */
|
{ /* BSSID is matched, the same AP => rewrite with new PMKID. */
|
||||||
|
|
||||||
|
@ -1261,8 +1235,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!blInserted)
|
if(!blInserted) {
|
||||||
{
|
|
||||||
/* Find a new entry */
|
/* Find a new entry */
|
||||||
DBG_871X( "[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n",
|
DBG_871X( "[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n",
|
||||||
psecuritypriv->PMKIDIndex );
|
psecuritypriv->PMKIDIndex );
|
||||||
|
@ -1273,17 +1246,12 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
||||||
psecuritypriv->PMKIDList[ psecuritypriv->PMKIDIndex ].bUsed = true;
|
psecuritypriv->PMKIDList[ psecuritypriv->PMKIDIndex ].bUsed = true;
|
||||||
psecuritypriv->PMKIDIndex++ ;
|
psecuritypriv->PMKIDIndex++ ;
|
||||||
if(psecuritypriv->PMKIDIndex==16)
|
if(psecuritypriv->PMKIDIndex==16)
|
||||||
{
|
|
||||||
psecuritypriv->PMKIDIndex =0;
|
psecuritypriv->PMKIDIndex =0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else if ( pPMK->cmd == IW_PMKSA_REMOVE ) {
|
||||||
else if ( pPMK->cmd == IW_PMKSA_REMOVE )
|
|
||||||
{
|
|
||||||
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" );
|
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" );
|
||||||
intReturn = true;
|
intReturn = true;
|
||||||
for(j=0 ; j<NUM_PMKID_CACHE; j++)
|
for(j=0 ; j<NUM_PMKID_CACHE; j++) {
|
||||||
{
|
|
||||||
if( _rtw_memcmp( psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true )
|
if( _rtw_memcmp( psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true )
|
||||||
{ /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
|
{ /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
|
||||||
memset( psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN );
|
memset( psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN );
|
||||||
|
@ -1291,15 +1259,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if ( pPMK->cmd == IW_PMKSA_FLUSH ) {
|
||||||
else if ( pPMK->cmd == IW_PMKSA_FLUSH )
|
|
||||||
{
|
|
||||||
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );
|
DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );
|
||||||
memset( &psecuritypriv->PMKIDList[ 0 ], 0x00, sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
|
memset( &psecuritypriv->PMKIDList[ 0 ], 0x00, sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE );
|
||||||
psecuritypriv->PMKIDIndex = 0;
|
psecuritypriv->PMKIDIndex = 0;
|
||||||
intReturn = true;
|
intReturn = true;
|
||||||
}
|
}
|
||||||
return( intReturn );
|
return( intReturn );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_wx_get_sens(struct net_device *dev,
|
static int rtw_wx_get_sens(struct net_device *dev,
|
||||||
|
@ -1353,7 +1319,7 @@ static int rtw_wx_get_range(struct net_device *dev,
|
||||||
|
|
||||||
range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
|
range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
|
||||||
/* TODO: Find real 'good' to 'bad' threshol value for RSSI */
|
/* TODO: Find real 'good' to 'bad' threshol value for RSSI */
|
||||||
range->avg_qual.level = 20 + -98;
|
range->avg_qual.level = 178; /* equals -78 */
|
||||||
range->avg_qual.noise = 0;
|
range->avg_qual.noise = 0;
|
||||||
range->avg_qual.updated = 7; /* Updated all three */
|
range->avg_qual.updated = 7; /* Updated all three */
|
||||||
|
|
||||||
|
@ -1462,8 +1428,8 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
||||||
|
|
||||||
authmode = padapter->securitypriv.ndisauthtype;
|
authmode = padapter->securitypriv.ndisauthtype;
|
||||||
spin_lock_bh(&queue->lock);
|
spin_lock_bh(&queue->lock);
|
||||||
phead = get_list_head(queue);
|
phead = get_list_head(queue);
|
||||||
pmlmepriv->pscanned = get_next(phead);
|
pmlmepriv->pscanned = get_next(phead);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
|
@ -1602,8 +1568,8 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(padapter->bDriverStopped){
|
if (padapter->bDriverStopped) {
|
||||||
DBG_871X("bDriverStopped=%d\n", padapter->bDriverStopped);
|
DBG_871X("bDriverStopped=%d\n", padapter->bDriverStopped);
|
||||||
ret= -1;
|
ret= -1;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -1830,10 +1796,8 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
while (check_fwstate(pmlmepriv, wait_status) == true)
|
if (check_fwstate(pmlmepriv, wait_status))
|
||||||
{
|
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||||
|
|
||||||
|
@ -1866,7 +1830,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
||||||
|
|
||||||
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
|
||||||
|
|
||||||
wrqu->data.length = ev-extra;
|
wrqu->data.length = ev-extra;
|
||||||
wrqu->data.flags = 0;
|
wrqu->data.flags = 0;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
@ -1964,8 +1928,8 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
||||||
|
|
||||||
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid=[%s]\n", src_ssid));
|
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid=[%s]\n", src_ssid));
|
||||||
spin_lock_bh(&queue->lock);
|
spin_lock_bh(&queue->lock);
|
||||||
phead = get_list_head(queue);
|
phead = get_list_head(queue);
|
||||||
pmlmepriv->pscanned = get_next(phead);
|
pmlmepriv->pscanned = get_next(phead);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == true) {
|
if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == true) {
|
||||||
|
@ -2078,9 +2042,7 @@ static int rtw_wx_set_rate(struct net_device *dev,
|
||||||
u32 target_rate = wrqu->bitrate.value;
|
u32 target_rate = wrqu->bitrate.value;
|
||||||
u32 fixed = wrqu->bitrate.fixed;
|
u32 fixed = wrqu->bitrate.fixed;
|
||||||
u32 ratevalue = 0;
|
u32 ratevalue = 0;
|
||||||
u8 mpdatarate[NumRates]={11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
|
u8 mpdatarate[NumRates]={11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,(" rtw_wx_set_rate \n"));
|
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,(" rtw_wx_set_rate \n"));
|
||||||
RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_info_,("target_rate = %d, fixed = %d\n",target_rate,fixed));
|
RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_info_,("target_rate = %d, fixed = %d\n",target_rate,fixed));
|
||||||
|
@ -2466,12 +2428,9 @@ static int rtw_wx_set_gen_ie(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||||
|
|
||||||
ret = rtw_set_wpa_ie(padapter, extra, wrqu->data.length);
|
return rtw_set_wpa_ie(padapter, extra, wrqu->data.length);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_wx_set_auth(struct net_device *dev,
|
static int rtw_wx_set_auth(struct net_device *dev,
|
||||||
|
@ -4203,7 +4162,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
||||||
if (!blnMatch) {
|
if (!blnMatch) {
|
||||||
sprintf(inv_proc_str, "\nIP=-1");
|
sprintf(inv_proc_str, "\nIP=-1");
|
||||||
} else {
|
} else {
|
||||||
if (attr_content[0] && 0x20)
|
if (attr_content[0] & 0x20)
|
||||||
sprintf(inv_proc_str, "\nIP=1");
|
sprintf(inv_proc_str, "\nIP=1");
|
||||||
else
|
else
|
||||||
sprintf(inv_proc_str, "\nIP=0");
|
sprintf(inv_proc_str, "\nIP=0");
|
||||||
|
@ -5380,7 +5339,7 @@ static int rtw_p2p_get2(struct net_device *dev,
|
||||||
|
|
||||||
if (copy_from_user(buffer, wrqu->data.pointer, wrqu->data.length))
|
if (copy_from_user(buffer, wrqu->data.pointer, wrqu->data.length))
|
||||||
{
|
{
|
||||||
ret - EFAULT;
|
ret = -EFAULT;
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5642,19 +5601,16 @@ static int rtw_dbg_port(struct net_device *dev,
|
||||||
rtw_hal_write_rfreg(padapter, minor_cmd, arg, 0xffffffff, extra_arg);
|
rtw_hal_write_rfreg(padapter, minor_cmd, arg, 0xffffffff, extra_arg);
|
||||||
DBG_871X("write RF_reg path(0x%02x),offset(0x%x),value(0x%08x)\n",minor_cmd,arg, rtw_hal_read_rfreg(padapter, minor_cmd, arg, 0xffffffff));
|
DBG_871X("write RF_reg path(0x%02x),offset(0x%x),value(0x%08x)\n",minor_cmd,arg, rtw_hal_read_rfreg(padapter, minor_cmd, arg, 0xffffffff));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x76:
|
case 0x76:
|
||||||
switch(minor_cmd)
|
switch(minor_cmd) {
|
||||||
{
|
case 0x00: /* normal mode, */
|
||||||
case 0x00: /* normal mode, */
|
padapter->recvpriv.is_signal_dbg = 0;
|
||||||
padapter->recvpriv.is_signal_dbg = 0;
|
break;
|
||||||
break;
|
case 0x01: /* dbg mode */
|
||||||
case 0x01: /* dbg mode */
|
padapter->recvpriv.is_signal_dbg = 1;
|
||||||
padapter->recvpriv.is_signal_dbg = 1;
|
extra_arg = extra_arg > 100 ? 100 : extra_arg;
|
||||||
extra_arg = extra_arg>100?100:extra_arg;
|
padapter->recvpriv.signal_strength_dbg=extra_arg;
|
||||||
extra_arg = extra_arg<0?0:extra_arg;
|
break;
|
||||||
padapter->recvpriv.signal_strength_dbg=extra_arg;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x78: /* IOL test */
|
case 0x78: /* IOL test */
|
||||||
|
@ -6252,31 +6208,23 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value)
|
||||||
|
|
||||||
switch (name){
|
switch (name){
|
||||||
case IEEE_PARAM_WPA_ENABLED:
|
case IEEE_PARAM_WPA_ENABLED:
|
||||||
|
|
||||||
padapter->securitypriv.dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; /* 802.1x */
|
padapter->securitypriv.dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; /* 802.1x */
|
||||||
|
|
||||||
/* ret = ieee80211_wpa_enable(ieee, value); */
|
switch((value)&0xff) {
|
||||||
|
case 1 : /* WPA */
|
||||||
switch((value)&0xff)
|
|
||||||
{
|
|
||||||
case 1 : /* WPA */
|
|
||||||
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */
|
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */
|
||||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled;
|
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled;
|
||||||
break;
|
break;
|
||||||
case 2: /* WPA2 */
|
case 2: /* WPA2 */
|
||||||
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK; /* WPA2_PSK */
|
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK; /* WPA2_PSK */
|
||||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled;
|
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_info_,("wpa_set_param:padapter->securitypriv.ndisauthtype=%d\n", padapter->securitypriv.ndisauthtype));
|
RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_info_,("wpa_set_param:padapter->securitypriv.ndisauthtype=%d\n", padapter->securitypriv.ndisauthtype));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IEEE_PARAM_TKIP_COUNTERMEASURES:
|
case IEEE_PARAM_TKIP_COUNTERMEASURES:
|
||||||
/* ieee->tkip_countermeasures=value; */
|
/* ieee->tkip_countermeasures=value; */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IEEE_PARAM_DROP_UNENCRYPTED:
|
case IEEE_PARAM_DROP_UNENCRYPTED:
|
||||||
/* HACK:
|
/* HACK:
|
||||||
*
|
*
|
||||||
|
@ -6483,7 +6431,6 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
|
||||||
case _TKIP_:
|
case _TKIP_:
|
||||||
case _TKIP_WTMIC_:
|
case _TKIP_WTMIC_:
|
||||||
case _AES_:
|
case _AES_:
|
||||||
keylen = 16;
|
|
||||||
default:
|
default:
|
||||||
keylen = 16;
|
keylen = 16;
|
||||||
}
|
}
|
||||||
|
@ -6629,13 +6576,10 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
|
||||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||||
psecuritypriv->dot118021XGrpPrivacy=_WEP40_;
|
psecuritypriv->dot118021XGrpPrivacy=_WEP40_;
|
||||||
|
|
||||||
if(pwep->KeyLength==13)
|
if (pwep->KeyLength==13) {
|
||||||
{
|
|
||||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
psecuritypriv->dot11PrivacyAlgrthm=_WEP104_;
|
||||||
psecuritypriv->dot118021XGrpPrivacy=_WEP104_;
|
psecuritypriv->dot118021XGrpPrivacy=_WEP104_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
|
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
|
||||||
|
|
||||||
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
||||||
|
@ -6643,17 +6587,13 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
|
||||||
psecuritypriv->dot11DefKeylen[wep_key_idx]=pwep->KeyLength;
|
psecuritypriv->dot11DefKeylen[wep_key_idx]=pwep->KeyLength;
|
||||||
|
|
||||||
set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx);
|
set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx);
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DBG_871X("wep, set_tx=0\n");
|
DBG_871X("wep, set_tx=0\n");
|
||||||
|
|
||||||
/* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */
|
/* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */
|
||||||
/* psecuritypriv->dot11PrivacyKeyIndex=keyid", but can rtw_set_key to cam */
|
/* psecuritypriv->dot11PrivacyKeyIndex=keyid", but can rtw_set_key to cam */
|
||||||
|
|
||||||
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
|
||||||
|
|
||||||
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
|
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
|
||||||
|
|
||||||
|
@ -7289,21 +7229,10 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param,
|
||||||
memcpy(ssid, ssid_ie+2, ssid_len);
|
memcpy(ssid, ssid_ie+2, ssid_len);
|
||||||
ssid[ssid_len>NDIS_802_11_LENGTH_SSID?NDIS_802_11_LENGTH_SSID:ssid_len] = 0x0;
|
ssid[ssid_len>NDIS_802_11_LENGTH_SSID?NDIS_802_11_LENGTH_SSID:ssid_len] = 0x0;
|
||||||
|
|
||||||
if(0)
|
|
||||||
DBG_871X(FUNC_ADPT_FMT" ssid:(%s,%d), from ie:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter),
|
|
||||||
ssid, ssid_len,
|
|
||||||
pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength,
|
|
||||||
pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength);
|
|
||||||
|
|
||||||
memcpy(pbss_network->Ssid.Ssid, (void *)ssid, ssid_len);
|
memcpy(pbss_network->Ssid.Ssid, (void *)ssid, ssid_len);
|
||||||
pbss_network->Ssid.SsidLength = ssid_len;
|
pbss_network->Ssid.SsidLength = ssid_len;
|
||||||
memcpy(pbss_network_ext->Ssid.Ssid, (void *)ssid, ssid_len);
|
memcpy(pbss_network_ext->Ssid.Ssid, (void *)ssid, ssid_len);
|
||||||
pbss_network_ext->Ssid.SsidLength = ssid_len;
|
pbss_network_ext->Ssid.SsidLength = ssid_len;
|
||||||
|
|
||||||
if(0)
|
|
||||||
DBG_871X(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter),
|
|
||||||
pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength,
|
|
||||||
pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG_871X(FUNC_ADPT_FMT" ignore_broadcast_ssid:%d, %s,%d\n", FUNC_ADPT_ARG(adapter),
|
DBG_871X(FUNC_ADPT_FMT" ignore_broadcast_ssid:%d, %s,%d\n", FUNC_ADPT_ARG(adapter),
|
||||||
|
@ -7794,8 +7723,7 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
|
|
||||||
if(strcmp(tmp[0], "status") == 0){
|
if(strcmp(tmp[0], "status") == 0){
|
||||||
sprintf(extra, "Load File efuse=%s,Load File MAC=%s",(pEEPROM->bloadfile_fail_flag? "FAIL" : "OK"),(pEEPROM->bloadmac_fail_flag? "FAIL" : "OK"));
|
sprintf(extra, "Load File efuse=%s,Load File MAC=%s",(pEEPROM->bloadfile_fail_flag? "FAIL" : "OK"),(pEEPROM->bloadmac_fail_flag? "FAIL" : "OK"));
|
||||||
|
goto exit;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "drvmap") == 0)
|
else if (strcmp(tmp[0], "drvmap") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7804,22 +7732,16 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
sprintf(extra, "\n");
|
sprintf(extra, "\n");
|
||||||
for (i = 0; i < EFUSE_MAP_SIZE; i += 16)
|
for (i = 0; i < EFUSE_MAP_SIZE; i += 16)
|
||||||
{
|
{
|
||||||
/* DBG_871X("0x%02x\t", i); */
|
|
||||||
sprintf(extra, "%s0x%02x\t", extra, i);
|
sprintf(extra, "%s0x%02x\t", extra, i);
|
||||||
for (j=0; j<8; j++) {
|
for (j=0; j<8; j++) {
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, PROMContent[i+j]);
|
sprintf(extra, "%s%02X ", extra, PROMContent[i+j]);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\t"); */
|
|
||||||
sprintf(extra, "%s\t", extra);
|
sprintf(extra, "%s\t", extra);
|
||||||
for (; j<16; j++) {
|
for (; j<16; j++) {
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, PROMContent[i+j]);
|
sprintf(extra, "%s%02X ", extra, PROMContent[i+j]);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
sprintf(extra,"%s\n",extra);
|
sprintf(extra,"%s\n",extra);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "realmap") == 0)
|
else if (strcmp(tmp[0], "realmap") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7831,30 +7753,23 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("OFFSET\tVALUE(hex)\n"); */
|
|
||||||
sprintf(extra, "\n");
|
sprintf(extra, "\n");
|
||||||
for (i = 0; i < EFUSE_MAP_SIZE; i += 16)
|
for (i = 0; i < EFUSE_MAP_SIZE; i += 16)
|
||||||
{
|
{
|
||||||
/* DBG_871X("0x%02x\t", i); */
|
|
||||||
sprintf(extra, "%s0x%02x\t", extra, i);
|
sprintf(extra, "%s0x%02x\t", extra, i);
|
||||||
for (j=0; j<8; j++) {
|
for (j=0; j<8; j++) {
|
||||||
if (i + j >= EFUSE_MAX_MAP_LEN)
|
if (i + j >= EFUSE_MAX_MAP_LEN)
|
||||||
continue;
|
continue;
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\t"); */
|
|
||||||
sprintf(extra, "%s\t", extra);
|
sprintf(extra, "%s\t", extra);
|
||||||
for (; j<16; j++) {
|
for (; j<16; j++) {
|
||||||
if (i + j >= EFUSE_MAX_MAP_LEN)
|
if (i + j >= EFUSE_MAX_MAP_LEN)
|
||||||
continue;
|
continue;
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
sprintf(extra,"%s\n",extra);
|
sprintf(extra,"%s\n",extra);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "rmap") == 0)
|
else if (strcmp(tmp[0], "rmap") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7893,13 +7808,10 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("%s: data={", __FUNCTION__); */
|
|
||||||
*extra = 0;
|
*extra = 0;
|
||||||
for (i=0; i<cnts; i++) {
|
for (i=0; i<cnts; i++) {
|
||||||
/* DBG_871X("0x%02x ", data[i]); */
|
|
||||||
sprintf(extra, "%s0x%02X ", extra, data[i]);
|
sprintf(extra, "%s0x%02X ", extra, data[i]);
|
||||||
}
|
}
|
||||||
/* DBG_871X("}\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "realraw") == 0)
|
else if (strcmp(tmp[0], "realraw") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7912,26 +7824,20 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("%s: realraw={\n", __FUNCTION__); */
|
|
||||||
sprintf(extra, "\n");
|
sprintf(extra, "\n");
|
||||||
for (i=0; i<mapLen; i++)
|
for (i=0; i<mapLen; i++)
|
||||||
{
|
{
|
||||||
/* DBG_871X("%02X", rawdata[i]); */
|
|
||||||
sprintf(extra, "%s%02X", extra, rawdata[i]);
|
sprintf(extra, "%s%02X", extra, rawdata[i]);
|
||||||
|
|
||||||
if ((i & 0xF) == 0xF) {
|
if ((i & 0xF) == 0xF) {
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
sprintf(extra, "%s\n", extra);
|
sprintf(extra, "%s\n", extra);
|
||||||
}
|
}
|
||||||
else if ((i & 0x7) == 0x7){
|
else if ((i & 0x7) == 0x7){
|
||||||
/* DBG_871X("\t"); */
|
|
||||||
sprintf(extra, "%s\t", extra);
|
sprintf(extra, "%s\t", extra);
|
||||||
} else {
|
} else {
|
||||||
/* DBG_871X(" "); */
|
|
||||||
sprintf(extra, "%s ", extra);
|
sprintf(extra, "%s ", extra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* DBG_871X("}\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "mac") == 0)
|
else if (strcmp(tmp[0], "mac") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7956,15 +7862,10 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
*extra = 0;
|
*extra = 0;
|
||||||
for (i=0; i<cnts; i++)
|
for (i=0; i<cnts; i++)
|
||||||
{
|
{
|
||||||
/* DBG_871X("%02X", data[i]); */
|
|
||||||
sprintf(extra, "%s%02X", extra, data[i]);
|
sprintf(extra, "%s%02X", extra, data[i]);
|
||||||
if (i != (cnts-1))
|
if (i != (cnts-1))
|
||||||
{
|
|
||||||
/* DBG_871X(":"); */
|
|
||||||
sprintf(extra,"%s:",extra);
|
sprintf(extra,"%s:",extra);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* DBG_871X("}\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "vidpid") == 0)
|
else if (strcmp(tmp[0], "vidpid") == 0)
|
||||||
{
|
{
|
||||||
|
@ -7984,19 +7885,13 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("%s: {VID,PID}={", __FUNCTION__); */
|
|
||||||
*extra = 0;
|
*extra = 0;
|
||||||
for (i=0; i<cnts; i++)
|
for (i=0; i<cnts; i++)
|
||||||
{
|
{
|
||||||
/* DBG_871X("0x%02x", data[i]); */
|
|
||||||
sprintf(extra, "%s0x%02X", extra, data[i]);
|
sprintf(extra, "%s0x%02X", extra, data[i]);
|
||||||
if (i != (cnts-1))
|
if (i != (cnts-1))
|
||||||
{
|
|
||||||
/* DBG_871X(","); */
|
|
||||||
sprintf(extra,"%s,",extra);
|
sprintf(extra,"%s,",extra);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* DBG_871X("}\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0], "ableraw") == 0)
|
else if (strcmp(tmp[0], "ableraw") == 0)
|
||||||
{
|
{
|
||||||
|
@ -8014,26 +7909,17 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("OFFSET\tVALUE(hex)\n"); */
|
|
||||||
sprintf(extra, "\n");
|
sprintf(extra, "\n");
|
||||||
for (i=0; i<512; i+=16) /* set 512 because the iwpriv's extra size have limit 0x7FF */
|
for (i=0; i<512; i+=16) /* set 512 because the iwpriv's extra size have limit 0x7FF */
|
||||||
{
|
{
|
||||||
/* DBG_871X("0x%03x\t", i); */
|
|
||||||
sprintf(extra, "%s0x%03x\t", extra, i);
|
sprintf(extra, "%s0x%03x\t", extra, i);
|
||||||
for (j=0; j<8; j++) {
|
for (j=0; j<8; j++)
|
||||||
/* DBG_871X("%02X ", pEfuseHal->BTEfuseInitMap[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
||||||
}
|
|
||||||
/* DBG_871X("\t"); */
|
|
||||||
sprintf(extra,"%s\t",extra);
|
sprintf(extra,"%s\t",extra);
|
||||||
for (; j<16; j++) {
|
for (; j<16; j++)
|
||||||
/* DBG_871X("%02X ", pEfuseHal->BTEfuseInitMap[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
||||||
}
|
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
sprintf(extra, "%s\n", extra);
|
sprintf(extra, "%s\n", extra);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0],"btbmap") == 0)
|
else if (strcmp(tmp[0],"btbmap") == 0)
|
||||||
{
|
{
|
||||||
|
@ -8045,27 +7931,17 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DBG_871X("OFFSET\tVALUE(hex)\n"); */
|
|
||||||
sprintf(extra, "\n");
|
sprintf(extra, "\n");
|
||||||
for (i=512; i<1024 ; i+=16)
|
for (i=512; i<1024 ; i+=16)
|
||||||
{
|
{
|
||||||
/* DBG_871X("0x%03x\t", i); */
|
|
||||||
sprintf(extra, "%s0x%03x\t", extra, i);
|
sprintf(extra, "%s0x%03x\t", extra, i);
|
||||||
for (j=0; j<8; j++)
|
for (j=0; j<8; j++)
|
||||||
{
|
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
||||||
}
|
|
||||||
/* DBG_871X("\t"); */
|
|
||||||
sprintf(extra,"%s\t",extra);
|
sprintf(extra,"%s\t",extra);
|
||||||
for (; j<16; j++) {
|
for (; j<16; j++)
|
||||||
/* DBG_871X("%02X ", data[i+j]); */
|
|
||||||
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]);
|
||||||
}
|
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
sprintf(extra, "%s\n", extra);
|
sprintf(extra, "%s\n", extra);
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
|
||||||
}
|
}
|
||||||
else if (strcmp(tmp[0],"btrmap") == 0)
|
else if (strcmp(tmp[0],"btrmap") == 0)
|
||||||
{
|
{
|
||||||
|
@ -8188,65 +8064,53 @@ static int rtw_mp_efuse_get(struct net_device *dev,
|
||||||
}
|
}
|
||||||
/* DBG_871X("\n"); */
|
/* DBG_871X("\n"); */
|
||||||
|
|
||||||
}
|
} else if (strcmp(tmp[0],"wlrfkrmap")== 0) {
|
||||||
else if (strcmp(tmp[0],"wlrfkrmap")== 0)
|
if ((tmp[1]==NULL) || (tmp[2]==NULL)) {
|
||||||
{
|
DBG_871X("%s: rmap Fail!! Parameters error!\n", __FUNCTION__);
|
||||||
if ((tmp[1]==NULL) || (tmp[2]==NULL))
|
err = -EINVAL;
|
||||||
{
|
goto exit;
|
||||||
DBG_871X("%s: rmap Fail!! Parameters error!\n", __FUNCTION__);
|
}
|
||||||
err = -EINVAL;
|
/* rmap addr cnts */
|
||||||
goto exit;
|
addr = simple_strtoul(tmp[1], &ptmp, 16);
|
||||||
}
|
DBG_871X("%s: addr=%x\n", __FUNCTION__, addr);
|
||||||
/* rmap addr cnts */
|
|
||||||
addr = simple_strtoul(tmp[1], &ptmp, 16);
|
|
||||||
DBG_871X("%s: addr=%x\n", __FUNCTION__, addr);
|
|
||||||
|
|
||||||
cnts = simple_strtoul(tmp[2], &ptmp, 10);
|
cnts = simple_strtoul(tmp[2], &ptmp, 10);
|
||||||
if (cnts == 0)
|
if (cnts == 0) {
|
||||||
{
|
DBG_871X("%s: rmap Fail!! cnts error!\n", __FUNCTION__);
|
||||||
DBG_871X("%s: rmap Fail!! cnts error!\n", __FUNCTION__);
|
err = -EINVAL;
|
||||||
err = -EINVAL;
|
goto exit;
|
||||||
goto exit;
|
}
|
||||||
}
|
DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts);
|
||||||
DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts);
|
|
||||||
|
|
||||||
/* DBG_871X("%s: data={", __FUNCTION__); */
|
*extra = 0;
|
||||||
*extra = 0;
|
for (i=0; i<cnts; i++) {
|
||||||
for (i=0; i<cnts; i++) {
|
DBG_871X("wlrfkrmap = 0x%02x \n", pEfuseHal->fakeEfuseModifiedMap[addr+i]);
|
||||||
DBG_871X("wlrfkrmap = 0x%02x \n", pEfuseHal->fakeEfuseModifiedMap[addr+i]);
|
sprintf(extra, "%s0x%02X ", extra, pEfuseHal->fakeEfuseModifiedMap[addr+i]);
|
||||||
sprintf(extra, "%s0x%02X ", extra, pEfuseHal->fakeEfuseModifiedMap[addr+i]);
|
}
|
||||||
}
|
} else if (strcmp(tmp[0],"btrfkrmap")== 0) {
|
||||||
}
|
if ((tmp[1]==NULL) || (tmp[2]==NULL)) {
|
||||||
else if (strcmp(tmp[0],"btrfkrmap")== 0)
|
DBG_871X("%s: rmap Fail!! Parameters error!\n", __FUNCTION__);
|
||||||
{
|
err = -EINVAL;
|
||||||
if ((tmp[1]==NULL) || (tmp[2]==NULL))
|
goto exit;
|
||||||
{
|
}
|
||||||
DBG_871X("%s: rmap Fail!! Parameters error!\n", __FUNCTION__);
|
/* rmap addr cnts */
|
||||||
err = -EINVAL;
|
addr = simple_strtoul(tmp[1], &ptmp, 16);
|
||||||
goto exit;
|
DBG_871X("%s: addr=%x\n", __FUNCTION__, addr);
|
||||||
}
|
|
||||||
/* rmap addr cnts */
|
|
||||||
addr = simple_strtoul(tmp[1], &ptmp, 16);
|
|
||||||
DBG_871X("%s: addr=%x\n", __FUNCTION__, addr);
|
|
||||||
|
|
||||||
cnts = simple_strtoul(tmp[2], &ptmp, 10);
|
cnts = simple_strtoul(tmp[2], &ptmp, 10);
|
||||||
if (cnts == 0)
|
if (cnts == 0) {
|
||||||
{
|
DBG_871X("%s: rmap Fail!! cnts error!\n", __FUNCTION__);
|
||||||
DBG_871X("%s: rmap Fail!! cnts error!\n", __FUNCTION__);
|
err = -EINVAL;
|
||||||
err = -EINVAL;
|
goto exit;
|
||||||
goto exit;
|
}
|
||||||
}
|
DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts);
|
||||||
DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts);
|
|
||||||
|
|
||||||
/* DBG_871X("%s: data={", __FUNCTION__); */
|
*extra = 0;
|
||||||
*extra = 0;
|
for (i=0; i<cnts; i++) {
|
||||||
for (i=0; i<cnts; i++) {
|
DBG_871X("wlrfkrmap = 0x%02x \n", pEfuseHal->fakeBTEfuseModifiedMap[addr+i]);
|
||||||
DBG_871X("wlrfkrmap = 0x%02x \n", pEfuseHal->fakeBTEfuseModifiedMap[addr+i]);
|
sprintf(extra, "%s0x%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[addr+i]);
|
||||||
sprintf(extra, "%s0x%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[addr+i]);
|
}
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf(extra, "Command not found!");
|
sprintf(extra, "Command not found!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8706,18 +8570,14 @@ static int rtw_wfd_tdls_enable(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_weaksec(struct net_device *dev,
|
static int rtw_tdls_weaksec(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8725,92 +8585,70 @@ static int rtw_tdls_enable(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_setup(struct net_device *dev,
|
static int rtw_tdls_setup(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_teardown(struct net_device *dev,
|
static int rtw_tdls_teardown(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_discovery(struct net_device *dev,
|
static int rtw_tdls_discovery(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_ch_switch(struct net_device *dev,
|
static int rtw_tdls_ch_switch(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_pson(struct net_device *dev,
|
static int rtw_tdls_pson(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_psoff(struct net_device *dev,
|
static int rtw_tdls_psoff(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_setip(struct net_device *dev,
|
static int rtw_tdls_setip(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_getip(struct net_device *dev,
|
static int rtw_tdls_getip(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_getport(struct net_device *dev,
|
static int rtw_tdls_getport(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WFDTDLS, for sigma test */
|
/* WFDTDLS, for sigma test */
|
||||||
|
@ -8818,11 +8656,7 @@ static int rtw_tdls_dis_result(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WFDTDLS, for sigma test */
|
/* WFDTDLS, for sigma test */
|
||||||
|
@ -8830,28 +8664,21 @@ static int rtw_wfd_tdls_status(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls_ch_switch_off(struct net_device *dev,
|
static int rtw_tdls_ch_switch_off(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_tdls(struct net_device *dev,
|
static int rtw_tdls(struct net_device *dev,
|
||||||
struct iw_request_info *info,
|
struct iw_request_info *info,
|
||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8886,10 +8713,6 @@ static int rtw_tdls_get(struct net_device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
#ifdef CONFIG_MAC_LOOPBACK_DRIVER
|
||||||
|
|
||||||
#include <rtl8188e_hal.h>
|
#include <rtl8188e_hal.h>
|
||||||
|
@ -9671,20 +9494,17 @@ static iw_handler rtw_private_handler[] =
|
||||||
#if WIRELESS_EXT >= 17
|
#if WIRELESS_EXT >= 17
|
||||||
static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
|
static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||||
struct iw_statistics *piwstats=&padapter->iwstats;
|
struct iw_statistics *piwstats=&padapter->iwstats;
|
||||||
int tmp_level = 0;
|
int tmp_level = 0;
|
||||||
int tmp_qual = 0;
|
int tmp_qual = 0;
|
||||||
int tmp_noise = 0;
|
int tmp_noise = 0;
|
||||||
|
|
||||||
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) != true)
|
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) != true) {
|
||||||
{
|
|
||||||
piwstats->qual.qual = 0;
|
piwstats->qual.qual = 0;
|
||||||
piwstats->qual.level = 0;
|
piwstats->qual.level = 0;
|
||||||
piwstats->qual.noise = 0;
|
piwstats->qual.noise = 0;
|
||||||
/* DBG_871X("No link level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, tmp_noise); */
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
tmp_level = padapter->recvpriv.signal_strength;
|
tmp_level = padapter->recvpriv.signal_strength;
|
||||||
#ifdef CONFIG_BT_COEXIST
|
#ifdef CONFIG_BT_COEXIST
|
||||||
{
|
{
|
||||||
|
@ -9696,7 +9516,6 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
|
||||||
|
|
||||||
tmp_qual = padapter->recvpriv.signal_qual;
|
tmp_qual = padapter->recvpriv.signal_qual;
|
||||||
tmp_noise =padapter->recvpriv.noise;
|
tmp_noise =padapter->recvpriv.noise;
|
||||||
/* DBG_871X("level:%d, qual:%d, noise:%d, rssi (%d)\n", tmp_level, tmp_qual, tmp_noise,padapter->recvpriv.rssi); */
|
|
||||||
|
|
||||||
piwstats->qual.level = tmp_level;
|
piwstats->qual.level = tmp_level;
|
||||||
piwstats->qual.qual = tmp_qual;
|
piwstats->qual.qual = tmp_qual;
|
||||||
|
|
|
@ -178,21 +178,14 @@ void rtw_reset_securitypriv( struct adapter *adapter )
|
||||||
|
|
||||||
void rtw_os_indicate_disconnect( struct adapter *adapter )
|
void rtw_os_indicate_disconnect( struct adapter *adapter )
|
||||||
{
|
{
|
||||||
/* RT_PMKID_LIST backupPMKIDList[ NUM_PMKID_CACHE ]; */
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */
|
netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */
|
||||||
|
|
||||||
rtw_cfg80211_indicate_disconnect(adapter);
|
rtw_cfg80211_indicate_disconnect(adapter);
|
||||||
|
|
||||||
rtw_indicate_wx_disassoc_event(adapter);
|
rtw_indicate_wx_disassoc_event(adapter);
|
||||||
|
|
||||||
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
||||||
rtw_reset_securitypriv_cmd(adapter);
|
rtw_reset_securitypriv_cmd(adapter);
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
|
void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
|
||||||
|
@ -201,13 +194,10 @@ void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
|
||||||
u8 *buff,*p,i;
|
u8 *buff,*p,i;
|
||||||
union iwreq_data wrqu;
|
union iwreq_data wrqu;
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("+rtw_report_sec_ie, authmode=%d\n", authmode));
|
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("+rtw_report_sec_ie, authmode=%d\n", authmode));
|
||||||
|
|
||||||
buff = NULL;
|
buff = NULL;
|
||||||
if(authmode==_WPA_IE_ID_)
|
if(authmode==_WPA_IE_ID_) {
|
||||||
{
|
|
||||||
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode));
|
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode));
|
||||||
|
|
||||||
buff = rtw_malloc(IW_CUSTOM_MAX);
|
buff = rtw_malloc(IW_CUSTOM_MAX);
|
||||||
|
|
|
@ -1294,7 +1294,7 @@ static int ips_netdrv_open(struct adapter *padapter)
|
||||||
rtw_set_pwr_state_check_timer(adapter_to_pwrctl(padapter));
|
rtw_set_pwr_state_check_timer(adapter_to_pwrctl(padapter));
|
||||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer,5000);
|
_set_timer(&padapter->mlmepriv.dynamic_chk_timer,5000);
|
||||||
|
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
|
|
||||||
netdev_open_error:
|
netdev_open_error:
|
||||||
/* padapter->bup = false; */
|
/* padapter->bup = false; */
|
||||||
|
|
|
@ -51,21 +51,19 @@ u32 rtw_atoi(u8* s)
|
||||||
|
|
||||||
int num=0,flag=0;
|
int num=0,flag=0;
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<=strlen(s);i++)
|
for(i=0;i<=strlen(s);i++) {
|
||||||
{
|
if(s[i] >= '0' && s[i] <= '9')
|
||||||
if(s[i] >= '0' && s[i] <= '9')
|
num = num * 10 + s[i] -'0';
|
||||||
num = num * 10 + s[i] -'0';
|
else if(s[0] == '-' && i==0)
|
||||||
else if(s[0] == '-' && i==0)
|
flag =1;
|
||||||
flag =1;
|
else
|
||||||
else
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag == 1)
|
if(flag == 1)
|
||||||
num = num * -1;
|
num = num * -1;
|
||||||
|
|
||||||
return(num);
|
|
||||||
|
|
||||||
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u8* _rtw_vmalloc(u32 sz)
|
inline u8* _rtw_vmalloc(u32 sz)
|
||||||
|
@ -1166,13 +1164,14 @@ RETURN:
|
||||||
int rtw_change_ifname(struct adapter *padapter, const char *ifname)
|
int rtw_change_ifname(struct adapter *padapter, const char *ifname)
|
||||||
{
|
{
|
||||||
struct net_device *pnetdev;
|
struct net_device *pnetdev;
|
||||||
struct net_device *cur_pnetdev = padapter->pnetdev;
|
struct net_device *cur_pnetdev;
|
||||||
struct rereg_nd_name_data *rereg_priv;
|
struct rereg_nd_name_data *rereg_priv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if(!padapter)
|
if(!padapter)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
cur_pnetdev = padapter->pnetdev;
|
||||||
rereg_priv = &padapter->rereg_nd_name_priv;
|
rereg_priv = &padapter->rereg_nd_name_priv;
|
||||||
|
|
||||||
/* free the old_pnetdev */
|
/* free the old_pnetdev */
|
||||||
|
|
|
@ -211,6 +211,8 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!precv_frame)
|
||||||
|
goto _recv_indicatepkt_drop;
|
||||||
skb = precv_frame->u.hdr.pkt;
|
skb = precv_frame->u.hdr.pkt;
|
||||||
if(skb == NULL)
|
if(skb == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -459,7 +459,7 @@ void rtw_dev_unload(struct adapter *padapter)
|
||||||
|
|
||||||
/* s4. */
|
/* s4. */
|
||||||
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
|
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
|
||||||
rtw_stop_drv_threads(padapter);
|
rtw_stop_drv_threads(padapter);
|
||||||
|
|
||||||
|
|
||||||
/* s5. */
|
/* s5. */
|
||||||
|
@ -508,8 +508,6 @@ int rtw_hw_suspend(struct adapter *padapter )
|
||||||
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
|
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
|
||||||
struct net_device *pnetdev = padapter->pnetdev;
|
struct net_device *pnetdev = padapter->pnetdev;
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
|
||||||
{
|
{
|
||||||
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
|
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
|
||||||
|
@ -517,57 +515,49 @@ int rtw_hw_suspend(struct adapter *padapter )
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(padapter)/* system suspend */
|
LeaveAllPowerSaveMode(padapter);
|
||||||
|
|
||||||
|
DBG_871X("==> rtw_hw_suspend\n");
|
||||||
|
_enter_pwrlock(&pwrpriv->lock);
|
||||||
|
pwrpriv->bips_processing = true;
|
||||||
|
/* s1. */
|
||||||
|
if(pnetdev)
|
||||||
{
|
{
|
||||||
LeaveAllPowerSaveMode(padapter);
|
netif_carrier_off(pnetdev);
|
||||||
|
rtw_netif_stop_queue(pnetdev);
|
||||||
DBG_871X("==> rtw_hw_suspend\n");
|
|
||||||
_enter_pwrlock(&pwrpriv->lock);
|
|
||||||
pwrpriv->bips_processing = true;
|
|
||||||
/* padapter->net_closed = true; */
|
|
||||||
/* s1. */
|
|
||||||
if(pnetdev)
|
|
||||||
{
|
|
||||||
netif_carrier_off(pnetdev);
|
|
||||||
rtw_netif_stop_queue(pnetdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* s2. */
|
|
||||||
rtw_disassoc_cmd(padapter, 500, false);
|
|
||||||
|
|
||||||
/* s2-2. indicate disconnect to os */
|
|
||||||
/* rtw_indicate_disconnect(padapter); */
|
|
||||||
{
|
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
||||||
|
|
||||||
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
|
||||||
{
|
|
||||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
|
||||||
|
|
||||||
rtw_led_control(padapter, LED_CTL_NO_LINK);
|
|
||||||
|
|
||||||
rtw_os_indicate_disconnect(padapter);
|
|
||||||
|
|
||||||
/* donnot enqueue cmd */
|
|
||||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
/* s2-3. */
|
|
||||||
rtw_free_assoc_resources(padapter, 1);
|
|
||||||
|
|
||||||
/* s2-4. */
|
|
||||||
rtw_free_network_queue(padapter,true);
|
|
||||||
rtw_ips_dev_unload(padapter);
|
|
||||||
pwrpriv->rf_pwrstate = rf_off;
|
|
||||||
pwrpriv->bips_processing = false;
|
|
||||||
|
|
||||||
_exit_pwrlock(&pwrpriv->lock);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
goto error_exit;
|
|
||||||
|
|
||||||
;
|
/* s2. */
|
||||||
|
rtw_disassoc_cmd(padapter, 500, false);
|
||||||
|
|
||||||
|
/* s2-2. indicate disconnect to os */
|
||||||
|
{
|
||||||
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
|
|
||||||
|
if(check_fwstate(pmlmepriv, _FW_LINKED))
|
||||||
|
{
|
||||||
|
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||||
|
|
||||||
|
rtw_led_control(padapter, LED_CTL_NO_LINK);
|
||||||
|
|
||||||
|
rtw_os_indicate_disconnect(padapter);
|
||||||
|
|
||||||
|
/* donnot enqueue cmd */
|
||||||
|
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/* s2-3. */
|
||||||
|
rtw_free_assoc_resources(padapter, 1);
|
||||||
|
|
||||||
|
/* s2-4. */
|
||||||
|
rtw_free_network_queue(padapter,true);
|
||||||
|
rtw_ips_dev_unload(padapter);
|
||||||
|
pwrpriv->rf_pwrstate = rf_off;
|
||||||
|
pwrpriv->bips_processing = false;
|
||||||
|
|
||||||
|
_exit_pwrlock(&pwrpriv->lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_exit:
|
error_exit:
|
||||||
|
@ -578,21 +568,21 @@ error_exit:
|
||||||
|
|
||||||
int rtw_hw_resume(struct adapter *padapter)
|
int rtw_hw_resume(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
struct pwrctrl_priv *pwrpriv;
|
||||||
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
|
struct usb_interface *pusb_intf;
|
||||||
struct net_device *pnetdev = padapter->pnetdev;
|
struct net_device *pnetdev;
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
if(padapter)/* system resume */
|
if(padapter)/* system resume */
|
||||||
{
|
{
|
||||||
|
pwrpriv = adapter_to_pwrctl(padapter);
|
||||||
|
pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
|
||||||
|
pnetdev = padapter->pnetdev;
|
||||||
DBG_871X("==> rtw_hw_resume\n");
|
DBG_871X("==> rtw_hw_resume\n");
|
||||||
_enter_pwrlock(&pwrpriv->lock);
|
_enter_pwrlock(&pwrpriv->lock);
|
||||||
pwrpriv->bips_processing = true;
|
pwrpriv->bips_processing = true;
|
||||||
rtw_reset_drv_sw(padapter);
|
rtw_reset_drv_sw(padapter);
|
||||||
|
|
||||||
if(pm_netdev_open(pnetdev,false) != 0)
|
if(pm_netdev_open(pnetdev,false) != 0) {
|
||||||
{
|
|
||||||
_exit_pwrlock(&pwrpriv->lock);
|
_exit_pwrlock(&pwrpriv->lock);
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
@ -612,14 +602,10 @@ int rtw_hw_resume(struct adapter *padapter)
|
||||||
pwrpriv->bips_processing = false;
|
pwrpriv->bips_processing = false;
|
||||||
|
|
||||||
_exit_pwrlock(&pwrpriv->lock);
|
_exit_pwrlock(&pwrpriv->lock);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error_exit:
|
error_exit:
|
||||||
DBG_871X("%s, Open net dev failed \n",__FUNCTION__);
|
DBG_871X("%s, Open net dev failed \n",__FUNCTION__);
|
||||||
|
@ -694,7 +680,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
|
||||||
struct adapter *padapter = dvobj->if1;
|
struct adapter *padapter = dvobj->if1;
|
||||||
struct net_device *pnetdev = padapter->pnetdev;
|
struct net_device *pnetdev = padapter->pnetdev;
|
||||||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if(pwrpriv->bInternalAutoSuspend ){
|
if(pwrpriv->bInternalAutoSuspend ){
|
||||||
ret = rtw_resume_process(padapter);
|
ret = rtw_resume_process(padapter);
|
||||||
|
|
|
@ -311,7 +311,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||||
/* struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data; */
|
/* struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data; */
|
||||||
/* struct adapter *padapter = pxmitframe->padapter; */
|
/* struct adapter *padapter = pxmitframe->padapter; */
|
||||||
struct adapter *padapter = pxmitbuf->padapter;
|
struct adapter *padapter = pxmitbuf->padapter;
|
||||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||||
/* struct pkt_attrib *pattrib = &pxmitframe->attrib; */
|
/* struct pkt_attrib *pattrib = &pxmitframe->attrib; */
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
@ -53,33 +53,22 @@ uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
|
||||||
{
|
{
|
||||||
uint len = 0;
|
uint len = 0;
|
||||||
|
|
||||||
;
|
len = rtw_remainder_len(pfile);
|
||||||
|
|
||||||
len = rtw_remainder_len(pfile);
|
|
||||||
len = (rlen > len)? len: rlen;
|
len = (rlen > len)? len: rlen;
|
||||||
|
|
||||||
if(rmem)
|
if (rmem)
|
||||||
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
|
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
|
||||||
|
|
||||||
pfile->cur_addr += len;
|
|
||||||
pfile->pkt_len -= len;
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
|
pfile->cur_addr += len;
|
||||||
|
pfile->pkt_len -= len;
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
sint rtw_endofpktfile(struct pkt_file *pfile)
|
sint rtw_endofpktfile(struct pkt_file *pfile)
|
||||||
{
|
{
|
||||||
;
|
|
||||||
|
|
||||||
if (pfile->pkt_len == 0) {
|
if (pfile->pkt_len == 0) {
|
||||||
;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue