Staging: rt2860: prepare for rt28[67]0/common/*.[ch] merge
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
3fb468abc8
commit
59fe2d89b6
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,9 @@ NDIS_STATUS MiniportMMRequest(
|
|||
PNDIS_PACKET pPacket;
|
||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
||||
ULONG FreeNum;
|
||||
#ifdef RT2860
|
||||
unsigned long IrqFlags = 0;
|
||||
#endif
|
||||
UCHAR IrqState;
|
||||
UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN];
|
||||
|
||||
|
@ -117,9 +119,10 @@ NDIS_STATUS MiniportMMRequest(
|
|||
|
||||
IrqState = pAd->irq_disabled;
|
||||
|
||||
#ifdef RT2860
|
||||
if ((pAd->MACVersion == 0x28600100) && (!IrqState))
|
||||
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
|
||||
|
||||
#endif
|
||||
do
|
||||
{
|
||||
// Reset is in progress, stop immediately
|
||||
|
@ -172,14 +175,15 @@ NDIS_STATUS MiniportMMRequest(
|
|||
|
||||
} while (FALSE);
|
||||
|
||||
#ifdef RT2860
|
||||
// 2860C use Tx Ring
|
||||
if ((pAd->MACVersion == 0x28600100) && (!IrqState))
|
||||
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
|
||||
|
||||
#endif
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
#ifdef RT2860
|
||||
NDIS_STATUS MiniportMMRequestUnlock(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx,
|
||||
|
@ -247,7 +251,115 @@ NDIS_STATUS MiniportMMRequestUnlock(
|
|||
|
||||
return Status;
|
||||
}
|
||||
#endif
|
||||
#ifdef RT30xx
|
||||
NDIS_STATUS MlmeDataHardTransmit(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx,
|
||||
IN PNDIS_PACKET pPacket);
|
||||
|
||||
#define MAX_DATAMM_RETRY 3
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
Routine Description:
|
||||
API for MLME to transmit management frame to AP (BSS Mode)
|
||||
or station (IBSS Mode)
|
||||
|
||||
Arguments:
|
||||
pAd Pointer to our adapter
|
||||
pData Pointer to the outgoing 802.11 frame
|
||||
Length Size of outgoing management frame
|
||||
|
||||
Return Value:
|
||||
NDIS_STATUS_FAILURE
|
||||
NDIS_STATUS_PENDING
|
||||
NDIS_STATUS_SUCCESS
|
||||
|
||||
IRQL = PASSIVE_LEVEL
|
||||
IRQL = DISPATCH_LEVEL
|
||||
|
||||
Note:
|
||||
|
||||
========================================================================
|
||||
*/
|
||||
NDIS_STATUS MiniportDataMMRequest(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx,
|
||||
IN PUCHAR pData,
|
||||
IN UINT Length)
|
||||
{
|
||||
PNDIS_PACKET pPacket;
|
||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
||||
ULONG FreeNum;
|
||||
int retry = 0;
|
||||
UCHAR IrqState;
|
||||
UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN];
|
||||
|
||||
ASSERT(Length <= MGMT_DMA_BUFFER_SIZE);
|
||||
|
||||
// 2860C use Tx Ring
|
||||
IrqState = pAd->irq_disabled;
|
||||
|
||||
do
|
||||
{
|
||||
// Reset is in progress, stop immediately
|
||||
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
|
||||
RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)||
|
||||
!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
|
||||
{
|
||||
Status = NDIS_STATUS_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Check Free priority queue
|
||||
// Since we use PBF Queue2 for management frame. Its corresponding DMA ring should be using TxRing.
|
||||
|
||||
// 2860C use Tx Ring
|
||||
|
||||
// free Tx(QueIdx) resources
|
||||
FreeNum = GET_TXRING_FREENO(pAd, QueIdx);
|
||||
|
||||
if ((FreeNum > 0))
|
||||
{
|
||||
// We need to reserve space for rtmp hardware header. i.e., TxWI for RT2860 and TxInfo+TxWI for RT2870
|
||||
NdisZeroMemory(&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE));
|
||||
Status = RTMPAllocateNdisPacket(pAd, &pPacket, (PUCHAR)&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE), pData, Length);
|
||||
if (Status != NDIS_STATUS_SUCCESS)
|
||||
{
|
||||
DBGPRINT(RT_DEBUG_WARN, ("MiniportMMRequest (error:: can't allocate NDIS PACKET)\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
//pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
|
||||
//pAd->CommonCfg.MlmeRate = RATE_2;
|
||||
|
||||
|
||||
Status = MlmeDataHardTransmit(pAd, QueIdx, pPacket);
|
||||
if (Status != NDIS_STATUS_SUCCESS)
|
||||
RTMPFreeNdisPacket(pAd, pPacket);
|
||||
retry = MAX_DATAMM_RETRY;
|
||||
}
|
||||
else
|
||||
{
|
||||
retry ++;
|
||||
|
||||
printk("retry %d\n", retry);
|
||||
pAd->RalinkCounters.MgmtRingFullCount++;
|
||||
|
||||
if (retry >= MAX_DATAMM_RETRY)
|
||||
{
|
||||
DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in DataRing, MgmtRingFullCount=%ld!\n",
|
||||
QueIdx, pAd->RalinkCounters.MgmtRingFullCount));
|
||||
}
|
||||
}
|
||||
|
||||
} while (retry < MAX_DATAMM_RETRY);
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
#endif /* RT30xx */
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
@ -283,14 +395,16 @@ NDIS_STATUS MlmeHardTransmit(
|
|||
return NDIS_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef RT2860
|
||||
if ( pAd->MACVersion == 0x28600100 )
|
||||
return MlmeHardTransmitTxRing(pAd,QueIdx,pPacket);
|
||||
else
|
||||
#endif
|
||||
return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef RT2860
|
||||
NDIS_STATUS MlmeHardTransmitTxRing(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx,
|
||||
|
@ -472,7 +586,25 @@ NDIS_STATUS MlmeHardTransmitTxRing(
|
|||
|
||||
return NDIS_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* RT2860 */
|
||||
|
||||
#ifdef RT30xx
|
||||
NDIS_STATUS MlmeDataHardTransmit(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx,
|
||||
IN PNDIS_PACKET pPacket)
|
||||
{
|
||||
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
|
||||
)
|
||||
{
|
||||
return NDIS_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef RT2870
|
||||
return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket);
|
||||
#endif // RT2870 //
|
||||
}
|
||||
#endif /* RT30xx */
|
||||
|
||||
NDIS_STATUS MlmeHardTransmitMgmtRing(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
|
@ -500,7 +632,12 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
|
|||
|
||||
// outgoing frame always wakeup PHY to prevent frame lost
|
||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
|
||||
#ifdef RT2860
|
||||
AsicForceWakeup(pAd, FROM_TX);
|
||||
#endif
|
||||
#ifdef RT2870
|
||||
AsicForceWakeup(pAd, TRUE);
|
||||
#endif
|
||||
|
||||
pFirstTxWI = (PTXWI_STRUC)(pSrcBufVA + TXINFO_SIZE);
|
||||
pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE); //TXWI_SIZE);
|
||||
|
@ -823,7 +960,13 @@ BOOLEAN RTMP_FillTxBlkInfo(
|
|||
|
||||
{
|
||||
// If support WMM, enable it.
|
||||
#ifdef RT2860
|
||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
|
||||
#endif
|
||||
#ifdef RT2870
|
||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
|
||||
CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))
|
||||
#endif
|
||||
TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM);
|
||||
}
|
||||
|
||||
|
@ -870,6 +1013,11 @@ BOOLEAN RTMP_FillTxBlkInfo(
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
#ifdef RT30xx
|
||||
FillTxBlkErr:
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -957,6 +1105,7 @@ VOID RTMPDeQueuePacket(
|
|||
if (QIdx == NUM_OF_TX_RING)
|
||||
{
|
||||
sQIdx = 0;
|
||||
//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
|
||||
eQIdx = 3; // 4 ACs, start from 0.
|
||||
}
|
||||
else
|
||||
|
@ -999,7 +1148,7 @@ VOID RTMPDeQueuePacket(
|
|||
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef RT2860
|
||||
FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
|
||||
|
||||
#ifdef DBG_DIAGNOSE
|
||||
|
@ -1024,7 +1173,7 @@ VOID RTMPDeQueuePacket(
|
|||
RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
|
||||
FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
|
||||
}
|
||||
|
||||
#endif /* RT2860 */
|
||||
// probe the Queue Head
|
||||
pQueue = &pAd->TxSwQueue[QueIdx];
|
||||
if ((pEntry = pQueue->Head) == NULL)
|
||||
|
@ -1093,19 +1242,29 @@ VOID RTMPDeQueuePacket(
|
|||
pTxBlk->TxFrameType = TX_LEGACY_FRAME;
|
||||
}
|
||||
|
||||
#ifdef RT2870
|
||||
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
|
||||
#endif // RT2870 //
|
||||
|
||||
Count += pTxBlk->TxPacketList.Number;
|
||||
|
||||
// Do HardTransmit now.
|
||||
Status = STAHardTransmit(pAd, pTxBlk, QueIdx);
|
||||
|
||||
#ifdef RT2860
|
||||
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
|
||||
// static rate also need NICUpdateFifoStaCounters() function.
|
||||
//if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
|
||||
NICUpdateFifoStaCounters(pAd);
|
||||
#endif
|
||||
}
|
||||
|
||||
RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
|
||||
|
||||
#ifdef RT2870
|
||||
if (!hasTxDesc)
|
||||
RTUSBKickBulkOut(pAd);
|
||||
#endif // RT2870 //
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1633,7 +1792,7 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
#ifdef RT2860
|
||||
BOOLEAN RTMPFreeTXDUponTxDmaDone(
|
||||
IN PRTMP_ADAPTER pAd,
|
||||
IN UCHAR QueIdx)
|
||||
|
@ -2016,6 +2175,7 @@ VOID DBGPRINT_RX_RING(
|
|||
DBGPRINT_RAW(RT_DEBUG_TRACE,(" RxSwReadIdx [%d]=", AC0freeIdx));
|
||||
DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount));
|
||||
}
|
||||
#endif /* RT2860 */
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
@ -2075,7 +2235,15 @@ VOID RTMPResumeMsduTransmission(
|
|||
{
|
||||
DBGPRINT(RT_DEBUG_TRACE,("SCAN done, resume MSDU transmission ...\n"));
|
||||
|
||||
|
||||
#ifdef RT30xx
|
||||
// After finish BSS_SCAN_IN_PROGRESS, we need to restore Current R66 value
|
||||
// R66 should not be 0
|
||||
if (pAd->BbpTuning.R66CurrentValue == 0)
|
||||
{
|
||||
pAd->BbpTuning.R66CurrentValue = 0x38;
|
||||
DBGPRINT_ERR(("RTMPResumeMsduTransmission, R66CurrentValue=0...\n"));
|
||||
}
|
||||
#endif
|
||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, pAd->BbpTuning.R66CurrentValue);
|
||||
|
||||
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
|
||||
|
@ -2298,7 +2466,9 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(
|
|||
pEntry->AuthMode = pAd->StaCfg.AuthMode;
|
||||
pEntry->WepStatus = pAd->StaCfg.WepStatus;
|
||||
pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
|
||||
#ifdef RT2860
|
||||
AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2306,10 +2476,12 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(
|
|||
pEntry->PairwiseKey.KeyLen = 0;
|
||||
pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
|
||||
|
||||
#ifdef RT2860
|
||||
if ((pAd->OpMode == OPMODE_STA) &&
|
||||
(pAd->StaCfg.BssType == BSS_ADHOC))
|
||||
pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
|
||||
else
|
||||
#endif
|
||||
pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
|
||||
|
||||
pEntry->PMKID_CacheIdx = ENTRY_NOT_FOUND;
|
||||
|
@ -2445,7 +2617,12 @@ BOOLEAN MacTableDeleteEntry(
|
|||
if (pAd->MacTab.Size == 0)
|
||||
{
|
||||
pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode = 0;
|
||||
#ifndef RT30xx
|
||||
AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/);
|
||||
#endif
|
||||
#ifdef RT30xx
|
||||
RT28XX_UPDATE_PROTECT(pAd); // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
|
||||
#endif
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -2469,7 +2646,9 @@ VOID MacTableReset(
|
|||
|
||||
for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
|
||||
{
|
||||
#ifdef RT2860
|
||||
RT28XX_STA_ENTRY_MAC_RESET(pAd, i);
|
||||
#endif
|
||||
if (pAd->MacTab.Content[i].ValidAsCLI == TRUE)
|
||||
{
|
||||
// free resources of BA
|
||||
|
@ -2479,6 +2658,10 @@ VOID MacTableReset(
|
|||
|
||||
|
||||
|
||||
#ifdef RT2870
|
||||
NdisZeroMemory(pAd->MacTab.Content[i].Addr, 6);
|
||||
RT28XX_STA_ENTRY_MAC_RESET(pAd, i);
|
||||
#endif // RT2870 //
|
||||
|
||||
//AsicDelWcidTab(pAd, i);
|
||||
}
|
||||
|
@ -2791,6 +2974,37 @@ VOID Indicate_Legacy_Packet(
|
|||
|
||||
STATS_INC_RX_PACKETS(pAd, FromWhichBSSID);
|
||||
|
||||
#ifdef RT2870
|
||||
if (pAd->CommonCfg.bDisableReordering == 0)
|
||||
{
|
||||
PBA_REC_ENTRY pBAEntry;
|
||||
ULONG Now32;
|
||||
UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID;
|
||||
UCHAR TID = pRxBlk->pRxWI->TID;
|
||||
USHORT Idx;
|
||||
|
||||
#define REORDERING_PACKET_TIMEOUT ((100 * HZ)/1000) // system ticks -- 100 ms
|
||||
|
||||
if (Wcid < MAX_LEN_OF_MAC_TABLE)
|
||||
{
|
||||
Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID];
|
||||
if (Idx != 0)
|
||||
{
|
||||
pBAEntry = &pAd->BATable.BARecEntry[Idx];
|
||||
// update last rx time
|
||||
NdisGetSystemUpTime(&Now32);
|
||||
if ((pBAEntry->list.qlen > 0) &&
|
||||
RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(REORDERING_PACKET_TIMEOUT)))
|
||||
)
|
||||
{
|
||||
printk("Indicate_Legacy_Packet():flush reordering_timeout_mpdus! RxWI->Flags=%d, pRxWI.TID=%d, RxD->AMPDU=%d!\n", pRxBlk->Flags, pRxBlk->pRxWI->TID, pRxBlk->RxD.AMPDU);
|
||||
hex_dump("Dump the legacy Packet:", GET_OS_PKT_DATAPTR(pRxBlk->pRxPacket), 64);
|
||||
ba_flush_reordering_timeout_mpdus(pAd, pBAEntry, Now32);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // RT2870 //
|
||||
|
||||
wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue