mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Convert C90 comments
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
54abf571c4
commit
592c85f4e2
47 changed files with 4098 additions and 4374 deletions
|
@ -46,7 +46,7 @@ static u8 _is_fw_read_cmd_down(struct adapter* padapter, u8 msgbox_num)
|
|||
|
||||
u8 valid;
|
||||
|
||||
//DBG_8192C(" _is_fw_read_cmd_down ,reg_1cc(%x),msg_box(%d)...\n",rtw_read8(padapter,REG_HMETFR),msgbox_num);
|
||||
/* DBG_8192C(" _is_fw_read_cmd_down ,reg_1cc(%x),msg_box(%d)...\n",rtw_read8(padapter,REG_HMETFR),msgbox_num); */
|
||||
|
||||
do{
|
||||
valid = rtw_read8(padapter,REG_HMETFR) & BIT(msgbox_num);
|
||||
|
@ -108,7 +108,7 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
|
|||
if (padapter->bSurpriseRemoved == true)
|
||||
goto exit;
|
||||
|
||||
//pay attention to if race condition happened in H2C cmd setting.
|
||||
/* pay attention to if race condition happened in H2C cmd setting. */
|
||||
do{
|
||||
h2c_box_num = pHalData->LastHMEBoxNum;
|
||||
|
||||
|
@ -128,7 +128,7 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
|
|||
ext_cmd_len = CmdLen-3;
|
||||
memcpy((u8*)(&h2c_cmd_ex), pCmdBuffer+3,ext_cmd_len );
|
||||
|
||||
//Write Ext command
|
||||
/* Write Ext command */
|
||||
msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num *RTL88E_EX_MESSAGE_BOX_SIZE);
|
||||
#ifdef CONFIG_H2C_EF
|
||||
for(cmd_idx=0;cmd_idx<ext_cmd_len;cmd_idx++ ){
|
||||
|
@ -139,7 +139,7 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
|
|||
rtw_write32(padapter, msgbox_ex_addr, h2c_cmd_ex);
|
||||
#endif
|
||||
}
|
||||
// Write command
|
||||
/* Write command */
|
||||
msgbox_addr =REG_HMEBOX_0 + (h2c_box_num *RTL88E_MESSAGE_BOX_SIZE);
|
||||
#ifdef CONFIG_H2C_EF
|
||||
for(cmd_idx=0;cmd_idx<RTL88E_MESSAGE_BOX_SIZE;cmd_idx++ ){
|
||||
|
@ -152,11 +152,7 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
|
|||
|
||||
bcmd_down = true;
|
||||
|
||||
// DBG_8192C("MSG_BOX:%d,CmdLen(%d), reg:0x%x =>h2c_cmd:0x%x, reg:0x%x =>h2c_cmd_ex:0x%x ..\n"
|
||||
// ,pHalData->LastHMEBoxNum ,CmdLen,msgbox_addr,h2c_cmd,msgbox_ex_addr,h2c_cmd_ex);
|
||||
|
||||
pHalData->LastHMEBoxNum = (h2c_box_num+1) % RTL88E_MAX_H2C_BOX_NUMS;
|
||||
|
||||
}while((!bcmd_down) && (retry_cnts--));
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
@ -205,15 +201,13 @@ u8 rtl8188e_set_raid_cmd(struct adapter*padapter, u32 mask)
|
|||
return res;
|
||||
}
|
||||
|
||||
//bitmap[0:27] = tx_rate_bitmap
|
||||
//bitmap[28:31]= Rate Adaptive id
|
||||
//arg[0:4] = macid
|
||||
//arg[5] = Short GI
|
||||
/* bitmap[0:27] = tx_rate_bitmap */
|
||||
/* bitmap[28:31]= Rate Adaptive id */
|
||||
/* arg[0:4] = macid */
|
||||
/* arg[5] = Short GI */
|
||||
void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi_level)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
//struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
|
||||
u8 macid, init_rate, raid, shortGIrate=false;
|
||||
|
||||
macid = arg&0x1f;
|
||||
|
@ -226,7 +220,7 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi
|
|||
bitmap = ODM_Get_Rate_Bitmap(&pHalData->odmpriv, macid, bitmap, rssi_level);
|
||||
|
||||
bitmap |= ((raid<<28)&0xf0000000);
|
||||
#endif //CONFIG_ODM_REFRESH_RAMASK
|
||||
#endif /* CONFIG_ODM_REFRESH_RAMASK */
|
||||
|
||||
|
||||
init_rate = get_highest_rate_idx(bitmap&0x0fffffff)&0x3f;
|
||||
|
@ -237,7 +231,7 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi
|
|||
init_rate |= BIT(6);
|
||||
|
||||
|
||||
//rtw_write8(pAdapter, (REG_INIDATA_RATE_SEL+macid), (u8)init_rate);
|
||||
/* rtw_write8(pAdapter, (REG_INIDATA_RATE_SEL+macid), (u8)init_rate); */
|
||||
|
||||
raid = (bitmap>>28) & 0x0f;
|
||||
|
||||
|
@ -263,13 +257,13 @@ void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode)
|
|||
{
|
||||
SETPWRMODE_PARM H2CSetPwrMode;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
u8 RLBM = 0; // 0:Min, 1:Max , 2:User define
|
||||
u8 RLBM = 0; /* 0:Min, 1:Max , 2:User define */
|
||||
;
|
||||
|
||||
DBG_871X("%s: Mode=%d SmartPS=%d UAPSD=%d\n", __FUNCTION__,
|
||||
Mode, pwrpriv->smart_ps, padapter->registrypriv.uapsd_enable);
|
||||
|
||||
H2CSetPwrMode.AwakeInterval = 2; //DTIM =1
|
||||
H2CSetPwrMode.AwakeInterval = 2; /* DTIM =1 */
|
||||
|
||||
switch(Mode)
|
||||
{
|
||||
|
@ -295,7 +289,7 @@ void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode)
|
|||
break;
|
||||
}
|
||||
|
||||
//H2CSetPwrMode.Mode = Mode;
|
||||
/* H2CSetPwrMode.Mode = Mode; */
|
||||
|
||||
H2CSetPwrMode.SmartPS_RLBM = (((pwrpriv->smart_ps<<4)&0xf0) | (RLBM & 0x0f));
|
||||
|
||||
|
@ -303,13 +297,13 @@ void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode)
|
|||
|
||||
if(Mode > 0)
|
||||
{
|
||||
H2CSetPwrMode.PwrState = 0x00;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
|
||||
H2CSetPwrMode.PwrState = 0x00;/* AllON(0x0C), RFON(0x04), RFOFF(0x00) */
|
||||
#ifdef CONFIG_EXT_CLK
|
||||
H2CSetPwrMode.Mode |= BIT(7);//supporting 26M XTAL CLK_Request feature.
|
||||
#endif //CONFIG_EXT_CLK
|
||||
H2CSetPwrMode.Mode |= BIT(7);/* supporting 26M XTAL CLK_Request feature. */
|
||||
#endif /* CONFIG_EXT_CLK */
|
||||
}
|
||||
else
|
||||
H2CSetPwrMode.PwrState = 0x0C;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
|
||||
H2CSetPwrMode.PwrState = 0x0C;/* AllON(0x0C), RFON(0x04), RFOFF(0x00) */
|
||||
|
||||
FillH2CCmd_88E(padapter, H2C_PS_PWR_MODE, sizeof(H2CSetPwrMode), (u8 *)&H2CSetPwrMode);
|
||||
|
||||
|
@ -332,12 +326,12 @@ void rtl8188e_set_FwMediaStatus_cmd(struct adapter *padapter, __le16 mstatus_rpt
|
|||
reg_macid_no_link = REG_MACID_NO_LINK_1;
|
||||
}
|
||||
|
||||
//Delete select macid (MACID 0~63) from queue list.
|
||||
if(opmode == 1)// 1:connect
|
||||
/* Delete select macid (MACID 0~63) from queue list. */
|
||||
if(opmode == 1)/* 1:connect */
|
||||
{
|
||||
rtw_write32(padapter,reg_macid_no_link, (rtw_read32(padapter,reg_macid_no_link) & (~BIT(macid))));
|
||||
}
|
||||
else//0: disconnect
|
||||
else/* 0: disconnect */
|
||||
{
|
||||
rtw_write32(padapter,reg_macid_no_link, (rtw_read32(padapter,reg_macid_no_link)|BIT(macid)));
|
||||
}
|
||||
|
@ -357,7 +351,7 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
|
||||
//DBG_871X("%s\n", __FUNCTION__);
|
||||
/* DBG_871X("%s\n", __FUNCTION__); */
|
||||
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
|
||||
|
@ -369,23 +363,23 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
|
||||
|
||||
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
|
||||
//pmlmeext->mgnt_seq++;
|
||||
/* pmlmeext->mgnt_seq++; */
|
||||
SetFrameSubType(pframe, WIFI_BEACON);
|
||||
|
||||
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pktlen = sizeof (struct rtw_ieee80211_hdr_3addr);
|
||||
|
||||
//timestamp will be inserted by hardware
|
||||
/* timestamp will be inserted by hardware */
|
||||
pframe += 8;
|
||||
pktlen += 8;
|
||||
|
||||
// beacon interval: 2 bytes
|
||||
/* beacon interval: 2 bytes */
|
||||
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
|
||||
|
||||
pframe += 2;
|
||||
pktlen += 2;
|
||||
|
||||
// capability info: 2 bytes
|
||||
/* capability info: 2 bytes */
|
||||
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
||||
|
||||
pframe += 2;
|
||||
|
@ -393,46 +387,46 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
|
||||
if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
|
||||
{
|
||||
//DBG_871X("ie len=%d\n", cur_network->IELength);
|
||||
/* DBG_871X("ie len=%d\n", cur_network->IELength); */
|
||||
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
|
||||
memcpy(pframe, cur_network->IEs+sizeof(NDIS_802_11_FIXED_IEs), pktlen);
|
||||
|
||||
goto _ConstructBeacon;
|
||||
}
|
||||
|
||||
//below for ad-hoc mode
|
||||
/* below for ad-hoc mode */
|
||||
|
||||
// SSID
|
||||
/* SSID */
|
||||
pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen);
|
||||
|
||||
// supported rates...
|
||||
/* supported rates... */
|
||||
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
|
||||
pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pktlen);
|
||||
|
||||
// DS parameter set
|
||||
/* DS parameter set */
|
||||
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen);
|
||||
|
||||
if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
|
||||
{
|
||||
u32 ATIMWindow;
|
||||
// IBSS Parameter Set...
|
||||
//ATIMWindow = cur->Configuration.ATIMWindow;
|
||||
/* IBSS Parameter Set... */
|
||||
/* ATIMWindow = cur->Configuration.ATIMWindow; */
|
||||
ATIMWindow = 0;
|
||||
pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen);
|
||||
}
|
||||
|
||||
|
||||
//todo: ERP IE
|
||||
/* todo: ERP IE */
|
||||
|
||||
|
||||
// EXTERNDED SUPPORTED RATE
|
||||
/* EXTERNDED SUPPORTED RATE */
|
||||
if (rate_len > 8)
|
||||
{
|
||||
pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen);
|
||||
}
|
||||
|
||||
|
||||
//todo:HT for adhoc
|
||||
/* todo:HT for adhoc */
|
||||
|
||||
_ConstructBeacon:
|
||||
|
||||
|
@ -444,7 +438,7 @@ _ConstructBeacon:
|
|||
|
||||
*pLength = pktlen;
|
||||
|
||||
//DBG_871X("%s bcn_sz=%d\n", __FUNCTION__, pktlen);
|
||||
/* DBG_871X("%s bcn_sz=%d\n", __FUNCTION__, pktlen); */
|
||||
|
||||
}
|
||||
|
||||
|
@ -456,23 +450,23 @@ static void ConstructPSPoll(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
//DBG_871X("%s\n", __FUNCTION__);
|
||||
/* DBG_871X("%s\n", __FUNCTION__); */
|
||||
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
|
||||
// Frame control.
|
||||
/* Frame control. */
|
||||
fctrl = &(pwlanhdr->frame_ctl);
|
||||
*(fctrl) = 0;
|
||||
SetPwrMgt(fctrl);
|
||||
SetFrameSubType(pframe, WIFI_PSPOLL);
|
||||
|
||||
// AID.
|
||||
/* AID. */
|
||||
SetDuration(pframe, (pmlmeinfo->aid | 0xc000));
|
||||
|
||||
// BSSID.
|
||||
/* BSSID. */
|
||||
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
|
||||
// TA.
|
||||
/* TA. */
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
|
||||
*pLength = 16;
|
||||
|
@ -497,7 +491,7 @@ static void ConstructNullFunctionData(
|
|||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
||||
//DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave);
|
||||
/* DBG_871X("%s:%d\n", __FUNCTION__, bForcePowerSave); */
|
||||
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr*)pframe;
|
||||
|
||||
|
@ -552,10 +546,10 @@ static void ConstructNullFunctionData(
|
|||
}
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
//
|
||||
// Description:
|
||||
// Construct the ARP response packet to support ARP offload.
|
||||
//
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Construct the ARP response packet to support ARP offload. */
|
||||
/* */
|
||||
static void ConstructARPResponse(
|
||||
struct adapter *padapter,
|
||||
u8 *pframe,
|
||||
|
@ -574,7 +568,7 @@ static void ConstructARPResponse(
|
|||
__le16 *fctrl;
|
||||
u32 pktlen;
|
||||
u8 *pARPRspPkt = pframe;
|
||||
//for TKIP Cal MIC
|
||||
/* for TKIP Cal MIC */
|
||||
u8 *payload = pframe;
|
||||
u8 EncryptionHeadOverhead = 0;
|
||||
|
||||
|
@ -583,11 +577,11 @@ static void ConstructARPResponse(
|
|||
fctrl = &pwlanhdr->frame_ctl;
|
||||
*(fctrl) = 0;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// MAC Header.
|
||||
//-------------------------------------------------------------------------
|
||||
/* */
|
||||
/* MAC Header. */
|
||||
/* */
|
||||
SetFrameType(fctrl, WIFI_DATA);
|
||||
//SetFrameSubType(fctrl, 0);
|
||||
/* SetFrameSubType(fctrl, 0); */
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
|
@ -595,21 +589,21 @@ static void ConstructARPResponse(
|
|||
|
||||
SetSeqNum(pwlanhdr, 0);
|
||||
SetDuration(pwlanhdr, 0);
|
||||
//SET_80211_HDR_FRAME_CONTROL(pARPRspPkt, 0);
|
||||
//SET_80211_HDR_TYPE_AND_SUBTYPE(pARPRspPkt, Type_Data);
|
||||
//SET_80211_HDR_TO_DS(pARPRspPkt, 1);
|
||||
//SET_80211_HDR_ADDRESS1(pARPRspPkt, pMgntInfo->Bssid);
|
||||
//SET_80211_HDR_ADDRESS2(pARPRspPkt, Adapter->CurrentAddress);
|
||||
//SET_80211_HDR_ADDRESS3(pARPRspPkt, pMgntInfo->Bssid);
|
||||
/* SET_80211_HDR_FRAME_CONTROL(pARPRspPkt, 0); */
|
||||
/* SET_80211_HDR_TYPE_AND_SUBTYPE(pARPRspPkt, Type_Data); */
|
||||
/* SET_80211_HDR_TO_DS(pARPRspPkt, 1); */
|
||||
/* SET_80211_HDR_ADDRESS1(pARPRspPkt, pMgntInfo->Bssid); */
|
||||
/* SET_80211_HDR_ADDRESS2(pARPRspPkt, Adapter->CurrentAddress); */
|
||||
/* SET_80211_HDR_ADDRESS3(pARPRspPkt, pMgntInfo->Bssid); */
|
||||
|
||||
//SET_80211_HDR_DURATION(pARPRspPkt, 0);
|
||||
//SET_80211_HDR_FRAGMENT_SEQUENCE(pARPRspPkt, 0);
|
||||
/* SET_80211_HDR_DURATION(pARPRspPkt, 0); */
|
||||
/* SET_80211_HDR_FRAGMENT_SEQUENCE(pARPRspPkt, 0); */
|
||||
*pLength = 24;
|
||||
|
||||
//YJ,del,120503
|
||||
//-------------------------------------------------------------------------
|
||||
// Security Header: leave space for it if necessary.
|
||||
//-------------------------------------------------------------------------
|
||||
/* YJ,del,120503 */
|
||||
/* */
|
||||
/* Security Header: leave space for it if necessary. */
|
||||
/* */
|
||||
|
||||
switch (psecuritypriv->dot11PrivacyAlgrthm)
|
||||
{
|
||||
|
@ -636,25 +630,24 @@ static void ConstructARPResponse(
|
|||
{
|
||||
memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead);
|
||||
*pLength += EncryptionHeadOverhead;
|
||||
//SET_80211_HDR_WEP(pARPRspPkt, 1); //Suggested by CCW.
|
||||
SetPrivacy(fctrl);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Frame Body.
|
||||
//-------------------------------------------------------------------------
|
||||
/* */
|
||||
/* Frame Body. */
|
||||
/* */
|
||||
pARPRspPkt = (u8*)(pframe+ *pLength);
|
||||
// LLC header
|
||||
/* LLC header */
|
||||
memcpy(pARPRspPkt, ARPLLCHeader, 8);
|
||||
*pLength += 8;
|
||||
|
||||
// ARP element
|
||||
/* ARP element */
|
||||
pARPRspPkt += 8;
|
||||
SET_ARP_PKT_HW(pARPRspPkt, 0x0100);
|
||||
SET_ARP_PKT_PROTOCOL(pARPRspPkt, 0x0008); // IP protocol
|
||||
SET_ARP_PKT_PROTOCOL(pARPRspPkt, 0x0008); /* IP protocol */
|
||||
SET_ARP_PKT_HW_ADDR_LEN(pARPRspPkt, 6);
|
||||
SET_ARP_PKT_PROTOCOL_ADDR_LEN(pARPRspPkt, 4);
|
||||
SET_ARP_PKT_OPERATION(pARPRspPkt, 0x0200); // ARP response
|
||||
SET_ARP_PKT_OPERATION(pARPRspPkt, 0x0200); /* ARP response */
|
||||
SET_ARP_PKT_SENDER_MAC_ADDR(pARPRspPkt, myid(&(padapter->eeprompriv)));
|
||||
SET_ARP_PKT_SENDER_IP_ADDR(pARPRspPkt, pIPAddress);
|
||||
#ifdef CONFIG_ARP_KEEP_ALIVE
|
||||
|
@ -686,18 +679,18 @@ static void ConstructARPResponse(
|
|||
if(_rtw_memcmp(&psta->dot11tkiptxmickey.skey[0],null_key, 16)==true){
|
||||
DBG_871X("%s(): STA dot11tkiptxmickey==0\n",__FUNCTION__);
|
||||
}
|
||||
//start to calculate the mic code
|
||||
/* start to calculate the mic code */
|
||||
rtw_secmicsetkey(&micdata, &psta->dot11tkiptxmickey.skey[0]);
|
||||
}
|
||||
|
||||
rtw_secmicappend(&micdata, pwlanhdr->addr3, 6); //DA
|
||||
rtw_secmicappend(&micdata, pwlanhdr->addr3, 6); /* DA */
|
||||
|
||||
rtw_secmicappend(&micdata, pwlanhdr->addr2, 6); //SA
|
||||
rtw_secmicappend(&micdata, pwlanhdr->addr2, 6); /* SA */
|
||||
|
||||
priority[0]=0;
|
||||
rtw_secmicappend(&micdata, &priority[0], 4);
|
||||
|
||||
rtw_secmicappend(&micdata, payload, 36); //payload length = 8 + 28
|
||||
rtw_secmicappend(&micdata, payload, 36); /* payload length = 8 + 28 */
|
||||
|
||||
rtw_secgetmic(&micdata,&(mic[0]));
|
||||
|
||||
|
@ -714,8 +707,8 @@ static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC
|
|||
u8 u1H2CRsvdPageParm[H2C_8188E_RSVDPAGE_LOC_LEN]={0};
|
||||
u8 u1H2CAoacRsvdPageParm[H2C_8188E_AOAC_RSVDPAGE_LOC_LEN]={0};
|
||||
|
||||
//DBG_871X("8188RsvdPageLoc: PsPoll=%d Null=%d QoSNull=%d\n",
|
||||
// rsvdpageloc->LocPsPoll, rsvdpageloc->LocNullData, rsvdpageloc->LocQosNull);
|
||||
/* DBG_871X("8188RsvdPageLoc: PsPoll=%d Null=%d QoSNull=%d\n", */
|
||||
/* rsvdpageloc->LocPsPoll, rsvdpageloc->LocNullData, rsvdpageloc->LocQosNull); */
|
||||
|
||||
SET_8188E_H2CCMD_RSVDPAGE_LOC_PSPOLL(u1H2CRsvdPageParm, rsvdpageloc->LocPsPoll);
|
||||
SET_8188E_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocNullData);
|
||||
|
@ -724,7 +717,7 @@ static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC
|
|||
FillH2CCmd_88E(padapter, H2C_COM_RSVD_PAGE, H2C_8188E_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm);
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
//DBG_871X("8188E_AOACRsvdPageLoc: RWC=%d ArpRsp=%d\n", rsvdpageloc->LocRemoteCtrlInfo, rsvdpageloc->LocArpRsp);
|
||||
/* DBG_871X("8188E_AOACRsvdPageLoc: RWC=%d ArpRsp=%d\n", rsvdpageloc->LocRemoteCtrlInfo, rsvdpageloc->LocArpRsp); */
|
||||
SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocRemoteCtrlInfo);
|
||||
SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocArpRsp);
|
||||
|
||||
|
@ -732,8 +725,8 @@ static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC
|
|||
#endif
|
||||
}
|
||||
|
||||
// To check if reserved page content is destroyed by beacon beacuse beacon is too large.
|
||||
// 2010.06.23. Added by tynli.
|
||||
/* To check if reserved page content is destroyed by beacon beacuse beacon is too large. */
|
||||
/* 2010.06.23. Added by tynli. */
|
||||
void
|
||||
CheckFwRsvdPageContent(
|
||||
IN struct adapter * Adapter
|
||||
|
@ -752,16 +745,16 @@ CheckFwRsvdPageContent(
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Description: Fill the reserved packets that FW will use to RSVD page.
|
||||
// Now we just send 4 types packet to rsvd page.
|
||||
// (1)Beacon, (2)Ps-poll, (3)Null data, (4)ProbeRsp.
|
||||
// Input:
|
||||
// bDLFinished - FALSE: At the first time we will send all the packets as a large packet to Hw,
|
||||
// so we need to set the packet length to total lengh.
|
||||
// TRUE: At the second time, we should send the first packet (default:beacon)
|
||||
// to Hw again and set the lengh in descriptor to the real beacon lengh.
|
||||
// 2009.10.15 by tynli.
|
||||
/* */
|
||||
/* Description: Fill the reserved packets that FW will use to RSVD page. */
|
||||
/* Now we just send 4 types packet to rsvd page. */
|
||||
/* (1)Beacon, (2)Ps-poll, (3)Null data, (4)ProbeRsp. */
|
||||
/* Input: */
|
||||
/* bDLFinished - FALSE: At the first time we will send all the packets as a large packet to Hw, */
|
||||
/* so we need to set the packet length to total lengh. */
|
||||
/* TRUE: At the second time, we should send the first packet (default:beacon) */
|
||||
/* to Hw again and set the lengh in descriptor to the real beacon lengh. */
|
||||
/* 2009.10.15 by tynli. */
|
||||
static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
|
@ -800,14 +793,14 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
TxDescLen = TXDESC_SIZE;
|
||||
PageNum = 0;
|
||||
|
||||
//3 (1) beacon * 2 pages
|
||||
/* 3 (1) beacon * 2 pages */
|
||||
BufIndex = TXDESC_OFFSET;
|
||||
ConstructBeacon(padapter, &ReservedPagePacket[BufIndex], &BeaconLength);
|
||||
|
||||
// When we count the first page size, we need to reserve description size for the RSVD
|
||||
// packet, it will be filled in front of the packet in TXPKTBUF.
|
||||
/* When we count the first page size, we need to reserve description size for the RSVD */
|
||||
/* packet, it will be filled in front of the packet in TXPKTBUF. */
|
||||
PageNeed = (u8)PageNum_128(TxDescLen + BeaconLength);
|
||||
// To reserved 2 pages for beacon buffer. 2010.06.24.
|
||||
/* To reserved 2 pages for beacon buffer. 2010.06.24. */
|
||||
if (PageNeed == 1)
|
||||
PageNeed += 1;
|
||||
PageNum += PageNeed;
|
||||
|
@ -815,7 +808,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
|
||||
BufIndex += PageNeed*128;
|
||||
|
||||
//3 (2) ps-poll *1 page
|
||||
/* 3 (2) ps-poll *1 page */
|
||||
RsvdPageLoc.LocPsPoll = PageNum;
|
||||
ConstructPSPoll(padapter, &ReservedPagePacket[BufIndex], &PSPollLength);
|
||||
rtl8188e_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], PSPollLength, true, false);
|
||||
|
@ -825,7 +818,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
|
||||
BufIndex += PageNeed*128;
|
||||
|
||||
//3 (3) null data * 1 page
|
||||
/* 3 (3) null data * 1 page */
|
||||
RsvdPageLoc.LocNullData = PageNum;
|
||||
ConstructNullFunctionData(
|
||||
padapter,
|
||||
|
@ -840,7 +833,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
|
||||
BufIndex += PageNeed*128;
|
||||
|
||||
//3 (5) Qos null data
|
||||
/* 3 (5) Qos null data */
|
||||
RsvdPageLoc.LocQosNull = PageNum;
|
||||
ConstructNullFunctionData(
|
||||
padapter,
|
||||
|
@ -856,7 +849,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
BufIndex += PageNeed*128;
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
//3(7) ARP
|
||||
/* 3(7) ARP */
|
||||
rtw_get_current_ip_address(padapter, currentip);
|
||||
RsvdPageLoc.LocArpRsp = PageNum;
|
||||
ConstructARPResponse(
|
||||
|
@ -891,12 +884,12 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
|
||||
BufIndex += PageNeed*128;
|
||||
|
||||
//3(8) sec IV
|
||||
/* 3(8) sec IV */
|
||||
rtw_get_sec_iv(padapter, cur_dot11txpn, get_my_bssid(&pmlmeinfo->network));
|
||||
RsvdPageLoc.LocRemoteCtrlInfo = PageNum;
|
||||
memcpy(ReservedPagePacket+BufIndex-TxDescLen, cur_dot11txpn, 8);
|
||||
|
||||
TotalPacketLen = BufIndex-TxDescLen + sizeof (union pn48); //IV len
|
||||
TotalPacketLen = BufIndex-TxDescLen + sizeof (union pn48); /* IV len */
|
||||
#else
|
||||
TotalPacketLen = BufIndex + QosNullLength;
|
||||
#endif
|
||||
|
@ -905,7 +898,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
if (pmgntframe == NULL)
|
||||
goto exit;
|
||||
|
||||
// update attribute
|
||||
/* update attribute */
|
||||
pattrib = &pmgntframe->attrib;
|
||||
update_mgntframe_attrib(padapter, pattrib);
|
||||
pattrib->qsel = 0x10;
|
||||
|
@ -920,7 +913,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
|
|||
|
||||
DBG_871X("%s: Set RSVD page location to Fw\n", __FUNCTION__);
|
||||
rtl8188e_set_FwRsvdPage_cmd(padapter, &RsvdPageLoc);
|
||||
//FillH2CCmd_88E(padapter, H2C_COM_RSVD_PAGE, sizeof(RsvdPageLoc), (u8*)&RsvdPageLoc);
|
||||
/* FillH2CCmd_88E(padapter, H2C_COM_RSVD_PAGE, sizeof(RsvdPageLoc), (u8*)&RsvdPageLoc); */
|
||||
|
||||
exit:
|
||||
rtw_mfree(ReservedPagePacket, RTL88E_RSVDPAGE_SIZE);
|
||||
|
@ -947,24 +940,24 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
|
||||
if(mstatus == 1)
|
||||
{
|
||||
// We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C.
|
||||
// Suggested by filen. Added by tynli.
|
||||
/* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */
|
||||
/* Suggested by filen. Added by tynli. */
|
||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
|
||||
// Do not set TSF again here or vWiFi beacon DMA INT will not work.
|
||||
//correct_TSF(padapter, pmlmeext);
|
||||
// Hw sequende enable by dedault. 2010.06.23. by tynli.
|
||||
//rtw_write16(padapter, REG_NQOS_SEQ, ((pmlmeext->mgnt_seq+100)&0xFFF));
|
||||
//rtw_write8(padapter, REG_HWSEQ_CTRL, 0xFF);
|
||||
/* Do not set TSF again here or vWiFi beacon DMA INT will not work. */
|
||||
/* correct_TSF(padapter, pmlmeext); */
|
||||
/* Hw sequende enable by dedault. 2010.06.23. by tynli. */
|
||||
/* rtw_write16(padapter, REG_NQOS_SEQ, ((pmlmeext->mgnt_seq+100)&0xFFF)); */
|
||||
/* rtw_write8(padapter, REG_HWSEQ_CTRL, 0xFF); */
|
||||
|
||||
//Set REG_CR bit 8. DMA beacon by SW.
|
||||
/* Set REG_CR bit 8. DMA beacon by SW. */
|
||||
pHalData->RegCR_1 |= BIT0;
|
||||
rtw_write8(padapter, REG_CR+1, pHalData->RegCR_1);
|
||||
|
||||
// Disable Hw protection for a time which revserd for Hw sending beacon.
|
||||
// Fix download reserved page packet fail that access collision with the protection time.
|
||||
// 2010.05.11. Added by tynli.
|
||||
//SetBcnCtrlReg(padapter, 0, BIT3);
|
||||
//SetBcnCtrlReg(padapter, BIT4, 0);
|
||||
/* Disable Hw protection for a time which revserd for Hw sending beacon. */
|
||||
/* Fix download reserved page packet fail that access collision with the protection time. */
|
||||
/* 2010.05.11. Added by tynli. */
|
||||
/* SetBcnCtrlReg(padapter, 0, BIT3); */
|
||||
/* SetBcnCtrlReg(padapter, BIT4, 0); */
|
||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)&(~BIT(3)));
|
||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)|BIT(4));
|
||||
|
||||
|
@ -974,31 +967,31 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
bSendBeacon = true;
|
||||
}
|
||||
|
||||
// Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame.
|
||||
/* Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. */
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl&(~BIT6)));
|
||||
pHalData->RegFwHwTxQCtrl &= (~BIT6);
|
||||
|
||||
// Clear beacon valid check bit.
|
||||
/* Clear beacon valid check bit. */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||
DLBcnCount = 0;
|
||||
poll = 0;
|
||||
do
|
||||
{
|
||||
// download rsvd page.
|
||||
/* download rsvd page. */
|
||||
SetFwRsvdPagePkt(padapter, false);
|
||||
DLBcnCount++;
|
||||
do
|
||||
{
|
||||
rtw_yield_os();
|
||||
//rtw_mdelay_os(10);
|
||||
// check rsvd page download OK.
|
||||
/* rtw_mdelay_os(10); */
|
||||
/* check rsvd page download OK. */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
|
||||
poll++;
|
||||
} while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
|
||||
}while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
|
||||
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage88ES(): 1 Download RSVD page failed!\n"));
|
||||
/* RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage88ES(): 1 Download RSVD page failed!\n")); */
|
||||
if(padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
{
|
||||
}
|
||||
|
@ -1006,13 +999,13 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
DBG_871X("%s: 1 Download RSVD page failed! DLBcnCount:%u, poll:%u\n", __FUNCTION__ ,DLBcnCount, poll);
|
||||
else
|
||||
DBG_871X("%s: 1 Download RSVD success! DLBcnCount:%u, poll:%u\n", __FUNCTION__, DLBcnCount, poll);
|
||||
//
|
||||
// We just can send the reserved page twice during the time that Tx thread is stopped (e.g. pnpsetpower)
|
||||
// becuase we need to free the Tx BCN Desc which is used by the first reserved page packet.
|
||||
// At run time, we cannot get the Tx Desc until it is released in TxHandleInterrupt() so we will return
|
||||
// the beacon TCB in the following code. 2011.11.23. by tynli.
|
||||
//
|
||||
//if(bcn_valid && padapter->bEnterPnpSleep)
|
||||
/* */
|
||||
/* We just can send the reserved page twice during the time that Tx thread is stopped (e.g. pnpsetpower) */
|
||||
/* becuase we need to free the Tx BCN Desc which is used by the first reserved page packet. */
|
||||
/* At run time, we cannot get the Tx Desc until it is released in TxHandleInterrupt() so we will return */
|
||||
/* the beacon TCB in the following code. 2011.11.23. by tynli. */
|
||||
/* */
|
||||
/* if(bcn_valid && padapter->bEnterPnpSleep) */
|
||||
if(0)
|
||||
{
|
||||
if(bSendBeacon)
|
||||
|
@ -1028,14 +1021,14 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
do
|
||||
{
|
||||
rtw_yield_os();
|
||||
//rtw_mdelay_os(10);
|
||||
// check rsvd page download OK.
|
||||
/* rtw_mdelay_os(10); */
|
||||
/* check rsvd page download OK. */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
|
||||
poll++;
|
||||
} while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
}while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
|
||||
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage(): 2 Download RSVD page failed!\n"));
|
||||
/* RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage(): 2 Download RSVD page failed!\n")); */
|
||||
if(padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
{
|
||||
}
|
||||
|
@ -1046,37 +1039,37 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
}
|
||||
}
|
||||
|
||||
// Enable Bcn
|
||||
//SetBcnCtrlReg(padapter, BIT3, 0);
|
||||
//SetBcnCtrlReg(padapter, 0, BIT4);
|
||||
/* Enable Bcn */
|
||||
/* SetBcnCtrlReg(padapter, BIT3, 0); */
|
||||
/* SetBcnCtrlReg(padapter, 0, BIT4); */
|
||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)|BIT(3));
|
||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)&(~BIT(4)));
|
||||
|
||||
// To make sure that if there exists an adapter which would like to send beacon.
|
||||
// If exists, the origianl value of 0x422[6] will be 1, we should check this to
|
||||
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
|
||||
// the beacon cannot be sent by HW.
|
||||
// 2010.06.23. Added by tynli.
|
||||
/* To make sure that if there exists an adapter which would like to send beacon. */
|
||||
/* If exists, the origianl value of 0x422[6] will be 1, we should check this to */
|
||||
/* prevent from setting 0x422[6] to 0 after download reserved page, or it will cause */
|
||||
/* the beacon cannot be sent by HW. */
|
||||
/* 2010.06.23. Added by tynli. */
|
||||
if(bSendBeacon)
|
||||
{
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl|BIT6));
|
||||
pHalData->RegFwHwTxQCtrl |= BIT6;
|
||||
}
|
||||
|
||||
//
|
||||
// Update RSVD page location H2C to Fw.
|
||||
//
|
||||
/* */
|
||||
/* Update RSVD page location H2C to Fw. */
|
||||
/* */
|
||||
if(bcn_valid)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||
DBG_871X("Set RSVD page location to Fw.\n");
|
||||
//FillH2CCmd88E(Adapter, H2C_88E_RSVDPAGE, H2C_RSVDPAGE_LOC_LENGTH, pMgntInfo->u1RsvdPageLoc);
|
||||
/* FillH2CCmd88E(Adapter, H2C_88E_RSVDPAGE, H2C_RSVDPAGE_LOC_LENGTH, pMgntInfo->u1RsvdPageLoc); */
|
||||
}
|
||||
|
||||
// Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli.
|
||||
//if(!padapter->bEnterPnpSleep)
|
||||
/* Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli. */
|
||||
/* if(!padapter->bEnterPnpSleep) */
|
||||
{
|
||||
// Clear CR[8] or beacon packet will not be send to TxBuf anymore.
|
||||
/* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
|
||||
pHalData->RegCR_1 &= (~BIT0);
|
||||
rtw_write8(padapter, REG_CR+1, pHalData->RegCR_1);
|
||||
}
|
||||
|
@ -1095,7 +1088,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
|
|||
} else {
|
||||
DBG_871X_LEVEL(_drv_info_, "%s wowlan_mode is off\n", __func__);
|
||||
}
|
||||
#endif //CONFIG_WOWLAN
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -1119,40 +1112,40 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter* padapter, u8 p2p_ps_state)
|
|||
break;
|
||||
case P2P_PS_ENABLE:
|
||||
DBG_8192C("P2P_PS_ENABLE \n");
|
||||
// update CTWindow value.
|
||||
/* update CTWindow value. */
|
||||
if( pwdinfo->ctwindow > 0 )
|
||||
{
|
||||
p2p_ps_offload->CTWindow_En = 1;
|
||||
rtw_write8(padapter, REG_P2P_CTWIN, pwdinfo->ctwindow);
|
||||
}
|
||||
|
||||
// hw only support 2 set of NoA
|
||||
/* hw only support 2 set of NoA */
|
||||
for( i=0 ; i<pwdinfo->noa_num ; i++)
|
||||
{
|
||||
// To control the register setting for which NOA
|
||||
/* To control the register setting for which NOA */
|
||||
rtw_write8(padapter, REG_NOA_DESC_SEL, (i << 4));
|
||||
if(i == 0)
|
||||
p2p_ps_offload->NoA0_En = 1;
|
||||
else
|
||||
p2p_ps_offload->NoA1_En = 1;
|
||||
|
||||
// config P2P NoA Descriptor Register
|
||||
//DBG_8192C("%s(): noa_duration = %x\n",__FUNCTION__,pwdinfo->noa_duration[i]);
|
||||
/* config P2P NoA Descriptor Register */
|
||||
/* DBG_8192C("%s(): noa_duration = %x\n",__FUNCTION__,pwdinfo->noa_duration[i]); */
|
||||
rtw_write32(padapter, REG_NOA_DESC_DURATION, pwdinfo->noa_duration[i]);
|
||||
|
||||
//DBG_8192C("%s(): noa_interval = %x\n",__FUNCTION__,pwdinfo->noa_interval[i]);
|
||||
/* DBG_8192C("%s(): noa_interval = %x\n",__FUNCTION__,pwdinfo->noa_interval[i]); */
|
||||
rtw_write32(padapter, REG_NOA_DESC_INTERVAL, pwdinfo->noa_interval[i]);
|
||||
|
||||
//DBG_8192C("%s(): start_time = %x\n",__FUNCTION__,pwdinfo->noa_start_time[i]);
|
||||
/* DBG_8192C("%s(): start_time = %x\n",__FUNCTION__,pwdinfo->noa_start_time[i]); */
|
||||
rtw_write32(padapter, REG_NOA_DESC_START, pwdinfo->noa_start_time[i]);
|
||||
|
||||
//DBG_8192C("%s(): noa_count = %x\n",__FUNCTION__,pwdinfo->noa_count[i]);
|
||||
/* DBG_8192C("%s(): noa_count = %x\n",__FUNCTION__,pwdinfo->noa_count[i]); */
|
||||
rtw_write8(padapter, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
|
||||
}
|
||||
|
||||
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) )
|
||||
{
|
||||
// rst p2p circuit
|
||||
/* rst p2p circuit */
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, BIT(4));
|
||||
|
||||
p2p_ps_offload->Offload_En = 1;
|
||||
|
@ -1189,7 +1182,7 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter* padapter, u8 p2p_ps_state)
|
|||
;
|
||||
|
||||
}
|
||||
#endif //CONFIG_P2P_PS
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
/*
|
||||
|
@ -1237,7 +1230,7 @@ int reset_tsf(struct adapter *Adapter, u8 reset_port )
|
|||
}
|
||||
|
||||
|
||||
#endif // CONFIG_TSF_RESET_OFFLOAD
|
||||
#endif /* CONFIG_TSF_RESET_OFFLOAD */
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
|
@ -1281,7 +1274,7 @@ void rtl8188es_set_output_gpio(struct adapter* padapter, u8 index, u8 outputval)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_GPIO_WAKEUP
|
||||
#endif /* CONFIG_GPIO_WAKEUP */
|
||||
|
||||
void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
||||
{
|
||||
|
@ -1294,7 +1287,7 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
struct security_priv *psecpriv = &padapter->securitypriv;
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
u8 gpio_wake_pin = 7;
|
||||
u8 gpio_high_active = 0; //default low active
|
||||
u8 gpio_high_active = 0; /* default low active */
|
||||
#endif
|
||||
|
||||
;
|
||||
|
@ -1329,16 +1322,16 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
pwowlan_parm.mode |=FW_WOWLAN_REKEY_WAKEUP;
|
||||
pwowlan_parm.mode |=FW_WOWLAN_DEAUTH_WAKEUP;
|
||||
|
||||
//DataPinWakeUp
|
||||
/* DataPinWakeUp */
|
||||
pwowlan_parm.gpio_index=0x0;
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
pwowlan_parm.gpio_index = gpio_wake_pin;
|
||||
|
||||
//WOWLAN_GPIO_ACTIVE means GPIO high active
|
||||
//pwowlan_parm.mode |=FW_WOWLAN_GPIO_ACTIVE;
|
||||
/* WOWLAN_GPIO_ACTIVE means GPIO high active */
|
||||
/* pwowlan_parm.mode |=FW_WOWLAN_GPIO_ACTIVE; */
|
||||
if (gpio_high_active)
|
||||
pwowlan_parm.mode |=FW_WOWLAN_GPIO_ACTIVE;
|
||||
#endif //CONFIG_GPIO_WAKEUP
|
||||
#endif /* CONFIG_GPIO_WAKEUP */
|
||||
|
||||
DBG_871X_LEVEL(_drv_info_, "%s 5.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode);
|
||||
DBG_871X_LEVEL(_drv_info_, "%s 6.pwowlan_parm.index=0x%x \n",__FUNCTION__,pwowlan_parm.gpio_index);
|
||||
|
@ -1346,19 +1339,19 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
|
||||
rtw_msleep_os(2);
|
||||
|
||||
//disconnect decision
|
||||
/* disconnect decision */
|
||||
pwowlan_parm.mode =1;
|
||||
pwowlan_parm.gpio_index=0;
|
||||
pwowlan_parm.gpio_duration=0;
|
||||
FillH2CCmd_88E(padapter, H2C_COM_DISCNT_DECISION, 3, (u8 *)&pwowlan_parm);
|
||||
|
||||
//keep alive period = 10 * 10 BCN interval
|
||||
/* keep alive period = 10 * 10 BCN interval */
|
||||
pwowlan_parm.mode = FW_WOWLAN_KEEP_ALIVE_EN | FW_ADOPT_USER | FW_WOWLAN_KEEP_ALIVE_PKT_TYPE;
|
||||
pwowlan_parm.gpio_index=10;
|
||||
res = FillH2CCmd_88E(padapter, H2C_COM_KEEP_ALIVE, 2, (u8 *)&pwowlan_parm);
|
||||
|
||||
rtw_msleep_os(2);
|
||||
//Configure STA security information for GTK rekey wakeup event.
|
||||
/* Configure STA security information for GTK rekey wakeup event. */
|
||||
paoac_global_info_parm.pairwiseEncAlg=
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
paoac_global_info_parm.groupEncAlg=
|
||||
|
@ -1366,7 +1359,7 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
res = FillH2CCmd_88E(padapter, H2C_COM_AOAC_GLOBAL_INFO, 2, (u8 *)&paoac_global_info_parm);
|
||||
|
||||
rtw_msleep_os(2);
|
||||
//enable Remote wake ctrl
|
||||
/* enable Remote wake ctrl */
|
||||
pwowlan_parm.mode = FW_REMOTE_WAKE_CTRL_EN | FW_WOW_FW_UNICAST_EN | FW_ARP_EN;
|
||||
if (psecpriv->dot11PrivacyAlgrthm == _AES_ || psecpriv->dot11PrivacyAlgrthm == _NO_PRIVACY_)
|
||||
{
|
||||
|
@ -1381,7 +1374,7 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
pwrpriv->wowlan_magic =false;
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
rtl8188es_set_output_gpio(padapter, gpio_wake_pin, !gpio_high_active);
|
||||
#endif //CONFIG_GPIO_WAKEUP
|
||||
#endif /* CONFIG_GPIO_WAKEUP */
|
||||
res = FillH2CCmd_88E(padapter, H2C_COM_WWLAN, 2, (u8 *)&pwowlan_parm);
|
||||
rtw_msleep_os(2);
|
||||
res = FillH2CCmd_88E(padapter, H2C_COM_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm);
|
||||
|
@ -1390,4 +1383,4 @@ void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
|
|||
DBG_871X_LEVEL(_drv_always_, "-%s res:%d-\n", __func__, res);
|
||||
return ;
|
||||
}
|
||||
#endif //CONFIG_WOWLAN
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue