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

Staging: rt2870: prepare for rt{28,30}70/common/*.[ch] merge

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9e4dab71
......@@ -639,7 +639,7 @@ VOID RTMPFreeTxRxRingMemory(
// Free Tx frame resource
for (acidx = 0; acidx < 4; acidx++)
for(acidx=0; acidx<4; acidx++)
{
PHT_TX_CONTEXT pHTTXContext = &(pAd->TxContext[acidx]);
if (pHTTXContext)
......@@ -699,9 +699,14 @@ NDIS_STATUS AdapterBlockAllocateMemory(
usb_dev = pObj->pUsb_Dev;
#ifndef RT30xx
pObj->MLMEThr_task = NULL;
pObj->RTUSBCmdThr_task = NULL;
#endif
#ifdef RT30xx
pObj->MLMEThr_pid = NULL;
pObj->RTUSBCmdThr_pid = NULL;
#endif
*ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER));
if (*ppAd)
......@@ -737,7 +742,12 @@ NDIS_STATUS CreateThreads(
{
PRTMP_ADAPTER pAd = net_dev->ml_priv;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
#ifndef RT30xx
struct task_struct *tsk;
#endif
#ifdef RT30xx
pid_t pid_number;
#endif
//init_MUTEX(&(pAd->usbdev_semaphore));
......@@ -751,39 +761,76 @@ NDIS_STATUS CreateThreads(
init_completion (&pAd->TimerQComplete);
// Creat MLME Thread
#ifndef RT30xx
pObj->MLMEThr_task = NULL;
tsk = kthread_run(MlmeThread, pAd, pAd->net_dev->name);
if (IS_ERR(tsk)) {
#endif
#ifdef RT30xx
pObj->MLMEThr_pid = NULL;
pid_number = kernel_thread(MlmeThread, pAd, CLONE_VM);
if (pid_number < 0)
{
#endif
printk (KERN_WARNING "%s: unable to start Mlme thread\n",pAd->net_dev->name);
return NDIS_STATUS_FAILURE;
}
#ifndef RT30xx
pObj->MLMEThr_task = tsk;
#endif
#ifdef RT30xx
pObj->MLMEThr_pid = find_get_pid(pid_number);
#endif
// Wait for the thread to start
wait_for_completion(&(pAd->mlmeComplete));
// Creat Command Thread
#ifndef RT30xx
pObj->RTUSBCmdThr_task = NULL;
tsk = kthread_run(RTUSBCmdThread, pAd, pAd->net_dev->name);
if (IS_ERR(tsk) < 0)
#endif
#ifdef RT30xx
pObj->RTUSBCmdThr_pid = NULL;
pid_number = kernel_thread(RTUSBCmdThread, pAd, CLONE_VM);
if (pid_number < 0)
#endif
{
printk (KERN_WARNING "%s: unable to start RTUSBCmd thread\n",pAd->net_dev->name);
return NDIS_STATUS_FAILURE;
}
#ifndef RT30xx
pObj->RTUSBCmdThr_task = tsk;
#endif
#ifdef RT30xx
pObj->RTUSBCmdThr_pid = find_get_pid(pid_number);
#endif
wait_for_completion(&(pAd->CmdQComplete));
#ifndef RT30xx
pObj->TimerQThr_task = NULL;
tsk = kthread_run(TimerQThread, pAd, pAd->net_dev->name);
if (IS_ERR(tsk) < 0)
#endif
#ifdef RT30xx
pObj->TimerQThr_pid = NULL;
pid_number = kernel_thread(TimerQThread, pAd, CLONE_VM);
if (pid_number < 0)
#endif
{
printk (KERN_WARNING "%s: unable to start TimerQThread\n",pAd->net_dev->name);
return NDIS_STATUS_FAILURE;
}
#ifndef RT30xx
pObj->TimerQThr_task = tsk;
#endif
#ifdef RT30xx
pObj->TimerQThr_pid = find_get_pid(pid_number);
#endif
// Wait for the thread to start
wait_for_completion(&(pAd->TimerQComplete));
......@@ -1260,9 +1307,9 @@ static void rt2870_hcca_dma_done_tasklet(unsigned long data)
UCHAR BulkOutPipeId = 4;
purbb_t pUrb;
#ifndef RT30xx
DBGPRINT_RAW(RT_DEBUG_ERROR, ("--->hcca_dma_done_tasklet\n"));
#endif
pUrb = (purbb_t)data;
pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
......@@ -1292,13 +1339,19 @@ static void rt2870_hcca_dma_done_tasklet(unsigned long data)
RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
}
#ifndef RT30xx
RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL);
#endif
#ifdef RT30xx
RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<4);
#endif
RTUSBKickBulkOut(pAd);
}
}
#ifndef RT30xx
DBGPRINT_RAW(RT_DEBUG_ERROR, ("<---hcca_dma_done_tasklet\n"));
#endif
return;
}
......
......@@ -533,7 +533,12 @@ VOID SendRefreshBAR(
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);
}
......
......@@ -532,6 +532,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);
......@@ -1072,8 +1079,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);
}
......@@ -1377,6 +1392,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)
......@@ -1392,12 +1411,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;
}
......
......@@ -172,7 +172,114 @@ NDIS_STATUS MiniportMMRequest(
return Status;
}
#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 */
/*
......@@ -214,7 +321,23 @@ NDIS_STATUS MlmeHardTransmit(
}
#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,
......@@ -614,6 +737,11 @@ BOOLEAN RTMP_FillTxBlkInfo(
}
return TRUE;
#ifdef RT30xx
FillTxBlkErr:
return FALSE;
#endif
}
......@@ -701,6 +829,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
......@@ -1413,7 +1542,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);
......@@ -1774,7 +1911,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;
......
......@@ -292,6 +292,7 @@ USHORT RtmpUSB_WriteSingleTxResource(
pTxBlk->Priv = (TXINFO_SIZE + USBDMApktLen);
// For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload
//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT)(USBDMApktLen), FALSE, FIFO_EDCA, FALSE /*NextValid*/, FALSE);
if ((pHTTXContext->CurWritePosition + 3906 + pTxBlk->Priv) > MAX_TXBULK_LIMIT)
......@@ -809,7 +810,12 @@ VOID RT28xxUsbStaAsicForceWakeup(
AutoWakeupCfg.word = 0;
RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
#ifndef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
#endif
#ifdef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
#endif
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
}
......@@ -846,7 +852,12 @@ VOID RT28xxUsbMlmeRadioOn(
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
#ifndef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
#endif
#ifdef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
#endif
RTMPusecDelay(10000);
NICResetFromError(pAd);
......@@ -854,6 +865,13 @@ VOID RT28xxUsbMlmeRadioOn(
// Enable Tx/Rx
RTMPEnableRxTx(pAd);
#ifdef RT3070
if (IS_RT3071(pAd))
{
RT30xxReverseRFSleepModeSetup(pAd);
}
#endif // RT3070 //
// Clear Radio off flag
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
......@@ -890,6 +908,7 @@ VOID RT28xxUsbMlmeRadioOFF(
BssTableInit(&pAd->ScanTab);
}
#ifndef RT30xx
// Disable MAC Tx/Rx
RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
Value &= (0xfffffff3);
......@@ -903,6 +922,7 @@ VOID RT28xxUsbMlmeRadioOFF(
// TX_PIN_CFG => value = 0x0 => 20mA
RTMP_IO_WRITE32(pAd, TX_PIN_CFG, 0);
#endif
if (pAd->CommonCfg.BBPCurrentBW == BW_40)
{
......@@ -915,6 +935,14 @@ VOID RT28xxUsbMlmeRadioOFF(
AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
}
#ifdef RT30xx
// Disable Tx/Rx DMA
RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
GloCfg.field.EnableTxDMA = 0;
GloCfg.field.EnableRxDMA = 0;
RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
#endif
// Waiting for DMA idle
i = 0;
do
......@@ -926,6 +954,13 @@ VOID RT28xxUsbMlmeRadioOFF(
RTMPusecDelay(1000);
}while (i++ < 100);
#ifdef RT30xx
// Disable MAC Tx/Rx
RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
Value &= (0xfffffff3);
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
#endif
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
}
......@@ -1388,6 +1388,7 @@ 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)))
......@@ -1396,6 +1397,7 @@ VOID RTMPSetHT(
pAd->CommonCfg.DesiredHtPhy.TxSTBC = 0;
}
#endif // RT2870 //
#endif
if(pHTPhyMode->SHORTGI == GI_400)
{
......@@ -2454,13 +2456,26 @@ INT Set_HtAutoBa_Proc(
Value = simple_strtol(arg, 0, 10);
if (Value == 0)
{
pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
else if (Value == 1)
#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));
......@@ -2677,6 +2692,9 @@ PCHAR RTMPGetRalinkAuthModeStr(
{
case Ndis802_11AuthModeOpen:
return "OPEN";
#ifdef RT30xx
default:
#endif
case Ndis802_11AuthModeWPAPSK:
return "WPAPSK";
case Ndis802_11AuthModeShared:
......@@ -2691,10 +2709,12 @@ PCHAR RTMPGetRalinkAuthModeStr(
return "WPAPSKWPA2PSK";
case Ndis802_11AuthModeWPA1WPA2:
return "WPA1WPA2";
#ifndef RT30xx
case Ndis802_11AuthModeWPANone:
return "WPANONE";
default:
return "UNKNOW";
#endif
}
}
......@@ -2703,6 +2723,9 @@ PCHAR RTMPGetRalinkEncryModeStr(
{
switch(encryMode)
{
#ifdef RT30xx
default:
#endif
case Ndis802_11WEPDisabled:
return "NONE";
case Ndis802_11WEPEnabled:
......@@ -2713,8 +2736,10 @@ PCHAR RTMPGetRalinkEncryModeStr(
return "AES";
case Ndis802_11Encryption4Enabled:
return "TKIPAES";
#ifndef RT30xx
default:
return "UNKNOW";
#endif
}
}
......@@ -2739,7 +2764,12 @@ INT RTMPShowCfgValue(
{
sprintf(pBuf, "\n");
for (PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC = RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC++)
#ifndef RT30xx
sprintf(pBuf + strlen(pBuf), "%s\n", PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name);
#endif
#ifdef RT30xx
sprintf(pBuf, "%s%s\n", pBuf, PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name);
#endif
}
return Status;
......
......@@ -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.
......@@ -317,6 +317,7 @@ VOID RTUSBBulkOutDataPacket(
break;
}
//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
if (pTxInfo->QSEL != FIFO_EDCA)
{
printk("%s(): ====> pTxInfo->QueueSel(%d)!= FIFO_EDCA!!!!\n", __func__, pTxInfo->QSEL);
......@@ -349,7 +350,7 @@ VOID RTUSBBulkOutDataPacket(
pLastTxInfo = pTxInfo;
// Make sure we use EDCA QUEUE.
pTxInfo->QSEL = FIFO_EDCA;
pTxInfo->QSEL = FIFO_EDCA; //PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
ThisBulkSize += (pTxInfo->USBDMATxPktLen+4);
TmpBulkEndPos += (pTxInfo->USBDMATxPktLen+4);
......@@ -975,6 +976,17 @@ VOID RTUSBKickBulkOut(
RTUSBBulkOutDataPacket(pAd, 3, pAd->NextBulkOutIndex[3]);
}
}
#ifdef RT30xx
//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_5))
{
if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
(!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
))
{
}
}
#endif
// 7. Null frame is the last
else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL))
......
......@@ -110,6 +110,12 @@ NTSTATUS RTUSBFirmwareWrite(
Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff);
Status = RTUSBFirmwareRun(pAd);
#ifdef RT30xx
RTMPusecDelay(10000);
RTUSBWriteMACRegister(pAd,H2M_MAILBOX_CSR,0);
AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00);//reset rf by MCU supported by new firmware
#endif
return Status;
}
......@@ -665,6 +671,7 @@ NTSTATUS RTUSBWriteRFRegister(
return STATUS_SUCCESS;
}
#ifndef RT30xx
/*
========================================================================
......@@ -772,6 +779,7 @@ NTSTATUS RT30xxReadRFRegister(
return STATUS_SUCCESS;
}
#endif /* RT30xx */
/*
========================================================================
......@@ -796,6 +804,14 @@ NTSTATUS RTUSBReadEEPROM(
{
NTSTATUS Status = STATUS_SUCCESS;
#ifdef RT30xx
if(pAd->bUseEfuse)
{
Status =eFuseRead(pAd, Offset, pData, length);
}
else
#endif // RT30xx //
{
Status = RTUSB_VendorRequest(
pAd,
(USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK),
......@@ -805,6 +821,7 @@ NTSTATUS RTUSBReadEEPROM(
Offset,
pData,
length);
}
return Status;
}
......@@ -832,6 +849,14 @@ NTSTATUS RTUSBWriteEEPROM(
{
NTSTATUS Status = STATUS_SUCCESS;
#ifdef RT30xx
if(pAd->bUseEfuse)
{
Status = eFuseWrite(pAd, Offset, pData, length);
}
else
#endif // RT30xx //
{
Status = RTUSB_VendorRequest(
pAd,
USBD_TRANSFER_DIRECTION_OUT,
......@@ -841,6 +866,7 @@ NTSTATUS RTUSBWriteEEPROM(
Offset,
pData,
length);
}
return Status;
}
......@@ -957,9 +983,13 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(
PCmdQElmt cmdqelmt = NULL;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
#ifndef RT30xx
BUG_ON(pObj->RTUSBCmdThr_task == NULL);
CHECK_PID_LEGALITY(task_pid(pObj->RTUSBCmdThr_task))
#endif
#ifdef RT30xx
if (pObj->RTUSBCmdThr_pid < 0)
#endif
return (NDIS_STATUS_RESOURCES);
status = RTMPAllocateMemory((PVOID *)&cmdqelmt, sizeof(CmdQElmt));
......@@ -1710,6 +1740,38 @@ VOID CMDHandler(
}
break;
#ifdef RT30xx
//Benson modified for USB interface, avoid in interrupt when write key, 20080724 -->
case RT_CMD_SET_KEY_TABLE: //General call for AsicAddPairwiseKeyEntry()
{
RT_ADD_PAIRWISE_KEY_ENTRY KeyInfo;
KeyInfo = *((PRT_ADD_PAIRWISE_KEY_ENTRY)(pData));
AsicAddPairwiseKeyEntry(pAd,
KeyInfo.MacAddr,
(UCHAR)KeyInfo.MacTabMatchWCID,
&KeyInfo.CipherKey);
}
break;
case RT_CMD_SET_RX_WCID_TABLE: //General call for RTMPAddWcidAttributeEntry()
{
PMAC_TABLE_ENTRY pEntry;
UCHAR KeyIdx;
UCHAR CipherAlg;
UCHAR ApIdx;
pEntry = (PMAC_TABLE_ENTRY)(pData);
RTMPAddWcidAttributeEntry(
pAd,
ApIdx,
KeyIdx,
CipherAlg,
pEntry);
}
break;
//Benson modified for USB interface, avoid in interrupt when write key, 20080724 <--
#endif
case CMDTHREAD_SET_CLIENT_MAC_ENTRY:
{
MAC_TABLE_ENTRY *pEntry;
......@@ -1756,6 +1818,16 @@ VOID CMDHandler(
}
break;
#ifdef RT30xx
// add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
case CMDTHREAD_UPDATE_PROTECT:
{
AsicUpdateProtect(pAd, 0, (ALLN_SETPROTECT), TRUE, 0);
}
break;
// end johnli
#endif
case OID_802_11_ADD_WEP:
{
UINT i;
......
......@@ -1569,7 +1569,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