ifeq ($(CONFIG_PLATFORM_ARM_RK3188), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE
+EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN
EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT
ARCH := arm
CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
-MODULE_NAME := 8188eu
+MODULE_NAME := wlan
endif
ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y)
//report_del_sta_event(padapter, psta->hwaddr, reason);\r
\r
//clear cam entry / key\r
- rtw_clearstakey_cmd(padapter, (u8*)psta, (u8)rtw_get_camid(psta->mac_id), _TRUE);\r
+ rtw_clearstakey_cmd(padapter, psta, _TRUE);\r
\r
\r
_enter_critical_bh(&psta->lock, &irqL);\r
if (psta == NULL) {\r
DBG_871X(FUNC_ADPT_FMT" sta_info is null\n", FUNC_ADPT_ARG(padapter));\r
} else if (psta->state &_FW_LINKED) {\r
+ rtw_sta_media_status_rpt(padapter, psta, 1);\r
Update_RA_Entry(padapter, psta);\r
//pairwise key\r
/* per sta pairwise key and settings */\r
if( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||\r
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))\r
{\r
- rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);\r
+ rtw_setstakey_cmd(padapter, psta, _TRUE,_FALSE);\r
} \r
}\r
}\r
return res;
}
-u8 rtw_setstakey_cmd(_adapter *padapter, u8 *psta, u8 unicast_key, bool enqueue)
+u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 unicast_key, bool enqueue)
{
struct cmd_obj* ph2c;
struct set_stakey_parm *psetstakey_para;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
- struct sta_info* sta = (struct sta_info* )psta;
u8 res=_SUCCESS;
_func_enter_;
return res;
}
-u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
+u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue)
{
struct cmd_obj* ph2c;
struct set_stakey_parm *psetstakey_para;
struct set_stakey_rsp *psetstakey_rsp = NULL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
- struct sta_info* sta = (struct sta_info* )psta;
+ s16 cam_id = 0;
u8 res=_SUCCESS;
_func_enter_;
if(!enqueue)
{
- clear_cam_entry(padapter, entry);
+ while((cam_id = rtw_camid_search(padapter, sta->hwaddr, -1)) >= 0) {
+ DBG_871X_LEVEL(_drv_always_, "clear key for addr:"MAC_FMT", camid:%d\n", MAC_ARG(sta->hwaddr), cam_id);
+ clear_cam_entry(padapter, cam_id);
+ rtw_camid_free(padapter, cam_id);
+ }
}
else
{
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
psetstakey_para->algorithm = _NO_PRIVACY_;
-
- psetstakey_para->id = entry;
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
DBG_871X_SEL_NL(m, "hw_decrypted=%d\n", sec->hw_decrypted);
+#ifdef DBG_SW_SEC_CNT
+ DBG_871X_SEL_NL(m, "wep_sw_enc_cnt=%llu, %llu, %llu\n"
+ , sec->wep_sw_enc_cnt_bc , sec->wep_sw_enc_cnt_mc, sec->wep_sw_enc_cnt_uc);
+ DBG_871X_SEL_NL(m, "wep_sw_dec_cnt=%llu, %llu, %llu\n"
+ , sec->wep_sw_dec_cnt_bc , sec->wep_sw_dec_cnt_mc, sec->wep_sw_dec_cnt_uc);
+
+ DBG_871X_SEL_NL(m, "tkip_sw_enc_cnt=%llu, %llu, %llu\n"
+ , sec->tkip_sw_enc_cnt_bc , sec->tkip_sw_enc_cnt_mc, sec->tkip_sw_enc_cnt_uc);
+ DBG_871X_SEL_NL(m, "tkip_sw_dec_cnt=%llu, %llu, %llu\n"
+ , sec->tkip_sw_dec_cnt_bc , sec->tkip_sw_dec_cnt_mc, sec->tkip_sw_dec_cnt_uc);
+
+ DBG_871X_SEL_NL(m, "aes_sw_enc_cnt=%llu, %llu, %llu\n"
+ , sec->aes_sw_enc_cnt_bc , sec->aes_sw_enc_cnt_mc, sec->aes_sw_enc_cnt_uc);
+ DBG_871X_SEL_NL(m, "aes_sw_dec_cnt=%llu, %llu, %llu\n"
+ , sec->aes_sw_dec_cnt_bc , sec->aes_sw_dec_cnt_mc, sec->aes_sw_dec_cnt_uc);
+#endif /* DBG_SW_SEC_CNT */
+
return 0;
}
//Set key to CAM through H2C command
if(bgrouptkey)//never go to here
{
- res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _FALSE, _TRUE);
+ res=rtw_setstakey_cmd(padapter, stainfo, _FALSE, _TRUE);
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
}
else{
- res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _TRUE, _TRUE);
+ res=rtw_setstakey_cmd(padapter, stainfo, _TRUE, _TRUE);
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
}
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
+ u8 *wps_ie=NULL;
+ uint wpsie_len=0;
_func_enter_;
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS);
- //DBG_871X("clear wps when %s\n", __func__);
+ // force to clear cur_network_scanned's SELECTED REGISTRAR
+ if (pmlmepriv->cur_network_scanned) {
+ WLAN_BSSID_EX *current_joined_bss = &(pmlmepriv->cur_network_scanned->network);
+ if (current_joined_bss) {
+ wps_ie=rtw_get_wps_ie(current_joined_bss->IEs +_FIXED_IE_LENGTH_,
+ current_joined_bss->IELength-_FIXED_IE_LENGTH_, NULL, &wpsie_len);
+ if (wps_ie && wpsie_len>0) {
+ u8 *attr = NULL;
+ u32 attr_len;
+ attr=rtw_get_wps_attr(wps_ie, wpsie_len, WPS_ATTR_SELECTED_REGISTRAR,
+ NULL, &attr_len);
+ if (attr)
+ *(attr + 4) = 0;
+ }
+ }
+ }
if(rtw_to_roam(padapter) > 0)
_clr_fwstate_(pmlmepriv, _FW_LINKED);
_rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof (union Keytype));
_rtw_memset((u8 *)&psta->dot11txpn, 0, sizeof (union pn48));
+ psta->dot11txpn.val = psta->dot11txpn.val + 1;
#ifdef CONFIG_IEEE80211W
_rtw_memset((u8 *)&psta->dot11wtxpn, 0, sizeof (union pn48));
#endif //CONFIG_IEEE80211W
#ifdef CONFIG_RTL8711
//submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta
- rtw_setstakey_cmd(adapter, (unsigned char*)psta, _FALSE, _TRUE);
+ rtw_setstakey_cmd(adapter, psta, _FALSE, _TRUE);
#endif
exit:
// 13th element in the array is the IE length
//
-static int rtw_append_pmkid(_adapter *Adapter,int iEntry, u8 *ie, uint ie_len)
+static int rtw_append_pmkid(_adapter *adapter,int iEntry, u8 *ie, uint ie_len)
{
- struct security_priv *psecuritypriv=&Adapter->securitypriv;
+ struct security_priv *sec=&adapter->securitypriv;
- if(ie[13]<=20){
- // The RSN IE didn't include the PMK ID, append the PMK information
- ie[ie_len]=1;
- ie_len++;
- ie[ie_len]=0; //PMKID count = 0x0100
- ie_len++;
- _rtw_memcpy( &ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
-
- ie_len+=16;
- ie[13]+=18;//PMKID length = 2+16
+ if (ie[13] > 20) {
+ int i;
+ u16 pmkid_cnt = RTW_GET_LE16(ie+14+20);
+ if (pmkid_cnt == 1 && _rtw_memcmp(ie+14+20+2, &sec->PMKIDList[iEntry].PMKID, 16)) {
+ DBG_871X(FUNC_ADPT_FMT" has carried the same PMKID:"KEY_FMT"\n"
+ , FUNC_ADPT_ARG(adapter), KEY_ARG(&sec->PMKIDList[iEntry].PMKID));
+ goto exit;
+ }
+
+ DBG_871X(FUNC_ADPT_FMT" remove original PMKID, count:%u\n"
+ , FUNC_ADPT_ARG(adapter), pmkid_cnt);
+ for (i=0;i<pmkid_cnt;i++)
+ DBG_871X(" "KEY_FMT"\n", KEY_ARG(ie+14+20+2+i*16));
+
+ ie_len -= 2+pmkid_cnt*16;
+ ie[13] = 20;
+ }
+
+ if (ie[13] <= 20) {
+ /* The RSN IE didn't include the PMK ID, append the PMK information */
+
+ DBG_871X(FUNC_ADPT_FMT" append PMKID:"KEY_FMT"\n"
+ , FUNC_ADPT_ARG(adapter), KEY_ARG(&sec->PMKIDList[iEntry].PMKID));
+
+ RTW_PUT_LE16(&ie[ie_len], 1);
+ ie_len += 2;
+
+ _rtw_memcpy(&ie[ie_len], &sec->PMKIDList[iEntry].PMKID, 16);
+ ie_len += 16;
+
+ ie[13] += 18;//PMKID length = 2+16
}
+
+exit:
+ return (ie_len);
+}
+
+static int rtw_remove_pmkid(_adapter *adapter, u8 *ie, uint ie_len)
+{
+ struct security_priv *sec=&adapter->securitypriv;
+ int i;
+ u16 pmkid_cnt = RTW_GET_LE16(ie+14+20);
+
+ if (ie[13] <= 20)
+ goto exit;
+
+ DBG_871X(FUNC_ADPT_FMT" remove original PMKID, count:%u\n"
+ , FUNC_ADPT_ARG(adapter), pmkid_cnt);
+
+ for (i=0;i<pmkid_cnt;i++)
+ DBG_871X(" "KEY_FMT"\n", KEY_ARG(ie+14+20+2+i*16));
+
+ ie_len -= 2+pmkid_cnt*16;
+ ie[13] = 20;
+
+exit:
return (ie_len);
}
iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid);
if(iEntry<0)
{
- return ielength;
+ if(authmode == _WPA2_IE_ID_)
+ ielength = rtw_remove_pmkid(adapter, out_ie, ielength);
}
else
{
if(authmode == _WPA2_IE_ID_)
- {
ielength=rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
- }
}
_func_exit_;
u8 *pframe = precv_frame->u.hdr.rx_data;
uint len = precv_frame->u.hdr.len;
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
-
- DBG_871X("%s\n", __FUNCTION__);
-
//check RA matches or not
if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode
return _SUCCESS;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
int bssrate_len = 0, sta_bssrate_len = 0;
+ u8 vs_ie_length = 0;
#ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 p2pie[ 255 ] = { 0x00 };
if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) ||
(_rtw_memcmp(pIE->data, WMM_OUI, 4)) ||
(_rtw_memcmp(pIE->data, WPS_OUI, 4)))
- {
- if(!padapter->registrypriv.wifi_spec)
+ {
+ vs_ie_length = pIE->Length;
+ if((!padapter->registrypriv.wifi_spec) && (_rtw_memcmp(pIE->data, WPS_OUI, 4)))
{
//Commented by Kurt 20110629
//In some older APs, WPS handshake
//would be fail if we append vender extensions informations to AP
- if(_rtw_memcmp(pIE->data, WPS_OUI, 4)){
- pIE->Length=14;
- }
+
+ vs_ie_length = 14;
}
- pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, pIE->Length, pIE->data, &(pattrib->pktlen));
+
+ pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, vs_ie_length, pIE->data, &(pattrib->pktlen));
}
break;
u8 setkey_hdl(_adapter *padapter, u8 *pbuf)
{
- unsigned short ctrl;
+ u16 ctrl = 0;
+ s16 cam_id = 0;
struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
- unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ unsigned char null_addr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ u8 *addr;
//main tx key for wep.
if(pparm->set_tx)
pmlmeinfo->key_index = pparm->keyid;
-
- //write cam
- ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid;
- DBG_871X_LEVEL(_drv_always_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) "
- "keyid:%d\n", pparm->algorithm, pparm->keyid);
- write_cam(padapter, pparm->keyid, ctrl, null_sta, pparm->key);
-
+ cam_id = rtw_camid_alloc(padapter, NULL, pparm->keyid);
+
+ if (cam_id < 0){
+ } else {
+ if (cam_id > 3) /* not default key, searched by A2 */
+ addr = get_bssid(&padapter->mlmepriv);
+ else
+ addr = null_addr;
+
+ ctrl = BIT(15) | BIT6 |((pparm->algorithm) << 2) | pparm->keyid;
+ write_cam(padapter, cam_id, ctrl, addr, pparm->key);
+ DBG_871X_LEVEL(_drv_always_, "set group key camid:%d, addr:"MAC_FMT", kid:%d, type:%s\n"
+ ,cam_id, MAC_ARG(addr), pparm->keyid, security_type_str(pparm->algorithm));
+ }
+
+ #ifdef DYNAMIC_CAMID_ALLOC
+ if (cam_id >=0 && cam_id <=3)
+ rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_TRUE);
+ #endif
+
//allow multicast packets to driver
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_ON_RCR_AM, null_addr);
u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf)
{
- u16 ctrl=0;
- u8 cam_id = 0;//cam_entry
+ u16 ctrl = 0;
+ s16 cam_id = 0;
u8 ret = H2C_SUCCESS;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
#endif //CONFIG_TDLS
- //cam_entry:
- //0~3 for default key
+ if(pparm->algorithm == _NO_PRIVACY_)
+ goto write_to_cam;
- //for concurrent mode (ap+sta, sta+sta):
- //default key is disable, using sw encrypt/decrypt
- //camid 0, 1, 2, 3 is default entry for default key/group key
- //macid = 1 is for bc/mc stainfo, no mapping to camid
- //macid = 0 mapping to camid 4
- //for macid >=2, camid = macid+3;
-
-
- if(pparm->algorithm == _NO_PRIVACY_) // clear cam entry
- {
- clear_cam_entry(padapter, pparm->id);
- ret = H2C_SUCCESS;
- goto exit_set_stakey_hdl;
+ psta = rtw_get_stainfo(pstapriv, pparm->addr);
+ if (!psta) {
+ DBG_871X_LEVEL(_drv_always_, "%s sta:"MAC_FMT" not found\n", __func__, MAC_ARG(pparm->addr));
+ ret = H2C_REJECTED;
+ goto exit;
}
- if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
- {
- psta = rtw_get_stainfo(pstapriv, pparm->addr);
- if(psta)
- {
- ctrl = (BIT(15) | ((pparm->algorithm) << 2));
-
- DBG_871X("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm);
-
- if((psta->mac_id == 1) || (psta->mac_id>(NUM_STA-4)))
- {
- DBG_871X("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid)=%d\n", psta->mac_id);
- ret = H2C_REJECTED;
- goto exit_set_stakey_hdl;
- }
-
- cam_id = (u8)rtw_get_camid(psta->mac_id);//0~3 for default key, cmd_id=macid + 3;
-
- DBG_871X("Write CAM, mac_addr=%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0],
- pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4],
- pparm->addr[5], cam_id);
-
- write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
-
- ret = H2C_SUCCESS_RSP;
- goto exit_set_stakey_hdl;
+ pmlmeinfo->enc_algo = pparm->algorithm;
+ cam_id = rtw_camid_alloc(padapter, psta, 0);
+ if (cam_id < 0)
+ goto exit;
+write_to_cam:
+ if(pparm->algorithm == _NO_PRIVACY_) {
+ while((cam_id = rtw_camid_search(padapter, pparm->addr, -1)) >= 0) {
+ DBG_871X_LEVEL(_drv_always_, "clear key for addr:"MAC_FMT", camid:%d\n", MAC_ARG(pparm->addr), cam_id);
+ clear_cam_entry(padapter, cam_id);
+ rtw_camid_free(padapter,cam_id);
}
- else
- {
- DBG_871X("r871x_set_stakey_hdl(): sta has been free\n");
- ret = H2C_REJECTED;
- goto exit_set_stakey_hdl;
- }
-
- }
-
-
- //below for sta mode
- if((psta = rtw_get_stainfo(pstapriv, pparm->addr)))
- {
- cam_id = (u8)rtw_get_camid(psta->mac_id);
+ } else {
+ DBG_871X_LEVEL(_drv_always_, "set pairwise key camid:%d, addr:"MAC_FMT", kid:%d, type:%s\n",
+ cam_id, MAC_ARG(pparm->addr), pparm->keyid, security_type_str(pparm->algorithm));
+ ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid;
+ write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
}
- else
- cam_id = 4;
-
- ctrl = BIT(15) | ((pparm->algorithm) << 2);
- pmlmeinfo->enc_algo = pparm->algorithm;
-
- DBG_871X_LEVEL(_drv_always_, "set pairwise key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:%d\n",
- pparm->algorithm, cam_id);
-
- write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
-
-exit_set_stakey_hdl:
+ ret = H2C_SUCCESS_RSP;
+exit:
return ret;
-
}
u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf)
pxmitframe->attrib.triggered=1;
- pxmitframe->attrib.qsel = 0x11;//HIQ
+ if (xmitframe_hiq_filter(pxmitframe) == _TRUE)
+ pxmitframe->attrib.qsel = 0x11;//HIQ
#if 0
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
//_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
_exit_critical_bh(&pxmitpriv->lock, &irqL);
- //#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
- #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
- rtw_chk_hi_queue_cmd(padapter);
- #endif
+ if (padapter->interface_type != RTW_PCIE) {
+ /* check hi queue and bmc_sleepq */
+ rtw_chk_hi_queue_cmd(padapter);
+ }
}
#endif
pmppriv->tx.stop = 1;
pmppriv->bSetTxPower=0; //for manually set tx power
pmppriv->bTxBufCkFail=_FALSE;
- pmppriv->pktInterval=300;
+ pmppriv->pktInterval=1;
+ pmppriv->bPreBrunEfuse = _FALSE;
mp_init_xmit_attrib(&pmppriv->tx, padapter);
PHY_LCCalibrate(pAdapter);
PHY_IQCalibrate(pAdapter, _FALSE);
- dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter
+ //dm_CheckTXPowerTracking(&pHalData->odmpriv); //trigger thermal meter
PHY_SetRFPathSwitch(pAdapter, 1/*pHalData->bDefaultAntenna*/); //default use Main
rtw_write16(pAdapter, 0x870, 0x300);
rtw_write16(pAdapter, 0x860, 0x110);
- if (pAdapter->registrypriv.mp_mode == 1)
- pmlmepriv->fw_state = WIFI_MP_STATE;
-
return rtStatus;
}
#endif
Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, _TRUE);
-#ifdef CONFIG_BT_COEXIST
- rtw_btcoex_Switch(padapter, 0);
-#endif
+//#ifdef CONFIG_BT_COEXIST
+// rtw_btcoex_Switch(padapter, 0); //remove for BT MP Down.
+//#endif
}
struct dm_priv *pdmpriv = &pHalData->dmpriv;
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
- //Switch_DM_Func(padapter, DYNAMIC_RF_CALIBRATION, bstart);
if (bstart==1){
DBG_871X("in MPT_PwrCtlDM start \n");
Switch_DM_Func(padapter, DYNAMIC_RF_TX_PWR_TRACK, _TRUE);
pdmpriv->TxPowerTrackControl = _TRUE;
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _TRUE;
padapter->mppriv.mp_dm =1;
+ odm_TXPowerTrackingInit(pDM_Odm);
+ ODM_ClearTxPowerTrackingState(pDM_Odm);
+
}else{
DBG_871X("in MPT_PwrCtlDM stop \n");
disable_dm(padapter);
pdmpriv->TxPowerTrackControl = _FALSE;
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = _FALSE;
padapter->mppriv.mp_dm = 0;
+ {
+ TXPWRTRACK_CFG c;
+ u1Byte chnl =0 ;
+
+ ConfigureTxpowerTrack(pDM_Odm, &c);
+ ODM_ClearTxPowerTrackingState(pDM_Odm);
+ (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, ODM_RF_PATH_A, chnl);
+ (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, ODM_RF_PATH_B, chnl);
+ }
}
}
+
u32 mp_join(PADAPTER padapter,u8 mode)
{
WLAN_BSSID_EX bssid;
struct mp_priv *pmppriv = &padapter->mppriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
- _adapter *pbuddyadapter = padapter->pbuddy_adapter;
- struct mlme_priv *pbuddymlmepriv = &pbuddyadapter->mlmepriv;
// 1. initialize a new WLAN_BSSID_EX
_rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX));
_enter_critical_bh(&pmlmepriv->lock, &irqL);
- //if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE)
- // goto end_of_mp_start_test;
-#if 0
+ if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE)
+ goto end_of_mp_start_test;
+
//init mp_start_test status
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
- rtw_disassoc_cmd(padapter, 0, _TRUE);
+ rtw_disassoc_cmd(padapter, 500, _TRUE);
rtw_indicate_disconnect(padapter);
rtw_free_assoc_resources(padapter, 1);
}
- rtw_msleep_os(500);
-
pmppriv->prev_fw_state = get_fwstate(pmlmepriv);
- if (padapter->registrypriv.mp_mode == 1)
pmlmepriv->fw_state = WIFI_MP_STATE;
-
+#if 0
if (pmppriv->mode == _LOOPBOOK_MODE_) {
set_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE); //append txdesc
RT_TRACE(_module_mp_, _drv_notice_, ("+start mp in Lookback mode\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+start mp in normal mode\n"));
}
#endif
-
set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
- set_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
- #if 1
//3 2. create a new psta for mp driver
//clear psta in the cur_network, if any
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
res = _FAIL;
goto end_of_mp_start_test;
}
- #endif
+ set_fwstate(pmlmepriv,WIFI_ADHOC_MASTER_STATE);
//3 3. join psudo AdHoc
tgt_network->join_res = 1;
tgt_network->aid = psta->aid = 1;
rtw_indicate_connect(padapter);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+ set_fwstate(pmlmepriv,_FW_LINKED);
end_of_mp_start_test:
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmppriv->network_macaddr);
}
}
- pmlmepriv->fw_state = WIFI_MP_STATE;
+ set_fwstate(pmlmepriv, _FW_LINKED);
+
return res;
}
//This function initializes the DUT to the MP test mode
_rtw_memcpy(&(pxmitframe->attrib), &(pmptx->attrib), sizeof(struct pkt_attrib));
- rtw_udelay_os(padapter->mppriv.pktInterval);
+ rtw_usleep_os(padapter->mppriv.pktInterval);
dump_mpframe(padapter, pxmitframe);
pmptx->sended++;
static void Rtw_MPSetMacTxEDCA(PADAPTER padapter)
{
- rtw_write32(padapter, 0x508 , 0x00a43f); //Disable EDCA BE Txop for MP pkt tx adjust Packet interval
+ rtw_write32(padapter, 0x508 , 0x00a422); //Disable EDCA BE Txop for MP pkt tx adjust Packet interval
//DBG_871X("%s:write 0x508~~~~~~ 0x%x\n", __func__,rtw_read32(padapter, 0x508));
PHY_SetMacReg(padapter, 0x458 ,bMaskDWord , 0x0);
//DBG_8192C("%s()!!!!! 0x460 = 0x%x\n" ,__func__,PHY_QueryBBReg(padapter, 0x460, bMaskDWord));
PHY_SetMacReg(padapter, 0x460 ,bMaskLWord , 0x0);//fast EDCA queue packet interval & time out vaule
- PHY_SetMacReg(padapter, ODM_EDCA_VO_PARAM ,bMaskLWord , 0x431C);
- PHY_SetMacReg(padapter, ODM_EDCA_BE_PARAM ,bMaskLWord , 0x431C);
- PHY_SetMacReg(padapter, ODM_EDCA_BK_PARAM ,bMaskLWord , 0x431C);
+ //PHY_SetMacReg(padapter, ODM_EDCA_VO_PARAM ,bMaskLWord , 0x431C);
+ //PHY_SetMacReg(padapter, ODM_EDCA_BE_PARAM ,bMaskLWord , 0x431C);
+ //PHY_SetMacReg(padapter, ODM_EDCA_BK_PARAM ,bMaskLWord , 0x431C);
DBG_8192C("%s()!!!!! 0x460 = 0x%x\n" ,__func__,PHY_QueryBBReg(padapter, 0x460, bMaskDWord));
}
pxmitbuf->padapter = padapter;
pxmitbuf->buf_tag = XMITBUF_MGNT;
- if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _FALSE)) == _FAIL) {
+ if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _TRUE)) == _FAIL) {
res= _FAIL;
goto exit;
}
}
+s32 Rtw_EfuseChkPreBurn8188ESerial(PADAPTER pAdapter)
+{
+ HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
+ EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
+ struct mp_priv *pmppriv = &pAdapter->mppriv;
+
+ u16 i=0,j=0,ret=_SUCCESS;
+ u8 efuseContent;
+ u8 chkBurndata[]={0x00,0x00};
+ u8 preBurnAddr[]={0x00,0xd0,0xe0,0xf0};
+ u8 preBurnData[]={
+ 0x29,0x81,0x00,0x6c,0x0b,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xda,0x0b,0x79,0x01,0x43,0x66,0x00,0x00,0xe0,0x4c,0x81,0x88,0x02,0x09,0x03,0x52,
+ 0x65,0x61,0x6c,0x74,0x65,0x6b,0x0d,0x03,0x38,0x30,0x32,0x2e,0x31,0x31,0x6e,0x20,
+ 0x4e,0x49,0x43,0x0c,0x03,0x30,0x30,0x45,0x30,0x34,0x43,0x30,0x30,0x30,0x31,0x00};
+
+ if(!pEEPROM->bautoload_fail_flag)
+ {
+ DBG_871X("%s: Not autoload_fail!!\n", __FUNCTION__);
+ return ret;
+ }
+ ret = rtw_efuse_map_read(pAdapter, 0x00, 2, chkBurndata);
+ if (ret == _FAIL) return ret;
+ //Hal_EfuseParseIDCode88E(padapter, pEEPROM->efuse_eeprom_data);
+ if( chkBurndata[0]==0x29 && chkBurndata[1]==0x81 )
+ {
+ pmppriv->bPreBrunEfuse = _TRUE;
+ DBG_871X("%s: had 0x2981 !!\n", __FUNCTION__);
+ return ret;
+ }
+
+ Efuse_PowerSwitch(pAdapter, _FALSE, _TRUE);
+ if( efuse_OneByteRead(pAdapter, 0xFE, &efuseContent, FALSE) == _FALSE)
+ {
+ DBG_871X("%s: efuse_OneByteRead error!!\n", __FUNCTION__);
+ ret=_FAIL;
+ return ret;
+ }
+ DBG_871X("%s phy efuse read 0xFE =%x \n",__func__,efuseContent);
+ Efuse_PowerSwitch(pAdapter, _FALSE, _FALSE);
+
+ if ( efuseContent == 0xFB ) {//8188ETV
+
+ for(i=0;i<=3;i++)
+ {
+ if (rtw_efuse_map_write(pAdapter, preBurnAddr[i], 16, &preBurnData[j] ) == _FAIL)
+ {
+ DBG_871X("%s: rtw_efuse_map_write error!!\n", __FUNCTION__);
+ ret=_FAIL;
+ return ret;
+ }
+ j+=16;
+ }
+ }
+ else //8188EUS
+ {
+ preBurnData[19]=0x81;
+
+ for(i=0;i<=3;i++)
+ {
+ if (rtw_efuse_map_write(pAdapter, preBurnAddr[i], 16, &preBurnData[j] ) == _FAIL)
+ {
+ DBG_871X("%s: rtw_efuse_map_write error!!\n", __FUNCTION__);
+ ret=_FAIL;
+ return ret;
+ }
+ j+=16;
+ }
+ }
+ pmppriv->bPreBrunEfuse = _TRUE;
+
+ return ret;
+}
#endif
pcfg80211_wdinfo->is_ro_ch = _FALSE;
pcfg80211_wdinfo->last_ro_ch_time = rtw_get_current_time();
+ if (pcfg80211_wdinfo->not_indic_ro_ch_exp == _TRUE)
+ return;
+
DBG_871X("cfg80211_remain_on_channel_expired, ch=%d, bw=%d, offset=%d\n",
rtw_get_oper_ch(padapter), rtw_get_oper_bw(padapter), rtw_get_oper_choffset(padapter));
goto exit;
}
}
+ else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) )
+ {
+ DBG_871X("%s ,in WIFI_MP_STATE \n",__func__);
+
+ _rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
+ _rtw_memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
+ _rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
+ _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
+
+ //
+ _rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN);
+
+
+ *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); // get sta_info
+ if (*psta == NULL) {
+ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under MP_MODE ; drop pkt\n"));
+ #ifdef DBG_RX_DROP_FRAME
+ DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under WIFI_MP_STATE ; drop pkt\n", __FUNCTION__);
+ #endif
+ ret= _FAIL;
+ goto exit;
+ }
+
+ }
else {
u8 *myhwaddr = myid(&adapter->eeprompriv);
if (!_rtw_memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) {
}
}
#endif //CONFIG_AUTO_AP_MODE
-
+#if 0
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))
{
ptr += rmv_len ;
_rtw_memcpy(ptr, get_rxmem(precvframe), 24);
ptr+=24;
}
- else {
+ else
+#endif
+ {
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+ (bsnaphdr?2:0)));
}
void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq);
void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq)
-{\r
+{
if(current_seq < prev_seq)
{
- pdbgpriv->dbg_rx_ampdu_loss_count+= (4096 + current_seq - prev_seq);\r\r
+ pdbgpriv->dbg_rx_ampdu_loss_count+= (4096 + current_seq - prev_seq);
}
else
{
}
#endif
+static sint MPwlanhdr_to_ethhdr ( union recv_frame *precvframe)
+{
+ sint rmv_len;
+ u16 eth_type, len;
+ u8 bsnaphdr;
+ u8 *psnap_type;
+ struct ieee80211_snap_hdr *psnap;
+
+ sint ret=_SUCCESS;
+ _adapter *adapter =precvframe->u.hdr.adapter;
+ struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
+
+ u8 *ptr = get_recvframe_data(precvframe) ; // point to frame_ctrl field
+ struct rx_pkt_attrib *pattrib = & precvframe->u.hdr.attrib;
+
+_func_enter_;
+
+ if(pattrib->encrypt){
+ recvframe_pull_tail(precvframe, pattrib->icv_len);
+ }
+
+ psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
+ psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
+ /* convert hdr + possible LLC headers into Ethernet header */
+ //eth_type = (psnap_type[0] << 8) | psnap_type[1];
+ if((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
+ (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == _FALSE) &&
+ (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==_FALSE) )||
+ //eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
+ _rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){
+ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
+ bsnaphdr = _TRUE;
+ }
+ else {
+ /* Leave Ethernet header part of hdr and full payload */
+ bsnaphdr = _FALSE;
+ }
+
+ rmv_len = pattrib->hdrlen + pattrib->iv_len +(bsnaphdr?SNAP_SIZE:0);
+ len = precvframe->u.hdr.len - rmv_len;
+
+ RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len));
+
+ _rtw_memcpy(ð_type, ptr+rmv_len, 2);
+ eth_type= ntohs((unsigned short )eth_type); //pattrib->ether_type
+ pattrib->eth_type = eth_type;
+
+ {
+ ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+ (bsnaphdr?2:0)));
+ }
+
+ _rtw_memcpy(ptr, pattrib->dst, ETH_ALEN);
+ _rtw_memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
+
+ if(!bsnaphdr) {
+ len = htons(len);
+ _rtw_memcpy(ptr+12, &len, 2);
+ }
+
+ if (adapter->registrypriv.mp_mode == 1)
+ {
+ len = htons(pattrib->seq_num);
+ //DBG_871X("wlan seq = %d ,seq_num =%x\n",len,pattrib->seq_num);
+ _rtw_memcpy(ptr+12,&len, 2);
+ }
+_func_exit_;
+ return ret;
+
+}
+
+
int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
{
int ret = _SUCCESS;
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
struct recv_priv *precvpriv = &padapter->recvpriv;
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
-
#ifdef CONFIG_MP_INCLUDED
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct mp_priv *pmppriv = &padapter->mppriv;
+#endif //CONFIG_MP_INCLUDED
+ u8 type;
+ u8 *ptr = rframe->u.hdr.rx_data;
+ u8 *psa, *pda, *pbssid;
+ struct sta_info *psta = NULL;
+#ifdef CONFIG_MP_INCLUDED
if (padapter->registrypriv.mp_mode == 1)
{
- if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0))
+
+ if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) && (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) )//&&(padapter->mppriv.check_mp_pkt == 0))
{
if (pattrib->crc_err == 1){
padapter->mppriv.rx_crcerrpktcount++;
padapter->mppriv.rx_pktcount_filter_out++;
}
+
+ if(pmppriv->rx_bindicatePkt == _FALSE)
+ {
+ //if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == _FALSE) {
+ //RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt \n"));
+ ret = _FAIL;
+ rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
+ goto exit;
+ }
+ else {
+
+ type = GetFrameType(ptr);
+ pattrib->to_fr_ds = get_tofr_ds(ptr);
+ pattrib->frag_num = GetFragNum(ptr);
+ pattrib->seq_num = GetSequence(ptr);
+ pattrib->pw_save = GetPwrMgt(ptr);
+ pattrib->mfrag = GetMFrag(ptr);
+ pattrib->mdata = GetMData(ptr);
+ pattrib->privacy = GetPrivacy(ptr);
+ pattrib->order = GetOrder(ptr);
+
+ if(type ==WIFI_DATA_TYPE)
+ {
+ pda = get_da(ptr);
+ psa = get_sa(ptr);
+ pbssid = get_hdr_bssid(ptr);
+
+ _rtw_memcpy(pattrib->dst, pda, ETH_ALEN);
+ _rtw_memcpy(pattrib->src, psa, ETH_ALEN);
+ _rtw_memcpy(pattrib->bssid, pbssid, ETH_ALEN);
+
+ switch(pattrib->to_fr_ds)
+ {
+ case 0:
+ _rtw_memcpy(pattrib->ra, pda, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, psa, ETH_ALEN);
+ ret = sta2sta_data_frame(padapter, rframe, &psta);
+ break;
- if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == _FALSE) {
- //RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt \n"));
- ret = _FAIL;
- rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
- goto exit;
+ case 1:
+
+ _rtw_memcpy(pattrib->ra, pda, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, pbssid, ETH_ALEN);
+ ret = ap2sta_data_frame(padapter, rframe, &psta);
+
+ break;
+
+ case 2:
+ _rtw_memcpy(pattrib->ra, pbssid, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, psa, ETH_ALEN);
+ ret = sta2ap_data_frame(padapter, rframe, &psta);
+ break;
+
+ case 3:
+ _rtw_memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN);
+ ret =_FAIL;
+ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" case 3\n"));
+ break;
+
+ default:
+ ret =_FAIL;
+ break;
}
+
+ ret = MPwlanhdr_to_ethhdr (rframe);
+
+ if (ret != _SUCCESS)
+ {
+ RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("wlanhdr_to_ethhdr: drop pkt \n"));
+ #ifdef DBG_RX_DROP_FRAME
+ DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr: drop pkt\n", __FUNCTION__);
+ #endif
+ rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
+ ret = _FAIL;
+ goto exit;
+ }
+
+ if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE))
+ {
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" ));
+ //indicate this recv_frame
+ ret = rtw_recv_indicatepkt(padapter, rframe);
+ if (ret != _SUCCESS)
+ {
+ #ifdef DBG_RX_DROP_FRAME
+ DBG_871X("DBG_RX_DROP_FRAME %s rtw_recv_indicatepkt fail!\n", __FUNCTION__);
+ #endif
+ rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
+ ret = _FAIL;
+
+ goto exit;
+ }
+ }
+ else
+ {
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: rtw_free_recvframe\n" ));
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_debug_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
+ #ifdef DBG_RX_DROP_FRAME
+ DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", __FUNCTION__,
+ padapter->bDriverStopped, padapter->bSurpriseRemoved);
+ #endif
+ ret = _FAIL;
+ rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
+ goto exit;
+ }
+
+ }
+ }
+
}
+
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n"));
+ rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
+ ret = _FAIL;
+ goto exit;
+
}
+
+
#endif
//check the frame crtl field and decache
return NULL;
}
+#ifdef DBG_SW_SEC_CNT
+#define WEP_SW_ENC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->wep_sw_enc_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->wep_sw_enc_cnt_mc++; \
+ else \
+ sec->wep_sw_enc_cnt_uc++;
+
+#define WEP_SW_DEC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->wep_sw_dec_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->wep_sw_dec_cnt_mc++; \
+ else \
+ sec->wep_sw_dec_cnt_uc++;
+
+#define TKIP_SW_ENC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->tkip_sw_enc_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->tkip_sw_enc_cnt_mc++; \
+ else \
+ sec->tkip_sw_enc_cnt_uc++;
+
+#define TKIP_SW_DEC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->tkip_sw_dec_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->tkip_sw_dec_cnt_mc++; \
+ else \
+ sec->tkip_sw_dec_cnt_uc++;
+
+#define AES_SW_ENC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->aes_sw_enc_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->aes_sw_enc_cnt_mc++; \
+ else \
+ sec->aes_sw_enc_cnt_uc++;
+
+#define AES_SW_DEC_CNT_INC(sec, ra) \
+ if (is_broadcast_mac_addr(ra)) \
+ sec->aes_sw_dec_cnt_bc++; \
+ else if (is_multicast_mac_addr(ra)) \
+ sec->aes_sw_dec_cnt_mc++; \
+ else \
+ sec->aes_sw_dec_cnt_uc++;
+#else
+#define WEP_SW_ENC_CNT_INC(sec, ra)
+#define WEP_SW_DEC_CNT_INC(sec, ra)
+#define TKIP_SW_ENC_CNT_INC(sec, ra)
+#define TKIP_SW_DEC_CNT_INC(sec, ra)
+#define AES_SW_ENC_CNT_INC(sec, ra)
+#define AES_SW_DEC_CNT_INC(sec, ra)
+#endif /* DBG_SW_SEC_CNT */
+
//=====WEP related=====
#define CRC32_POLY 0x04c11db7
}
}
-
+
+ WEP_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra);
}
_func_exit_;
{
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
- }
-
+ }
+
+ WEP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra);
}
_func_exit_;
}
}
-
+ TKIP_SW_ENC_CNT_INC(psecuritypriv,pattrib->ra);
}
/*
else{
}
else
{
- RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo!=NULL!!!\n"));
prwskey=&stainfo->dot118021x_UncstKey.skey[0];
prwskeylen=16;
}
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
res=_FAIL;
}
-
-
+
+ TKIP_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra);
}
else{
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo==NULL!!!\n"));
}
}
-
+ AES_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra);
}
/*
else{
DBG_871X("%s, psta==NUL\n", __func__);
res=_FAIL;
}
-*/
+*/
}
static u32 no_gkey_bc_cnt = 0;
static u32 no_gkey_mc_cnt = 0;
- //in concurrent we should use sw descrypt in group key, so we remove this message
//DBG_871X("rx bc/mc packets, to perform sw rtw_aes_decrypt\n");
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
if(psecuritypriv->binstallGrpkey==_FALSE)
res= aes_decipher(prwskey,prxattrib->hdrlen,pframe, length);
-
+ AES_SW_DEC_CNT_INC(psecuritypriv, prxattrib->ra);
}
else{
- RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo==NULL!!!\n"));
+ RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo==NULL!!!\n"));
res=_FAIL;
}
for(keyid=0;keyid<4;keyid++){
if(securitypriv->key_mask & BIT(keyid)){
if(keyid == securitypriv->dot11PrivacyKeyIndex)
- rtw_set_key(adapter,securitypriv, keyid, 1, _TRUE);
+ rtw_set_key(adapter,securitypriv, keyid, 1, _FALSE);
else
- rtw_set_key(adapter,securitypriv, keyid, 0, _TRUE);
+ rtw_set_key(adapter,securitypriv, keyid, 0, _FALSE);
}
}
}
else\r
{\r
//pairwise key\r
- rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);\r
+ rtw_setstakey_cmd(padapter, psta, _TRUE,_FALSE);\r
//group key\r
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);\r
}\r
}\r
\r
//clear cam\r
- rtw_clearstakey_cmd(padapter, (u8 *)ptdls_sta, (u8)rtw_get_camid(ptdls_sta->mac_id), _TRUE);\r
+ rtw_clearstakey_cmd(padapter, ptdls_sta, _TRUE);\r
\r
if(ptdlsinfo->sta_cnt==0){\r
rtw_tdls_cmd(padapter, myid(&(padapter->eeprompriv)), TDLS_RS_RCR);\r
if(prx_pkt_attrib->encrypt)\r
{\r
ptdls_sta->dot118021XPrivacy=_AES_;\r
- rtw_setstakey_cmd(padapter, (u8*)ptdls_sta, _TRUE, _TRUE);\r
+ rtw_setstakey_cmd(padapter, ptdls_sta, _TRUE, _TRUE);\r
}\r
}\r
\r
#define WAIT_FOR_BCN_TO_MIN (6000)
#define WAIT_FOR_BCN_TO_MAX (20000)
+#define DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS 1000
+#define DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD 3
+
static u8 rtw_basic_rate_cck[4] = {
IEEE80211_CCK_RATE_1MB|IEEE80211_BASIC_RATE_MASK, IEEE80211_CCK_RATE_2MB|IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_5MB|IEEE80211_BASIC_RATE_MASK, IEEE80211_CCK_RATE_11MB|IEEE80211_BASIC_RATE_MASK
void invalidate_cam_all(_adapter *padapter)
{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+ cam_ctl->bitmap = 0;
+ _rtw_memset(dvobj->cam_cache, 0, sizeof(struct cam_entry_cache)*TOTAL_CAM_ENTRY);
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
}
#if 1
static u32 _ReadCAM(_adapter *padapter ,u32 addr)
inline void write_cam_from_cache(_adapter *adapter, u8 id)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+ struct cam_entry_cache cache;
- _write_cam(adapter, id, dvobj->cam_cache[id].ctrl, dvobj->cam_cache[id].mac, dvobj->cam_cache[id].key);
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+ _rtw_memcpy(&cache, &dvobj->cam_cache[id], sizeof(struct cam_entry_cache));
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
+
+ _write_cam(adapter, id, cache.ctrl, cache.mac, cache.key);
}
void write_cam_cache(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
dvobj->cam_cache[id].ctrl = ctrl;
_rtw_memcpy(dvobj->cam_cache[id].mac, mac, ETH_ALEN);
_rtw_memcpy(dvobj->cam_cache[id].key, key, 16);
+
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
}
void clear_cam_cache(_adapter *adapter, u8 id)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
_rtw_memset(&(dvobj->cam_cache[id]), 0, sizeof(struct cam_entry_cache));
+
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
+}
+
+s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, s16 kid)
+{
+ u8 macid;
+ s16 camid;
+
+ //cam_entry:
+ //0~3 for default key
+
+ //for concurrent mode (ap+sta, sta+sta):
+ //default key is disable, using sw encrypt/decrypt
+ //camid 0, 1, 2, 3 is default entry for default key/group key
+ //macid = 1 is for bc/mc stainfo, no mapping to camid
+ //macid = 0 mapping to camid 4
+ //for macid >=2, camid = macid+3;
+
+ if (sta) {
+ struct mlme_ext_info *mlmeinfo = &adapter->mlmeextpriv.mlmext_info;
+ macid = sta->mac_id;
+
+ if((mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+ if((macid == 1) || (macid>(NUM_STA-4))){
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" failed, mac_id=%d\n", FUNC_ADPT_ARG(adapter), macid);
+ camid = -1;
+ goto exit;
+ }
+ }
+
+ if(macid==0)
+ camid = 4;
+ else if(macid >=2)
+ camid = macid + 3;
+ else
+ camid = 4;
+ }
+ else {
+ /* default key is disabled */
+ camid = -1;
+ }
+
+exit:
+ return (s16)camid;
+}
+
+bool _rtw_camid_is_gk(_adapter *adapter, u8 cam_id)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ bool ret = _FALSE;
+
+ if (cam_id >= TOTAL_CAM_ENTRY)
+ goto exit;
+
+ if (!(cam_ctl->bitmap & BIT(cam_id)))
+ goto exit;
+
+ ret = (dvobj->cam_cache[cam_id].ctrl&BIT6)?_TRUE:_FALSE;
+
+exit:
+ return ret;
+}
+
+bool rtw_camid_is_gk(_adapter *adapter, u8 cam_id)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+ bool ret;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+ ret = _rtw_camid_is_gk(adapter, cam_id);
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
+
+ return ret;
+}
+
+s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ int i;
+ s16 cam_id = -1;
+
+ for (i=0;i<TOTAL_CAM_ENTRY;i++) {
+ if (addr && _rtw_memcmp(dvobj->cam_cache[i].mac, addr, ETH_ALEN) == _FALSE)
+ continue;
+ if (kid >= 0 && kid != (dvobj->cam_cache[i].ctrl&0x03))
+ continue;
+
+ cam_id = i;
+ break;
+ }
+
+ if (0) {
+ if (addr)
+ DBG_871X(FUNC_ADPT_FMT" addr:"MAC_FMT" kid:%d, return cam_id:%d\n"
+ , FUNC_ADPT_ARG(adapter), MAC_ARG(addr), kid, cam_id);
+ else
+ DBG_871X(FUNC_ADPT_FMT" addr:%p kid:%d, return cam_id:%d\n"
+ , FUNC_ADPT_ARG(adapter), addr, kid, cam_id);
+ }
+
+ return cam_id;
+}
+
+s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+ s16 cam_id = -1;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+ cam_id = _rtw_camid_search(adapter, addr, kid);
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
+
+ return cam_id;
+}
+
+s16 rtw_camid_alloc(_adapter *adapter, struct sta_info *sta, u8 kid)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+ s16 cam_id = -1;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+
+#ifdef DYNAMIC_CAMID_ALLOC
+ {
+ struct mlme_ext_info *mlmeinfo = &adapter->mlmeextpriv.mlmext_info;
+
+ if((((mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) || ((mlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE))
+ && !sta) {
+ /* AP/Ad-hoc mode group key: static alloction to default key by key ID */
+ if (kid > 3) {
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key with invalid key id:%u\n"
+ , FUNC_ADPT_ARG(adapter), kid);
+ rtw_warn_on(1);
+ goto bitmap_handle;
+ }
+
+ cam_id = kid;
+ }
+ else {
+ int i;
+ u8 *addr = sta?sta->hwaddr:NULL;
+
+ if(!sta) {
+ if (!(mlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
+ /* bypass STA mode group key setting before connected(ex:WEP) because bssid is not ready */
+ goto bitmap_handle;
+ }
+
+ addr = get_bssid(&adapter->mlmepriv);
+ }
+
+ if ((i = _rtw_camid_search(adapter, addr, kid)) >= 0) {
+ /* Fix issue that pairwise and group key have same key id. Pairwise key first, group key can overwirte group only(ex: rekey) */
+ if (sta || _rtw_camid_is_gk(adapter, i) == _TRUE)
+ cam_id = i;
+ else
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key id:%u the same key id as pairwise key\n"
+ , FUNC_ADPT_ARG(adapter), kid);
+ goto bitmap_handle;
+ }
+
+ for (i=4;i<TOTAL_CAM_ENTRY;i++)
+ if (!(cam_ctl->bitmap & BIT(i)))
+ break;
+
+ if (i == TOTAL_CAM_ENTRY) {
+ if (sta)
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" pairwise key with "MAC_FMT" id:%u no room\n"
+ , FUNC_ADPT_ARG(adapter), MAC_ARG(sta->hwaddr), kid);
+ else
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key id:%u no room\n"
+ , FUNC_ADPT_ARG(adapter), kid);
+ rtw_warn_on(1);
+ goto bitmap_handle;
+ }
+
+ cam_id = i;
+ }
+ }
+#else
+ cam_id = rtw_get_camid(adapter, sta, kid);
+#endif /* DYNAMIC_CAMID_ALLOC */
+
+bitmap_handle:
+ if (cam_id >= 0)
+ cam_ctl->bitmap |= BIT(cam_id);
+
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
+
+ return cam_id;
+}
+
+void rtw_camid_free(_adapter *adapter, u8 cam_id)
+{
+ struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
+ struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
+ _irqL irqL;
+
+ _enter_critical_bh(&cam_ctl->lock, &irqL);
+
+ if (cam_id < TOTAL_CAM_ENTRY)
+ cam_ctl->bitmap &= ~(BIT(cam_id));
+
+ _exit_critical_bh(&cam_ctl->lock, &irqL);
}
int allocate_fw_sta_entry(_adapter *padapter)
void flush_all_cam_entry(_adapter *padapter)
{
- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-
-#ifdef CONFIG_CONCURRENT_MODE
-
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
- //if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
- if(check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE)
- {
- rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
- }
- else
+#ifdef CONFIG_CONCURRENT_MODE
+ if(check_buddy_fwstate(padapter, _FW_LINKED) == _TRUE)
{
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta;
- u8 cam_id;//cam_entry
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
if(psta) {
if(psta->state & WIFI_AP_STATE)
{} //clear cam when ap free per sta_info
else {
- cam_id = (u8)rtw_get_camid(psta->mac_id);
- rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, _FALSE);
- }
+ rtw_clearstakey_cmd(padapter, psta, _FALSE);
+ }
}
}
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
- //clear cam when ap free per sta_info
- }
- }
-#else //CONFIG_CONCURRENT_MODE
+ /* clear default key */
+ int i, cam_id;
+ u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0};
+
+ for (i=0;i<4;i++) {
+ cam_id = rtw_camid_search(padapter, null_addr, i);
+ if (cam_id >= 0) {
+ clear_cam_entry(padapter, cam_id);
+ rtw_camid_free(padapter, cam_id);
+ }
+ }
- rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
+ /* clear default key related key search setting */
+ #ifdef DYNAMIC_CAMID_ALLOC
+ rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_FALSE);
+ #endif
+ /* leave pairwise key when ap free per sta_info */
+ }
+ }
+ else
#endif //CONFIG_CONCURRENT_MODE
+ {
+ invalidate_cam_all(padapter);
+ /* clear default key related key search setting */
+ #ifdef DYNAMIC_CAMID_ALLOC
+ rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8*)_FALSE);
+ #endif
+ }
_rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
u32 bcn_channel;
unsigned short ht_cap_info;
unsigned char ht_info_infos_0;
+ struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
if (is_client_associated_to_ap(Adapter) == _FALSE)
return _TRUE;
return _TRUE;
}
+ if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) > DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS))
+ {
+ pmlmepriv->timeBcnInfoChkStart = 0;
+ pmlmepriv->NumOfBcnInfoChkFail = 0;
+ }
+
subtype = GetFrameSubType(pframe) >> 4;
if(subtype==WIFI_BEACON)
ht_cap_info, ht_info_infos_0);
DBG_871X("%s bcn link: ht_cap_info:%x ht_info_infos_0:%x\n", __func__,
cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0);
- DBG_871X("%s bw mode change, disconnect\n", __func__);
+ DBG_871X("%s bw mode change\n", __func__);
{
//bcn_info_update
cur_network->BcnInfo.ht_cap_info = ht_cap_info;
if (_rtw_memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) == _FALSE ||
bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) {
if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) { /* not hidden ssid */
- DBG_871X("%s(), SSID is not match return FAIL\n", __func__);
+ DBG_871X("%s(), SSID is not match\n", __func__);
goto _mismatch;
}
}
("%s(): cur_network->network.Privacy is %d, bssid.Privacy is %d\n",
__func__, cur_network->network.Privacy,bssid->Privacy));
if (cur_network->network.Privacy != bssid->Privacy) {
- DBG_871X("%s(), privacy is not match return FAIL\n",__func__);
+ DBG_871X("%s(), privacy is not match\n",__func__);
goto _mismatch;
}
}
if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) {
- DBG_871X("%s(): enctyp is not match ,return FAIL\n",__func__);
+ DBG_871X("%s(): enctyp is not match\n",__func__);
goto _mismatch;
}
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,
("%s cur_network->group_cipher is %d: %d\n",__func__, cur_network->BcnInfo.group_cipher, group_cipher));
if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) {
- DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match ,return FAIL\n",__func__,
+ DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match\n",__func__,
pairwise_cipher, cur_network->BcnInfo.pairwise_cipher,
group_cipher, cur_network->BcnInfo.group_cipher);
goto _mismatch;
}
if (is_8021x != cur_network->BcnInfo.is_8021x) {
- DBG_871X("%s authentication is not match ,return FAIL\n", __func__);
+ DBG_871X("%s authentication is not match\n", __func__);
goto _mismatch;
}
}
_mismatch:
rtw_mfree((u8 *)bssid, sizeof(WLAN_BSSID_EX));
- return _FAIL;
+
+ if (pmlmepriv->NumOfBcnInfoChkFail == 0)
+ {
+ pmlmepriv->timeBcnInfoChkStart = rtw_get_current_time();
+ }
+
+ pmlmepriv->NumOfBcnInfoChkFail++;
+ DBG_871X("%s by "ADPT_FMT" - NumOfChkFail = %d (SeqNum of this Beacon frame = %d).\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail, GetSequence(pframe));
+
+ if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) <= DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)
+ && (pmlmepriv->NumOfBcnInfoChkFail >= DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD))
+ {
+ DBG_871X("%s by "ADPT_FMT" - NumOfChkFail = %d >= threshold : %d (in %d ms), return FAIL.\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail,
+ DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD, rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart));
+ pmlmepriv->timeBcnInfoChkStart = 0;
+ pmlmepriv->NumOfBcnInfoChkFail = 0;
+ return _FAIL;
+ }
+
+ return _SUCCESS;
}
void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
rtw_hal_bcn_related_reg_setting(padapter);
}
-uint rtw_get_camid(uint macid)
-{
- uint camid;
-
- //camid 0, 1, 2, 3 is default entry for default key/group key
- //macid = 1 is for bc/mc stainfo, no mapping to camid
- //macid = 0 mapping to camid 4
- //for macid >=2, camid = macid+3;
-
- if(macid==0)
- camid = 4;
- else if(macid >=2)
- camid = macid + 3;
- else
- camid = 4;
-
- return camid;
-}
-
void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta)
{
int i;
}
}
-static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta)
+static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
{
+ struct mlme_ext_priv *mlmeext = &padapter->mlmeextpriv;
+
pattrib->rtsen = psta->rtsen;
pattrib->cts2self = psta->cts2self;
pattrib->raid = psta->raid;
- pattrib->bwmode = psta->bw_mode;
+ if (mlmeext->cur_bwmode < psta->bw_mode)
+ pattrib->bwmode = mlmeext->cur_bwmode;
+ else
+ pattrib->bwmode = psta->bw_mode;
pattrib->sgi = query_ra_short_GI(psta);
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=_FALSE\n"));
}
-#ifdef CONFIG_CONCURRENT_MODE
+#if defined(CONFIG_CONCURRENT_MODE) && !defined(DYNAMIC_CAMID_ALLOC)
if((pattrib->encrypt && bmcast) || (pattrib->encrypt ==_WEP40_) || (pattrib->encrypt ==_WEP104_))
{
pattrib->bswenc = _TRUE;//force using sw enc.
goto exit;
}
- update_attrib_phy_info(pattrib, psta);
+ update_attrib_phy_info(padapter, pattrib, psta);
exit:
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
- _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN);
}
else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
_rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN);
- _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
+ _rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN);
}
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
goto exit;
}
- update_attrib_phy_info(pattrib, psta);
+ update_attrib_phy_info(padapter, pattrib, psta);
//DBG_8192C("%s ==> mac_id(%d)\n",__FUNCTION__,pattrib->mac_id );
if (pattrib->subtype & WIFI_DATA_TYPE)
{
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
- //to_ds = 1, fr_ds = 0;
-
#ifdef CONFIG_TDLS
if(pattrib->direct_link == _TRUE){
//TDLS data transfer, ToDS=0, FrDs=0
else
#endif //CONFIG_TDLS
{
+ //to_ds = 1, fr_ds = 0;
// 1.Data transfer to AP
// 2.Arp pkt will relayed by AP
SetToDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
- _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
+ _rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
}
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
- _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
+ _rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
if(pattrib->qos_en)
}
#endif //CONFIG_TDLS
+#define RTW_HIQ_FILTER_ALLOW_ALL 0
+#define RTW_HIQ_FILTER_ALLOW_SPECIAL 1
+#define RTW_HIQ_FILTER_DENY_ALL 2
+
+inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
+{
+ bool allow = _FALSE;
+ _adapter *adapter = xmitframe->padapter;
+ struct registry_priv *registry = &adapter->registrypriv;
+
+if (adapter->interface_type != RTW_PCIE) {
+
+ if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
+
+ struct pkt_attrib *attrib = &xmitframe->attrib;
+
+ if (attrib->ether_type == 0x0806
+ || attrib->ether_type == 0x888e
+ #ifdef CONFIG_WAPI_SUPPORT
+ || attrib->ether_type == 0x88B4
+ #endif
+ || attrib->dhcp_pkt
+ ) {
+ if (0)
+ DBG_871X(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter)
+ , attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
+ allow = _TRUE;
+ }
+ }
+ else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) {
+ allow = _TRUE;
+ }
+ else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
+ }
+ else {
+ rtw_warn_on(1);
+ }
+}
+ return allow;
+}
+
#if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS)
sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe)
//DBG_871X("directly xmit pspoll_triggered packet\n");
//pattrib->triggered=0;
-
- if(bmcst)
+ if (bmcst && xmitframe_hiq_filter(pxmitframe) == _TRUE)
pattrib->qsel = 0x11;//HIQ
-
return ret;
}
}
+ if(psta->sleepq_len==0)
+ {
+#ifdef CONFIG_TDLS
+ if( psta->tdls_sta_state & TDLS_LINKED_STATE )
+ {
+ if(psta->state&WIFI_SLEEP_STATE)
+ psta->state ^= WIFI_SLEEP_STATE;
+
+ _exit_critical_bh(&pxmitpriv->lock, &irqL);
+ return;
+ }
+#endif //CONFIG_TDLS
+
+ if (pstapriv->tim_bitmap & BIT(psta->aid)) {
+ //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap);
+ //upate BCN for TIM IE
+ //update_BCNTIM(padapter);
+ update_mask = BIT(0);
+ }
+
+ pstapriv->tim_bitmap &= ~BIT(psta->aid);
+
+ if(psta->state&WIFI_SLEEP_STATE)
+ psta->state ^= WIFI_SLEEP_STATE;
+
+ if(psta->state & WIFI_STA_ALIVE_CHK_STATE)
+ {
+ DBG_871X("%s alive check\n", __func__);
+ psta->expire_to = pstapriv->expire_to;
+ psta->state ^= WIFI_STA_ALIVE_CHK_STATE;
+ }
+
+ pstapriv->sta_dz_bitmap &= ~BIT(psta->aid);
+ }
+
//for BC/MC Frames
if(!psta_bmc)
goto _exit;
}
- if(psta->sleepq_len==0)
- {
-#ifdef CONFIG_TDLS
- if( psta->tdls_sta_state & TDLS_LINKED_STATE )
- {
- if(psta->state&WIFI_SLEEP_STATE)
- psta->state ^= WIFI_SLEEP_STATE;
-
- _exit_critical_bh(&pxmitpriv->lock, &irqL);
- return;
- }
-#endif //CONFIG_TDLS
-
- if (pstapriv->tim_bitmap & BIT(psta->aid)) {
- //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap);
- //upate BCN for TIM IE
- //update_BCNTIM(padapter);
- update_mask = BIT(0);
- }
-
- pstapriv->tim_bitmap &= ~BIT(psta->aid);
-
- if(psta->state&WIFI_SLEEP_STATE)
- psta->state ^= WIFI_SLEEP_STATE;
-
- if(psta->state & WIFI_STA_ALIVE_CHK_STATE)
- {
- DBG_871X("%s alive check\n", __func__);
- psta->expire_to = pstapriv->expire_to;
- psta->state ^= WIFI_STA_ALIVE_CHK_STATE;
- }
-
- pstapriv->sta_dz_bitmap &= ~BIT(psta->aid);
- }
-
_exit:
//_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
);\r
#endif\r
\r
+VOID\r
+odm_TXPowerTrackingInit(\r
+ IN PDM_ODM_T pDM_Odm \r
+ );\r
\r
\r
VOID ODM_DMInit( IN PDM_ODM_T pDM_Odm);\r
case HW_VAR_PORT_SWITCH:
hw_var_port_switch(adapter);
break;
+ case HW_VAR_SEC_CFG:
+ {
+ #if defined(CONFIG_CONCURRENT_MODE) && !defined(DYNAMIC_CAMID_ALLOC)
+ // enable tx enc and rx dec engine, and no key search for MC/BC
+ rtw_write8(adapter, REG_SECCFG, SCR_NoSKMC|SCR_RxDecEnable|SCR_TxEncEnable);
+ #elif defined(DYNAMIC_CAMID_ALLOC)
+ u16 reg_scr;
+
+ reg_scr = rtw_read16(adapter, REG_SECCFG);
+ rtw_write16(adapter, REG_SECCFG, reg_scr|SCR_CHK_KEYID|SCR_RxDecEnable|SCR_TxEncEnable);
+ #else
+ rtw_write8(adapter, REG_SECCFG, *((u8*)val));
+ #endif
+ }
+ break;
+ case HW_VAR_SEC_DK_CFG:
+ {
+ struct security_priv *sec = &adapter->securitypriv;
+ u8 reg_scr = rtw_read8(adapter, REG_SECCFG);
+
+ if (val) /* Enable default key related setting */
+ {
+ reg_scr |= SCR_TXBCUSEDK;
+ if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
+ reg_scr |= (SCR_RxUseDK|SCR_TxUseDK);
+ }
+ else /* Disable default key related setting */
+ {
+ reg_scr &= ~(SCR_RXBCUSEDK|SCR_TXBCUSEDK|SCR_RxUseDK|SCR_TxUseDK);
+ }
+
+ rtw_write8(adapter, REG_SECCFG, reg_scr);
+ }
+ break;
case HW_VAR_DM_FLAG:
odm->SupportAbility = *((u32*)val);
break;
}
}
#endif
+
+//bus-agg check for SoftAP mode
+inline u8 rtw_hal_busagg_qsel_check(_adapter *padapter,u8 pre_qsel,u8 next_qsel)
+{
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ u8 chk_rst = _SUCCESS;
+
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE)
+ return chk_rst;
+
+ //if((pre_qsel == 0xFF)||(next_qsel== 0xFF))
+ // return chk_rst;
+
+ if( ((pre_qsel == QSLT_HIGH)||((next_qsel== QSLT_HIGH)))
+ && (pre_qsel != next_qsel )){
+ //DBG_871X("### bus-agg break cause of qsel misatch, pre_qsel=0x%02x,next_qsel=0x%02x ###\n",
+ // pre_qsel,next_qsel);
+ chk_rst = _FAIL;
+ }
+ return chk_rst;
+}
+
rtw_hal_init_opmode(padapter);
- for (i = 0; i<dvobj->iface_nums; i++) {
- padapter = dvobj->padapters[i];
- padapter->hw_init_completed = _TRUE;
- }
+ for (i = 0; i<dvobj->iface_nums; i++)
+ dvobj->padapters[i]->hw_init_completed = _TRUE;
if (padapter->registrypriv.notch_filter == 1)
rtw_hal_notch_filter(padapter, 1);
rtw_hal_reset_security_engine(padapter);
- rtw_sec_restore_wep_key(padapter);
+
+ for (i = 0; i<dvobj->iface_nums; i++)
+ rtw_sec_restore_wep_key(dvobj->padapters[i]);
rtw_led_control(padapter, LED_CTL_POWER_ON);
init_hw_mlme_ext(padapter);
}
else{
- for (i = 0; i<dvobj->iface_nums; i++) {
- padapter = dvobj->padapters[i];
- padapter->hw_init_completed = _FALSE;
- }
+ for (i = 0; i<dvobj->iface_nums; i++)
+ dvobj->padapters[i]->hw_init_completed = _FALSE;
DBG_871X("rtw_hal_init: hal__init fail\n");
}
_func_enter_;
switch (variable) {
+ case HW_VAR_BASIC_RATE:
+ {
+ struct mlme_ext_info *mlmext_info = &adapter->mlmeextpriv.mlmext_info;
+ u16 input_b = 0, masked = 0, ioted = 0, BrateCfg = 0, RateIndex = 0;
+ u16 rrsr_2g_force_mask = (RRSR_11M|RRSR_5_5M|RRSR_1M);
+ u16 rrsr_2g_allow_mask = (RRSR_24M|RRSR_12M|RRSR_6M|RRSR_11M|RRSR_5_5M|RRSR_2M|RRSR_1M);
+
+ HalSetBrateCfg(adapter, val, &BrateCfg);
+ input_b = BrateCfg;
+
+ /* apply force and allow mask */
+ BrateCfg |= rrsr_2g_force_mask;
+ BrateCfg &= rrsr_2g_allow_mask;
+ masked = BrateCfg;
+
+ /* IOT consideration */
+ if (mlmext_info->assoc_AP_vendor == HT_IOT_PEER_CISCO) {
+ /* if peer is cisco and didn't use ofdm rate, we enable 6M ack */
+ if((BrateCfg & (RRSR_24M|RRSR_12M|RRSR_6M)) == 0)
+ BrateCfg |= RRSR_6M;
+ }
+ ioted = BrateCfg;
+
+ HalData->BasicRateSet = BrateCfg;
+
+ DBG_8192C("HW_VAR_BASIC_RATE: %#x -> %#x -> %#x\n", input_b, masked, ioted);
+
+ // Set RRSR rate table.
+ rtw_write16(adapter, REG_RRSR, BrateCfg);
+ rtw_write8(adapter, REG_RRSR+2, rtw_read8(adapter, REG_RRSR+2)&0xf0);
+
+ // Set RTS initial rate
+ while(BrateCfg > 0x1)
+ {
+ BrateCfg = (BrateCfg>> 1);
+ RateIndex++;
+ }
+ rtw_write8(adapter, REG_INIRTS_RATE_SEL, RateIndex);
+ }
+ break;
case HW_VAR_CHECK_TXBUF:
{
u8 retry_limit;
return TxNum;\r
}\r
\r
+s8 tx_power_extra_bias(\r
+ IN u8 RFPath,\r
+ IN u8 Rate, \r
+ IN CHANNEL_WIDTH BandWidth, \r
+ IN u8 Channel\r
+ )\r
+{\r
+ s8 bias = 0;\r
+\r
+ if (Rate == MGN_2M)\r
+ bias = -9;\r
+\r
+ return bias;\r
+}\r
+\r
u8\r
PHY_GetTxPowerIndex_8188E(\r
IN PADAPTER pAdapter,\r
IN u8 Channel\r
)\r
{\r
- PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);\r
- s8 powerDiffByRate = 0, txPower = 0, limit = 0;\r
- u8 txNum = phy_GetCurrentTxNum_8188E( pAdapter, Rate );\r
- BOOLEAN bIn24G = _FALSE;\r
+ PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);\r
+ u8 base_index = 0;\r
+ s8 by_rate_diff = 0, txPower = 0, limit = 0, track_diff = 0, extra_bias = 0;\r
+ u8 txNum = phy_GetCurrentTxNum_8188E(pAdapter, Rate);\r
+ BOOLEAN bIn24G = _FALSE;\r
\r
- //DBG_871X("===>%s\n", __FUNCTION__ );\r
- \r
- txPower = (s8) PHY_GetTxPowerIndexBase( pAdapter,RFPath, Rate, BandWidth, Channel, &bIn24G );\r
+ base_index = PHY_GetTxPowerIndexBase(pAdapter,RFPath, Rate, BandWidth, Channel, &bIn24G);\r
\r
- powerDiffByRate = PHY_GetTxPowerByRate( pAdapter, BAND_ON_2_4G, RFPath, txNum, Rate );\r
+ by_rate_diff = PHY_GetTxPowerByRate(pAdapter, BAND_ON_2_4G, RFPath, txNum, Rate);\r
+ limit = PHY_GetTxPowerLimit(pAdapter, pAdapter->registrypriv.RegPwrTblSel, (u8)(!bIn24G), pHalData->CurrentChannelBW, RFPath, Rate, pHalData->CurrentChannel);\r
+ by_rate_diff = by_rate_diff > limit ? limit : by_rate_diff;\r
\r
- limit = PHY_GetTxPowerLimit( pAdapter, pAdapter->registrypriv.RegPwrTblSel, (u8)(!bIn24G), pHalData->CurrentChannelBW, RFPath, Rate, pHalData->CurrentChannel);\r
+ track_diff = PHY_GetTxPowerTrackingOffset(pAdapter, RFPath, Rate);\r
\r
- powerDiffByRate = powerDiffByRate > limit ? limit : powerDiffByRate;\r
+ extra_bias = tx_power_extra_bias(RFPath, Rate, BandWidth, Channel);\r
\r
- txPower += powerDiffByRate;\r
-\r
- txPower += PHY_GetTxPowerTrackingOffset( pAdapter, RFPath, Rate );\r
+ txPower = base_index + by_rate_diff + track_diff + extra_bias;\r
\r
if(txPower > MAX_POWER_INDEX)\r
txPower = MAX_POWER_INDEX;\r
\r
- //DBG_871X("Final Tx Power(RF-%c, Channel: %d) = %d(0x%X)\n", ((RFPath==0)?'A':'B'), Channel, txPower, txPower);\r
- \r
+ if (0)\r
+ DBG_871X("RF-%c ch%d TxPwrIdx = %d(0x%X) [%2u %2d %2d %2d]\n"\r
+ , ((RFPath==0)?'A':'B'), Channel, txPower, txPower, base_index, by_rate_diff, track_diff, extra_bias);\r
+\r
return (u8)txPower; \r
}\r
\r
//init recv_buf
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
-#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
_rtw_init_queue(&precvpriv->recv_buf_pending_queue);
-#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF *sizeof(struct recv_buf) + 4);
if(precvpriv->pallocated_recv_buf==NULL){
// check pkt amount in one bulk
descCount = 0;
bulkPtr = bulkSize;
- if (pbuf < bulkPtr)
+ if (pbuf < bulkPtr) {
descCount++;
- else {
+ if (descCount == pHalData->UsbTxAggDescNum)
+ goto agg_end;
+ } else {
descCount = 0;
bulkPtr = ((pbuf / bulkSize) + 1) * bulkSize; // round to next bulkSize
}
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist);
- pxmitframe->agg_num = 0; // not first frame of aggregation
+ if(_FAIL == rtw_hal_busagg_qsel_check(padapter,pfirstframe->attrib.qsel,pxmitframe->attrib.qsel))
+ break;
+
+ pxmitframe->agg_num = 0; // not first frame of aggregation
#ifdef CONFIG_TX_EARLY_MODE
pxmitframe->pkt_offset = 1;// not first frame of aggregation,reserve offset for EM Info
#else
}
}//end while( aggregate same priority and same DA(AP or STA) frames)
-
if (_rtw_queue_empty(&ptxservq->sta_pending) == _TRUE)
rtw_list_delete(&ptxservq->tx_pending);
_exit_critical_bh(&pxmitpriv->lock, &irqL);
+
+agg_end:
+
#ifdef CONFIG_80211N_HT
if ((pfirstframe->attrib.ether_type != 0x0806) &&
(pfirstframe->attrib.ether_type != 0x888e) &&
#ifdef CONFIG_USB_TX_AGGREGATION
pHalData->UsbTxAggMode = 1;
- pHalData->UsbTxAggDescNum = 0x6; // only 4 bits
+ pHalData->UsbTxAggDescNum = 0x1; // only 4 bits
#endif
#ifdef CONFIG_USB_RX_AGGREGATION
}
#endif //CONFIG_EFUSE_CONFIG_FILE
+
static VOID
readAdapterInfo_8188EU(
IN PADAPTER padapter
case HW_VAR_BSSID:
hw_var_set_bssid(Adapter, variable, val);
break;
- case HW_VAR_BASIC_RATE:
- {
- u16 BrateCfg = 0;
- u8 RateIndex = 0;
-
- // 2007.01.16, by Emily
- // Select RRSR (in Legacy-OFDM and CCK)
- // For 8190, we select only 24M, 12M, 6M, 11M, 5.5M, 2M, and 1M from the Basic rate.
- // We do not use other rates.
- HalSetBrateCfg( Adapter, val, &BrateCfg );
- DBG_8192C("HW_VAR_BASIC_RATE: BrateCfg(%#x)\n", BrateCfg);
-
- //2011.03.30 add by Luke Lee
- //CCK 2M ACK should be disabled for some BCM and Atheros AP IOT
- //because CCK 2M has poor TXEVM
- //CCK 5.5M & 11M ACK should be enabled for better performance
-
- pHalData->BasicRateSet = BrateCfg = (BrateCfg |0xd) & 0x15d;
-
- BrateCfg |= 0x01; // default enable 1M ACK rate
- // Set RRSR rate table.
- rtw_write8(Adapter, REG_RRSR, BrateCfg&0xff);
- rtw_write8(Adapter, REG_RRSR+1, (BrateCfg>>8)&0xff);
- rtw_write8(Adapter, REG_RRSR+2, rtw_read8(Adapter, REG_RRSR+2)&0xf0);
-
- // Set RTS initial rate
- while(BrateCfg > 0x1)
- {
- BrateCfg = (BrateCfg>> 1);
- RateIndex++;
- }
- // Ziv - Check
- rtw_write8(Adapter, REG_INIRTS_RATE_SEL, RateIndex);
- }
- break;
case HW_VAR_TXPAUSE:
rtw_write8(Adapter, REG_TXPAUSE, *((u8 *)val));
break;
rtw_write8(Adapter,REG_WMAC_TRXPTCL_CTL+2,regTmp);
}
break;
- case HW_VAR_SEC_CFG:
-#ifdef CONFIG_CONCURRENT_MODE
- rtw_write8(Adapter, REG_SECCFG, 0x0c|BIT(5));// enable tx enc and rx dec engine, and no key search for MC/BC
-#else
- rtw_write8(Adapter, REG_SECCFG, *((u8 *)val));
-#endif
- break;
case HW_VAR_CAM_EMPTY_ENTRY:
{
u8 ucIndex = *((u8 *)val);
case WOWLAN_ENABLE:
DBG_871X_LEVEL(_drv_always_, "WOWLAN_ENABLE\n");
+ #ifndef DYNAMIC_CAMID_ALLOC
val8 = (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf;
rtw_write8(Adapter, REG_SECCFG, val8);
DBG_871X_LEVEL(_drv_always_, "REG_SECCFG: %02x\n", rtw_read8(Adapter, REG_SECCFG));
+ #endif
+
SetFwRelatedForWoWLAN8188ES(Adapter, _TRUE);
rtl8188e_set_FwJoinBssReport_cmd(Adapter, 1);
DBG_871X_LEVEL(_drv_always_, "WOWLAN_DISABLE\n");
rtl8188e_set_FwJoinBssReport_cmd(Adapter, 0);
+
+ #ifndef DYNAMIC_CAMID_ALLOC
rtw_write8(Adapter, REG_SECCFG, 0x0c|BIT(5));// enable tx enc and rx dec engine, and no key search for MC/BC
DBG_871X_LEVEL(_drv_always_, "REG_SECCFG: %02x\n", rtw_read8(Adapter, REG_SECCFG));
+ #endif
pwrctl->wowlan_wake_reason =
rtw_read8(Adapter, REG_WOWLAN_WAKE_REASON);
_pkt *pskb;
_adapter *padapter = (_adapter*)priv;
struct recv_priv *precvpriv = &padapter->recvpriv;
-
+ struct recv_buf *precvbuf = NULL;
+
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue)))
{
if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE))
#endif
}
+
+ while (NULL != (precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue)))
+ {
+ DBG_871X("dequeue_recvbuf %p\n", precvbuf);
+ precvbuf->pskb = NULL;
+ precvbuf->reuse = _FALSE;
+ rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+ }
}
if(precvbuf->pskb == NULL)
{
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! precvbuf=%p #####\n", precvbuf);
+ //enqueue precvbuf and wait for free skb
+ rtw_enqueue_recvbuf(precvbuf, &precvpriv->recv_buf_pending_queue);
return _FAIL;
- }
+ }
tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
#define CONFIG_USB_VENDOR_REQ_MUTEX
#endif
+#define DYNAMIC_CAMID_ALLOC
+
+#ifndef CONFIG_RTW_HIQ_FILTER
+ #define CONFIG_RTW_HIQ_FILTER 1
+#endif
//#include <rtl871x_byteorder.h>
u8 ext_iface_num;//primary/secondary iface is excluded
#endif
u8 qos_opt_enable;
+
+ u8 hiq_filter;
};
u32 cur_rx_tp; // Rx throughput in MBps.
};
+struct cam_ctl_t {
+ _lock lock;
+ u64 bitmap;
+};
+
struct cam_entry_cache {
u16 ctrl;
u8 mac[ETH_ALEN];
_adapter *padapters[IFACE_ID_MAX];
u8 iface_nums; // total number of ifaces used runtime
- struct cam_entry_cache cam_cache[32];
+ struct cam_ctl_t cam_ctl;
+ struct cam_entry_cache cam_cache[TOTAL_CAM_ENTRY];
//For 92D, DMDP have 2 interface.
u8 InterfaceNumber;
void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe);
void rtw_dump_raw_rssi_info(_adapter *padapter);
#endif
+
+u8 rtw_hal_busagg_qsel_check(_adapter *padapter,u8 pre_qsel,u8 next_qsel);
+
#endif //__HAL_COMMON_H__
#define CAM_READ 0x00000000
#define CAM_POLLINIG BIT31
-#define SCR_UseDK 0x01
-#define SCR_TxSecEnable 0x02
-#define SCR_RxSecEnable 0x04
-
//
// 10. Power Save Control Registers
//
#define SCR_NoSKMC BIT(5) //No Key Search Multicast
#define SCR_TXBCUSEDK BIT(6) // Force Tx Broadcast packets Use Default Key
#define SCR_RXBCUSEDK BIT(7) // Force Rx Broadcast packets Use Default Key
+#define SCR_CHK_KEYID BIT(8)
//-----------------------------------------------------
//
HW_VAR_RESP_SIFS,
HW_VAR_ACK_PREAMBLE,
HW_VAR_SEC_CFG,
+ HW_VAR_SEC_DK_CFG,
HW_VAR_BCN_VALID,
HW_VAR_RF_TYPE,
HW_VAR_DM_FLAG,
struct set_stakey_parm {
u8 addr[ETH_ALEN];
u8 algorithm;
- u8 id;// currently for erasing cam entry if algorithm == _NO_PRIVACY_
+ u8 keyid;
u8 key[16];
};
extern u8 rtw_createbss_cmd_ex(_adapter *padapter, unsigned char *pbss, unsigned int sz);
u8 rtw_startbss_cmd(_adapter *padapter, int flags);
extern u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch);
-extern u8 rtw_setstakey_cmd(_adapter *padapter, u8 *psta, u8 unicast_key, bool enqueue);
-extern u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue);
+
+struct sta_info;
+extern u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 unicast_key, bool enqueue);
+extern u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue);
+
extern u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network* pnetwork);
u8 rtw_disassoc_cmd(_adapter *padapter, u32 deauth_timeout_ms, bool enqueue);
extern u8 rtw_setopmode_cmd(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype, bool enqueue);
struct ieee80211_channel remain_on_ch_channel;
enum nl80211_channel_type remain_on_ch_type;
u64 remain_on_ch_cookie;
+ bool not_indic_ro_ch_exp;
bool is_ro_ch;
u32 last_ro_ch_time; /* this will be updated at the beginning and end of ro_ch */
};
u8 scanning_via_buddy_intf;
#endif
+ u8 NumOfBcnInfoChkFail;
+ u32 timeBcnInfoChkStart;
};
#define rtw_mlme_set_auto_scan_int(adapter, ms) \
unsigned int is_ap_in_wep(_adapter *padapter);
unsigned int should_forbid_n_rate(_adapter * padapter);
-extern uint rtw_get_camid(uint macid);
+s16 rtw_get_camid(_adapter *adapter, struct sta_info* sta, s16 kid);
+s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid);
+s16 rtw_camid_alloc(_adapter *adapter, struct sta_info *sta, u8 kid);
+void rtw_camid_free(_adapter *adapter, u8 cam_id);
+
extern void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta);
extern void rtw_release_macid(_adapter *padapter, struct sta_info *psta);
extern u8 rtw_search_max_mac_id(_adapter *padapter);
u32 rx_pktcount_filter_out;
u32 rx_crcerrpktcount;
u32 rx_pktloss;
+ BOOLEAN rx_bindicatePkt;
struct recv_stat rxstat;
u32 free_mp_xmitframe_cnt;
BOOLEAN bSetRxBssid;
BOOLEAN bTxBufCkFail;
+ BOOLEAN bPreBrunEfuse;
MPT_CONTEXT MptCtx;
extern ULONG mpt_ProQueryCalTxPower(PADAPTER pAdapter,u8 RfPath);
extern void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart);
extern u8 MptToMgntRate(u32 MptRateIdx);
+extern s32 Rtw_EfuseChkPreBurn8188ESerial(PADAPTER pAdapter);
#endif //_RTW_MP_H_
struct ifqueue rx_indicate_queue;
#endif // CONFIG_RX_INDICATE_QUEUE
-#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
- _queue recv_buf_pending_queue;
-#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX
#endif //defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
u8 *pallocated_recv_buf;
_queue free_recv_buf_queue;
u32 free_recv_buf_queue_cnt;
-#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
+#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_USB_HCI)
_queue recv_buf_pending_queue;
#endif
//u8 szCapability[256]; // For WPA2-PSK using zero-config, by Annie, 2005-09-20.
u8 bWepDefaultKeyIdxSet;
+
+#define DBG_SW_SEC_CNT
+#ifdef DBG_SW_SEC_CNT
+ u64 wep_sw_enc_cnt_bc;
+ u64 wep_sw_enc_cnt_mc;
+ u64 wep_sw_enc_cnt_uc;
+ u64 wep_sw_dec_cnt_bc;
+ u64 wep_sw_dec_cnt_mc;
+ u64 wep_sw_dec_cnt_uc;
+
+ u64 tkip_sw_enc_cnt_bc;
+ u64 tkip_sw_enc_cnt_mc;
+ u64 tkip_sw_enc_cnt_uc;
+ u64 tkip_sw_dec_cnt_bc;
+ u64 tkip_sw_dec_cnt_mc;
+ u64 tkip_sw_dec_cnt_uc;
+
+ u64 aes_sw_enc_cnt_bc;
+ u64 aes_sw_enc_cnt_mc;
+ u64 aes_sw_enc_cnt_uc;
+ u64 aes_sw_dec_cnt_bc;
+ u64 aes_sw_dec_cnt_mc;
+ u64 aes_sw_dec_cnt_uc;
+#endif /* DBG_SW_SEC_CNT */
};
struct sha256_state {
-#define DRIVERVERSION "v4.3.0.2_10792.20140318"
+#define DRIVERVERSION "v4.3.0.5_11894.20140718_beta"
COUNTRY_CODE_MAX
};
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+int rtw_regd_init(_adapter *padapter,
+ void (*reg_notifier)(struct wiphy *wiphy,
+ struct regulatory_request *request));
+void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
+#else
int rtw_regd_init(_adapter *padapter,
int (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request));
int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
-
+#endif
#endif
void rtw_count_tx_stats(_adapter *padapter, struct xmit_frame *pxmitframe, int sz);
extern void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len);
static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta);
-static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta);
+static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta);
extern s32 rtw_make_wlanhdr(_adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib);
extern s32 rtw_put_snap(u8 *data, u16 h_proto);
s32 rtw_xmit(_adapter *padapter, _pkt **pkt);
-
+bool xmitframe_hiq_filter(struct xmit_frame *xmitframe);
#if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS)
sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe);
void stop_sta_xmit(_adapter *padapter, struct sta_info *psta);
#define RTW_MAX_MGMT_TX_CNT (8)\r
\r
#define RTW_SCAN_IE_LEN_MAX 2304\r
-#define RTW_MAX_REMAIN_ON_CHANNEL_DURATION 3000 //ms\r
+#define RTW_MAX_REMAIN_ON_CHANNEL_DURATION 5000 //ms\r
#define RTW_MAX_NUM_PMKIDS 4\r
\r
#define RTW_CH_MAX_2G_CHANNEL 14 /* Max channel in 2G band */\r
}\r
}\r
\r
+static u64 rtw_get_systime_us(void)\r
+{\r
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))\r
+ struct timespec ts;\r
+ get_monotonic_boottime(&ts);\r
+ return ((u64)ts.tv_sec*1000000) + ts.tv_nsec / 1000;\r
+#else\r
+ struct timeval tv;\r
+ do_gettimeofday(&tv);\r
+ return ((u64)tv.tv_sec*1000000) + tv.tv_usec;\r
+#endif\r
+}\r
+\r
#define MAX_BSSINFO_LEN 1000\r
struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnetwork)\r
{\r
u8 *notify_ie;\r
size_t notify_ielen;\r
s32 notify_signal;\r
- u8 buf[MAX_BSSINFO_LEN], *pbuf;\r
+ //u8 buf[MAX_BSSINFO_LEN];\r
+\r
+ u8 *pbuf;\r
+ size_t buf_size = MAX_BSSINFO_LEN;\r
size_t len,bssinf_len=0;\r
struct rtw_ieee80211_hdr *pwlanhdr;\r
unsigned short *fctrl;\r
struct wiphy *wiphy = wdev->wiphy;\r
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);\r
\r
+ pbuf = rtw_zmalloc(buf_size);\r
+ if(pbuf == NULL){\r
+ DBG_871X("%s pbuf allocate failed !! \n",__FUNCTION__);\r
+ return bss;\r
+ }\r
\r
//DBG_8192C("%s\n", __func__);\r
\r
bssinf_len = pnetwork->network.IELength+sizeof (struct rtw_ieee80211_hdr_3addr);\r
- if(bssinf_len > MAX_BSSINFO_LEN){\r
- DBG_871X("%s IE Length too long > %d byte \n",__FUNCTION__,MAX_BSSINFO_LEN);\r
+ if(bssinf_len > buf_size){\r
+ DBG_871X("%s IE Length too long > %zu byte \n",__FUNCTION__,buf_size);\r
goto exit;\r
}\r
\r
\r
notify_channel = ieee80211_get_channel(wiphy, freq);\r
\r
- //rtw_get_timestampe_from_ie()\r
- notify_timestamp = jiffies_to_msecs(jiffies)*1000; /* uSec */\r
+ if (0)\r
+ notify_timestamp = le64_to_cpu(*(u64*)rtw_get_timestampe_from_ie(pnetwork->network.IEs));\r
+ else\r
+ notify_timestamp = rtw_get_systime_us();\r
\r
notify_interval = le16_to_cpu(*(u16*)rtw_get_beacon_interval_from_ie(pnetwork->network.IEs));\r
notify_capability = le16_to_cpu(*(u16*)rtw_get_capability_from_ie(pnetwork->network.IEs)); \r
\r
- \r
notify_ie = pnetwork->network.IEs+_FIXED_IE_LENGTH_;\r
notify_ielen = pnetwork->network.IELength-_FIXED_IE_LENGTH_;\r
\r
DBG_8192C("Capability: %X\n", notify_capability);\r
DBG_8192C("Beacon interval: %d\n", notify_interval);\r
DBG_8192C("Signal: %d\n", notify_signal);\r
- DBG_8192C("notify_timestamp: %#018llx\n", notify_timestamp);\r
+ DBG_8192C("notify_timestamp: %llu\n", notify_timestamp);\r
#endif\r
\r
- pbuf = buf;\r
+ //pbuf = buf;\r
\r
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf; \r
fctrl = &(pwlanhdr->frame_ctl);\r
_rtw_memcpy(pwlanhdr->addr3, pnetwork->network.MacAddress, ETH_ALEN);\r
\r
\r
- pbuf += sizeof(struct rtw_ieee80211_hdr_3addr); \r
+ //pbuf += sizeof(struct rtw_ieee80211_hdr_3addr);\r
len = sizeof (struct rtw_ieee80211_hdr_3addr);\r
+ _rtw_memcpy((pbuf+len), pnetwork->network.IEs, pnetwork->network.IELength);\r
+ *((u64*)(pbuf+len)) = cpu_to_le64(notify_timestamp);\r
\r
- _rtw_memcpy(pbuf, pnetwork->network.IEs, pnetwork->network.IELength);\r
len += pnetwork->network.IELength;\r
\r
//#ifdef CONFIG_P2P\r
// DBG_8192C("%s, got p2p_ie\n", __func__);\r
//}\r
//#endif\r
- \r
\r
#if 1 \r
- bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf,\r
+ bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)pbuf,\r
len, notify_signal, GFP_ATOMIC);\r
#else \r
\r
cfg80211_put_bss(bss);\r
#endif\r
\r
-exit: \r
+exit:\r
+\r
+ if(pbuf)\r
+ rtw_mfree(pbuf, buf_size);\r
+\r
return bss;\r
- \r
}\r
\r
/*\r
pnetwork->Ssid.SsidLength,\r
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);\r
\r
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)\r
+ cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss);\r
+#else\r
+ cfg80211_put_bss(bss);\r
+#endif\r
+\r
return (bss!=NULL);\r
}\r
\r
//DEBUG_ERR((" param->u.crypt.key_len=%d\n",param->u.crypt.key_len));\r
DBG_871X(" ~~~~set sta key:unicastkey\n");\r
\r
- rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE, _TRUE);\r
+ rtw_setstakey_cmd(padapter, psta, _TRUE, _TRUE);\r
}\r
else//group key\r
{\r
DBG_871X(" ~~~~set sta key:groupkey\n");\r
\r
padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;\r
-#ifdef CONFIG_CONCURRENT_MODE \r
- if (padapter->adapter_type == PRIMARY_ADAPTER)\r
- rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1, _TRUE);\r
- else\r
- DBG_871X_LEVEL(_drv_always_, "second interface do not set cam.\n");\r
-#else\r
rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1, _TRUE);\r
-#endif\r
}\r
#ifdef CONFIG_IEEE80211W\r
else if(strcmp(param->u.crypt.alg, "BIP") == 0)\r
{\r
u8 index,blInserted = _FALSE;\r
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);\r
+ struct mlme_priv *mlme = &padapter->mlmepriv;\r
struct security_priv *psecuritypriv = &padapter->securitypriv;\r
u8 strZeroMacAddress[ ETH_ALEN ] = { 0x00 };\r
\r
- DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));\r
+ DBG_871X(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev)\r
+ , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));\r
\r
if ( _rtw_memcmp( pmksa->bssid, strZeroMacAddress, ETH_ALEN ) == _TRUE )\r
{\r
return -EINVAL;\r
}\r
\r
+ if (check_fwstate(mlme, _FW_LINKED) == _FALSE) {\r
+ DBG_871X(FUNC_NDEV_FMT" not set pmksa cause not in linked state\n", FUNC_NDEV_ARG(ndev));\r
+ return -EINVAL;\r
+ }\r
+\r
blInserted = _FALSE;\r
\r
//overwrite PMKID\r
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);\r
struct security_priv *psecuritypriv = &padapter->securitypriv;\r
\r
- DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));\r
+ DBG_871X(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev)\r
+ , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));\r
\r
for(index=0 ; index<NUM_PMKID_CACHE; index++)\r
{\r
_rtw_memset( psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN );\r
psecuritypriv->PMKIDList[index].bUsed = _FALSE;\r
bMatched = _TRUE;\r
+ DBG_871X(FUNC_NDEV_FMT" clear id:%hhu\n", FUNC_NDEV_ARG(ndev), index); \r
break;\r
} \r
}\r
\r
if(pcfg80211_wdinfo->is_ro_ch == _TRUE)\r
{\r
+ pcfg80211_wdinfo->not_indic_ro_ch_exp = _TRUE;\r
DBG_8192C("%s, cancel ro ch timer\n", __func__);\r
- \r
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);\r
-\r
-#ifdef CONFIG_CONCURRENT_MODE\r
- ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); \r
-#endif //CONFIG_CONCURRENT_MODE \r
-\r
+ #ifdef CONFIG_CONCURRENT_MODE\r
+ ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);\r
+ #endif //CONFIG_CONCURRENT_MODE\r
p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK);\r
+ pcfg80211_wdinfo->not_indic_ro_ch_exp = _FALSE;\r
}\r
\r
pcfg80211_wdinfo->is_ro_ch = _TRUE;\r
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));\r
\r
if (pcfg80211_wdinfo->is_ro_ch == _TRUE) {\r
+ pcfg80211_wdinfo->not_indic_ro_ch_exp = _TRUE;\r
DBG_8192C("%s, cancel ro ch timer\n", __func__);\r
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);\r
#ifdef CONFIG_CONCURRENT_MODE\r
ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);\r
#endif\r
p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK);\r
+ pcfg80211_wdinfo->not_indic_ro_ch_exp = _FALSE;\r
}\r
\r
#if 0\r
}
*/
-static char *translate_scan(_adapter *padapter,
+static int search_p2p_wfd_ie(_adapter *padapter,
struct iw_request_info* info, struct wlan_network *pnetwork,
char *start, char *stop)
{
- struct iw_event iwe;
- u16 cap;
- u32 ht_ielen = 0, vht_ielen = 0;
- char custom[MAX_CUSTOM_LEN];
- char *p;
- u16 max_rate=0, rate, ht_cap=_FALSE, vht_cap = _FALSE;
- u32 i = 0;
- char *current_val;
- long rssi;
- u8 bw_40MHz=0, short_GI=0, bw_160MHz=0, vht_highest_rate = 0;
- u16 mcs_rate=0, vht_data_rate=0;
- u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);
- struct registry_priv *pregpriv = &padapter->registrypriv;
#ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
-#endif //CONFIG_P2P
-
-#ifdef CONFIG_P2P
#ifdef CONFIG_WFD
if ( SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type )
{
u32 p2pielen = 0;
// Verifying the P2P IE
- if (rtw_get_p2p_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &p2pielen, pnetwork->network.Reserved[0]))
+ if (rtw_get_p2p_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &p2pielen, pnetwork->network.Reserved[0]))
{
blnGotP2PIE = _TRUE;
}
if ( blnGotP2PIE == _FALSE )
{
- return start;
+ return _FALSE;
}
}
if ( blnGotWFD == _FALSE )
{
- return start;
+ return _FALSE;
}
}
#endif // CONFIG_WFD
#endif //CONFIG_P2P
+ return _TRUE;
+}
+static inline char *iwe_stream_mac_addr_proess(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
/* AP MAC address */
- iwe.cmd = SIOCGIWAP;
- iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
+ iwe->cmd = SIOCGIWAP;
+ iwe->u.ap_addr.sa_family = ARPHRD_ETHER;
- _rtw_memcpy(iwe.u.ap_addr.sa_data, pnetwork->network.MacAddress, ETH_ALEN);
- start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_ADDR_LEN);
+ _rtw_memcpy(iwe->u.ap_addr.sa_data, pnetwork->network.MacAddress, ETH_ALEN);
+ start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_ADDR_LEN);
+ return start;
+}
+static inline char * iwe_stream_essid_proess(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
/* Add the ESSID */
- iwe.cmd = SIOCGIWESSID;
- iwe.u.data.flags = 1;
- iwe.u.data.length = min((u16)pnetwork->network.Ssid.SsidLength, (u16)32);
- start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid);
+ iwe->cmd = SIOCGIWESSID;
+ iwe->u.data.flags = 1;
+ iwe->u.data.length = min((u16)pnetwork->network.Ssid.SsidLength, (u16)32);
+ start = iwe_stream_add_point(info, start, stop, iwe, pnetwork->network.Ssid.Ssid);
+ return start;
+}
- //parsing HT_CAP_IE
- if (pnetwork->network.Reserved[0] == 2) // Probe Request
- {
- p = rtw_get_ie(&pnetwork->network.IEs[0], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength);
+static inline char * iwe_stream_chan_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ if(pnetwork->network.Configuration.DSConfig<1 /*|| pnetwork->network.Configuration.DSConfig>14*/)
+ pnetwork->network.Configuration.DSConfig = 1;
+
+ /* Add frequency/channel */
+ iwe->cmd = SIOCGIWFREQ;
+ iwe->u.freq.m = rtw_ch2freq(pnetwork->network.Configuration.DSConfig) * 100000;
+ iwe->u.freq.e = 1;
+ iwe->u.freq.i = pnetwork->network.Configuration.DSConfig;
+ start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_FREQ_LEN);
+ return start;
+}
+
+static inline char * iwe_stream_mode_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe,u16 cap)
+{
+ /* Add mode */
+ if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_BSS)){
+ iwe->cmd = SIOCGIWMODE;
+ if (cap & WLAN_CAPABILITY_BSS)
+ iwe->u.mode = IW_MODE_MASTER;
+ else
+ iwe->u.mode = IW_MODE_ADHOC;
+
+ start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_UINT_LEN);
}
+ return start;
+}
+
+static inline char * iwe_stream_encryption_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe,u16 cap)
+{
+ /* Add encryption capability */
+ iwe->cmd = SIOCGIWENCODE;
+ if (cap & WLAN_CAPABILITY_PRIVACY)
+ iwe->u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
else
- {
- p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12);
- }
+ iwe->u.data.flags = IW_ENCODE_DISABLED;
+ iwe->u.data.length = 0;
+ start = iwe_stream_add_point(info, start, stop, iwe, pnetwork->network.Ssid.Ssid);
+ return start;
+}
+
+static inline char * iwe_stream_protocol_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ u16 ht_cap=_FALSE,vht_cap = _FALSE;
+ u32 ht_ielen = 0, vht_ielen = 0;
+ char *p;
+ u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);// Probe Request
+
+ //parsing HT_CAP_IE
+ p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-ie_offset);
if(p && ht_ielen>0)
- {
- struct rtw_ieee80211_ht_cap *pht_capie;
- ht_cap = _TRUE;
- pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
- _rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
- bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0;
- short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0;
- }
+ ht_cap = _TRUE;
-#ifdef CONFIG_80211AC_VHT
+ #ifdef CONFIG_80211AC_VHT
//parsing VHT_CAP_IE
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength-ie_offset);
if(p && vht_ielen>0)
- {
- u8 mcs_map[2];
-
- vht_cap = _TRUE;
- bw_160MHz = GET_VHT_CAPABILITY_ELE_CHL_WIDTH(p+2);
- if(bw_160MHz)
- short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI160M(p+2);
- else
- short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI80M(p+2);
-
- _rtw_memcpy(mcs_map, GET_VHT_CAPABILITY_ELE_TX_MCS(p+2), 2);
-
- vht_highest_rate = rtw_get_vht_highest_rate(mcs_map);
- vht_data_rate = rtw_vht_mcs_to_data_rate(CHANNEL_WIDTH_80, short_GI, vht_highest_rate);
- }
-#endif
-
+ vht_cap = _TRUE;
+ #endif
/* Add the protocol name */
- iwe.cmd = SIOCGIWNAME;
- if ((rtw_is_cckratesonly_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE)
+ iwe->cmd = SIOCGIWNAME;
+ if ((rtw_is_cckratesonly_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE)
{
if(ht_cap == _TRUE)
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bn");
else
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b");
- }
- else if ((rtw_is_cckrates_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE)
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11b");
+ }
+ else if ((rtw_is_cckrates_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE)
{
if(ht_cap == _TRUE)
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bgn");
else
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg");
- }
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bg");
+ }
else
{
if(pnetwork->network.Configuration.DSConfig > 14)
{
if(vht_cap == _TRUE)
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11AC");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11AC");
else if(ht_cap == _TRUE)
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11an");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11an");
else
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11a");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11a");
}
else
{
if(ht_cap == _TRUE)
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11gn");
else
- snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g");
+ snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11g");
}
- }
+ }
+ start = iwe_stream_add_event(info, start, stop, iwe, IW_EV_CHAR_LEN);
+ return start;
+}
- start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN);
+static inline char * iwe_stream_rate_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ u32 ht_ielen = 0, vht_ielen = 0;
+ char *p;
+ u16 max_rate=0, rate, ht_cap=_FALSE, vht_cap = _FALSE;
+ u32 i = 0;
+ u8 bw_40MHz=0, short_GI=0, bw_160MHz=0, vht_highest_rate = 0;
+ u16 mcs_rate=0, vht_data_rate=0;
+ char custom[MAX_CUSTOM_LEN]={0};
+ u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);// Probe Request
- /* Add mode */
- if (pnetwork->network.Reserved[0] == 2) // Probe Request
+ //parsing HT_CAP_IE
+ p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-ie_offset);
+ if(p && ht_ielen>0)
{
- cap = 0;
+ struct rtw_ieee80211_ht_cap *pht_capie;
+ ht_cap = _TRUE;
+ pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
+ _rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
+ bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0;
+ short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0;
}
- else
+
+#ifdef CONFIG_80211AC_VHT
+ //parsing VHT_CAP_IE
+ p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength-ie_offset);
+ if(p && vht_ielen>0)
{
- iwe.cmd = SIOCGIWMODE;
- _rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
- cap = le16_to_cpu(cap);
- }
+ u8 mcs_map[2];
- if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_BSS)){
- if (cap & WLAN_CAPABILITY_BSS)
- iwe.u.mode = IW_MODE_MASTER;
+ vht_cap = _TRUE;
+ bw_160MHz = GET_VHT_CAPABILITY_ELE_CHL_WIDTH(p+2);
+ if(bw_160MHz)
+ short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI160M(p+2);
else
- iwe.u.mode = IW_MODE_ADHOC;
-
- start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN);
- }
-
- if(pnetwork->network.Configuration.DSConfig<1 /*|| pnetwork->network.Configuration.DSConfig>14*/)
- pnetwork->network.Configuration.DSConfig = 1;
+ short_GI = GET_VHT_CAPABILITY_ELE_SHORT_GI80M(p+2);
- /* Add frequency/channel */
- iwe.cmd = SIOCGIWFREQ;
- iwe.u.freq.m = rtw_ch2freq(pnetwork->network.Configuration.DSConfig) * 100000;
- iwe.u.freq.e = 1;
- iwe.u.freq.i = pnetwork->network.Configuration.DSConfig;
- start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN);
+ _rtw_memcpy(mcs_map, GET_VHT_CAPABILITY_ELE_TX_MCS(p+2), 2);
- /* Add encryption capability */
- iwe.cmd = SIOCGIWENCODE;
- if (cap & WLAN_CAPABILITY_PRIVACY)
- iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
- else
- iwe.u.data.flags = IW_ENCODE_DISABLED;
- iwe.u.data.length = 0;
- start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid);
+ vht_highest_rate = rtw_get_vht_highest_rate(mcs_map);
+ vht_data_rate = rtw_vht_mcs_to_data_rate(CHANNEL_WIDTH_80, short_GI, vht_highest_rate);
+ }
+#endif
/*Add basic and extended rates */
- max_rate = 0;
p = custom;
p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Rates (Mb/s): ");
while(pnetwork->network.SupportedRates[i]!=0)
{
- rate = pnetwork->network.SupportedRates[i]&0x7F;
+ rate = pnetwork->network.SupportedRates[i]&0x7F;
if (rate > max_rate)
max_rate = rate;
p += snprintf(p, MAX_CUSTOM_LEN - (p - custom),
if(mcs_rate&0x8000)//MCS15
{
max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130);
-
}
else if(mcs_rate&0x0080)//MCS7
{
max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65);
}
- max_rate = max_rate*2;//Mbps/2;
+ max_rate = max_rate*2;//Mbps/2;
}
- iwe.cmd = SIOCGIWRATE;
- iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
- iwe.u.bitrate.value = max_rate * 500000;
- start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_PARAM_LEN);
+ iwe->cmd = SIOCGIWRATE;
+ iwe->u.bitrate.fixed = iwe->u.bitrate.disabled = 0;
+ iwe->u.bitrate.value = max_rate * 500000;
+ start =iwe_stream_add_event(info, start, stop, iwe, IW_EV_PARAM_LEN);
+ return start ;
+}
- //parsing WPA/WPA2 IE
- if (pnetwork->network.Reserved[0] != 2) // Probe Request
- {
- u8 buf[MAX_WPA_IE_LEN*2];
- u8 wpa_ie[255],rsn_ie[255];
- u16 wpa_len=0,rsn_len=0;
- u8 *p;
- sint out_len=0;
- out_len=rtw_get_sec_ie(pnetwork->network.IEs ,pnetwork->network.IELength,rsn_ie,&rsn_len,wpa_ie,&wpa_len);
- RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid));
- RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len));
+static inline char * iwe_stream_wpa_wpa2_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ int buf_size = MAX_WPA_IE_LEN*2;
+ //u8 pbuf[buf_size]={0};
+ u8 *pbuf = rtw_zmalloc(buf_size);
+
+ u8 wpa_ie[255]={0},rsn_ie[255]={0};
+ u16 i, wpa_len=0,rsn_len=0;
+ u8 *p;
+ sint out_len=0;
- if (wpa_len > 0)
+ if(pbuf){
+ p=pbuf;
+
+ //parsing WPA/WPA2 IE
+ if (pnetwork->network.Reserved[0] != 2) // Probe Request
{
- p=buf;
- _rtw_memset(buf, 0, MAX_WPA_IE_LEN*2);
- p += sprintf(p, "wpa_ie=");
- for (i = 0; i < wpa_len; i++) {
- p += sprintf(p, "%02x", wpa_ie[i]);
- }
+ out_len=rtw_get_sec_ie(pnetwork->network.IEs ,pnetwork->network.IELength,rsn_ie,&rsn_len,wpa_ie,&wpa_len);
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid));
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len));
- if (wpa_len > 100) {
- printk("-----------------Len %d----------------\n", wpa_len);
+ if (wpa_len > 0){
+ _rtw_memset(pbuf, 0, buf_size);
+ p += sprintf(p, "wpa_ie=");
for (i = 0; i < wpa_len; i++) {
- printk("%02x ", wpa_ie[i]);
+ p += sprintf(p, "%02x", wpa_ie[i]);
}
- printk("\n");
- printk("-----------------Len %d----------------\n", wpa_len);
+
+ if (wpa_len > 100) {
+ printk("-----------------Len %d----------------\n", wpa_len);
+ for (i = 0; i < wpa_len; i++) {
+ printk("%02x ", wpa_ie[i]);
+ }
+ printk("\n");
+ printk("-----------------Len %d----------------\n", wpa_len);
+ }
+
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd = IWEVCUSTOM;
+ iwe->u.data.length = strlen(pbuf);
+ start = iwe_stream_add_point(info, start, stop, iwe,pbuf);
+
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd =IWEVGENIE;
+ iwe->u.data.length = wpa_len;
+ start = iwe_stream_add_point(info, start, stop, iwe, wpa_ie);
}
-
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = strlen(buf);
- start = iwe_stream_add_point(info, start, stop, &iwe,buf);
-
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd =IWEVGENIE;
- iwe.u.data.length = wpa_len;
- start = iwe_stream_add_point(info, start, stop, &iwe, wpa_ie);
- }
- if (rsn_len > 0)
- {
- p = buf;
- _rtw_memset(buf, 0, MAX_WPA_IE_LEN*2);
- p += sprintf(p, "rsn_ie=");
- for (i = 0; i < rsn_len; i++) {
- p += sprintf(p, "%02x", rsn_ie[i]);
+
+ if (rsn_len > 0){
+ _rtw_memset(pbuf, 0, buf_size);
+ p += sprintf(p, "rsn_ie=");
+ for (i = 0; i < rsn_len; i++) {
+ p += sprintf(p, "%02x", rsn_ie[i]);
+ }
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd = IWEVCUSTOM;
+ iwe->u.data.length = strlen(pbuf);
+ start = iwe_stream_add_point(info, start, stop, iwe,pbuf);
+
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd =IWEVGENIE;
+ iwe->u.data.length = rsn_len;
+ start = iwe_stream_add_point(info, start, stop, iwe, rsn_ie);
}
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = strlen(buf);
- start = iwe_stream_add_point(info, start, stop, &iwe,buf);
-
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd =IWEVGENIE;
- iwe.u.data.length = rsn_len;
- start = iwe_stream_add_point(info, start, stop, &iwe, rsn_ie);
}
+
+ rtw_mfree(pbuf, buf_size);
}
+ return start;
+}
- { //parsing WPS IE
- uint cnt = 0,total_ielen;
- u8 *wpsie_ptr=NULL;
- uint wps_ielen = 0;
+static inline char * iwe_stream_wps_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ //parsing WPS IE
+ uint cnt = 0,total_ielen;
+ u8 *wpsie_ptr=NULL;
+ uint wps_ielen = 0;
+ u8 ie_offset = (pnetwork->network.Reserved[0] == 2? 0:12);
- u8 *ie_ptr = pnetwork->network.IEs + ie_offset;
- total_ielen= pnetwork->network.IELength - ie_offset;
+ u8 *ie_ptr = pnetwork->network.IEs + ie_offset;
+ total_ielen= pnetwork->network.IELength - ie_offset;
- if (pnetwork->network.Reserved[0] == 2) // Probe Request
- {
- ie_ptr = pnetwork->network.IEs;
- total_ielen = pnetwork->network.IELength;
- }
- else // Beacon or Probe Respones
- {
- ie_ptr = pnetwork->network.IEs + _FIXED_IE_LENGTH_;
- total_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_;
- }
-
- while(cnt < total_ielen)
+ if (pnetwork->network.Reserved[0] == 2) // Probe Request
+ {
+ ie_ptr = pnetwork->network.IEs;
+ total_ielen = pnetwork->network.IELength;
+ }
+ else // Beacon or Probe Respones
+ {
+ ie_ptr = pnetwork->network.IEs + _FIXED_IE_LENGTH_;
+ total_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_;
+ }
+
+ while(cnt < total_ielen)
+ {
+ if(rtw_is_wps_ie(&ie_ptr[cnt], &wps_ielen) && (wps_ielen>2))
{
- if(rtw_is_wps_ie(&ie_ptr[cnt], &wps_ielen) && (wps_ielen>2))
- {
- wpsie_ptr = &ie_ptr[cnt];
- iwe.cmd =IWEVGENIE;
- iwe.u.data.length = (u16)wps_ielen;
- start = iwe_stream_add_point(info, start, stop, &iwe, wpsie_ptr);
- }
- cnt+=ie_ptr[cnt+1]+2; //goto next
+ wpsie_ptr = &ie_ptr[cnt];
+ iwe->cmd =IWEVGENIE;
+ iwe->u.data.length = (u16)wps_ielen;
+ start = iwe_stream_add_point(info, start, stop,iwe, wpsie_ptr);
}
+ cnt+=ie_ptr[cnt+1]+2; //goto next
}
+ return start;
+}
+static inline char * iwe_stream_wapi_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
#ifdef CONFIG_WAPI_SUPPORT
+ char *p;
+
if (pnetwork->network.Reserved[0] != 2) // Probe Request
{
sint out_len_wapi=0;
/* here use static for stack size */
- static u8 buf_wapi[MAX_WAPI_IE_LEN*2];
- static u8 wapi_ie[MAX_WAPI_IE_LEN];
+ static u8 buf_wapi[MAX_WAPI_IE_LEN*2]={0};
+ static u8 wapi_ie[MAX_WAPI_IE_LEN]={0};
u16 wapi_len=0;
u16 i;
- _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN);
- _rtw_memset(wapi_ie, 0, MAX_WAPI_IE_LEN);
-
out_len_wapi=rtw_get_wapi_ie(pnetwork->network.IEs ,pnetwork->network.IELength,wapi_ie,&wapi_len);
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid));
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wapi_len=%d \n",wapi_len));
DBG_871X("rtw_wx_get_scan: %s ",pnetwork->network.Ssid.Ssid);
DBG_871X("rtw_wx_get_scan: ssid = %d ",wapi_len);
-
if (wapi_len > 0)
{
p=buf_wapi;
- _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2);
+ //_rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2);
p += sprintf(p, "wapi_ie=");
for (i = 0; i < wapi_len; i++) {
p += sprintf(p, "%02x", wapi_ie[i]);
}
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = strlen(buf_wapi);
- start = iwe_stream_add_point(info, start, stop, &iwe,buf_wapi);
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd = IWEVCUSTOM;
+ iwe->u.data.length = strlen(buf_wapi);
+ start = iwe_stream_add_point(info, start, stop, iwe,buf_wapi);
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd =IWEVGENIE;
- iwe.u.data.length = wapi_len;
- start = iwe_stream_add_point(info, start, stop, &iwe, wapi_ie);
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd =IWEVGENIE;
+ iwe->u.data.length = wapi_len;
+ start = iwe_stream_add_point(info, start, stop, iwe, wapi_ie);
}
}
-#endif
+#endif//#ifdef CONFIG_WAPI_SUPPORT
+ return start;
+}
+static inline char * iwe_stream_rssi_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
{
- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
u8 ss, sq;
-
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+
/* Add quality statistics */
- iwe.cmd = IWEVQUAL;
- iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID
+ iwe->cmd = IWEVQUAL;
+ iwe->u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED
+ #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR)
+ | IW_QUAL_NOISE_UPDATED
+ #else
+ | IW_QUAL_NOISE_INVALID
+ #endif
#ifdef CONFIG_SIGNAL_DISPLAY_DBM
| IW_QUAL_DBM
#endif
ss = pnetwork->network.PhyInfo.SignalStrength;
sq = pnetwork->network.PhyInfo.SignalQuality;
}
-
-
+
#ifdef CONFIG_SIGNAL_DISPLAY_DBM
- iwe.u.qual.level = (u8) translate_percentage_to_dbm(ss);//dbm
+ iwe->u.qual.level = (u8) translate_percentage_to_dbm(ss);//dbm
#else
- iwe.u.qual.level = (u8)ss;//%
+ #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING
+ {
+ /* Do signal scale mapping when using percentage as the unit of signal strength, since the scale mapping is skipped in odm */
+ HAL_DATA_TYPE *pHal = GET_HAL_DATA(padapter);
+ iwe->u.qual.level = (u8)odm_SignalScaleMapping(&pHal->odmpriv, ss);
+ }
+ #else
+ iwe->u.qual.level = (u8)ss;//%
#endif
-
- iwe.u.qual.qual = (u8)sq; // signal quality
+ #endif
+
+ iwe->u.qual.qual = (u8)sq; // signal quality
#ifdef CONFIG_PLATFORM_ROCKCHIPS
- iwe.u.qual.noise = -100; // noise level suggest by zhf@rockchips
- #else
- iwe.u.qual.noise = 0; // noise level
+ iwe->u.qual.noise = -100; // noise level suggest by zhf@rockchips
+ #else
+ #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && defined(CONFIG_BACKGROUND_NOISE_MONITOR)
+ {
+ s16 tmp_noise=0;
+ rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR,&(pnetwork->network.Configuration.DSConfig), &(tmp_noise));
+ iwe->u.qual.noise = tmp_noise;
+ }
+ #else
+ iwe->u.qual.noise = 0; // noise level
+ #endif
#endif //CONFIG_PLATFORM_ROCKCHIPS
-
+
//DBG_871X("iqual=%d, ilevel=%d, inoise=%d, iupdated=%d\n", iwe.u.qual.qual, iwe.u.qual.level , iwe.u.qual.noise, iwe.u.qual.updated);
- 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);
+ return start;
+}
+
+static inline char * iwe_stream_net_rsv_process(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop,struct iw_event *iwe)
+{
+ u8 buf[32] = {0};
+ u8 * p,*pos;
+ int len;
+ p = buf;
+ pos = pnetwork->network.Reserved;
+
+ p += sprintf(p, "fm=%02X%02X", pos[1], pos[0]);
+ _rtw_memset(iwe, 0, sizeof(iwe));
+ iwe->cmd = IWEVCUSTOM;
+ iwe->u.data.length = strlen(buf);
+ start = iwe_stream_add_point(info, start, stop,iwe, buf);
+ return start;
}
+static char *translate_scan(_adapter *padapter,
+ struct iw_request_info* info, struct wlan_network *pnetwork,
+ char *start, char *stop)
+{
+ struct iw_event iwe;
+ u16 cap = 0;
+ _rtw_memset(&iwe, 0, sizeof(iwe));
+
+ if(_FALSE == search_p2p_wfd_ie(padapter,info,pnetwork,start,stop))
+ return start;
+
+ start = iwe_stream_mac_addr_proess(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_essid_proess(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_protocol_process(padapter,info,pnetwork,start,stop,&iwe);
+ if (pnetwork->network.Reserved[0] == 2) // Probe Request
{
- u8 buf[MAX_WPA_IE_LEN];
- u8 * p,*pos;
- int len;
- p = buf;
- pos = pnetwork->network.Reserved;
- _rtw_memset(buf, 0, MAX_WPA_IE_LEN);
- p += sprintf(p, "fm=%02X%02X", pos[1], pos[0]);
- _rtw_memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = strlen(buf);
- start = iwe_stream_add_point(info, start, stop, &iwe, buf);
+ cap = 0;
}
-
- return start;
+ else
+ {
+ _rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
+ cap = le16_to_cpu(cap);
+ }
+
+ start = iwe_stream_mode_process(padapter,info,pnetwork,start,stop,&iwe,cap);
+ start = iwe_stream_chan_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_encryption_process(padapter,info,pnetwork,start,stop,&iwe,cap);
+ start = iwe_stream_rate_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_wpa_wpa2_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_wps_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_wapi_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_rssi_process(padapter,info,pnetwork,start,stop,&iwe);
+ start = iwe_stream_net_rsv_process(padapter,info,pnetwork,start,stop,&iwe);
+
+ return start;
}
static int wpa_set_auth_algs(struct net_device *dev, u32 value)
//DEBUG_ERR((" param->u.crypt.key_len=%d\n",param->u.crypt.key_len));
DBG_871X(" ~~~~set sta key:unicastkey\n");
- rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE, _TRUE);
+ rtw_setstakey_cmd(padapter, psta, _TRUE, _TRUE);
}
else//group key
{
struct pwrctrl_priv *pwrctrlpriv ;
PHAL_DATA_TYPE pHalData;
PEFUSE_HAL pEfuseHal;
-
+ struct mp_priv *pmppriv;
+
u8 ips_mode = IPS_NUM; // init invalid value
u8 lps_mode = PS_MODE_NUM; // init invalid value
u32 i=0,j=0, jj, kk;
pwrctrlpriv = adapter_to_pwrctl(padapter);
pHalData = GET_HAL_DATA(padapter);
pEfuseHal = &pHalData->EfuseHal;
+ pmppriv = &padapter->mppriv;
+
err = 0;
if (copy_from_user(extra, wrqu->pointer, wrqu->length))
// wmap,addr,00e04c871200
if (strcmp(tmp[0], "wmap") == 0)
{
+#if defined(CONFIG_RTL8188E) || defined(CONFIG_USB_HCI)
+ if(pmppriv->bPreBrunEfuse==_FALSE)
+ Rtw_EfuseChkPreBurn8188ESerial(padapter);
+#endif
if ((tmp[1]==NULL) || (tmp[2]==NULL))
{
err = -EINVAL;
goto exit;
}
-
#if 1
// unknown bug workaround, need to fix later
addr=0x1ff;
err = -EINVAL;
goto exit;
}
-
DBG_871X("%s: addr=0x%X\n", __FUNCTION__, addr);
DBG_871X("%s: cnts=%d\n", __FUNCTION__, cnts);
DBG_871X("%s: map data=%s\n", __FUNCTION__, tmp[2]);
DBG_871X("_rtw_mp_xmit_priv for Download BT patch FW\n");
_rtw_mp_xmit_priv(&padapter->xmitpriv);
#endif
-
+ pHalFunc->hal_deinit(padapter);
padapter->registrypriv.mp_mode =1;
-
+ pHalFunc->hal_init(padapter);
rtw_pm_set_ips(padapter,IPS_NONE);
LeaveAllPowerSaveMode(padapter);
u32 mac_cck_err=0, mac_ofdm_err=0, mac_ht_err=0, mac_vht_err=0;
u8 input[wrqu->length];
char *pch, *ptmp, *token, *tmp[2]={0x00,0x00};
- u32 i=0,ii=0,jj=0,kk=0,cnts=0;
+ u32 i=0,ii=0,jj=0,kk=0,cnts=0,bmon=0;
PADAPTER padapter = rtw_netdev_priv(dev);
struct mp_priv *pmppriv = &padapter->mppriv;
+
if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT;
bSetBssid = (strncmp(input, "setbssid=", 8)==0)?1:0; // strncmp TRUE is 0
//bfilter_init = (strncmp(input, "filter_init",11)==0)?1:0;
bmac_filter = (strncmp(input, "accept_mac",10)==0)?1:0;
+ bmon = (strncmp(input, "mon=",4)==0)?1:0;
if(bSetBssid==1){
sprintf( extra, "Mac Received packet OK: %d , CRC error: %d , Drop Packets: %d\n",
mac_cck_ok+mac_ofdm_ok+mac_ht_ok+mac_vht_ok,mac_cck_err+mac_ofdm_err+mac_ht_err+mac_vht_err,DropPacket);
}
+
+
+
+ if( bmon==1 ) {
+ sscanf(input, "mon=%d", &bmon);
+ if(bmon==1) {
+ pmppriv->rx_bindicatePkt= _TRUE;
+ sprintf( extra, "Indicating Receive Packet to network start\n");
+ }else {
+ pmppriv->rx_bindicatePkt= _FALSE;
+ sprintf( extra, "Indicating Receive Packet to network Stop\n");
+ }
+ }
wrqu->length = strlen(extra) + 1;
module_param(ifname, charp, 0644);
MODULE_PARM_DESC(ifname, "The default name to allocate for first interface");
-char* if2name = "p2p0";
+char* if2name = "wlan%d";
module_param(if2name, charp, 0644);
MODULE_PARM_DESC(if2name, "The default name to allocate for second interface");
module_param(rtw_notch_filter, uint, 0644);
MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P");
+uint rtw_hiq_filter = CONFIG_RTW_HIQ_FILTER;
+module_param(rtw_hiq_filter, uint, 0644);
+MODULE_PARM_DESC(rtw_hiq_filter, "0:allow all, 1:allow special, 2:deny all");
+
#if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY) //eFuse: Regulatory selection=1
int rtw_tx_pwr_lmt_enable = 1;
int rtw_tx_pwr_by_rate = 1;
#endif
registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable;
+ registry_par->hiq_filter = (u8)rtw_hiq_filter;
_func_exit_;
return status;
ATOMIC_SET(&pdvobj->disable_func, 0);
+ _rtw_spinlock_init(&pdvobj->cam_ctl.lock);
+
return pdvobj;
}
_rtw_mutex_free(&pdvobj->setch_mutex);
_rtw_mutex_free(&pdvobj->setbw_mutex);
+ _rtw_spinlock_free(&pdvobj->cam_ctl.lock);
+
rtw_mfree((u8*)pdvobj, sizeof(*pdvobj));
}
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
u8 i;
- DBG_871X_SEL_NL(m, "%-2s %-6s %-17s %-32s %-7s %-3s"
- //" %-2s %-2s"
+ DBG_871X_SEL_NL(m, "cam bitmap:0x%016llx\n", dvobj->cam_ctl.bitmap);
+
+ DBG_871X_SEL_NL(m, "%-2s %-6s %-17s %-32s %-3s %-7s"
+ //" %-2s %-2s %-4s %-5s"
"\n"
- , "id", "ctrl", "mac", "key", "type", "kid"
- //, "DK", "GK"
+ , "id", "ctrl", "addr", "key", "kid", "type"
+ //, "MK", "GK", "MFB", "valid"
);
for (i=0;i<32;i++) {
if (dvobj->cam_cache[i].ctrl != 0)
- DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %-7s %3u"
- //" %2u %2u"
+ DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %3u %-7s"
+ //" %2u %2u 0x%02x %5u"
"\n", i
, dvobj->cam_cache[i].ctrl
, MAC_ARG(dvobj->cam_cache[i].mac)
, KEY_ARG(dvobj->cam_cache[i].key)
- , security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07)
, (dvobj->cam_cache[i].ctrl)&0x03
+ , security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07)
//, ((dvobj->cam_cache[i].ctrl)>>5)&0x01
//, ((dvobj->cam_cache[i].ctrl)>>6)&0x01
+ //, ((dvobj->cam_cache[i].ctrl)>>8)&0x7f
+ //, ((dvobj->cam_cache[i].ctrl)>>15)&0x01
);
}
rtw_mstat_dump(RTW_DBGDUMP);
}
+
#include "wifi_version.h"
#include <linux/rfkill-wlan.h>
EXPORT_SYMBOL(rockchip_wifi_init_module);
EXPORT_SYMBOL(rockchip_wifi_exit_module);
+//module_init(rtw_drv_entry);
+//module_exit(rtw_drv_halt);
#ifdef CONFIG_INTEL_PROXIM
_adapter *rtw_usb_get_sw_pointer(void)
case BK_QUEUE_INX:\r
pxmitpriv->bkq_cnt--; \r
break;\r
- case HIGH_QUEUE_INX:\r
-#ifdef CONFIG_AP_MODE \r
- rtw_chk_hi_queue_cmd(padapter);\r
-#endif\r
- break;\r
default: \r
break;\r
}\r
#endif
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+static int _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
+ struct wiphy *wiphy,
+ void (*reg_notifier) (struct wiphy * wiphy,
+ struct regulatory_request *
+ request))
+#else
static int _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
struct wiphy *wiphy,
int (*reg_notifier) (struct wiphy * wiphy,
struct regulatory_request *
request))
+#endif
{
const struct ieee80211_regdomain *regd;
return NULL;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
int rtw_regd_init(_adapter * padapter,
- int (*reg_notifier) (struct wiphy * wiphy,
+ void (*reg_notifier) (struct wiphy * wiphy,
struct regulatory_request * request))
+#else
+int rtw_regd_init(_adapter * padapter,
+ int (*reg_notifier) (struct wiphy * wiphy,
+ struct regulatory_request * request))
+#endif
{
//struct registry_priv *registrypriv = &padapter->registrypriv;
struct wiphy *wiphy = padapter->rtw_wdev->wiphy;
return 0;
}
-int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
{
struct rtw_regulatory *reg = NULL;
DBG_8192C("%s\n", __func__);
- return _rtw_reg_notifier_apply(wiphy, request, reg);
+ _rtw_reg_notifier_apply(wiphy, request, reg);
+}
+#else
+int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
+{
+ struct rtw_regulatory *reg = NULL;
+
+ DBG_8192C("%s\n", __func__);
+
+ return _rtw_reg_notifier_apply(wiphy, request, reg);
}
-#endif //CONFIG_IOCTL_CFG80211
\ No newline at end of file
+#endif
+#endif //CONFIG_IOCTL_CFG80211
/*
* Broadcom BCM4319 driver version.
*/
-#define RTL8192_DRV_VERSION "3.50.WFD"
+#define RTL8192_DRV_VERSION "3.60.WFD"
#endif /* WIFI_VERSION_H */
_func_enter_;
+ if(padapter->registrypriv.mp_mode)
+ {
+ DBG_871X("MP_TX_DROP_OS_FRAME\n");
+ goto drop_packet;
+ }
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+xmit_enry\n"));
if (rtw_if_up(padapter) == _FALSE) {
if ( !rtw_mc2u_disable
&& check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE
&& ( IP_MCAST_MAC(pkt->data)
- || ICMPV6_MCAST_MAC(pkt->data) )
+ || ICMPV6_MCAST_MAC(pkt->data)
+ #ifdef CONFIG_TX_BCAST2UNI
+ || is_broadcast_mac_addr(pkt->data)
+ #endif
+ )
&& (padapter->registrypriv.wifi_spec == 0)
)
{