Commit 59fe2d89 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rt2860: prepare for rt28[67]0/common/*.[ch] merge

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3fb468ab
......@@ -527,9 +527,15 @@ VOID SendRefreshBAR(
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(FRAME_BAR), &FrameBar,
END_OF_ARGS);
if (1) // Now we always send BAR.
{
#ifndef RT30xx
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
#endif
#ifdef RT30xx
MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
#endif
}
MlmeFreeMemory(pAd, pOutBuffer);
}
......
......@@ -531,6 +531,13 @@ VOID BAOriSessionSetUp(
pBAEntry->TimeOutValue = TimeOut;
pBAEntry->pAdapter = pAd;
#ifdef RT30xx
DBGPRINT(RT_DEBUG_TRACE,("Send AddBA to %02x:%02x:%02x:%02x:%02x:%02x Tid:%d isForced:%d Wcid:%d\n"
,pEntry->Addr[0],pEntry->Addr[1],pEntry->Addr[2]
,pEntry->Addr[3],pEntry->Addr[4],pEntry->Addr[5]
,TID,isForced,pEntry->Aid));
#endif
if (!(pEntry->TXBAbitmap & (1<<TID)))
{
RTMPInitTimer(pAd, &pBAEntry->ORIBATimer, GET_TIMER_FUNCTION(BAOriSessionSetupTimeout), pBAEntry, FALSE);
......@@ -1071,8 +1078,16 @@ VOID BAOriSessionSetupTimeout(
AddbaReq.Token = pBAEntry->Token;
MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE, sizeof(MLME_ADDBA_REQ_STRUCT), (PVOID)&AddbaReq);
RT28XX_MLME_HANDLER(pAd);
#ifndef RT30xx
DBGPRINT(RT_DEBUG_TRACE,("BA Ori Session Timeout(%d) : Send ADD BA again\n", pBAEntry->Token));
#endif
#ifdef RT30xx
DBGPRINT(RT_DEBUG_TRACE,("BA Ori Session Timeout(%d) to %02x:%02x:%02x:%02x:%02x:%02x Tid:%d Wcid:%d\n"
,pBAEntry->Token
,pEntry->Addr[0],pEntry->Addr[1],pEntry->Addr[2]
,pEntry->Addr[3],pEntry->Addr[4],pEntry->Addr[5]
,pBAEntry->TID,pEntry->Aid));
#endif
pBAEntry->Token++;
RTMPSetTimer(&pBAEntry->ORIBATimer, ORI_BA_SESSION_TIMEOUT);
}
......@@ -1376,6 +1391,10 @@ VOID SendPSMPAction(
//ULONG Idx;
FRAME_PSMP_ACTION Frame;
ULONG FrameLen;
#ifdef RT30xx
UCHAR bbpdata=0;
UINT32 macdata;
#endif // RT30xx //
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
if (NStatus != NDIS_STATUS_SUCCESS)
......@@ -1391,12 +1410,54 @@ VOID SendPSMPAction(
switch (Psmp)
{
case MMPS_ENABLE:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// disable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata &= ~(0x04); //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// disable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata &= ~(0x09); //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 0;
break;
case MMPS_DYNAMIC:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// enable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata |= 0x04; //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// enable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata |= 0x09; //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 3;
break;
case MMPS_STATIC:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// enable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata |= 0x04; //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// enable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata |= 0x09; //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 1;
break;
}
......
This diff is collapsed.
......@@ -762,6 +762,7 @@ INT Show_DescInfo_Proc(
IN PRTMP_ADAPTER pAd,
IN PUCHAR arg)
{
#ifdef RT2860
INT i, QueIdx=0;
PRT28XX_RXD_STRUC pRxD;
PTXD_STRUC pTxD;
......@@ -792,7 +793,7 @@ INT Show_DescInfo_Proc(
hex_dump("Rx Descriptor", (char *)pRxD, 16);
printk("pRxD->DDONE = %x\n", pRxD->DDONE);
}
#endif /* RT2860 */
return TRUE;
}
......@@ -1418,6 +1419,16 @@ VOID RTMPSetHT(
pAd->CommonCfg.DesiredHtPhy.RxSTBC = 0;
}
#ifndef RT30xx
#ifdef RT2870
/* Frank recommend ,If not, Tx maybe block in high power. Rx has no problem*/
if(IS_RT3070(pAd) && ((pAd->RfIcType == RFIC_3020) || (pAd->RfIcType == RFIC_2020)))
{
pAd->CommonCfg.HtCapability.HtCapInfo.TxSTBC = 0;
pAd->CommonCfg.DesiredHtPhy.TxSTBC = 0;
}
#endif // RT2870 //
#endif
if(pHTPhyMode->SHORTGI == GI_400)
{
......@@ -1696,7 +1707,12 @@ VOID RTMPAddWcidAttributeEntry(
}
// For key index and ext IV bit, so only need to update the position(offset+3).
#ifdef RT2860
RTMP_IO_WRITE8(pAd, offset+3, IVEIV);
#endif
#ifdef RT2870
RTUSBMultiWrite_OneByte(pAd, offset+3, &IVEIV);
#endif // RT2870 //
DBGPRINT(RT_DEBUG_TRACE,("RTMPAddWcidAttributeEntry: WCID #%d, KeyIndex #%d, Alg=%s\n",Wcid, KeyIdx, CipherName[CipherAlg]));
DBGPRINT(RT_DEBUG_TRACE,(" WCIDAttri = 0x%x \n", WCIDAttri));
......@@ -2473,13 +2489,26 @@ INT Set_HtAutoBa_Proc(
Value = simple_strtol(arg, 0, 10);
if (Value == 0)
{
pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
#ifdef RT30xx
pAd->CommonCfg.BACapability.field.Policy = BA_NOTUSE;
#endif
}
else if (Value == 1)
{
pAd->CommonCfg.BACapability.field.AutoBA = TRUE;
#ifdef RT30xx
pAd->CommonCfg.BACapability.field.Policy = IMMED_BA;
#endif
}
else
return FALSE; //Invalid argument
pAd->CommonCfg.REGBACapability.field.AutoBA = pAd->CommonCfg.BACapability.field.AutoBA;
#ifdef RT30xx
pAd->CommonCfg.REGBACapability.field.Policy = pAd->CommonCfg.BACapability.field.Policy;
#endif
SetCommonHT(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("Set_HtAutoBa_Proc::(HtAutoBa=%d)\n",pAd->CommonCfg.BACapability.field.AutoBA));
......@@ -2696,7 +2725,9 @@ PCHAR RTMPGetRalinkAuthModeStr(
{
case Ndis802_11AuthModeOpen:
return "OPEN";
#if defined(RT2860) || defined(RT30xx)
default:
#endif
case Ndis802_11AuthModeWPAPSK:
return "WPAPSK";
case Ndis802_11AuthModeShared:
......@@ -2711,8 +2742,14 @@ PCHAR RTMPGetRalinkAuthModeStr(
return "WPAPSKWPA2PSK";
case Ndis802_11AuthModeWPA1WPA2:
return "WPA1WPA2";
#ifndef RT30xx
case Ndis802_11AuthModeWPANone:
return "WPANONE";
#ifdef RT2870
default:
return "UNKNOW";
#endif
#endif
}
}
......@@ -2721,7 +2758,9 @@ PCHAR RTMPGetRalinkEncryModeStr(
{
switch(encryMode)
{
#if defined(RT2860) || defined(RT30xx)
default:
#endif
case Ndis802_11WEPDisabled:
return "NONE";
case Ndis802_11WEPEnabled:
......@@ -2732,6 +2771,10 @@ PCHAR RTMPGetRalinkEncryModeStr(
return "AES";
case Ndis802_11Encryption4Enabled:
return "TKIPAES";
#if !defined(RT2860) && !defined(RT30xx)
default:
return "UNKNOW";
#endif
}
}
......
......@@ -440,13 +440,24 @@ VOID ScanNextChannel(
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
}
#ifdef RT2870
else if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->OpMode == OPMODE_STA))
{
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
MlmeCntlConfirm(pAd, MT2_SCAN_CONF, MLME_FAIL_NO_RESOURCE);
}
#endif // RT2870 //
else
{
{
// BBP and RF are not accessible in PS mode, we has to wake them up first
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
#ifdef RT2860
AsicForceWakeup(pAd, FROM_TX);
#endif
#ifdef RT2870
AsicForceWakeup(pAd, TRUE);
#endif
// leave PSM during scanning. otherwise we may lost ProbeRsp & BEACON
if (pAd->StaCfg.Psm == PWR_SAVE)
MlmeSetPsmBit(pAd, PWR_ACTIVE);
......
......@@ -39,10 +39,14 @@
// WPA OUI
UCHAR OUI_WPA_NONE_AKM[4] = {0x00, 0x50, 0xF2, 0x00};
UCHAR OUI_WPA_VERSION[4] = {0x00, 0x50, 0xF2, 0x01};
#ifndef RT30xx
UCHAR OUI_WPA_WEP40[4] = {0x00, 0x50, 0xF2, 0x01};
#endif
UCHAR OUI_WPA_TKIP[4] = {0x00, 0x50, 0xF2, 0x02};
UCHAR OUI_WPA_CCMP[4] = {0x00, 0x50, 0xF2, 0x04};
#ifndef RT30xx
UCHAR OUI_WPA_WEP104[4] = {0x00, 0x50, 0xF2, 0x05};
#endif
UCHAR OUI_WPA_8021X_AKM[4] = {0x00, 0x50, 0xF2, 0x01};
UCHAR OUI_WPA_PSK_AKM[4] = {0x00, 0x50, 0xF2, 0x02};
// WPA2 OUI
......@@ -51,7 +55,9 @@ UCHAR OUI_WPA2_TKIP[4] = {0x00, 0x0F, 0xAC, 0x02};
UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04};
UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01};
UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02};
#ifndef RT30xx
UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05};
#endif
// MSA OUI
UCHAR OUI_MSA_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x05}; // Not yet final - IEEE 802.11s-D1.06
UCHAR OUI_MSA_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x06}; // Not yet final - IEEE 802.11s-D1.06
......@@ -370,6 +376,7 @@ static VOID RTMPInsertRsnIeCipher(
break;
}
#ifndef RT30xx
if ((pAd->OpMode == OPMODE_STA) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
......@@ -385,7 +392,7 @@ static VOID RTMPInsertRsnIeCipher(
break;
}
}
#endif
// swap for big-endian platform
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
......@@ -446,6 +453,7 @@ static VOID RTMPInsertRsnIeCipher(
break;
}
#ifndef RT30xx
if ((pAd->OpMode == OPMODE_STA) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
......@@ -461,7 +469,7 @@ static VOID RTMPInsertRsnIeCipher(
break;
}
}
#endif
// swap for big-endian platform
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1570,7 +1570,12 @@ static VOID PeerMeasureReportAction(
if ((pMeasureReportInfo = kmalloc(sizeof(MEASURE_RPI_REPORT), GFP_ATOMIC)) == NULL)
{
#ifndef RT30xx
DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%zu).\n", __func__, sizeof(MEASURE_RPI_REPORT)));
#endif
#ifdef RT30xx
DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%d).\n", __func__, sizeof(MEASURE_RPI_REPORT)));
#endif
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment