rtl_8188eu: Remove CONFIG_MMC_PM_KEEP_POWER, and CONFIG_WOWLAN

These parameters are not defined.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-03-02 17:03:18 -06:00
parent 2a75f42bff
commit ed192682fe
20 changed files with 9 additions and 1146 deletions

View file

@ -22,10 +22,8 @@ CONFIG_POWER_SAVING = y
CONFIG_USB_AUTOSUSPEND = n CONFIG_USB_AUTOSUSPEND = n
CONFIG_BT_COEXIST = n CONFIG_BT_COEXIST = n
CONFIG_EXT_CLK = n CONFIG_EXT_CLK = n
CONFIG_WOWLAN = n
CONFIG_GPIO_WAKEUP = n CONFIG_GPIO_WAKEUP = n
CONFIG_ODM_ADAPTIVITY = n CONFIG_ODM_ADAPTIVITY = n
CONFIG_MMC_PM_KEEP_POWER = n
CONFIG_DRVEXT_MODULE = n CONFIG_DRVEXT_MODULE = n
@ -52,10 +50,6 @@ OUTSRC_FILES += hal/HalHWImg8188E_MAC.o\
hal/Hal8188ERateAdaptive.o\ hal/Hal8188ERateAdaptive.o\
hal/odm_RTL8188E.o hal/odm_RTL8188E.o
ifeq ($(CONFIG_WOWLAN), y)
OUTSRC_FILES += hal/HalHWImg8188E_FW.o
endif
PWRSEQ_FILES := hal/HalPwrSeqCmd.o \ PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
hal/Hal8188EPwrSeq.o hal/Hal8188EPwrSeq.o
@ -109,14 +103,6 @@ ifeq ($(CONFIG_ODM_ADAPTIVITY), y)
EXTRA_CFLAGS += -DCONFIG_ODM_ADAPTIVITY EXTRA_CFLAGS += -DCONFIG_ODM_ADAPTIVITY
endif endif
ifeq ($(CONFIG_MMC_PM_KEEP_POWER), y)
EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER
endif
ifeq ($(CONFIG_WOWLAN), y)
EXTRA_CFLAGS += -DCONFIG_WOWLAN
EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER
endif
ifeq ($(CONFIG_GPIO_WAKEUP), y) ifeq ($(CONFIG_GPIO_WAKEUP), y)
EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP
endif endif

View file

@ -2408,9 +2408,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv )
if(candidate == NULL) { if(candidate == NULL) {
DBG_871X("%s: return _FAIL(candidate == NULL)\n", __FUNCTION__); DBG_871X("%s: return _FAIL(candidate == NULL)\n", __FUNCTION__);
#ifdef CONFIG_WOWLAN
_clr_fwstate_(pmlmepriv, _FW_LINKED|_FW_UNDER_LINKING);
#endif
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} else { } else {

View file

@ -433,15 +433,8 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
#ifdef CONFIG_WOWLAN
if(true == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
return true;
else if (true == pwrpriv->bInSuspend)
return false;
#else
if(true == pwrpriv->bInSuspend ) if(true == pwrpriv->bInSuspend )
return false; return false;
#endif
curr_time = rtw_get_current_time(); curr_time = rtw_get_current_time();
delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp; delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp;
@ -538,28 +531,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
pwrpriv->pwr_mode = ps_mode; pwrpriv->pwr_mode = ps_mode;
rtw_set_rpwm(padapter, PS_STATE_S4); rtw_set_rpwm(padapter, PS_STATE_S4);
#ifdef CONFIG_WOWLAN
if (pwrpriv->wowlan_mode == true)
{
u32 start_time, delay_ms;
u8 val8;
delay_ms = 20;
start_time = rtw_get_current_time();
do {
rtw_hal_get_hwreg(padapter, HW_VAR_SYS_CLKR, &val8);
if (!(val8 & BIT(4))){ /* 0x08 bit4 =1 --> in 32k, bit4 = 0 --> leave 32k */
pwrpriv->cpwm = PS_STATE_S4;
break;
}
if (rtw_get_passing_time_ms(start_time) > delay_ms)
{
DBG_871X("%s: Wait for FW 32K leave more than %u ms!!!\n", __FUNCTION__, delay_ms);
break;
}
rtw_usleep_os(100);
} while (1);
}
#endif
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode)); rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
pwrpriv->bFwCurrentInPSMode = false; pwrpriv->bFwCurrentInPSMode = false;
} }

View file

@ -2104,8 +2104,7 @@ void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
psta = rtw_get_stainfo(pstapriv, addr); psta = rtw_get_stainfo(pstapriv, addr);
if(psta) if(psta) {
{
start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4; start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4;
param = le16_to_cpu(preq->BA_para_set); param = le16_to_cpu(preq->BA_para_set);
@ -2125,7 +2124,6 @@ void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
preorder_ctrl->enable =(pmlmeinfo->bAcceptAddbaReq == true)? true :false; preorder_ctrl->enable =(pmlmeinfo->bAcceptAddbaReq == true)? true :false;
} }
} }
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
@ -2177,72 +2175,3 @@ int rtw_handle_dualmac(struct adapter *adapter, bool init)
exit: exit:
return status; return status;
} }
#ifdef CONFIG_WOWLAN
void rtw_get_current_ip_address(struct adapter *padapter, u8 *pcurrentip)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct in_device *my_ip_ptr = padapter->pnetdev->ip_ptr;
u8 ipaddress[4];
if ( (pmlmeinfo->state & WIFI_FW_LINKING_STATE) ) {
if ( my_ip_ptr != NULL ) {
struct in_ifaddr *my_ifa_list = my_ip_ptr->ifa_list ;
if ( my_ifa_list != NULL ) {
ipaddress[0] = my_ifa_list->ifa_address & 0xFF;
ipaddress[1] = (my_ifa_list->ifa_address >> 8) & 0xFF;
ipaddress[2] = (my_ifa_list->ifa_address >> 16) & 0xFF;
ipaddress[3] = my_ifa_list->ifa_address >> 24;
DBG_871X("%s: %d.%d.%d.%d ==========\n", __func__,
ipaddress[0], ipaddress[1], ipaddress[2], ipaddress[3]);
memcpy(pcurrentip, ipaddress, 4);
}
}
}
}
void rtw_get_sec_iv(struct adapter *padapter, u8*pcur_dot11txpn, u8 *StaAddr)
{
struct sta_info *psta;
struct security_priv *psecpriv = &padapter->securitypriv;
memset(pcur_dot11txpn, 0, 8);
if(NULL == StaAddr)
return;
psta = rtw_get_stainfo(&padapter->stapriv, StaAddr);
DBG_871X("%s(): StaAddr: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
__func__, StaAddr[0], StaAddr[1], StaAddr[2], StaAddr[3], StaAddr[4], StaAddr[5]);
if(psta)
{
if (psecpriv->dot11PrivacyAlgrthm != _NO_PRIVACY_ && psta->dot11txpn.val > 0)
psta->dot11txpn.val--;
memcpy(pcur_dot11txpn, (u8*)&psta->dot11txpn, 8);
DBG_871X("%s(): CurrentIV: 0x%016llx\n", __func__, psta->dot11txpn.val);
}
}
void rtw_set_sec_iv(struct adapter *padapter)
{
struct sta_info *psta;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct security_priv *psecpriv = &padapter->securitypriv;
psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&pmlmeinfo->network));
if(psta)
{
if (pwrpriv->wowlan_fw_iv > psta->dot11txpn.val)
{
if (psecpriv->dot11PrivacyAlgrthm != _NO_PRIVACY_)
psta->dot11txpn.val = pwrpriv->wowlan_fw_iv + 2;
} else {
DBG_871X("%s(): FW IV is smaller than driver\n", __func__);
psta->dot11txpn.val += 2;
}
DBG_871X("%s: dot11txpn: 0x%016llx\n", __func__ ,psta->dot11txpn.val);
}
}
#endif /* CONFIG_WOWLAN */

View file

@ -58,10 +58,6 @@
#include "HalHWImg8188E_BB.h" #include "HalHWImg8188E_BB.h"
#include "Hal8188EReg.h" #include "Hal8188EReg.h"
#ifdef CONFIG_WOWLAN
#include "HalHWImg8188E_FW.h"
#endif /* CONFIG_WOWLAN */
#include "odm_RegConfig8188E.h" #include "odm_RegConfig8188E.h"
#include "odm_RTL8188E.h" #include "odm_RTL8188E.h"

View file

@ -53,9 +53,6 @@ static u8 _is_fw_read_cmd_down(struct adapter* padapter, u8 msgbox_num)
if(0 == valid ){ if(0 == valid ){
read_down = true; read_down = true;
} }
#ifdef CONFIG_WOWLAN
rtw_msleep_os(2);
#endif
}while( (!read_down) && (retry_cnts--)); }while( (!read_down) && (retry_cnts--));
return read_down; return read_down;
@ -539,158 +536,6 @@ static void ConstructNullFunctionData(
*pLength = pktlen; *pLength = pktlen;
} }
#ifdef CONFIG_WOWLAN
/* */
/* Description: */
/* Construct the ARP response packet to support ARP offload. */
/* */
static void ConstructARPResponse(
struct adapter *padapter,
u8 *pframe,
u32 *pLength,
u8 *pIPAddress
)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct security_priv *psecuritypriv = &padapter->securitypriv;
static u8 ARPLLCHeader[8] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06};
__le16 *fctrl;
u32 pktlen;
u8 *pARPRspPkt = pframe;
/* for TKIP Cal MIC */
u8 *payload = pframe;
u8 EncryptionHeadOverhead = 0;
pwlanhdr = (struct rtw_ieee80211_hdr*)pframe;
fctrl = &pwlanhdr->frame_ctl;
*(fctrl) = 0;
/* */
/* MAC Header. */
/* */
SetFrameType(fctrl, WIFI_DATA);
/* SetFrameSubType(fctrl, 0); */
SetToDs(fctrl);
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
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_DURATION(pARPRspPkt, 0); */
/* SET_80211_HDR_FRAGMENT_SEQUENCE(pARPRspPkt, 0); */
*pLength = 24;
/* YJ,del,120503 */
/* */
/* Security Header: leave space for it if necessary. */
/* */
switch (psecuritypriv->dot11PrivacyAlgrthm)
{
case _WEP40_:
case _WEP104_:
EncryptionHeadOverhead = 4;
break;
case _TKIP_:
EncryptionHeadOverhead = 8;
break;
case _AES_:
EncryptionHeadOverhead = 8;
break;
default:
EncryptionHeadOverhead = 0;
}
if(EncryptionHeadOverhead > 0)
{
memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead);
*pLength += EncryptionHeadOverhead;
SetPrivacy(fctrl);
}
/* */
/* Frame Body. */
/* */
pARPRspPkt = (u8*)(pframe+ *pLength);
/* LLC header */
memcpy(pARPRspPkt, ARPLLCHeader, 8);
*pLength += 8;
/* ARP element */
pARPRspPkt += 8;
SET_ARP_PKT_HW(pARPRspPkt, 0x0100);
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_SENDER_MAC_ADDR(pARPRspPkt, myid(&(padapter->eeprompriv)));
SET_ARP_PKT_SENDER_IP_ADDR(pARPRspPkt, pIPAddress);
#ifdef CONFIG_ARP_KEEP_ALIVE
if (rtw_gw_addr_query(padapter)==0) {
SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, pmlmepriv->gw_mac_addr);
SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, pmlmepriv->gw_ip);
}
else
#endif
{
SET_ARP_PKT_TARGET_MAC_ADDR(pARPRspPkt, get_my_bssid(&(pmlmeinfo->network)));
SET_ARP_PKT_TARGET_IP_ADDR(pARPRspPkt, pIPAddress);
DBG_871X("%s Target Mac Addr:" MAC_FMT "\n", __FUNCTION__, MAC_ARG(get_my_bssid(&(pmlmeinfo->network))));
DBG_871X("%s Target IP Addr" IP_FMT "\n", __FUNCTION__, IP_ARG(pIPAddress));
}
*pLength += 28;
if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_)
{
u8 mic[8];
struct mic_data micdata;
struct sta_info *psta = NULL;
u8 priority[4]={0x0,0x0,0x0,0x0};
u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
DBG_871X("%s(): Add MIC\n",__FUNCTION__);
psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&(pmlmeinfo->network)));
if (psta != NULL) {
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 */
rtw_secmicsetkey(&micdata, &psta->dot11tkiptxmickey.skey[0]);
}
rtw_secmicappend(&micdata, pwlanhdr->addr3, 6); /* DA */
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_secgetmic(&micdata,&(mic[0]));
pARPRspPkt += 28;
memcpy(pARPRspPkt, &(mic[0]),8);
*pLength += 8;
}
}
#endif
static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC rsvdpageloc) static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC rsvdpageloc)
{ {
u8 u1H2CRsvdPageParm[H2C_8188E_RSVDPAGE_LOC_LEN]={0}; u8 u1H2CRsvdPageParm[H2C_8188E_RSVDPAGE_LOC_LEN]={0};
@ -704,14 +549,6 @@ static void rtl8188e_set_FwRsvdPage_cmd(struct adapter *padapter, PRSVDPAGE_LOC
SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull); SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull);
FillH2CCmd_88E(padapter, H2C_COM_RSVD_PAGE, H2C_8188E_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm); 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); */
SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocRemoteCtrlInfo);
SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1H2CAoacRsvdPageParm, rsvdpageloc->LocArpRsp);
FillH2CCmd_88E(padapter, H2C_COM_AOAC_RSVD_PAGE, H2C_8188E_AOAC_RSVDPAGE_LOC_LEN, u1H2CAoacRsvdPageParm);
#endif
} }
/* To check if reserved page content is destroyed by beacon beacuse beacon is too large. */ /* To check if reserved page content is destroyed by beacon beacuse beacon is too large. */
@ -759,12 +596,6 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
u16 BufIndex; u16 BufIndex;
u32 TotalPacketLen; u32 TotalPacketLen;
RSVDPAGE_LOC RsvdPageLoc; RSVDPAGE_LOC RsvdPageLoc;
#ifdef CONFIG_WOWLAN
u32 ARPLegnth = 0;
struct security_priv *psecuritypriv = &padapter->securitypriv;
u8 currentip[4];
u8 cur_dot11txpn[8];
#endif
DBG_871X("%s\n", __FUNCTION__); DBG_871X("%s\n", __FUNCTION__);
@ -837,46 +668,7 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished)
BufIndex += PageNeed*128; BufIndex += PageNeed*128;
#ifdef CONFIG_WOWLAN
/* 3(7) ARP */
rtw_get_current_ip_address(padapter, currentip);
RsvdPageLoc.LocArpRsp = PageNum;
ConstructARPResponse(
padapter,
&ReservedPagePacket[BufIndex],
&ARPLegnth,
currentip
);
rtl8188e_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], ARPLegnth, false, false);
switch (psecuritypriv->dot11PrivacyAlgrthm)
{
case _WEP40_:
case _WEP104_:
case _TKIP_:
ReservedPagePacket[BufIndex-TxDescLen+6] |= BIT(6);
break;
case _AES_:
ReservedPagePacket[BufIndex-TxDescLen+6] |= BIT(6)|BIT(7);
break;
default:
break;
}
PageNeed = (u8)PageNum_128(TxDescLen + ARPLegnth);
PageNum += PageNeed;
BufIndex += PageNeed*128;
/* 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 */
#else
TotalPacketLen = BufIndex + QosNullLength; TotalPacketLen = BufIndex + QosNullLength;
#endif
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) if (pmgntframe == NULL)
@ -909,21 +701,14 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
#ifdef CONFIG_WOWLAN
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_info *psta = NULL;
#endif
BOOLEAN bSendBeacon=false; BOOLEAN bSendBeacon=false;
BOOLEAN bcn_valid = false; BOOLEAN bcn_valid = false;
u8 DLBcnCount=0; u8 DLBcnCount=0;
u32 poll = 0; u32 poll = 0;
;
DBG_871X("%s mstatus(%x)\n", __FUNCTION__,mstatus); DBG_871X("%s mstatus(%x)\n", __FUNCTION__,mstatus);
if(mstatus == 1) if(mstatus == 1) {
{
/* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */ /* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */
/* Suggested by filen. Added by tynli. */ /* Suggested by filen. Added by tynli. */
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid)); rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
@ -1058,22 +843,6 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
rtw_write8(padapter, REG_CR+1, pHalData->RegCR_1); rtw_write8(padapter, REG_CR+1, pHalData->RegCR_1);
} }
} }
#ifdef CONFIG_WOWLAN
if (adapter_to_pwrctl(padapter)->wowlan_mode){
JoinBssRptParm.OpMode = mstatus;
psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(pmlmepriv));
if (psta != NULL) {
JoinBssRptParm.MacID = psta->mac_id;
} else {
JoinBssRptParm.MacID = 0;
}
FillH2CCmd_88E(padapter, H2C_COM_MEDIA_STATUS_RPT, sizeof(JoinBssRptParm), (u8 *)&JoinBssRptParm);
DBG_871X_LEVEL(_drv_info_, "%s opmode:%d MacId:%d\n", __func__, JoinBssRptParm.OpMode, JoinBssRptParm.MacID);
} else {
DBG_871X_LEVEL(_drv_info_, "%s wowlan_mode is off\n", __func__);
}
#endif /* CONFIG_WOWLAN */
;
} }
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
@ -1215,156 +984,3 @@ 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
void rtl8188es_set_output_gpio(struct adapter* padapter, u8 index, u8 outputval)
{
if ( index <= 7 ) {
/* config GPIO mode */
rtw_write8(padapter, REG_GPIO_PIN_CTRL + 3, rtw_read8(padapter, REG_GPIO_PIN_CTRL + 3) & ~BIT(index) );
/* config GPIO Sel */
/* 0: input */
/* 1: output */
rtw_write8(padapter, REG_GPIO_PIN_CTRL + 2, rtw_read8(padapter, REG_GPIO_PIN_CTRL + 2) | BIT(index));
/* set output value */
if ( outputval ) {
rtw_write8(padapter, REG_GPIO_PIN_CTRL + 1, rtw_read8(padapter, REG_GPIO_PIN_CTRL + 1) | BIT(index));
} else {
rtw_write8(padapter, REG_GPIO_PIN_CTRL + 1, rtw_read8(padapter, REG_GPIO_PIN_CTRL + 1) & ~BIT(index));
}
} else {
/* 88C Series: */
/* index: 11~8 transform to 3~0 */
/* 8723 Series: */
/* index: 12~8 transform to 4~0 */
index -= 8;
/* config GPIO mode */
rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 3, rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 3) & ~BIT(index) );
/* config GPIO Sel */
/* 0: input */
/* 1: output */
rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 2, rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 2) | BIT(index));
/* set output value */
if ( outputval ) {
rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 1, rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 1) | BIT(index));
} else {
rtw_write8(padapter, REG_GPIO_PIN_CTRL_2 + 1, rtw_read8(padapter, REG_GPIO_PIN_CTRL_2 + 1) & ~BIT(index));
}
}
}
#endif /* CONFIG_GPIO_WAKEUP */
void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable)
{
u8 res=_SUCCESS;
u32 test=0;
struct recv_priv *precvpriv = &padapter->recvpriv;
SETWOWLAN_PARM pwowlan_parm;
SETAOAC_GLOBAL_INFO paoac_global_info_parm;
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct security_priv *psecpriv = &padapter->securitypriv;
#ifdef CONFIG_GPIO_WAKEUP
u8 gpio_wake_pin = 7;
u8 gpio_high_active = 0; /* default low active */
#endif
;
DBG_871X_LEVEL(_drv_always_, "+%s+\n", __func__);
pwowlan_parm.mode =0;
pwowlan_parm.gpio_index=0;
pwowlan_parm.gpio_duration=0;
pwowlan_parm.second_mode =0;
pwowlan_parm.reserve=0;
if(enable){
pwowlan_parm.mode |=FW_WOWLAN_FUN_EN;
pwrpriv->wowlan_magic =true;
if (psecpriv->dot11PrivacyAlgrthm == _WEP40_ || psecpriv->dot11PrivacyAlgrthm == _WEP104_)
pwrpriv->wowlan_unicast =true;
if(pwrpriv->wowlan_pattern ==true){
pwowlan_parm.mode |= FW_WOWLAN_PATTERN_MATCH;
DBG_871X_LEVEL(_drv_info_, "%s 2.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
if(pwrpriv->wowlan_magic ==true){
pwowlan_parm.mode |=FW_WOWLAN_MAGIC_PKT;
DBG_871X_LEVEL(_drv_info_, "%s 3.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
if(pwrpriv->wowlan_unicast ==true){
pwowlan_parm.mode |=FW_WOWLAN_UNICAST;
DBG_871X_LEVEL(_drv_info_, "%s 4.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
pwowlan_parm.mode |=FW_WOWLAN_REKEY_WAKEUP;
pwowlan_parm.mode |=FW_WOWLAN_DEAUTH_WAKEUP;
/* 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; */
if (gpio_high_active)
pwowlan_parm.mode |=FW_WOWLAN_GPIO_ACTIVE;
#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);
res = FillH2CCmd_88E(padapter, H2C_COM_WWLAN, 2, (u8 *)&pwowlan_parm);
rtw_msleep_os(2);
/* 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 */
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. */
paoac_global_info_parm.pairwiseEncAlg=
padapter->securitypriv.dot11PrivacyAlgrthm;
paoac_global_info_parm.groupEncAlg=
padapter->securitypriv.dot118021XGrpPrivacy;
res = FillH2CCmd_88E(padapter, H2C_COM_AOAC_GLOBAL_INFO, 2, (u8 *)&paoac_global_info_parm);
rtw_msleep_os(2);
/* 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_)
{
pwowlan_parm.gpio_index=0;
} else {
pwowlan_parm.gpio_index=1;
}
pwowlan_parm.gpio_duration=0;
res = FillH2CCmd_88E(padapter, H2C_COM_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm);
} else {
pwrpriv->wowlan_magic =false;
#ifdef CONFIG_GPIO_WAKEUP
rtl8188es_set_output_gpio(padapter, gpio_wake_pin, !gpio_high_active);
#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);
}
;
DBG_871X_LEVEL(_drv_always_, "-%s res:%d-\n", __func__, res);
return ;
}
#endif /* CONFIG_WOWLAN */

View file

@ -776,16 +776,10 @@ static s32 _FWFreeToGo(struct adapter *padapter)
extern char *rtw_fw_file_path; extern char *rtw_fw_file_path;
u8 FwBuffer8188E[FW_8188E_SIZE]; u8 FwBuffer8188E[FW_8188E_SIZE];
#endif /* CONFIG_FILE_FWIMG */ #endif /* CONFIG_FILE_FWIMG */
#ifdef CONFIG_WOWLAN
/* */
/* Description: */ /* Description: */
/* Download 8192C firmware code. */ /* Download 8192C firmware code. */
/* */
/* */
s32 rtl8188e_FirmwareDownload(struct adapter *padapter, BOOLEAN bUsedWoWLANFw)
#else
s32 rtl8188e_FirmwareDownload(struct adapter *padapter) s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
#endif
{ {
s32 rtStatus = _SUCCESS; s32 rtStatus = _SUCCESS;
u8 writeFW_retry = 0; u8 writeFW_retry = 0;
@ -795,10 +789,6 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
u8 *FwImage; u8 *FwImage;
u32 FwImageLen; u32 FwImageLen;
u8 *pFwImageFileName; u8 *pFwImageFileName;
#ifdef CONFIG_WOWLAN
u8 *FwImageWoWLAN;
u32 FwImageWoWLANLen;
#endif
u8 *pucMappedFile = NULL; u8 *pucMappedFile = NULL;
PRT_FIRMWARE_8188E pFirmware = NULL; PRT_FIRMWARE_8188E pFirmware = NULL;
PRT_8188E_FIRMWARE_HDR pFwHdr = NULL; PRT_8188E_FIRMWARE_HDR pFwHdr = NULL;
@ -818,13 +808,6 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
FwImage = (u8*)Rtl8188E_FwImageArray; FwImage = (u8*)Rtl8188E_FwImageArray;
FwImageLen = Rtl8188E_FWImgArrayLength; FwImageLen = Rtl8188E_FWImgArrayLength;
#ifdef CONFIG_WOWLAN
FwImageWoWLAN = (u8*)Rtl8188E_FwWoWImageArray;
FwImageWoWLANLen = Rtl8188E_FwWoWImgArrayLength;
#endif /* CONFIG_WOWLAN */
/* RT_TRACE(_module_hal_init_c_, _drv_err_, ("rtl8723a_FirmwareDownload: %s\n", pFwImageFileName)); */
#ifdef CONFIG_FILE_FWIMG #ifdef CONFIG_FILE_FWIMG
if(rtw_is_file_readable(rtw_fw_file_path) == true) if(rtw_is_file_readable(rtw_fw_file_path) == true)
{ {
@ -855,29 +838,14 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
pFirmware->szFwBuffer = FwImage; pFirmware->szFwBuffer = FwImage;
pFirmware->ulFwLength = FwImageLen; pFirmware->ulFwLength = FwImageLen;
#ifdef CONFIG_WOWLAN
if(bUsedWoWLANFw){
pFirmware->szWoWLANFwBuffer = FwImageWoWLAN;
pFirmware->ulWoWLANFwLength = FwImageWoWLANLen;
}
#endif /* CONFIG_WOWLAN */
break; break;
} }
#ifdef CONFIG_WOWLAN
if(bUsedWoWLANFw) {
pFirmwareBuf = pFirmware->szWoWLANFwBuffer;
FirmwareLen = pFirmware->ulWoWLANFwLength;
pFwHdr = (PRT_8188E_FIRMWARE_HDR)pFirmware->szWoWLANFwBuffer;
} else
#endif
{
pFirmwareBuf = pFirmware->szFwBuffer; pFirmwareBuf = pFirmware->szFwBuffer;
FirmwareLen = pFirmware->ulFwLength; FirmwareLen = pFirmware->ulFwLength;
DBG_871X_LEVEL(_drv_info_, "+%s: !bUsedWoWLANFw, FmrmwareLen:%d+\n", __func__, FirmwareLen); DBG_871X_LEVEL(_drv_info_, "+%s: !bUsedWoWLANFw, FmrmwareLen:%d+\n", __func__, FirmwareLen);
/* To Check Fw header. Added by tynli. 2009.12.04. */ /* To Check Fw header. Added by tynli. 2009.12.04. */
pFwHdr = (PRT_8188E_FIRMWARE_HDR)pFirmware->szFwBuffer; pFwHdr = (PRT_8188E_FIRMWARE_HDR)pFirmware->szFwBuffer;
}
pHalData->FirmwareVersion = le16_to_cpu(pFwHdr->Version); pHalData->FirmwareVersion = le16_to_cpu(pFwHdr->Version);
pHalData->FirmwareSubVersion = pFwHdr->Subversion; pHalData->FirmwareSubVersion = pFwHdr->Subversion;
@ -938,66 +906,9 @@ Exit:
if (pFirmware) if (pFirmware)
rtw_mfree((u8*)pFirmware, sizeof(RT_FIRMWARE_8188E)); rtw_mfree((u8*)pFirmware, sizeof(RT_FIRMWARE_8188E));
/* RT_TRACE(COMP_INIT, DBG_LOUD, (" <=== FirmwareDownload91C()\n")); */
#ifdef CONFIG_WOWLAN
if (adapter_to_pwrctl(padapter)->wowlan_mode)
rtl8188e_InitializeFirmwareVars(padapter);
else
DBG_871X_LEVEL(_drv_always_, "%s: wowland_mode:%d wowlan_wake_reason:%d\n",
__func__, adapter_to_pwrctl(padapter)->wowlan_mode,
adapter_to_pwrctl(padapter)->wowlan_wake_reason);
#endif
return rtStatus; return rtStatus;
} }
#ifdef CONFIG_WOWLAN
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
/* Init Fw LPS related. */
pwrpriv->bFwCurrentInPSMode = false;
/* Init H2C counter. by tynli. 2009.12.09. */
pHalData->LastHMEBoxNum = 0;
}
/* */
/* */
/* Description: Prepare some information to Fw for WoWLAN. */
/* (1) Download wowlan Fw. */
/* (2) Download RSVD page packets. */
/* (3) Enable AP offload if needed. */
/* */
/* 2011.04.12 by tynli. */
/* */
void
SetFwRelatedForWoWLAN8188ES(
IN struct adapter * padapter,
IN u8 bHostIsGoingtoSleep
)
{
int status=_FAIL;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
u8 bRecover = false;
/* */
/* 1. Before WoWLAN we need to re-download WoWLAN Fw. */
/* */
status = rtl8188e_FirmwareDownload(padapter, bHostIsGoingtoSleep);
if(status != _SUCCESS) {
DBG_871X("ConfigFwRelatedForWoWLAN8188ES(): Re-Download Firmware failed!!\n");
return;
} else {
DBG_871X("ConfigFwRelatedForWoWLAN8188ES(): Re-Download Firmware Success !!\n");
}
/* */
/* 2. Re-Init the variables about Fw related setting. */
/* */
rtl8188e_InitializeFirmwareVars(padapter);
}
#else
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter) void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
{ {
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
@ -1007,28 +918,17 @@ void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
/* Init H2C counter. by tynli. 2009.12.09. */ /* Init H2C counter. by tynli. 2009.12.09. */
pHalData->LastHMEBoxNum = 0; pHalData->LastHMEBoxNum = 0;
/* pHalData->H2CQueueHead = 0; */
/* pHalData->H2CQueueTail = 0; */
/* pHalData->H2CStopInsertQueue = FALSE; */
} }
#endif /* CONFIG_WOWLAN */
static void rtl8188e_free_hal_data(struct adapter *padapter) static void rtl8188e_free_hal_data(struct adapter *padapter)
{ {
; if(padapter->HalData) {
if(padapter->HalData)
{
rtw_mfree(padapter->HalData, sizeof(HAL_DATA_TYPE)); rtw_mfree(padapter->HalData, sizeof(HAL_DATA_TYPE));
padapter->HalData = NULL; padapter->HalData = NULL;
} }
;
} }
/* */
/* Efuse related code */ /* Efuse related code */
/* */
enum{ enum{
VOLTAGE_V25 = 0x03, VOLTAGE_V25 = 0x03,
LDOE25_SHIFT = 28 , LDOE25_SHIFT = 28 ,
@ -3562,14 +3462,6 @@ BOOLEAN HalDetectPwrDownMode88E(struct adapter *Adapter)
return pHalData->pwrdown; return pHalData->pwrdown;
} /* HalDetectPwrDownMode */ } /* HalDetectPwrDownMode */
#ifdef CONFIG_WOWLAN
void Hal_DetectWoWMode(struct adapter *pAdapter)
{
adapter_to_pwrctl(pAdapter)->bSupportRemoteWakeup = true;
DBG_871X("%s\n", __func__);
}
#endif
/* 20100209 Joseph: */ /* 20100209 Joseph: */
/* This function is used only for 92C to set REG_BCN_CTRL(0x550) register. */ /* This function is used only for 92C to set REG_BCN_CTRL(0x550) register. */
/* We just reserve the value of the register in variable pHalData->RegBcnCtrlVal and then operate */ /* We just reserve the value of the register in variable pHalData->RegBcnCtrlVal and then operate */

View file

@ -1277,54 +1277,19 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN); HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
#ifdef CONFIG_WOWLAN
pwrctrlpriv->wowlan_wake_reason = rtw_read8(Adapter, REG_WOWLAN_WAKE_REASON);
DBG_8192C("%s wowlan_wake_reason: 0x%02x\n",
__func__, pwrctrlpriv->wowlan_wake_reason);
if(rtw_read8(Adapter, REG_MCUFWDL)&BIT7){ /*&&
(pwrctrlpriv->wowlan_wake_reason & FWDecisionDisconnect)) {*/
u8 reg_val=0;
DBG_8192C("+Reset Entry+\n");
rtw_write8(Adapter, REG_MCUFWDL, 0x00);
_8051Reset88E(Adapter);
/* reset BB */
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN);
reg_val &= ~(BIT(0) | BIT(1));
rtw_write8(Adapter, REG_SYS_FUNC_EN, reg_val);
/* reset RF */
rtw_write8(Adapter, REG_RF_CTRL, 0);
/* reset TRX path */
rtw_write16(Adapter, REG_CR, 0);
/* reset MAC, Digital Core */
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
reg_val &= ~(BIT(4) | BIT(7));
rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val);
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
reg_val |= BIT(4) | BIT(7);
rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val);
DBG_8192C("-Reset Entry-\n");
}
#endif /* CONFIG_WOWLAN */
if(pwrctrlpriv->bkeepfwalive) if(pwrctrlpriv->bkeepfwalive)
{ {
_ps_open_RF(Adapter); _ps_open_RF(Adapter);
if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){ if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
/* PHY_IQCalibrate(padapter, true); */
PHY_IQCalibrate_8188E(Adapter,true); PHY_IQCalibrate_8188E(Adapter,true);
} }
else else
{ {
/* PHY_IQCalibrate(padapter, false); */
PHY_IQCalibrate_8188E(Adapter,false); PHY_IQCalibrate_8188E(Adapter,false);
pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true; pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
} }
/* dm_CheckTXPowerTracking(padapter); */
/* PHY_LCCalibrate(padapter); */
ODM_TXPowerTrackingCheck(&pHalData->odmpriv ); ODM_TXPowerTrackingCheck(&pHalData->odmpriv );
PHY_LCCalibrate_8188E(Adapter); PHY_LCCalibrate_8188E(Adapter);
@ -1374,13 +1339,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW);
} }
#endif /* MP_DRIVER == 1 */ #endif /* MP_DRIVER == 1 */
{ {
#ifdef CONFIG_WOWLAN
status = rtl8188e_FirmwareDownload(Adapter, false);
#else
status = rtl8188e_FirmwareDownload(Adapter); status = rtl8188e_FirmwareDownload(Adapter);
#endif /* CONFIG_WOWLAN */
if (status != _SUCCESS) { if (status != _SUCCESS) {
DBG_871X("%s: Download Firmware failed!!\n", __FUNCTION__); DBG_871X("%s: Download Firmware failed!!\n", __FUNCTION__);
Adapter->bFWReady = false; Adapter->bFWReady = false;
@ -2948,101 +2907,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
pHalData->bMacPwrCtrlOn = *val; pHalData->bMacPwrCtrlOn = *val;
DBG_871X("%s: bMacPwrCtrlOn=%d\n", __func__, pHalData->bMacPwrCtrlOn); DBG_871X("%s: bMacPwrCtrlOn=%d\n", __func__, pHalData->bMacPwrCtrlOn);
break; break;
#ifdef CONFIG_WOWLAN
case HW_VAR_WOWLAN:
{
struct wowlan_ioctl_param *poidparam;
struct recv_buf *precvbuf;
int res, i;
u32 tmp;
u16 len = 0;
u8 mstatus = (*(u8 *)val);
u8 trycnt = 100;
u8 data[4];
poidparam = (struct wowlan_ioctl_param *)val;
switch (poidparam->subcode){
case WOWLAN_ENABLE:
DBG_871X_LEVEL(_drv_always_, "WOWLAN_ENABLE\n");
SetFwRelatedForWoWLAN8188ES(Adapter, true);
/* Set Pattern */
/* if(adapter_to_pwrctl(Adapter)->wowlan_pattern==true) */
/* rtw_wowlan_reload_pattern(Adapter); */
/* RX DMA stop */
DBG_871X_LEVEL(_drv_always_, "Pause DMA\n");
rtw_write32(Adapter,REG_RXPKT_NUM,(rtw_read32(Adapter,REG_RXPKT_NUM)|RW_RELEASE_EN));
do{
if((rtw_read32(Adapter, REG_RXPKT_NUM)&RXDMA_IDLE)) {
DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is true\n");
break;
} else {
/* If RX_DMA is not idle, receive one pkt from DMA */
DBG_871X_LEVEL(_drv_always_, "RX_DMA_IDLE is not true\n");
}
}while(trycnt--);
if(trycnt ==0)
DBG_871X_LEVEL(_drv_always_, "Stop RX DMA failed...... \n");
/* Set WOWLAN H2C command. */
DBG_871X_LEVEL(_drv_always_, "Set WOWLan cmd\n");
rtl8188es_set_wowlan_cmd(Adapter, 1);
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
trycnt = 10;
while(!(mstatus&BIT1) && trycnt>1) {
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_871X_LEVEL(_drv_always_, "Loop index: %d :0x%02x\n", trycnt, mstatus);
trycnt --;
rtw_msleep_os(2);
}
adapter_to_pwrctl(Adapter)->wowlan_wake_reason = rtw_read8(Adapter, REG_WOWLAN_WAKE_REASON);
DBG_871X_LEVEL(_drv_always_, "wowlan_wake_reason: 0x%02x\n",
adapter_to_pwrctl(Adapter)->wowlan_wake_reason);
/* Invoid SE0 reset signal during suspending*/
rtw_write8(Adapter, REG_RSV_CTRL, 0x20);
rtw_write8(Adapter, REG_RSV_CTRL, 0x60);
/* rtw_msleep_os(10); */
break;
case WOWLAN_DISABLE:
DBG_871X_LEVEL(_drv_always_, "WOWLAN_DISABLE\n");
trycnt = 10;
rtl8188es_set_wowlan_cmd(Adapter, 0);
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_871X_LEVEL(_drv_info_, "%s mstatus:0x%02x\n", __func__, mstatus);
while(mstatus&BIT1 && trycnt>1) {
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_871X_LEVEL(_drv_always_, "Loop index: %d :0x%02x\n", trycnt, mstatus);
trycnt --;
rtw_msleep_os(2);
}
if (mstatus & BIT1)
printk("System did not release RX_DMA\n");
else
SetFwRelatedForWoWLAN8188ES(Adapter, false);
rtw_msleep_os(2);
if(!(adapter_to_pwrctl(Adapter)->wowlan_wake_reason & FWDecisionDisconnect))
rtl8188e_set_FwJoinBssReport_cmd(Adapter, 1);
/* rtw_msleep_os(10); */
break;
default:
break;
}
}
break;
#endif /* CONFIG_WOWLAN */
#if (RATE_ADAPTIVE_SUPPORT == 1) #if (RATE_ADAPTIVE_SUPPORT == 1)
case HW_VAR_TX_RPT_MAX_MACID: case HW_VAR_TX_RPT_MAX_MACID:
{ {

View file

@ -109,9 +109,6 @@ typedef enum _HW_VARIABLES{
HW_VAR_APFM_ON_MAC, //Auto FSM to Turn On, include clock, isolation, power control for MAC only HW_VAR_APFM_ON_MAC, //Auto FSM to Turn On, include clock, isolation, power control for MAC only
// The valid upper nav range for the HW updating, if the true value is larger than the upper range, the HW won't update it. // The valid upper nav range for the HW updating, if the true value is larger than the upper range, the HW won't update it.
// Unit in microsecond. 0 means disable this function. // Unit in microsecond. 0 means disable this function.
#ifdef CONFIG_WOWLAN
HW_VAR_WOWLAN,
#endif
HW_VAR_SYS_CLKR, HW_VAR_SYS_CLKR,
HW_VAR_NAV_UPPER, HW_VAR_NAV_UPPER,
HW_VAR_RPT_TIMER_SETTING, HW_VAR_RPT_TIMER_SETTING,
@ -189,9 +186,6 @@ struct hal_ops {
void (*enable_interrupt)(struct adapter *padapter); void (*enable_interrupt)(struct adapter *padapter);
void (*disable_interrupt)(struct adapter *padapter); void (*disable_interrupt)(struct adapter *padapter);
s32 (*interrupt_handler)(struct adapter *padapter); s32 (*interrupt_handler)(struct adapter *padapter);
#ifdef CONFIG_WOWLAN
void (*clear_interrupt)(struct adapter *padapter);
#endif
void (*set_bwmode_handler)(struct adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offset); void (*set_bwmode_handler)(struct adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offset);
void (*set_channel_handler)(struct adapter *padapter, u8 channel); void (*set_channel_handler)(struct adapter *padapter, u8 channel);
@ -343,39 +337,6 @@ typedef struct eeprom_priv EEPROM_EFUSE_PRIV, *PEEPROM_EFUSE_PRIV;
#define GET_EEPROM_EFUSE_PRIV(adapter) (&adapter->eeprompriv) #define GET_EEPROM_EFUSE_PRIV(adapter) (&adapter->eeprompriv)
#define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse) #define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
#ifdef CONFIG_WOWLAN
typedef enum _wowlan_subcode{
WOWLAN_PATTERN_MATCH = 1,
WOWLAN_MAGIC_PACKET = 2,
WOWLAN_UNICAST = 3,
WOWLAN_SET_PATTERN = 4,
WOWLAN_DUMP_REG = 5,
WOWLAN_ENABLE = 6,
WOWLAN_DISABLE = 7,
WOWLAN_STATUS = 8,
WOWLAN_DEBUG_RELOAD_FW = 9,
WOWLAN_DEBUG_1 =10,
WOWLAN_DEBUG_2 =11
}wowlan_subcode;
struct wowlan_ioctl_param{
unsigned int subcode;
unsigned int subcode_value;
unsigned int wakeup_reason;
unsigned int len;
unsigned char pattern[0];
};
#define Rx_Pairwisekey 0x01
#define Rx_GTK 0x02
#define Rx_DisAssoc 0x04
#define Rx_DeAuth 0x08
#define FWDecisionDisconnect 0x10
#define Rx_MagicPkt 0x21
#define Rx_UnicastPkt 0x22
#define Rx_PatternPkt 0x23
#endif // CONFIG_WOWLAN
void rtw_hal_def_value_init(struct adapter *padapter); void rtw_hal_def_value_init(struct adapter *padapter);
void rtw_hal_free_data(struct adapter *padapter); void rtw_hal_free_data(struct adapter *padapter);

View file

@ -73,9 +73,6 @@ u8 rtw_reset_drv_sw(struct adapter *padapter);
u32 rtw_start_drv_threads(struct adapter *padapter); u32 rtw_start_drv_threads(struct adapter *padapter);
void rtw_stop_drv_threads (struct adapter *padapter); void rtw_stop_drv_threads (struct adapter *padapter);
#ifdef CONFIG_WOWLAN
void rtw_cancel_dynamic_chk_timer(struct adapter *padapter);
#endif
void rtw_cancel_all_timer(struct adapter *padapter); void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);

View file

@ -28,9 +28,6 @@ typedef enum _RTL8188E_H2C_CMD_ID
H2C_COM_SCAN =0x02, H2C_COM_SCAN =0x02,
H2C_COM_KEEP_ALIVE =0x03, H2C_COM_KEEP_ALIVE =0x03,
H2C_COM_DISCNT_DECISION =0x04, H2C_COM_DISCNT_DECISION =0x04,
#ifndef CONFIG_WOWLAN
H2C_COM_WWLAN =0x05,
#endif
H2C_COM_INIT_OFFLOAD =0x06, H2C_COM_INIT_OFFLOAD =0x06,
H2C_COM_REMOTE_WAKE_CTL =0x07, H2C_COM_REMOTE_WAKE_CTL =0x07,
H2C_COM_AP_OFFLOAD =0x08, H2C_COM_AP_OFFLOAD =0x08,
@ -54,14 +51,6 @@ typedef enum _RTL8188E_H2C_CMD_ID
H2C_BT_DAC_SWING_VAL =0x62, H2C_BT_DAC_SWING_VAL =0x62,
H2C_BT_PSD_RST =0x63, H2C_BT_PSD_RST =0x63,
//Class Remote WakeUp
#ifdef CONFIG_WOWLAN
H2C_COM_WWLAN =0x80,
H2C_COM_REMOTE_WAKE_CTRL =0x81,
H2C_COM_AOAC_GLOBAL_INFO =0x82,
H2C_COM_AOAC_RSVD_PAGE =0x83,
#endif
//Class //Class
H2C_RESET_TSF =0xc0, H2C_RESET_TSF =0xc0,
}RTL8188E_H2C_CMD_ID; }RTL8188E_H2C_CMD_ID;
@ -90,12 +79,8 @@ struct H2C_SS_RFOFF_PARAM{
u16 gpio_period; // unit: 1024 us u16 gpio_period; // unit: 1024 us
}__attribute__ ((packed)); }__attribute__ ((packed));
typedef struct JOINBSSRPT_PARM{ typedef struct JOINBSSRPT_PARM{
u8 OpMode; // RT_MEDIA_STATUS u8 OpMode; // RT_MEDIA_STATUS
#ifdef CONFIG_WOWLAN
u8 MacID; // MACID
#endif //CONFIG_WOWLAN
}JOINBSSRPT_PARM, *PJOINBSSRPT_PARM; }JOINBSSRPT_PARM, *PJOINBSSRPT_PARM;
typedef struct _RSVDPAGE_LOC { typedef struct _RSVDPAGE_LOC {
@ -104,15 +89,6 @@ typedef struct _RSVDPAGE_LOC {
u8 LocNullData; u8 LocNullData;
u8 LocQosNull; u8 LocQosNull;
u8 LocBTQosNull; u8 LocBTQosNull;
#ifdef CONFIG_WOWLAN
u8 LocRemoteCtrlInfo;
u8 LocArpRsp;
u8 LocNbrAdv;
u8 LocGTKRsp;
u8 LocGTKInfo;
u8 LocProbeReq;
u8 LocNetList;
#endif //CONFIG_WOWLAN
} RSVDPAGE_LOC, *PRSVDPAGE_LOC; } RSVDPAGE_LOC, *PRSVDPAGE_LOC;
struct P2P_PS_Offload_t { struct P2P_PS_Offload_t {
@ -155,70 +131,6 @@ int reset_tsf(struct adapter *Adapter, u8 reset_port );
#define H2C_8188E_RSVDPAGE_LOC_LEN 5 #define H2C_8188E_RSVDPAGE_LOC_LEN 5
#define H2C_8188E_AOAC_RSVDPAGE_LOC_LEN 7 #define H2C_8188E_AOAC_RSVDPAGE_LOC_LEN 7
#ifdef CONFIG_WOWLAN
typedef struct _SETWOWLAN_PARM{
u8 mode;
u8 gpio_index;
u8 gpio_duration;
u8 second_mode;
u8 reserve;
}SETWOWLAN_PARM, *PSETWOWLAN_PARM;
typedef struct _SETAOAC_GLOBAL_INFO{
u8 pairwiseEncAlg;
u8 groupEncAlg;
}SETAOAC_GLOBAL_INFO, *PSETAOAC_GLOBAL_INFO;
#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 )
#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5])
#define cpIpAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3])
//
// ARP packet
//
// LLC Header
#define GET_ARP_PKT_LLC_TYPE(__pHeader) ReadEF2Byte( ((u8*)(__pHeader)) + 6)
//ARP element
#define GET_ARP_PKT_OPERATION(__pHeader) ReadEF2Byte( ((u8*)(__pHeader)) + 6)
#define GET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val) cpMacAddr((u8*)(_val), ((u8*)(__pHeader))+8)
#define GET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val) cpIpAddr((u8*)(_val), ((u8*)(__pHeader))+14)
#define GET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val) cpMacAddr((u8*)(_val), ((u8*)(__pHeader))+18)
#define SET_ARP_PKT_HW(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 0, __Value)
#define SET_ARP_PKT_PROTOCOL(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 2, __Value)
#define SET_ARP_PKT_HW_ADDR_LEN(__pHeader, __Value) WriteEF1Byte( ((u8*)(__pHeader)) + 4, __Value)
#define SET_ARP_PKT_PROTOCOL_ADDR_LEN(__pHeader, __Value) WriteEF1Byte( ((u8*)(__pHeader)) + 5, __Value)
#define SET_ARP_PKT_OPERATION(__pHeader, __Value) WriteEF2Byte( ((u8*)(__pHeader)) + 6, __Value)
#define SET_ARP_PKT_SENDER_MAC_ADDR(__pHeader, _val) cpMacAddr(((u8*)(__pHeader))+8, (u8*)(_val))
#define SET_ARP_PKT_SENDER_IP_ADDR(__pHeader, _val) cpIpAddr(((u8*)(__pHeader))+14, (u8*)(_val))
#define SET_ARP_PKT_TARGET_MAC_ADDR(__pHeader, _val) cpMacAddr(((u8*)(__pHeader))+18, (u8*)(_val))
#define SET_ARP_PKT_TARGET_IP_ADDR(__pHeader, _val) cpIpAddr(((u8*)(__pHeader))+24, (u8*)(_val))
#define FW_WOWLAN_FUN_EN BIT(0)
#define FW_WOWLAN_PATTERN_MATCH BIT(1)
#define FW_WOWLAN_MAGIC_PKT BIT(2)
#define FW_WOWLAN_UNICAST BIT(3)
#define FW_WOWLAN_ALL_PKT_DROP BIT(4)
#define FW_WOWLAN_GPIO_ACTIVE BIT(5)
#define FW_WOWLAN_REKEY_WAKEUP BIT(6)
#define FW_WOWLAN_DEAUTH_WAKEUP BIT(7)
#define FW_WOWLAN_GPIO_WAKEUP_EN BIT(0)
#define FW_FW_PARSE_MAGIC_PKT BIT(1)
#define FW_WOWLAN_KEEP_ALIVE_EN BIT(0)
#define FW_WOWLAN_KEEP_ALIVE_PKT_TYPE BIT(2)
#define FW_REMOTE_WAKE_CTRL_EN BIT(0)
#define FW_ARP_EN BIT(1)
#define FW_REALWOWLAN_EN BIT(5)
#define FW_WOW_FW_UNICAST_EN BIT(7)
#define FW_ADOPT_USER BIT(1)
void rtl8188es_set_wowlan_cmd(struct adapter* padapter, u8 enable);
void SetFwRelatedForWoWLAN8188ES(struct adapter* padapter, u8 bHostIsGoingtoSleep);
#endif//CONFIG_WOWLAN
//---------------------------------------------------------------------------------------------------------// //---------------------------------------------------------------------------------------------------------//
//---------------------------------- H2C CMD CONTENT --------------------------------------------------// //---------------------------------- H2C CMD CONTENT --------------------------------------------------//
//---------------------------------------------------------------------------------------------------------// //---------------------------------------------------------------------------------------------------------//

View file

@ -41,11 +41,6 @@
// Fw Array // Fw Array
#define Rtl8188E_FwImageArray Rtl8188EFwImgArray #define Rtl8188E_FwImageArray Rtl8188EFwImgArray
#define Rtl8188E_FWImgArrayLength Rtl8188EFWImgArrayLength #define Rtl8188E_FWImgArrayLength Rtl8188EFWImgArrayLength
#ifdef CONFIG_WOWLAN
#define Rtl8188E_FwWoWImageArray Array_8188E_FW_WoWLAN
#define Rtl8188E_FwWoWImgArrayLength ArrayLength_8188E_FW_WoWLAN
#endif //CONFIG_WOWLAN
#define RTL8188E_FW_UMC_IMG "rtl8188E\\rtl8188efw.bin" #define RTL8188E_FW_UMC_IMG "rtl8188E\\rtl8188efw.bin"
#define RTL8188E_PHY_REG "rtl8188E\\PHY_REG_1T.txt" #define RTL8188E_PHY_REG "rtl8188E\\PHY_REG_1T.txt"
#define RTL8188E_PHY_RADIO_A "rtl8188E\\radio_a_1T.txt" #define RTL8188E_PHY_RADIO_A "rtl8188E\\radio_a_1T.txt"
@ -97,11 +92,6 @@ typedef struct _RT_FIRMWARE {
u8 szFwBuffer[FW_8188E_SIZE]; u8 szFwBuffer[FW_8188E_SIZE];
#endif #endif
u32 ulFwLength; u32 ulFwLength;
#ifdef CONFIG_WOWLAN
u8* szWoWLANFwBuffer;
u32 ulWoWLANFwLength;
#endif //CONFIG_WOWLAN
} RT_FIRMWARE, *PRT_FIRMWARE, RT_FIRMWARE_8188E, *PRT_FIRMWARE_8188E; } RT_FIRMWARE, *PRT_FIRMWARE, RT_FIRMWARE_8188E, *PRT_FIRMWARE_8188E;
// //
@ -497,11 +487,7 @@ typedef struct hal_data_8188e HAL_DATA_TYPE, *PHAL_DATA_TYPE;
#define INCLUDE_MULTI_FUNC_GPS(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_GPS) #define INCLUDE_MULTI_FUNC_GPS(_Adapter) (GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_GPS)
// rtl8188e_hal_init.c // rtl8188e_hal_init.c
#ifdef CONFIG_WOWLAN
s32 rtl8188e_FirmwareDownload(struct adapter *padapter, BOOLEAN bUsedWoWLANFw);
#else
s32 rtl8188e_FirmwareDownload(struct adapter *padapter); s32 rtl8188e_FirmwareDownload(struct adapter *padapter);
#endif
void _8051Reset88E(struct adapter *padapter); void _8051Reset88E(struct adapter *padapter);
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter); void rtl8188e_InitializeFirmwareVars(struct adapter *padapter);
@ -526,10 +512,6 @@ void Hal_ReadPowerSavingMode88E(struct adapter *pAdapter,u8* hwinfo,BOOLEAN Auto
BOOLEAN HalDetectPwrDownMode88E(struct adapter *Adapter); BOOLEAN HalDetectPwrDownMode88E(struct adapter *Adapter);
#ifdef CONFIG_WOWLAN
void Hal_DetectWoWMode(struct adapter *pAdapter);
#endif //CONFIG_WOWLAN
void Hal_InitChannelPlan(struct adapter *padapter); void Hal_InitChannelPlan(struct adapter *padapter);
void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc); void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc);

View file

@ -190,9 +190,6 @@
#define REG_C2HEVT_MSG_NORMAL 0x01A0 #define REG_C2HEVT_MSG_NORMAL 0x01A0
#define REG_C2HEVT_CLEAR 0x01AF #define REG_C2HEVT_CLEAR 0x01AF
#define REG_MCUTST_1 0x01c0 #define REG_MCUTST_1 0x01c0
#ifdef CONFIG_WOWLAN
#define REG_WOWLAN_WAKE_REASON 0x01c7
#endif
#define REG_FMETHR 0x01C8 #define REG_FMETHR 0x01C8
#define REG_HMETFR 0x01CC #define REG_HMETFR 0x01CC
#define REG_HMEBOX_0 0x01D0 #define REG_HMEBOX_0 0x01D0
@ -310,11 +307,6 @@
#define REG_TX_RPT_TIME 0x04F0 // 2 byte #define REG_TX_RPT_TIME 0x04F0 // 2 byte
#define REG_DUMMY 0x04FC #define REG_DUMMY 0x04FC
#ifdef CONFIG_WOWLAN
#define REG_TXPKTBUF_IV_LOW 0x0484
#define REG_TXPKTBUF_IV_HIGH 0x0488
#endif
//----------------------------------------------------- //-----------------------------------------------------
// //
// 0x0500h ~ 0x05FFh EDCA Configuration // 0x0500h ~ 0x05FFh EDCA Configuration

View file

@ -628,11 +628,6 @@ void update_tx_basic_rate(struct adapter *padapter, u8 modulation);
void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id); void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id);
int update_sta_support_rate(struct adapter *padapter, u8* pvar_ie, uint var_ie_len, int cam_idx); int update_sta_support_rate(struct adapter *padapter, u8* pvar_ie, uint var_ie_len, int cam_idx);
#ifdef CONFIG_WOWLAN
void rtw_get_current_ip_address(struct adapter *padapter, u8 *pcurrentip);
void rtw_get_sec_iv(struct adapter *padapter, u8*pcur_dot11txpn, u8 *StaAddr);
#endif
//for sta/adhoc mode //for sta/adhoc mode
void update_sta_info(struct adapter *padapter, struct sta_info *psta); void update_sta_info(struct adapter *padapter, struct sta_info *psta);
unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz); unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz);

View file

@ -298,14 +298,10 @@ enum {
CTA_TEST, CTA_TEST,
MP_DISABLE_BT_COEXIST, MP_DISABLE_BT_COEXIST,
MP_PwrCtlDM, MP_PwrCtlDM,
#ifdef CONFIG_WOWLAN
MP_WOW_ENABLE,
#endif
MP_NULL, MP_NULL,
}; };
struct mp_priv struct mp_priv {
{
struct adapter *papdater; struct adapter *papdater;
//Testing Flag //Testing Flag

View file

@ -233,16 +233,6 @@ struct pwrctrl_priv
u8 autopm_cnt; u8 autopm_cnt;
#endif #endif
u8 bSupportRemoteWakeup; u8 bSupportRemoteWakeup;
#ifdef CONFIG_WOWLAN
u8 wowlan_mode;
u8 wowlan_pattern;
u8 wowlan_magic;
u8 wowlan_unicast;
u8 wowlan_pattern_idx;
u8 wowlan_wake_reason;
u32 wowlan_pattern_context[8][5];
u64 wowlan_fw_iv;
#endif // CONFIG_WOWLAN
_timer pwr_state_check_timer; _timer pwr_state_check_timer;
int pwr_state_check_interval; int pwr_state_check_interval;
u8 pwr_state_check_cnts; u8 pwr_state_check_cnts;

View file

@ -51,8 +51,4 @@ extern void EnableInterrupt8188ESdio(struct adapter *padapter);
extern void DisableInterrupt8188ESdio(struct adapter *padapter); extern void DisableInterrupt8188ESdio(struct adapter *padapter);
extern void UpdateInterruptMask8188ESdio(struct adapter *padapter, u32 AddMSR, u32 RemoveMSR); extern void UpdateInterruptMask8188ESdio(struct adapter *padapter, u32 AddMSR, u32 RemoveMSR);
#ifdef CONFIG_WOWLAN
extern u8 RecvOnePkt(struct adapter *padapter, u32 size);
extern void ClearInterrupt8189ESdio(struct adapter *padapter);
#endif //CONFIG_WOWLAN
#endif #endif

View file

@ -7809,97 +7809,6 @@ FREE_EXT:
} }
#ifdef CONFIG_WOWLAN
static int rtw_wowlan_ctrl(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct wowlan_ioctl_param poidparam;
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_info *psta = NULL;
int ret = 0;
u32 start_time = rtw_get_current_time();
poidparam.subcode = 0;
DBG_871X("+rtw_wowlan_ctrl: %s\n", extra);
if(pwrctrlpriv->bSupportRemoteWakeup==false){
ret = -EPERM;
DBG_871X("+rtw_wowlan_ctrl: Device didn't support the remote wakeup!!\n");
goto _rtw_wowlan_ctrl_exit_free;
}
if (!check_fwstate(pmlmepriv, _FW_LINKED) &&
check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
DBG_871X("[%s] WARNING: Please Connect With AP First!!\n", __func__);
goto _rtw_wowlan_ctrl_exit_free;
}
if (_rtw_memcmp( extra, "enable", 6 )) {
while (pwrctrlpriv->bips_processing == true)
rtw_msleep_os(1);
rtw_cancel_all_timer(padapter);
padapter->bDriverStopped = true; /* for stop thread */
rtw_stop_drv_threads(padapter);
padapter->bDriverStopped = false; /* for 32k command */
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0);
rtw_hal_disable_interrupt(padapter); /* It need wait for leaving 32K. */
/* 2.1 clean interupt */
if (padapter->HalFunc.clear_interrupt)
padapter->HalFunc.clear_interrupt(padapter);
poidparam.subcode = WOWLAN_ENABLE;
rtw_hal_set_hwreg(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
} else if (_rtw_memcmp( extra, "disable", 6 )) {
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0);
pwrctrlpriv->bFwCurrentInPSMode = false;
rtw_hal_disable_interrupt(padapter);
if (padapter->HalFunc.clear_interrupt)
padapter->HalFunc.clear_interrupt(padapter);
poidparam.subcode = WOWLAN_DISABLE;
rtw_hal_set_hwreg(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv));
if (psta) {
set_sta_rate(padapter, psta);
}
padapter->bDriverStopped = false;
DBG_871X("%s: wowmode resuming, DriverStopped:%d\n", __func__, padapter->bDriverStopped);
rtw_start_drv_threads(padapter);
rtw_hal_enable_interrupt(padapter);
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
pwrctrlpriv->bips_processing = false;
rtw_set_pwr_state_check_timer(pwrctrlpriv);
} else {
DBG_871X("[%s] Invalid Parameter.\n", __func__);
goto _rtw_wowlan_ctrl_exit_free;
}
/* mutex_lock(&ioctl_mutex); */
_rtw_wowlan_ctrl_exit_free:
DBG_871X("-rtw_wowlan_ctrl( subcode = %d)\n", poidparam.subcode);
DBG_871X_LEVEL(_drv_always_, "%s in %d ms\n", __func__,
rtw_get_passing_time_ms(start_time));
_rtw_wowlan_ctrl_exit:
return ret;
}
#endif /* CONFIG_WOWLAN */
static int rtw_pm_set(struct net_device *dev, static int rtw_pm_set(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
@ -10277,10 +10186,6 @@ static const struct iw_priv_args rtw_private_args[] = {
SIOCIWFIRSTPRIV + 0x1D, SIOCIWFIRSTPRIV + 0x1D,
IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_CHAR | 0x7FF, "test" IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_CHAR | 0x7FF, "test"
}, },
#ifdef CONFIG_WOWLAN
{ MP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "wow_enable" }, /* set */
#endif
}; };
static iw_handler rtw_private_handler[] = static iw_handler rtw_private_handler[] =

View file

@ -942,23 +942,10 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
#endif /* CONFIG_BR_EXT */ #endif /* CONFIG_BR_EXT */
exit: exit:
RT_TRACE(_module_os_intfs_c_,_drv_info_,("-rtw_init_drv_sw\n")); RT_TRACE(_module_os_intfs_c_,_drv_info_,("-rtw_init_drv_sw\n"));
;
return ret8; return ret8;
} }
#ifdef CONFIG_WOWLAN
void rtw_cancel_dynamic_chk_timer(struct adapter *padapter)
{
_cancel_timer_ex(&padapter->mlmepriv.dynamic_chk_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel dynamic_chk_timer! \n"));
}
#endif
void rtw_cancel_all_timer(struct adapter *padapter) void rtw_cancel_all_timer(struct adapter *padapter)
{ {
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_cancel_all_timer\n")); RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_cancel_all_timer\n"));
@ -966,9 +953,6 @@ void rtw_cancel_all_timer(struct adapter *padapter)
_cancel_timer_ex(&padapter->mlmepriv.assoc_timer); _cancel_timer_ex(&padapter->mlmepriv.assoc_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel association timer complete! \n")); RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel association timer complete! \n"));
/* _cancel_timer_ex(&padapter->securitypriv.tkip_timer); */
/* RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel tkip_timer! \n")); */
_cancel_timer_ex(&padapter->mlmepriv.scan_to_timer); _cancel_timer_ex(&padapter->mlmepriv.scan_to_timer);
RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel scan_to_timer! \n")); RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel scan_to_timer! \n"));

View file

@ -469,26 +469,12 @@ void rtw_dev_unload(struct adapter *padapter)
/* s5. */ /* s5. */
if(padapter->bSurpriseRemoved == false) if(padapter->bSurpriseRemoved == false)
{ {
/* DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n"); */ rtw_hal_deinit(padapter);
#ifdef CONFIG_WOWLAN
if((adapter_to_pwrctl(padapter)->bSupportRemoteWakeup==true)&&(adapter_to_pwrctl(padapter)->wowlan_mode==true)){
DBG_871X("%s bSupportWakeOnWlan==true do not run rtw_hal_deinit()\n",__FUNCTION__);
}
else
#endif /* CONFIG_WOWLAN */
{
rtw_hal_deinit(padapter);
}
padapter->bSurpriseRemoved = true; padapter->bSurpriseRemoved = true;
} }
padapter->bup = false; padapter->bup = false;
#ifdef CONFIG_WOWLAN } else {
padapter->hw_init_completed=false;
#endif /* CONFIG_WOWLAN */
}
else
{
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("r871x_dev_unload():padapter->bup == false\n" )); RT_TRACE(_module_hci_intfs_c_,_drv_err_,("r871x_dev_unload():padapter->bup == false\n" ));
} }
@ -656,77 +642,6 @@ error_exit:
return (-1); return (-1);
} }
#ifdef CONFIG_WOWLAN
static void rtw_suspend_wow(struct adapter *padapter)
{
struct net_device *pnetdev = padapter->pnetdev;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct wifidirect_info* pwdinfo = &padapter->wdinfo;
struct wowlan_ioctl_param poidparam;
if (check_fwstate(pmlmepriv, _FW_LINKED))
pwrpriv->wowlan_mode = true;
else
pwrpriv->wowlan_mode = false;
rtw_cancel_all_timer(padapter);
LeaveAllPowerSaveMode(padapter);
rtw_stop_cmd_thread(padapter);
/* padapter->net_closed = true; */
/* s1. */
if(pnetdev)
{
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
}
if(pwrpriv->bSupportRemoteWakeup==true && pwrpriv->wowlan_mode==true){
/* set H2C command */
poidparam.subcode=WOWLAN_ENABLE;
padapter->HalFunc.SetHwRegHandler(padapter,HW_VAR_WOWLAN,(u8 *)&poidparam);
}
else
{
/* s2. */
rtw_disassoc_cmd(padapter, 0, false);
}
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)&& rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
/* DBG_871X("%s:%d assoc_ssid:%s\n", __FUNCTION__, __LINE__, pmlmepriv->assoc_ssid.Ssid); */
DBG_871X("%s:%d %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__, __LINE__,
pmlmepriv->cur_network.network.Ssid.Ssid,
MAC_ARG(pmlmepriv->cur_network.network.MacAddress),
pmlmepriv->cur_network.network.Ssid.SsidLength,
pmlmepriv->assoc_ssid.SsidLength);
rtw_set_roaming(padapter, 1);
}
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
#ifdef CONFIG_AUTOSUSPEND
if(!pwrpriv->bInternalAutoSuspend )
#endif
/* s2-4. */
rtw_free_network_queue(padapter, true);
rtw_dev_unload(padapter);
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
/* if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) */
/* rtw_indicate_disconnect(padapter); */
}
#endif
static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message) static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
{ {
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
@ -774,11 +689,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
pwrpriv->bInSuspend = true; pwrpriv->bInSuspend = true;
_enter_pwrlock(&pwrpriv->lock); _enter_pwrlock(&pwrpriv->lock);
#ifdef CONFIG_WOWLAN
rtw_suspend_wow(padapter);
#else
rtw_suspend_common(padapter); rtw_suspend_common(padapter);
#endif
#ifdef CONFIG_AUTOSUSPEND #ifdef CONFIG_AUTOSUSPEND
pwrpriv->rf_pwrstate = rf_off; pwrpriv->rf_pwrstate = rf_off;
@ -786,14 +697,13 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
#endif #endif
_exit_pwrlock(&pwrpriv->lock); _exit_pwrlock(&pwrpriv->lock);
exit: exit:
DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__ DBG_871X("<=== %s return %d.............. in %dms\n", __FUNCTION__
, ret, rtw_get_passing_time_ms(start_time)); , ret, rtw_get_passing_time_ms(start_time));
;
return ret; return ret;
} }
static int rtw_resume(struct usb_interface *pusb_intf) static int rtw_resume(struct usb_interface *pusb_intf)
{ {
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
@ -808,11 +718,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
#ifdef CONFIG_RESUME_IN_WORKQUEUE #ifdef CONFIG_RESUME_IN_WORKQUEUE
rtw_resume_in_workqueue(pwrpriv); rtw_resume_in_workqueue(pwrpriv);
#else #else
if (rtw_is_earlysuspend_registered(pwrpriv) if (rtw_is_earlysuspend_registered(pwrpriv)) {
#ifdef CONFIG_WOWLAN
&& !pwrpriv->wowlan_mode
#endif /* CONFIG_WOWLAN */
) {
/* jeff: bypass resume here, do in late_resume */ /* jeff: bypass resume here, do in late_resume */
rtw_set_do_late_resume(pwrpriv, true); rtw_set_do_late_resume(pwrpriv, true);
} else { } else {
@ -1234,10 +1140,6 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
#endif #endif
rtw_cancel_all_timer(if1); rtw_cancel_all_timer(if1);
#ifdef CONFIG_WOWLAN
pwrctl->wowlan_mode=false;
#endif /* CONFIG_WOWLAN */
rtw_dev_unload(if1); rtw_dev_unload(if1);
DBG_871X("+r871xu_dev_remove, hw_init_completed=%d\n", if1->hw_init_completed); DBG_871X("+r871xu_dev_remove, hw_init_completed=%d\n", if1->hw_init_completed);