// Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. ***
MODULE_AUTHOR("Paul Lin <paul_lin@ralinktech.com>");
MODULE_DESCRIPTION("RT2870 Wireless Lan Linux Driver");
-#ifdef CONFIG_STA_SUPPORT
MODULE_LICENSE("GPL");
#ifdef MODULE_VERSION
MODULE_VERSION(STA_DRIVER_VERSION);
#endif
-#endif // CONFIG_STA_SUPPORT //
/* Kernel thread and vars, which handles packets that are completed. Only
* packets that have a "complete" function are sent here. This way, the
{
INT NumOfBcn;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
NumOfBcn = MAX_MESH_NUM;
}
-#endif // CONFIG_STA_SUPPORT //
RTMPCancelTimer(&pAd->CommonCfg.BeaconUpdateTimer, &Cancelled);
{
INT NumOfBcn;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
NumOfBcn = MAX_MESH_NUM;
}
-#endif // CONFIG_STA_SUPPORT //
for(apidx=0; apidx<NumOfBcn; apidx++)
{
# TODO: all of these should be removed
EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
EXTRA_CFLAGS += -DRT2870
-EXTRA_CFLAGS += -DCONFIG_STA_SUPPORT
EXTRA_CFLAGS += -DDBG
EXTRA_CFLAGS += -DDOT11_N_SUPPORT
EXTRA_CFLAGS += -DWPA_SUPPLICANT_SUPPORT
return NDIS_STATUS_SUCCESS;
}
-
-#ifdef CONFIG_STA_SUPPORT
/*
========================================================================
Routine Description:
DBGPRINT_RAW(RT_DEBUG_TRACE,(" %x:", pKey->KeyMaterial[i]));
DBGPRINT(RT_DEBUG_TRACE,(" \n"));
}
-#endif // CONFIG_STA_SUPPORT //
/*
========================================================================
pBAEntry =&pAd->BATable.BAOriEntry[Idx];
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (ADHOC_ON(pAd))
else
ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pInfo->pAddr);
}
-#endif // CONFIG_STA_SUPPORT //
Frame.Category = CATEGORY_BA;
Frame.Action = ADDBA_REQ;
// SEND BAR (Send BAR to refresh peer reordering buffer.)
Idx = pAd->MacTab.Content[pInfo->Wcid].BAOriWcidArray[pInfo->TID];
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pInfo->Wcid].Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL funciton.
FrameBar.StartingSeq.field.StartSeq = pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID]; // make sure sequence not clear in DEL funciton.
// SEND DELBA FRAME
FrameLen = 0;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (ADHOC_ON(pAd))
else
ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[pInfo->Wcid].Addr);
}
-#endif // CONFIG_STA_SUPPORT //
+
Frame.Category = CATEGORY_BA;
Frame.Action = DELBA;
Frame.DelbaParm.Initiator = pInfo->Initiator;
NdisZeroMemory(&HTINFOframe, sizeof(FRAME_HT_INFO));
// 2-1. Prepare ADDBA Response frame.
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (ADHOC_ON(pAd))
else
ActHeaderInit(pAd, &HTINFOframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr);
}
-#endif // CONFIG_STA_SUPPORT //
HTINFOframe.Category = CATEGORY_HT;
HTINFOframe.Action = HT_INFO_EXCHANGE;
{
case NOTIFY_BW_ACTION:
DBGPRINT(RT_DEBUG_TRACE,("ACTION - HT Notify Channel bandwidth action----> \n"));
-#ifdef CONFIG_STA_SUPPORT
+
if(pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE)
{
// Note, this is to patch DIR-1353 AP. When the AP set to Wep, it will use legacy mode. But AP still keeps
Elem->Msg[LENGTH_802_11+2] ));
break;
}
-#endif // CONFIG_STA_SUPPORT //
if (Elem->Msg[LENGTH_802_11+2] == 0) // 7.4.8.2. if value is 1, keep the same as supported channel bandwidth.
pAd->MacTab.Content[Elem->Wcid].HTPhyMode.field.BW = 0;
Sequence = pEntry->TxSeq[TID];
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
BarHeaderInit(pAd, &FrameBar, pEntry->Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function.
FrameBar.StartingSeq.field.StartSeq = Sequence; // make sure sequence not clear in DEL funciton.
// pass this 802.3 packet to upper layer or forward this packet to WM directly
//
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket, RTMP_GET_PACKET_IF(pPacket));
-#endif // CONFIG_STA_SUPPORT //
}
}
return;
}
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pBAEntry->Wcid].Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function.
FrameBar.StartingSeq.field.StartSeq = pBAEntry->Sequence; // make sure sequence not clear in DEL funciton.
pAd = pBAEntry->pAdapter;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Do nothing if monitor mode is on
if (MONITOR_ON(pAd))
return;
}
-#endif // CONFIG_STA_SUPPORT //
pEntry = &pAd->MacTab.Content[pBAEntry->Wcid];
}
NdisZeroMemory(&ADDframe, sizeof(FRAME_ADDBA_RSP));
+
// 2-1. Prepare ADDBA Response frame.
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (ADHOC_ON(pAd))
else
ActHeaderInit(pAd, &ADDframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr);
}
-#endif // CONFIG_STA_SUPPORT //
+
ADDframe.Category = CATEGORY_BA;
ADDframe.Action = ADDBA_RESP;
ADDframe.Token = pAddreqFrame->Token;
}
// Rcv Decline StatusCode
if ((pFrame->StatusCode == 37)
-#ifdef CONFIG_STA_SUPPORT
|| ((pAd->OpMode == OPMODE_STA) && STA_TGN_WIFI_ON(pAd) && (pFrame->StatusCode != 0))
-#endif // CONFIG_STA_SUPPORT //
)
{
pAd->MacTab.Content[Elem->Wcid].BADeclineBitmap |= 1<<pFrame->BaParm.TID;
DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() allocate memory failed \n"));
return;
}
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[Wcid].Addr);
-#endif // CONFIG_STA_SUPPORT //
Frame.Category = CATEGORY_HT;
Frame.Action = SMPS_ACTION;
// a. pointer pRxBlk->pData to payload
// b. modify pRxBlk->DataSize
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
ASSERT(pRxBlk->pRxPacket);
pRxPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
//
if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU))
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
#ifdef LINUX
NdisMoveMemory(skb_push(pRxPkt, LENGTH_802_3), Header802_3, LENGTH_802_3);
#endif
}
-#endif // CONFIG_STA_SUPPORT //
}
}
return NDIS_STATUS_FAILURE;
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// outgoing frame always wakeup PHY to prevent frame lost
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
AsicForceWakeup(pAd, TRUE);
}
-#endif // CONFIG_STA_SUPPORT //
pFirstTxWI = (PTXWI_STRUC)(pSrcBufVA + TXINFO_SIZE);
pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE); //TXWI_SIZE);
pMacEntry = MacTableLookup(pAd, pHeader_802_11->Addr1);
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Fixed W52 with Activity scan issue in ABG_MIXED and ABGN_MIXED mode.
pAd->CommonCfg.MlmeTransmit.field.MODE = 0;
}
}
-#endif // CONFIG_STA_SUPPORT //
//
// Should not be hard code to set PwrMgmt to 0 (PWR_ACTIVE)
// pHeader_802_11->FC.PwrMgmt = 0; // (pAd->StaCfg.Psm == PWR_SAVE);
//
// In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame
-#ifdef CONFIG_STA_SUPPORT
+
// Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD
if ((pHeader_802_11->FC.Type != BTYPE_DATA) && (pHeader_802_11->FC.Type != BTYPE_CNTL))
{
else
pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE;
}
-#endif // CONFIG_STA_SUPPORT //
bInsertTimestamp = FALSE;
if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL
{
-#ifdef CONFIG_STA_SUPPORT
//Set PM bit in ps-poll, to fix WLK 1.2 PowerSaveMode_ext failure issue.
if ((pAd->OpMode == OPMODE_STA) && (pHeader_802_11->FC.SubType == SUBTYPE_PS_POLL))
{
pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
}
-#endif // CONFIG_STA_SUPPORT //
bAckRequired = FALSE;
}
else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
TX_BLK_SET_FLAG(pTxBlk, fTX_bAckRequired);
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))
TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM);
}
-#endif // CONFIG_STA_SUPPORT //
}
if (pTxBlk->TxFrameType == TX_LEGACY_FRAME)
return FALSE;
}
-#ifdef CONFIG_STA_SUPPORT
if ((INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA)) // must be unicast to AP
return TRUE;
else
-#endif // CONFIG_STA_SUPPORT //
return FALSE;
-
}
Count += pTxBlk->TxPacketList.Number;
// Do HardTransmit now.
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
Status = STAHardTransmit(pAd, pTxBlk, QueIdx);
-#endif // CONFIG_STA_SUPPORT //
-
#if 0 // We should not break if HardTransmit failed. Well, at least now we should not!
if (Status != NDIS_STATUS_SUCCESS)
// convert to 802.3 header
CONVERT_TO_802_3(Header802_3, pDA, pSA, pPayload, PayloadSize, pRemovedLLCSNAP);
-#ifdef CONFIG_STA_SUPPORT
if ((Header802_3[12] == 0x88) && (Header802_3[13] == 0x8E) )
{
// avoid local heap overflow, use dyanamic allocation
WpaEAPOLKeyAction(pAd, Elem);
kfree(Elem);
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pRemovedLLCSNAP)
NdisMoveMemory(pPayload, &Header802_3[0], LENGTH_802_3);
}
}
-#endif // CONFIG_STA_SUPPORT //
pClonePacket = ClonePacket(pAd, pPacket, pPayload, PayloadSize);
if (pClonePacket)
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pClonePacket, RTMP_GET_PACKET_IF(pPacket));
-#endif // CONFIG_STA_SUPPORT //
}
return NULL;
FirstWcid = 1;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
+
if (pAd->StaCfg.BssType == BSS_INFRA)
FirstWcid = 2;
-#endif // CONFIG_STA_SUPPORT //
// allocate one MAC entry
NdisAcquireSpinLock(&pAd->MacTabLock);
pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
}
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pEntry->ValidAsCLI = TRUE;
pEntry->ValidAsMesh = FALSE;
pEntry->ValidAsDls = FALSE;
}
-#endif // CONFIG_STA_SUPPORT //
}
pEntry->bIAmBadAtheros = FALSE;
pEntry->apidx = apidx;
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pEntry->AuthMode = pAd->StaCfg.AuthMode;
pEntry->WepStatus = pAd->StaCfg.WepStatus;
pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
}
-#endif // CONFIG_STA_SUPPORT //
}
pEntry->GTKState = REKEY_NEGOTIATING;
// 2. remove LLC
// a. pointer pRxBlk->pData to payload
// b. modify pRxBlk->DataSize
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
if (pRxBlk->DataSize > MAX_RX_PKT_LEN)
{
//
// pass this 802.3 packet to upper layer or forward this packet to WM directly
//
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxPacket, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
-
}
}
// get 802.3 Header and remove LLC
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
-
ASSERT(pRxBlk->pRxPacket);
Payload2Size = Msdu2Size - LENGTH_802_3;
pData2 = pRxBlk->pData + Payload1Size + LENGTH_802_3;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pPacket2 = duplicate_pkt(pAd, (pData2-LENGTH_802_3), LENGTH_802_3, pData2, Payload2Size, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
if (!pPacket2)
{
pRxBlk->DataSize = Payload1Size;
wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxBlk->pRxPacket, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
if (pPacket2)
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket2, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
}
}
{
MAC_TABLE_ENTRY *pEntry = NULL;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pEntry = &pAd->MacTab.Content[BSSID_WCID];
STARxEAPOLFrameIndicate(pAd, pEntry, pRxBlk, FromWhichBSSID);
return;
}
-#endif // CONFIG_STA_SUPPORT //
if (pEntry == NULL)
{
}
-#ifdef CONFIG_STA_SUPPORT
/*
========================================================================
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_DOZE);
}
-#endif // CONFIG_STA_SUPPORT //
VOID RT28xxUsbMlmeRadioOn(
IN PRTMP_ADAPTER pAd)
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
RTMPusecDelay(10000);
}
-#endif // CONFIG_STA_SUPPORT //
+
NICResetFromError(pAd);
// Enable Tx/Rx
// Clear Radio off flag
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
RTUSBBulkReceive(pAd);
-#endif // CONFIG_STA_SUPPORT //
// Set LED
RTMPSetLED(pAd, LED_RADIO_ON);
// Set Radio off flag
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Link down first if any association exists
// Clean up old bss table
BssTableInit(&pAd->ScanTab);
}
-#endif // CONFIG_STA_SUPPORT //
-
// Disable MAC Tx/Rx
RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
RTMPusecDelay(1000);
}while (i++ < 100);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
-#endif // CONFIG_STA_SUPPORT //
}
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf);
-#ifdef CONFIG_STA_SUPPORT
INT Show_NetworkType_Proc(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf);
-#endif // CONFIG_STA_SUPPORT //
INT Show_AuthMode_Proc(
IN PRTMP_ADAPTER pAd,
{"WmmCapable", Show_WmmCapable_Proc},
#endif
{"IEEE80211H", Show_IEEE80211H_Proc},
-#ifdef CONFIG_STA_SUPPORT
{"NetworkType", Show_NetworkType_Proc},
-#endif // CONFIG_STA_SUPPORT //
{"AuthMode", Show_AuthMode_Proc},
{"EncrypType", Show_EncrypType_Proc},
{"DefaultKeyID", Show_DefaultKeyID_Proc},
IN PRTMP_ADAPTER pAd,
IN PUCHAR arg)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
DBGPRINT(RT_DEBUG_TRACE, ("Driver version-%s\n", STA_DRIVER_VERSION));
-#endif // CONFIG_STA_SUPPORT //
return TRUE;
}
WirelessMode = simple_strtol(arg, 0, 10);
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
INT MaxPhyMode = PHY_11G;
success = FALSE;
}
}
-#endif // CONFIG_STA_SUPPORT //
// it is needed to set SSID to take effect
if (success == TRUE)
// check if this channel is valid
if (ChannelSanity(pAd, Channel) == TRUE)
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pAd->CommonCfg.Channel = Channel;
}
}
}
-#endif // CONFIG_STA_SUPPORT //
success = TRUE;
}
else
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
success = FALSE;
-#endif // CONFIG_STA_SUPPORT //
}
TxPower = (ULONG) simple_strtol(arg, 0, 10);
if (TxPower <= 100)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pAd->CommonCfg.TxPowerDefault = TxPower;
pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
}
-#endif // CONFIG_STA_SUPPORT //
success = TRUE;
}
else
{
case Rt802_11PreambleShort:
pAd->CommonCfg.TxPreamble = Preamble;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
MlmeSetTxPreamble(pAd, Rt802_11PreambleShort);
-#endif // CONFIG_STA_SUPPORT //
break;
case Rt802_11PreambleLong:
-#ifdef CONFIG_STA_SUPPORT
case Rt802_11PreambleAuto:
// if user wants AUTO, initialize to LONG here, then change according to AP's
// capability upon association.
-#endif // CONFIG_STA_SUPPORT //
pAd->CommonCfg.TxPreamble = Preamble;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
MlmeSetTxPreamble(pAd, Rt802_11PreambleLong);
-#endif // CONFIG_STA_SUPPORT //
break;
default: //Invalid argument
return FALSE;
if((RtsThresh > 0) && (RtsThresh <= MAX_RTS_THRESHOLD))
pAd->CommonCfg.RtsThreshold = (USHORT)RtsThresh;
-#ifdef CONFIG_STA_SUPPORT
else if (RtsThresh == 0)
pAd->CommonCfg.RtsThreshold = MAX_RTS_THRESHOLD;
-#endif // CONFIG_STA_SUPPORT //
else
return FALSE; //Invalid argument
pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh;
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->CommonCfg.FragmentThreshold == MAX_FRAG_THRESHOLD)
else
pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;
}
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("Set_FragThreshold_Proc::(FragThreshold=%d)\n", pAd->CommonCfg.FragmentThreshold));
========================================================================
*/
-#ifdef CONFIG_STA_SUPPORT
VOID RTMPSetDesiredRates(
IN PRTMP_ADAPTER pAdapter,
IN LONG Rates)
return (Status);
}
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
/*
========================================================================
}
}
-#endif // CONFIG_STA_SUPPORT //
/*
========================================================================
if (i == pAd->ChannelListNum)
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pAd->CommonCfg.Channel = FirstChannel(pAd);
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_ERROR, ("RTMPSetPhyMode: channel is out of range, use first channel=%d \n", pAd->CommonCfg.Channel));
}
}
AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
RTMPSetIndividualHT(pAd, 0);
}
-#endif // CONFIG_STA_SUPPORT //
-
}
/*
do
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pDesired_ht_phy = &pAd->StaCfg.DesiredHtPhyInfo;
//pAd->StaCfg.bAutoTxRateSwitch = (DesiredMcs == MCS_AUTO) ? TRUE : FALSE;
break;
}
-#endif // CONFIG_STA_SUPPORT //
} while (FALSE);
if (pDesired_ht_phy == NULL)
USHORT Wcid = 0;
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (BssIdx > BSS0)
else
Wcid = MCAST_WCID;
}
-#endif // CONFIG_STA_SUPPORT //
}
// Update WCID attribute table
offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pEntry && pEntry->ValidAsMesh)
else
WCIDAttri = (CipherAlg<<1) | SHAREDKEYTABLE;
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
WaitCnt = 0;
-#ifdef CONFIG_STA_SUPPORT
pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
+
while ((ScanRunning(pAdapter) == TRUE) && (WaitCnt++ < 200))
OS_WAIT(500);
-#endif // CONFIG_STA_SUPPORT //
for(i=0; i<pAdapter->ScanTab.BssNr ;i++)
{
sprintf(msg+strlen(msg),"\n");
}
-#ifdef CONFIG_STA_SUPPORT
pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
-#endif // CONFIG_STA_SUPPORT //
wrq->u.data.length = strlen(msg);
Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length);
IN PUCHAR arg)
{
ULONG HtMcs, Mcs_tmp;
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN bAutoRate = FALSE;
-#endif // CONFIG_STA_SUPPORT //
Mcs_tmp = simple_strtol(arg, 0, 10);
else
HtMcs = MCS_AUTO;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pAd->StaCfg.DesiredTransmitSetting.field.MCS = HtMcs;
if (ADHOC_ON(pAd))
return TRUE;
}
-#endif // CONFIG_STA_SUPPORT //
SetCommonHT(pAd);
fix_tx_mode = FIXED_TXMODE_CCK;
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode = fix_tx_mode;
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("Set_FixedTxMode_Proc::(FixedTxMode=%d)\n", fix_tx_mode));
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
sprintf(pBuf, "\t%s", pAd->CommonCfg.Ssid);
-#endif // CONFIG_STA_SUPPORT //
return 0;
}
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
sprintf(pBuf, "\t%u", pAd->StaCfg.DesiredTransmitSetting.field.MCS);
-#endif // CONFIG_STA_SUPPORT //
return 0;
}
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
sprintf(pBuf, "\t%s", pAd->CommonCfg.bWmmCapable ? "TRUE":"FALSE");
-#endif // CONFIG_STA_SUPPORT //
return 0;
}
return 0;
}
-#ifdef CONFIG_STA_SUPPORT
INT Show_NetworkType_Proc(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf)
}
return 0;
}
-#endif // CONFIG_STA_SUPPORT //
INT Show_AuthMode_Proc(
IN PRTMP_ADAPTER pAd,
{
NDIS_802_11_AUTHENTICATION_MODE AuthMode = Ndis802_11AuthModeOpen;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
AuthMode = pAd->StaCfg.AuthMode;
-#endif // CONFIG_STA_SUPPORT //
if ((AuthMode >= Ndis802_11AuthModeOpen) &&
(AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK))
{
NDIS_802_11_WEP_STATUS WepStatus = Ndis802_11WEPDisabled;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
WepStatus = pAd->StaCfg.WepStatus;
-#endif // CONFIG_STA_SUPPORT //
if ((WepStatus >= Ndis802_11WEPEnabled) &&
(WepStatus <= Ndis802_11Encryption4KeyAbsent))
{
UCHAR DefaultKeyId = 0;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
DefaultKeyId = pAd->StaCfg.DefaultKeyId;
-#endif // CONFIG_STA_SUPPORT //
sprintf(pBuf, "\t%d", DefaultKeyId);
INT idx;
UCHAR PMK[32] = {0};
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
NdisMoveMemory(PMK, pAd->StaCfg.PMK, 32);
-#endif // CONFIG_STA_SUPPORT //
sprintf(pBuf, "\tPMK = ");
for (idx = 0; idx < 32; idx++)
OUT PQOS_CAPABILITY_PARM pQosCapability,
OUT ULONG *pRalinkIe,
OUT UCHAR *pHtCapabilityLen,
-#ifdef CONFIG_STA_SUPPORT
OUT UCHAR *pPreNHtCapabilityLen,
-#endif // CONFIG_STA_SUPPORT //
OUT HT_CAPABILITY_IE *pHtCapability,
OUT UCHAR *AddHtInfoLen,
OUT ADD_HT_INFO_IE *AddHtInfo,
OUT PNDIS_802_11_VARIABLE_IEs pVIE)
{
CHAR *Ptr;
-#ifdef CONFIG_STA_SUPPORT
CHAR TimLen;
-#endif // CONFIG_STA_SUPPORT //
PFRAME_802_11 pFrame;
PEID_STRUCT pEid;
UCHAR SubType;
*pAironetCellPowerLimit = 0xFF; // Default of AironetCellPowerLimit is 0xFF
*LengthVIE = 0; // Set the length of VIE to init value 0
*pHtCapabilityLen = 0; // Set the length of VIE to init value 0
-#ifdef CONFIG_STA_SUPPORT
if (pAd->OpMode == OPMODE_STA)
*pPreNHtCapabilityLen = 0; // Set the length of VIE to init value 0
-#endif // CONFIG_STA_SUPPORT //
*AddHtInfoLen = 0; // Set the length of VIE to init value 0
*pRalinkIe = 0;
*pNewChannel = 0;
*(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo));
*(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo));
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
*pPreNHtCapabilityLen = 0; // Nnow we only support 26 bytes.
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
*LengthVIE += (pEid->Len + 2);
}
-#endif // CONFIG_STA_SUPPORT //
}
else
{
*(USHORT *)(&AddHtInfo->AddHtInfo2) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo2));
*(USHORT *)(&AddHtInfo->AddHtInfo3) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo3));
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
Ptr = (PUCHAR) pVIE;
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
*LengthVIE += (pEid->Len + 2);
}
-#endif // CONFIG_STA_SUPPORT //
}
else
{
if(pEid->Len == 1)
{
*pChannel = *pEid->Octet;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (ChannelSanity(pAd, *pChannel) == 0)
return FALSE;
}
}
-#endif // CONFIG_STA_SUPPORT //
+
Sanity |= 0x4;
}
else
}
break;
-#ifdef CONFIG_STA_SUPPORT
case IE_TIM:
if(INFRA_ON(pAd) && SubType == SUBTYPE_BEACON)
{
GetTimBit((PUCHAR)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe);
}
break;
-#endif // CONFIG_STA_SUPPORT //
+
case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
if(pEid->Len == 3)
{
else
*pRalinkIe = 0xf0000000; // Set to non-zero value (can't set bit0-2) to represent this is Ralink Chip. So at linkup, we will set ralinkchip flag.
}
-#ifdef CONFIG_STA_SUPPORT
#ifdef DOT11_N_SUPPORT
// This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan.
}
}
#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
{
// Copy to pVIE which will report to microsoft bssid list.
}
// For some 11a AP. it did not have the channel EID, patch here
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
UCHAR LatchRfChannel = MsgChannel;
Sanity |= 0x4;
}
}
-#endif // CONFIG_STA_SUPPORT //
if (Sanity != 0x7)
{
if ((*pBssType == BSS_INFRA || *pBssType == BSS_ADHOC || *pBssType == BSS_ANY)
&& (*pScanType == SCAN_ACTIVE || *pScanType == SCAN_PASSIVE
-#ifdef CONFIG_STA_SUPPORT
|| *pScanType == SCAN_CISCO_PASSIVE || *pScanType == SCAN_CISCO_ACTIVE
|| *pScanType == SCAN_CISCO_CHANNEL_LOAD || *pScanType == SCAN_CISCO_NOISE
-#endif // CONFIG_STA_SUPPORT //
))
{
return TRUE;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
UCHAR SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0;
-#ifdef CONFIG_STA_SUPPORT
USHORT Status;
PHEADER_802_11 pHdr80211;
-#endif // CONFIG_STA_SUPPORT //
UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (MONITOR_ON(pAd))
return;
}
-#endif // CONFIG_STA_SUPPORT //
if (pAd->MlmeAux.Channel == 0)
{
if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
-#ifdef CONFIG_STA_SUPPORT
&& (INFRA_ON(pAd)
|| (pAd->OpMode == OPMODE_AP))
-#endif // CONFIG_STA_SUPPORT //
)
{
AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//
Status = MLME_SUCCESS;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
}
-#endif // CONFIG_STA_SUPPORT //
-
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
}
#ifdef RT2870
-#ifdef CONFIG_STA_SUPPORT
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 // CONFIG_STA_SUPPORT //
#endif // RT2870 //
else
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// BBP and RF are not accessible in PS mode, we has to wake them up first
if (pAd->StaCfg.Psm == PWR_SAVE)
MlmeSetPsmBit(pAd, PWR_ACTIVE);
}
-#endif // CONFIG_STA_SUPPORT //
AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, TRUE);
AsicLockChannel(pAd, pAd->MlmeAux.Channel);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->MlmeAux.Channel > 14)
}
}
}
-#endif // CONFIG_STA_SUPPORT //
//Global country domain(ch1-11:active scan, ch12-14 passive scan)
if ((pAd->MlmeAux.Channel <= 14) && (pAd->MlmeAux.Channel >= 12) && ((pAd->CommonCfg.CountryRegion & 0x7f) == REGION_31_BG_BAND))
// Chnage the channel scan time for CISCO stuff based on its IAPP announcement
if (ScanType == FAST_SCAN_ACTIVE)
RTMPSetTimer(&pAd->MlmeAux.ScanTimer, FAST_ACTIVE_SCAN_TIME);
-#ifdef CONFIG_STA_SUPPORT
else if (((ScanType == SCAN_CISCO_ACTIVE) ||
(ScanType == SCAN_CISCO_PASSIVE) ||
(ScanType == SCAN_CISCO_CHANNEL_LOAD) ||
else
RTMPSetTimer(&pAd->MlmeAux.ScanTimer, pAd->StaCfg.CCXScanTime);
}
-#endif // CONFIG_STA_SUPPORT //
else // must be SCAN_PASSIVE or SCAN_ACTIVE
{
if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
if (NStatus != NDIS_STATUS_SUCCESS)
{
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - ScanNextChannel() allocate memory fail\n"));
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
Status = MLME_FAIL_NO_RESOURCE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
}
-#endif // CONFIG_STA_SUPPORT //
return;
}
// For SCAN_CISCO_PASSIVE, do nothing and silently wait for beacon or other probe reponse
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pAd->Mlme.SyncMachine.CurrState = SCAN_LISTEN;
-#endif // CONFIG_STA_SUPPORT //
-
}
}
break;
}
-#ifdef CONFIG_STA_SUPPORT
if ((pAd->OpMode == OPMODE_STA) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
break;
}
}
-#endif // CONFIG_STA_SUPPORT //
// swap for big-endian platform
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
break;
}
-#ifdef CONFIG_STA_SUPPORT
if ((pAd->OpMode == OPMODE_STA) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
break;
}
}
-#endif // CONFIG_STA_SUPPORT //
// swap for big-endian platform
pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
rsnielen_ex_cur_p = NULL;
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
#ifdef WPA_SUPPLICANT_SUPPORT
bMixCipher = pAd->StaCfg.bMixCipher;
}
-#endif // CONFIG_STA_SUPPORT //
}
// indicate primary RSNIE as WPA or WPA2
return FALSE;
}
-
-#ifdef CONFIG_STA_SUPPORT
- // Todo
-#endif // CONFIG_STA_SUPPORT //
-
return TRUE;
}
UCHAR RALINK_OUI[] = {0x00, 0x0c, 0x43};
UCHAR BROADCOM_OUI[] = {0x00, 0x90, 0x4c};
UCHAR WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-#ifdef CONFIG_STA_SUPPORT
#ifdef DOT11_N_SUPPORT
UCHAR PRE_N_HT_OUI[] = {0x00, 0x90, 0x4c};
#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
UCHAR RateSwitchTable[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
pAd->Mlme.bRunning = FALSE;
NdisAllocateSpinLock(&pAd->Mlme.TaskLock);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
BssTableInit(&pAd->ScanTab);
// state machine init
MlmeCntlInit(pAd, &pAd->Mlme.CntlMachine, NULL);
}
-#endif // CONFIG_STA_SUPPORT //
-
-
ActionStateMachineInit(pAd, &pAd->Mlme.ActMachine, pAd->Mlme.ActFunc);
switch (Elem->Machine)
{
// STA state machines
-#ifdef CONFIG_STA_SUPPORT
case ASSOC_STATE_MACHINE:
StateMachinePerformAction(pAd, &pAd->Mlme.AssocMachine, Elem);
break;
case AIRONET_STATE_MACHINE:
StateMachinePerformAction(pAd, &pAd->Mlme.AironetMachine, Elem);
break;
-#endif // CONFIG_STA_SUPPORT //
-
case ACTION_STATE_MACHINE:
StateMachinePerformAction(pAd, &pAd->Mlme.ActMachine, Elem);
break;
AsicDisableSync(pAd);
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Cancel pending timers
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
}
-#endif // CONFIG_STA_SUPPORT //
RTMPCancelTimer(&pAd->Mlme.PeriodicTimer, &Cancelled);
RTMPCancelTimer(&pAd->Mlme.RxAntEvalTimer, &Cancelled);
RT28XX_MLME_PRE_SANITY_CHECK(pAd);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Do nothing if monitor mode is on
}
}
}
-#endif // CONFIG_STA_SUPPORT //
pAd->bUpdateBcnCntDone = FALSE;
// execute every 500ms
if ((pAd->Mlme.PeriodicRound % 5 == 0) && RTMPAutoRateSwitchCheck(pAd)/*(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))*/)
{
-#ifdef CONFIG_STA_SUPPORT
// perform dynamic tx rate switching based on past TX history
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
&& (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)))
MlmeDynamicTxRateSwitching(pAd);
}
-#endif // CONFIG_STA_SUPPORT //
}
// Normal 1 second Mlme PeriodicExec.
}
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
STAMlmePeriodicExec(pAd);
-#endif // CONFIG_STA_SUPPORT //
MlmeResetRalinkCounters(pAd);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
{
}
}
}
-#endif // CONFIG_STA_SUPPORT //
RT28XX_MLME_HANDLER(pAd);
}
pAd->bUpdateBcnCntDone = FALSE;
}
-#ifdef CONFIG_STA_SUPPORT
VOID STAMlmePeriodicExec(
PRTMP_ADAPTER pAd)
{
RT28XX_MLME_HANDLER(pAd);
}
}
-#endif // CONFIG_STA_SUPPORT //
/*
==========================================================================
break;
}
-#ifdef CONFIG_STA_SUPPORT
if ((pAd->OpMode == OPMODE_STA) && ADHOC_ON(pAd))
{
#ifdef DOT11_N_SUPPORT
}
break;
}
-#endif // CONFIG_STA_SUPPORT //
#ifdef DOT11_N_SUPPORT
//if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
#ifdef DOT11_N_SUPPORT
#endif // DOT11_N_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
#ifdef DOT11_N_SUPPORT
DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode (SupRateLen=%d, ExtRateLen=%d, MCSSet[0]=0x%x, MCSSet[1]=0x%x)\n",
pAd->StaActive.SupRateLen, pAd->StaActive.ExtRateLen, pAd->StaActive.SupportedPhyInfo.MCSSet[0], pAd->StaActive.SupportedPhyInfo.MCSSet[1]));
}
-#endif // CONFIG_STA_SUPPORT //
} while(FALSE);
}
-#ifdef CONFIG_STA_SUPPORT
/*
==========================================================================
Description:
RTMP_IO_WRITE32(pAd, AUTO_RSP_CFG, csr4.word);
DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetPsmBit = %d\n", psm));
}
-#endif // CONFIG_STA_SUPPORT //
-
// IRQL = DISPATCH_LEVEL
VOID MlmeSetTxPreamble(
//===========================================================================
//===========================================================================
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pHtPhy = &pAd->StaCfg.HTPhyMode;
MaxDesire = RATE_11;
}
}
-#endif // CONFIG_STA_SUPPORT //
pAd->CommonCfg.MaxDesiredRate = MaxDesire;
pMinHtPhy->word = 0;
}
#endif
-#ifdef CONFIG_STA_SUPPORT
if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA))
{
pSupRate = &pAd->StaActive.SupRate[0];
ExtRateLen = pAd->StaActive.ExtRateLen;
}
else
-#endif // CONFIG_STA_SUPPORT //
{
pSupRate = &pAd->CommonCfg.SupRate[0];
pExtRate = &pAd->CommonCfg.ExtRate[0];
if (*auto_rate_cur_p)
{
short dbm = 0;
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
dbm = pAd->StaCfg.RssiSample.AvgRssi0 - pAd->BbpRssiToDbmDelta;
-#endif // CONFIG_STA_SUPPORT //
+
if (bLinkUp == TRUE)
pAd->CommonCfg.TxRate = RATE_24;
else
auto_rate_cur_p = NULL;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
pDesireHtPhy = &pAd->StaCfg.DesiredHtPhyInfo;
auto_rate_cur_p = &pAd->StaCfg.bAutoTxRateSwitch;
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA))
{
if (pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE)
pMaxHtPhy->field.STBC = STBC_NONE;
}
else
-#endif // CONFIG_STA_SUPPORT //
{
if (pDesireHtPhy->bHtEnable == FALSE)
return;
pMinHtPhy->field.STBC = 0;
pMinHtPhy->field.ShortGI = 0;
//If STA assigns fixed rate. update to fixed here.
-#ifdef CONFIG_STA_SUPPORT
if ( (pAd->OpMode == OPMODE_STA) && (pDesireHtPhy->MCSSet[0] != 0xff))
{
if (pDesireHtPhy->MCSSet[4] != 0)
break;
}
}
-#endif // CONFIG_STA_SUPPORT //
-
// Decide ht rate
pHtPhy->field.STBC = pMaxHtPhy->field.STBC;
else
pBss->QbssLoad.bValid = FALSE;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
PEID_STRUCT pEid;
pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
}
}
-#endif // CONFIG_STA_SUPPORT //
}
/*!
return Idx;
}
-#ifdef CONFIG_STA_SUPPORT
// IRQL = DISPATCH_LEVEL
VOID BssTableSsidSort(
IN PRTMP_ADAPTER pAd,
}
}
}
-#endif // CONFIG_STA_SUPPORT //
-
VOID BssCipherParse(
IN OUT PBSS_ENTRY pBss)
// pHdr80211->FC.Type = BTYPE_CNTL;
pHdr80211->FC.ToDs = ToDs;
COPY_MAC_ADDR(pHdr80211->Addr1, pDA);
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
+
COPY_MAC_ADDR(pHdr80211->Addr3, pBssid);
}
return FALSE;
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (!MsgTypeSubst(pAd, pFrame, &Machine, &MsgType))
return FALSE;
}
}
-#endif // CONFIG_STA_SUPPORT //
// OK, we got all the informations, it is time to put things into queue
NdisAcquireSpinLock(&(Queue->Lock));
VOID MlmeRestartStateMachine(
IN PRTMP_ADAPTER pAd)
{
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN Cancelled;
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("MlmeRestartStateMachine \n"));
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Cancel all timer events
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
}
-#endif // CONFIG_STA_SUPPORT //
// Change back to original channel in case of doing scan
AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
// Resume MSDU which is turned off durning scan
RTMPResumeMsduTransmission(pAd);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Set all state machines back IDLE
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
pAd->Mlme.ActMachine.CurrState = ACT_IDLE;
}
-#endif // CONFIG_STA_SUPPORT //
-
}
/*! \brief test if the MLME Queue is empty
IRQL = DISPATCH_LEVEL
*/
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN MsgTypeSubst(
IN PRTMP_ADAPTER pAd,
IN PFRAME_802_11 pFrame,
return TRUE;
}
-#endif // CONFIG_STA_SUPPORT //
// ===========================================================================================
// state_machine.c
}
-#ifdef CONFIG_STA_SUPPORT
/*
==========================================================================
Description:
DBGPRINT(RT_DEBUG_TRACE, ("--> AsicForceWakeup \n"));
RT28XX_STA_FORCE_WAKEUP(pAd, bFromTx);
}
-#endif // CONFIG_STA_SUPPORT //
+
/*
==========================================================================
Description:
RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
// RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, 0x00000000);
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
csr.field.bBeaconGen = 0; // do NOT generate BEACON
csr.field.bTBTTEnable = 1;
}
-#endif // CONFIG_STA_SUPPORT //
+
RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
}
Ac2Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VI];
Ac2Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VI];
Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI];
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Tuning for Wi-Fi WMM S06
Ac2Cfg.field.AcTxop = 5;
}
}
-#endif // CONFIG_STA_SUPPORT //
Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO];
Ac3Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VO];
CwminCsr.field.Cwmin0 = pEdcaParm->Cwmin[QID_AC_BE];
CwminCsr.field.Cwmin1 = pEdcaParm->Cwmin[QID_AC_BK];
CwminCsr.field.Cwmin2 = pEdcaParm->Cwmin[QID_AC_VI];
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test
-#endif // CONFIG_STA_SUPPORT //
+
RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word);
CwmaxCsr.word = 0;
AifsnCsr.field.Aifsn0 = Ac0Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BE];
AifsnCsr.field.Aifsn1 = Ac1Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BK];
AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_VI];
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Tuning for Wi-Fi WMM S06
if (INFRA_ON(pAd))
CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_WMM_CAPABLE);
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test
-#endif // CONFIG_STA_SUPPORT //
+
RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word);
NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
ULONG SlotTime;
UINT32 RegValue = 0;
-#ifdef CONFIG_STA_SUPPORT
if (pAd->CommonCfg.Channel > 14)
bUseShortSlotTime = TRUE;
-#endif // CONFIG_STA_SUPPORT //
if (bUseShortSlotTime)
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED);
SlotTime = (bUseShortSlotTime)? 9 : 20;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// force using short SLOT time for FAE to demo performance when TxBurst is ON
else if (pAd->CommonCfg.bEnableTxBurst)
SlotTime = 9;
}
-#endif // CONFIG_STA_SUPPORT //
//
// For some reasons, always set it to short slot time.
//
// ToDo: Should consider capability with 11B
//
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->StaCfg.BssType == BSS_ADHOC)
SlotTime = 20;
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_READ32(pAd, BKOFF_SLOT_CFG, &RegValue);
RegValue = RegValue & 0xFFFFFF00;
NdisMoveMemory(SupRate, NewRate, NewRateLen);
}
-#ifdef CONFIG_STA_SUPPORT
#ifdef DOT11_N_SUPPORT
BOOLEAN RTMPCheckChannel(
IN PRTMP_ADAPTER pAd,
return TRUE;
}
#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
/*
========================================================================
{
UCHAR BBPR3 = 0;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS |
if (pAd->StaCfg.Psm == PWR_SAVE)
return;
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
BBPR3 &= (~0x18);
BBPR3 |= (0x0);
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
+
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
)
{
IN PVOID SystemSpecific3)
{
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-#ifdef CONFIG_STA_SUPPORT
UCHAR BBPR3 = 0;
CHAR larger = -127, rssi0, rssi1, rssi2;
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
}
-
-#endif // CONFIG_STA_SUPPORT //
-
}
{
BOOLEAN result = TRUE;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// only associated STA counts
else
result = FALSE;
}
-#endif // CONFIG_STA_SUPPORT //
-
-
return result;
}
BOOLEAN RTMPAutoRateSwitchCheck(
IN PRTMP_ADAPTER pAd)
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->StaCfg.bAutoTxRateSwitch)
return TRUE;
}
-#endif // CONFIG_STA_SUPPORT //
+
return FALSE;
}
{
UCHAR tx_mode = FIXED_TXMODE_HT;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode;
}
-#endif // CONFIG_STA_SUPPORT //
return tx_mode;
}
}
}
-#ifdef CONFIG_STA_SUPPORT
/*
==========================================================================
Description:
}
}
-#endif // CONFIG_STA_SUPPORT //
VOID RTMPSetAGCInitValue(
IN PRTMP_ADAPTER pAd,
{PWR_PIN_CFG, 0x00000003}, // patch for 2880-E
};
-
-#ifdef CONFIG_STA_SUPPORT
RTMP_REG_PAIR STAMACRegTable[] = {
{WMM_AIFSN_CFG, 0x00002273},
{WMM_CWMIN_CFG, 0x00002344},
{WMM_CWMAX_CFG, 0x000034aa},
};
-#endif // CONFIG_STA_SUPPORT //
#define NUM_MAC_REG_PARMS (sizeof(MACRegTable) / sizeof(RTMP_REG_PAIR))
-#ifdef CONFIG_STA_SUPPORT
#define NUM_STA_MAC_REG_PARMS (sizeof(STAMACRegTable) / sizeof(RTMP_REG_PAIR))
-#endif // CONFIG_STA_SUPPORT //
#ifdef RT2870
//
NicConfig2.word = pAd->EEPROMDefaultValue[1];
-
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
NicConfig2.word = 0;
NicConfig2.word &= 0x00ff;
}
}
-#endif // CONFIG_STA_SUPPORT //
if (NicConfig2.field.DynamicTxAgcControl == 1)
pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = TRUE;
VOID NICInitAsicFromEEPROM(
IN PRTMP_ADAPTER pAd)
{
-#ifdef CONFIG_STA_SUPPORT
UINT32 data = 0;
UCHAR BBPR1 = 0;
-#endif // CONFIG_STA_SUPPORT //
USHORT i;
EEPROM_ANTENNA_STRUC Antenna;
EEPROM_NIC_CONFIG2_STRUC NicConfig2;
pAd->LedIndicatorStregth = 0xFF;
RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, before link up
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Read Hardware controlled Radio state enable bit
RTMPSetLED(pAd, LED_RADIO_ON);
}
}
-#endif // CONFIG_STA_SUPPORT //
// Turn off patching for cardbus controller
if (NicConfig2.field.CardbusAcceleration == 1)
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Handle the difference when 1T
DBGPRINT(RT_DEBUG_TRACE, ("Use Hw Radio Control Pin=%d; if used Pin=%d;\n", pAd->CommonCfg.bHardwareRadio, pAd->CommonCfg.bHardwareRadio));
}
-#endif // CONFIG_STA_SUPPORT //
+
DBGPRINT(RT_DEBUG_TRACE, ("TxPath = %d, RxPath = %d, RFIC=%d, Polar+LED mode=%x\n", pAd->Antenna.field.TxPath, pAd->Antenna.field.RxPath, pAd->RfIcType, pAd->LedCntl.word));
DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitAsicFromEEPROM\n"));
}
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++)
RTMP_IO_WRITE32(pAd, (USHORT)STAMACRegTable[Index].Register, STAMACRegTable[Index].Value);
}
}
-#endif // CONFIG_STA_SUPPORT //
#endif // RT2870 //
//
#endif // RT2870 //
// Add radio off control
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->StaCfg.bRadio == FALSE)
DBGPRINT(RT_DEBUG_TRACE, ("Set Radio Off\n"));
}
}
-#endif // CONFIG_STA_SUPPORT //
// Clear raw counters
RTMP_IO_READ32(pAd, RX_STA_CNT0, &Counter);
RTMP_IO_WRITE32(pAd, USB_CYC_CFG, Counter);
#endif // RT2870 //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT.
if ((pAd->MACVersion&0xffff) != 0x0101)
RTMP_IO_WRITE32(pAd, TXOP_CTRL_CFG, 0x583f);
}
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitializeAsic\n"));
return NDIS_STATUS_SUCCESS;
//
// part II. intialize STA specific configuration
//
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_DIRECT);
pAd->StaCfg.bAutoTxRateSwitch = TRUE;
pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
}
-#endif // CONFIG_STA_SUPPORT //
// global variables mXXXX used in MAC protocol state machines
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; // default PHY mode
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); // CCK use LONG preamble
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// user desired power mode
#endif // WPA_SUPPLICANT_SUPPORT //
}
-#endif // CONFIG_STA_SUPPORT //
// Default for extra information is not valid
pAd->ExtraInfo = EXTRA_INFO_CLEAR;
// determine if this is a vlan packet
if (((*(pSrc + 12) << 8) + *(pSrc + 13)) == 0x8100)
vlan_offset = 4;
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
{
RTMPInitMICEngine(
pAd,
pAd->PrivateInfo.FCSCRC32 = PPPINITFCS32; //Init crc32.
-#ifdef CONFIG_STA_SUPPORT
if (pAd->StaCfg.bCkipOn && (pAd->StaCfg.CkipFlag & 0x10) && (pAd->OpMode == OPMODE_STA))
{
ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, pKey, KeyLen); //INIT SBOX, KEYLEN+3(IV)
NdisMoveMemory(pDest, pKey, 3); //Append Init Vector
}
else
-#endif // CONFIG_STA_SUPPORT //
{
NdisMoveMemory(WEPKEY + 3, pKey, KeyLen);
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
// read RxContext, Since not
-#ifdef CONFIG_STA_SUPPORT
STARxDoneInterruptHandle(pAd, TRUE);
-#endif // CONFIG_STA_SUPPORT //
//return;
}
}
// read RxContext, Since not
-#ifdef CONFIG_STA_SUPPORT
STARxDoneInterruptHandle(pAd, FALSE);
-#endif // CONFIG_STA_SUPPORT //
}
/*
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
// read RxContext, Since not
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
STARxDoneInterruptHandle(pAd, TRUE);
-#endif // CONFIG_STA_SUPPORT //
// Finish to handle this bulkIn buffer.
RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
{
case CMDTHREAD_CHECK_GPIO:
{
-#ifdef CONFIG_STA_SUPPORT
UINT32 data;
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
-
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
}
}
}
-#endif // CONFIG_STA_SUPPORT //
}
break;
-#ifdef CONFIG_STA_SUPPORT
case CMDTHREAD_QKERIODIC_EXECUT:
{
StaQuickResponeForRateUpExec(NULL, pAd, NULL, NULL);
}
break;
-#endif // CONFIG_STA_SUPPORT //
case CMDTHREAD_RESET_BULK_OUT:
{
case CMDTHREAD_SET_ASIC_WCID_CIPHER:
{
-#ifdef CONFIG_STA_SUPPORT
RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri;
USHORT offset;
UINT32 MACRValue = 0;
RTUSBWriteMACRegister(pAd, SHARED_KEY_MODE_BASE+4*(0/2), csr1.word);
}
-#endif // CONFIG_STA_SUPPORT //
}
break;
MAC_TABLE_ENTRY *pEntry;
pEntry = (MAC_TABLE_ENTRY *)pData;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)pEntry->Aid);
RTUSBWriteMACRegister(pAd, offset, 0);
}
}
-#endif // CONFIG_STA_SUPPORT //
AsicUpdateRxWCIDTable(pAd, pEntry->Aid, pEntry->Addr);
printk("UpdateRxWCIDTable(): Aid=%d, Addr=%02x:%02x:%02x:%02x:%02x:%02x!\n", pEntry->Aid,
case OID_802_11_ADD_WEP:
{
-#ifdef CONFIG_STA_SUPPORT
UINT i;
UINT32 KeyIdx;
PNDIS_802_11_WEP pWepKey;
AsicAddSharedKeyEntry(pAd, BSS0, (UCHAR)KeyIdx, CipherAlg, pWepKey->KeyMaterial, NULL, NULL);
DBGPRINT(RT_DEBUG_TRACE, ("CmdThread::OID_802_11_ADD_WEP (KeyIdx=%d, Len=%d-byte)\n", KeyIdx, pWepKey->KeyLength));
}
-#endif // CONFIG_STA_SUPPORT //
}
break;
{
CH_SW_ANN_INFO ChSwAnnInfo;
PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
-#ifdef CONFIG_STA_SUPPORT
UCHAR index = 0, Channel = 0, NewChannel = 0;
ULONG Bssidx = 0;
-#endif // CONFIG_STA_SUPPORT //
NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO));
if (! PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo))
return;
}
-
-#ifdef CONFIG_STA_SUPPORT
if (pAd->OpMode == OPMODE_STA)
{
Bssidx = BssTableSearch(&pAd->ScanTab, pFr->Hdr.Addr3, pAd->CommonCfg.Channel);
}
}
}
-#endif // CONFIG_STA_SUPPORT //
return;
}
#define FAST_ACTIVE_SCAN_TIME 30 // Active scan waiting for probe response time
#define CW_MIN_IN_BITS 4 // actual CwMin = 2^CW_MIN_IN_BITS - 1
-
-#ifdef CONFIG_STA_SUPPORT
#ifndef CONFIG_AP_SUPPORT
#define CW_MAX_IN_BITS 10 // actual CwMax = 2^CW_MAX_IN_BITS - 1
#endif
-#endif // CONFIG_STA_SUPPORT //
// Note: RSSI_TO_DBM_OFFSET has been changed to variable for new RF (2004-0720).
// SHould not refer to this constant anymore
#define BSS_NOT_FOUND 0xFFFFFFFF
-
-#ifdef CONFIG_STA_SUPPORT
#define MAX_LEN_OF_MLME_QUEUE 40 //10
-#endif // CONFIG_STA_SUPPORT //
#define SCAN_PASSIVE 18 // scan with no probe request, only wait beacon and probe response
#define SCAN_ACTIVE 19 // scan with probe request, and wait beacon and probe response
UCHAR EdcaUpdateCount;
} QOS_CAPABILITY_PARM, *PQOS_CAPABILITY_PARM;
-#ifdef CONFIG_STA_SUPPORT
typedef struct {
UCHAR IELen;
UCHAR IE[MAX_CUSTOM_LEN];
} WPA_IE_;
-#endif // CONFIG_STA_SUPPORT //
-
typedef struct {
UCHAR Bssid[MAC_ADDR_LEN];
EDCA_PARM EdcaParm;
QOS_CAPABILITY_PARM QosCapability;
QBSS_LOAD_PARM QbssLoad;
-#ifdef CONFIG_STA_SUPPORT
WPA_IE_ WpaIE;
WPA_IE_ RsnIE;
-#endif // CONFIG_STA_SUPPORT //
} BSS_ENTRY, *PBSS_ENTRY;
typedef struct {
RADIUS_KEY_INFO RadiusInfo[8/*MAX_MBSSID_NUM*/];
} RADIUS_CONF, *PRADIUS_CONF;
-
-
-#ifdef CONFIG_STA_SUPPORT
// Key mapping keys require a BSSID
typedef struct _NDIS_802_11_KEY
{
NDIS_802_11_KEY_RSC KeyRSC;
UCHAR KeyMaterial[1]; // variable length depending on above field
} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
-#endif // CONFIG_STA_SUPPORT //
typedef struct _NDIS_802_11_REMOVE_KEY
{
// PMKID Structures
typedef UCHAR NDIS_802_11_PMKID_VALUE[16];
-#ifdef CONFIG_STA_SUPPORT
typedef struct _BSSID_INFO
{
NDIS_802_11_MAC_ADDRESS BSSID;
UINT BSSIDInfoCount;
BSSID_INFO BSSIDInfo[1];
} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
-#endif // CONFIG_STA_SUPPORT //
-
typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION
{
#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
#endif
-#ifdef CONFIG_STA_SUPPORT
#define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02)
#ifdef DBG
SHOW_ADHOC_ENTRY_INFO = 21,
};
-
-#endif // CONFIG_STA_SUPPORT //
-
#define OID_802_11_BUILD_CHANNEL_EX 0x0714
#define OID_802_11_GET_CH_LIST 0x0715
#define OID_802_11_GET_COUNTRY_CODE 0x0716
} RT_LLTD_ASSOICATION_TABLE, *PRT_LLTD_ASSOICATION_TABLE;
#endif // LLTD_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
#ifdef WPA_SUPPLICANT_SUPPORT
#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
#define RT_ASSOC_EVENT_FLAG 0x0101
#define RT_INTERFACE_UP 0x0108
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
#endif // WPA_SUPPLICANT_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
#define MAX_CUSTOM_LEN 128
-#ifdef CONFIG_STA_SUPPORT
typedef enum _RT_802_11_D_CLIENT_MODE
{
Rt802_11_D_None,
Rt802_11_D_Flexible,
Rt802_11_D_Strict,
} RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
-#endif // CONFIG_STA_SUPPORT //
typedef struct _RT_CHANNEL_LIST_INFO
{
#include "igmp_snoop.h"
#endif // IGMP_SNOOP_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
#ifndef WPA_SUPPLICANT_SUPPORT
#error "Build for being controlled by NetworkManager or wext, please set HAS_WPA_SUPPLICANT=y and HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y"
#endif // WPA_SUPPLICANT_SUPPORT //
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
#ifdef IKANOS_VX_1X0
#include "vr_ikans.h"
#endif // IKANOS_VX_1X0 //
BUILD_TIMER_FUNCTION(BeaconUpdateExec);
#endif // RT2870 //
-
-#ifdef CONFIG_STA_SUPPORT
BUILD_TIMER_FUNCTION(BeaconTimeout);
BUILD_TIMER_FUNCTION(ScanTimeout);
BUILD_TIMER_FUNCTION(AuthTimeout);
BUILD_TIMER_FUNCTION(LinkDownExec);
BUILD_TIMER_FUNCTION(StaQuickResponeForRateUpExec);
BUILD_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
-#endif // CONFIG_STA_SUPPORT //
// for wireless system event message
char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = {
{
PNET_DEV dev_p = NULL;
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
dev_p = pAd->net_dev;
}
-#endif // CONFIG_STA_SUPPORT //
ASSERT(dev_p);
return dev_p; /* return one of MBSS */
//
//
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
NdisMoveMemory(skb_push(pOSPkt, LENGTH_802_3), pHeader802_3, LENGTH_802_3);
-#endif // CONFIG_STA_SUPPORT //
}
pRxPkt = RTPKT_TO_OSPKT(pPacket);
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
/* Push up the protocol stack */
#ifdef IKANOS_VX_1X0
IKANOS_DataFrameRx(pAd, pRxPkt->dev, pRxPkt, pRxPkt->len);
#endif /* WIRELESS_EXT >= 15 */
}
-
-#ifdef CONFIG_STA_SUPPORT
void send_monitor_packets(
IN PRTMP_ADAPTER pAd,
IN RX_BLK *pRxBlk)
return;
}
-#endif // CONFIG_STA_SUPPORT //
-
void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify)
{
// add by kathy
-#ifdef CONFIG_STA_SUPPORT
-
#ifdef RT2870
#define STA_PROFILE_PATH "/etc/Wireless/RT2870STA/RT2870STA.dat"
#define STA_RT2870_IMAGE_FILE_NAME "/etc/Wireless/RT2870STA/rt2870.bin"
#define STA_DRIVER_VERSION "1.4.0.0"
#endif // RT2870 //
-#endif // CONFIG_STA_SUPPORT //
-
-
#define RTMP_TIME_AFTER(a,b) \
(typecheck(unsigned long, (unsigned long)a) && \
typecheck(unsigned long, (unsigned long)b) && \
#define MIN_NET_DEVICE_FOR_WDS 0x10 //0x40,0x50,0x60,0x70
#define MIN_NET_DEVICE_FOR_APCLI 0x20
#define MIN_NET_DEVICE_FOR_MESH 0x30
-#ifdef CONFIG_STA_SUPPORT
#define MIN_NET_DEVICE_FOR_DLS 0x40
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
#define NDIS_PACKET_TYPE_DIRECTED 0
#define NDIS_PACKET_TYPE_MULTICAST 1
#define NDIS_PACKET_TYPE_BROADCAST 2
#define NDIS_PACKET_TYPE_ALL_MULTICAST 3
-#endif // CONFIG_STA_SUPPORT //
typedef struct pid * THREAD_PID;
#define GET_PID(_v) find_get_pid(_v)
DECLARE_TIMER_FUNCTION(BeaconUpdateExec);
#endif // RT2870 //
-
-#ifdef CONFIG_STA_SUPPORT
DECLARE_TIMER_FUNCTION(BeaconTimeout);
DECLARE_TIMER_FUNCTION(ScanTimeout);
DECLARE_TIMER_FUNCTION(AuthTimeout);
DECLARE_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
DECLARE_TIMER_FUNCTION(PsPollWakeExec);
DECLARE_TIMER_FUNCTION(RadioOnExec);
-#endif // CONFIG_STA_SUPPORT //
void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
static void CfgInitHook(PRTMP_ADAPTER pAd);
//static BOOLEAN RT28XXAvailRANameAssign(IN CHAR *name_p);
-#ifdef CONFIG_STA_SUPPORT
extern const struct iw_handler_def rt28xx_iw_handler_def;
-#endif // CONFIG_STA_SUPPORT //
#if WIRELESS_EXT >= 12
// This function will be called when query /proc
if (pAd == NULL)
return 0; // close ok
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
MlmeRadioOff(pAd);
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
// Close kernel threads or tasklets
kill_thread_task(pAd);
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
MacTableReset(pAd);
}
-#endif // CONFIG_STA_SUPPORT //
-
MeasureReqTabExit(pAd);
TpcReqTabExit(pAd);
CfgInitHook(pAd);
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
NdisAllocateSpinLock(&pAd->MacTabLock);
-#endif // CONFIG_STA_SUPPORT //
MeasureReqTabInit(pAd);
TpcReqTabInit(pAd);
// We should read EEPROM for all cases. rt2860b
NICReadEEPROMParameters(pAd, mac);
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
printk("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode);
return -1;
}
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
// Init
pObj = (POS_COOKIE)pAd->OS_Cookie;
if (rt28xx_init(net_dev) == FALSE)
goto err;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
NdisZeroMemory(pAd->StaCfg.dev_name, 16);
NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name));
}
-#endif // CONFIG_STA_SUPPORT //
// Set up the Mac address
NdisMoveMemory(net_dev->dev_addr, (void *) pAd->CurrentAddress, 6);
// Various AP function init
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
#ifdef WPA_SUPPLICANT_SUPPORT
#endif // WPA_SUPPLICANT_SUPPORT //
}
-#endif // CONFIG_STA_SUPPORT //
// Enable Interrupt
RT28XX_IRQ_ENABLE(pAd);
BUG();
#endif
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
return (retval);
err:
//ether_setup(dev);
// dev->set_multicast_list = ieee80211_set_multicast_list;
// dev->change_mtu = ieee80211_change_mtu;
-#ifdef CONFIG_STA_SUPPORT
#if WIRELESS_EXT >= 12
if (pAd->OpMode == OPMODE_STA)
{
dev->wireless_handlers = &rt28xx_iw_handler_def;
}
#endif //WIRELESS_EXT >= 12
-#endif // CONFIG_STA_SUPPORT //
#if WIRELESS_EXT < 21
dev->get_wireless_stats = rt28xx_get_wireless_stats;
#endif // RT2870 //
-#ifdef CONFIG_STA_SUPPORT
DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
-#endif // CONFIG_STA_SUPPORT //
// Check chipset vendor/product ID
// if (RT28XXChipsetCheck(_dev_p) == FALSE)
RT28XXNetDevInit(_dev_p, net_dev, pAd);
-#ifdef CONFIG_STA_SUPPORT
pAd->StaCfg.OriDevType = net_dev->type;
-#endif // CONFIG_STA_SUPPORT //
// Find and assign a free interface name, raxx
// RT28XXAvailRANameAssign(net_dev->name);
if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE)
goto err_out_unmap;
-#ifdef CONFIG_STA_SUPPORT
pAd->OpMode = OPMODE_STA;
-#endif // CONFIG_STA_SUPPORT //
// sample move
if (rt_ieee80211_if_setup(net_dev, pAd) != NDIS_STATUS_SUCCESS)
int status = 0;
PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Drop send request since we are in monitor mode
goto done;
}
}
-#endif // CONFIG_STA_SUPPORT //
// EapolStart size is 18
if (skb->len < 14)
}
#endif
-
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1);
}
-#endif // CONFIG_STA_SUPPORT //
-
status = 0;
done:
if(pAd->iw_stats.qual.qual > 100)
pAd->iw_stats.qual.qual = 100;
-#ifdef CONFIG_STA_SUPPORT
if (pAd->OpMode == OPMODE_STA)
pAd->iw_stats.qual.level = RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2);
-#endif // CONFIG_STA_SUPPORT //
pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; // noise level (dBm)
return -ENETDOWN;
}
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
ret = rt28xx_sta_ioctl(net_dev, rq, cmd);
}
-#endif // CONFIG_STA_SUPPORT //
return ret;
}
//DefaultKeyID
if(RTMPGetKeyParameter("DefaultKeyID", tmpbuf, 25, buffer))
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
KeyIdx = simple_strtol(tmpbuf, 0, 10);
DBGPRINT(RT_DEBUG_TRACE, ("DefaultKeyID(0~3)=%d\n", pAd->StaCfg.DefaultKeyId));
}
-#endif // CONFIG_STA_SUPPORT //
}
KeyType[i] = simple_strtol(macptr, 0, 10);
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
sprintf(tok_str, "Key%dStr", idx + 1);
rtmp_parse_key_buffer_from_file(pAd, tmpbuf, KeyType[BSS0], BSS0, idx);
}
}
-#endif // CONFIG_STA_SUPPORT //
}
}
}
-
-#ifdef CONFIG_STA_SUPPORT
static void rtmp_read_sta_wmm_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbuf, char *buffer)
{
PUCHAR macptr;
}
}
-#endif // CONFIG_STA_SUPPORT //
-
NDIS_STATUS RTMPReadParametersHook(
IN PRTMP_ADAPTER pAd)
CHAR *tmpbuf;
ULONG RtsThresh;
ULONG FragThresh;
-#ifdef CONFIG_STA_SUPPORT
UCHAR keyMaterial[40];
-#endif // CONFIG_STA_SUPPORT //
-
PUCHAR macptr;
INT i = 0;
return NDIS_STATUS_FAILURE;
}
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
src = STA_PROFILE_PATH;
-#endif // CONFIG_STA_SUPPORT //
// Save uid and gid used for filesystem access.
// Set user and group to 0 (root)
pAd->CommonCfg.CountryCode[2] = ' ';
}
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//SSID
}
}
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//NetworkType
DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __func__, pAd->StaCfg.BssType));
}
}
-#endif // CONFIG_STA_SUPPORT //
+
//Channel
if(RTMPGetKeyParameter("Channel", tmpbuf, 10, buffer))
{
if(RTMPGetKeyParameter("TxPower", tmpbuf, 10, buffer))
{
pAd->CommonCfg.TxPowerPercentage = (ULONG) simple_strtol(tmpbuf, 0, 10);
-#ifdef CONFIG_STA_SUPPORT
+
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pAd->CommonCfg.TxPowerDefault = pAd->CommonCfg.TxPowerPercentage;
-#endif // CONFIG_STA_SUPPORT //
+
DBGPRINT(RT_DEBUG_TRACE, ("TxPower=%ld\n", pAd->CommonCfg.TxPowerPercentage));
}
//BGProtection
#endif // AGGREGATION_SUPPORT //
// WmmCapable
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
rtmp_read_sta_wmm_parms_from_file(pAd, tmpbuf, buffer);
-#endif // CONFIG_STA_SUPPORT //
//ShortSlot
if(RTMPGetKeyParameter("ShortSlot", tmpbuf, 10, buffer))
//AuthMode
if(RTMPGetKeyParameter("AuthMode", tmpbuf, 128, buffer))
{
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if ((strcmp(tmpbuf, "WEPAUTO") == 0) || (strcmp(tmpbuf, "wepauto") == 0))
DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
}
-#endif // CONFIG_STA_SUPPORT //
}
//EncrypType
if(RTMPGetKeyParameter("EncrypType", tmpbuf, 128, buffer))
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if ((strcmp(tmpbuf, "WEP") == 0) || (strcmp(tmpbuf, "wep") == 0))
//RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
}
-#endif // CONFIG_STA_SUPPORT //
}
-
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if(RTMPGetCriticalParameter("WPAPSK", tmpbuf, 512, buffer))
}
}
}
-#endif // CONFIG_STA_SUPPORT //
//DefaultKeyID, KeyType, KeyStr
rtmp_read_key_parms_from_file(pAd, tmpbuf, buffer);
HTParametersHook(pAd, tmpbuf, buffer);
#endif // DOT11_N_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//PSMode
DBGPRINT(RT_DEBUG_TRACE, ("TGnWifiTest=%d\n", pAd->StaCfg.bTGnWifiTest));
}
}
-#endif // CONFIG_STA_SUPPORT //
-
-
-
}
}
else
{
UCHAR fix_tx_mode;
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
fix_tx_mode = FIXED_TXMODE_HT;
DBGPRINT(RT_DEBUG_TRACE, ("Fixed Tx Mode = %d\n", fix_tx_mode));
}
-#endif // CONFIG_STA_SUPPORT //
}
// MSC
if (RTMPGetKeyParameter("HT_MCS", pValueStr, 50, pInput))
{
-
-#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
Value = simple_strtol(pValueStr, 0, 10);
DBGPRINT(RT_DEBUG_TRACE, ("HT: MCS = AUTO\n"));
}
}
-#endif // CONFIG_STA_SUPPORT //
}
// STBC
#include "link_list.h"
#include "spectrum_def.h"
-
-#ifdef CONFIG_STA_SUPPORT
#include "aironet.h"
-#endif // CONFIG_STA_SUPPORT //
//#define DBG 1
//#define DBG_DIAGNOSE 1
-#if defined(CONFIG_AP_SUPPORT) && defined(CONFIG_STA_SUPPORT)
+#if defined(CONFIG_AP_SUPPORT)
#define IF_DEV_CONFIG_OPMODE_ON_AP(_pAd) if(_pAd->OpMode == OPMODE_AP)
#define IF_DEV_CONFIG_OPMODE_ON_STA(_pAd) if(_pAd->OpMode == OPMODE_STA)
#else
extern UCHAR RateSwitchTable11N2S[];
extern UCHAR RateSwitchTable11N2SForABand[];
-#ifdef CONFIG_STA_SUPPORT
extern UCHAR PRE_N_HT_OUI[];
-#endif // CONFIG_STA_SUPPORT //
#endif // DOT11_N_SUPPORT //
#define MAXSEQ (0xFFF)
#define RX_FILTER_CLEAR_FLAG(_pAd, _F) ((_pAd)->CommonCfg.PacketFilter &= ~(_F))
#define RX_FILTER_TEST_FLAG(_pAd, _F) (((_pAd)->CommonCfg.PacketFilter & (_F)) != 0)
-#ifdef CONFIG_STA_SUPPORT
#define STA_NO_SECURITY_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11EncryptionDisabled)
#define STA_WEP_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption1Enabled)
#define STA_TKIP_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption2Enabled)
#define STA_AES_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
#define STA_TGN_WIFI_ON(_p) (_p->StaCfg.bTGnWifiTest == TRUE)
-#endif // CONFIG_STA_SUPPORT //
#define CKIP_KP_ON(_p) ((((_p)->StaCfg.CkipFlag) & 0x10) && ((_p)->StaCfg.bCkipCmicOn == TRUE))
#define CKIP_CMIC_ON(_p) ((((_p)->StaCfg.CkipFlag) & 0x08) && ((_p)->StaCfg.bCkipCmicOn == TRUE))
//
#define JapanChannelCheck(channel) ((channel == 52) || (channel == 56) || (channel == 60) || (channel == 64))
-#ifdef CONFIG_STA_SUPPORT
#define STA_PORT_SECURED(_pAd) \
{ \
_pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \
_pAd->MacTab.Content[BSSID_WCID].PortSecured = _pAd->StaCfg.PortSecured; \
NdisReleaseSpinLock(&_pAd->MacTabLock); \
}
-#endif // CONFIG_STA_SUPPORT //
-
//
// Register set pair for initialzation register set definition
UCHAR RxTsc[6]; // 48bit TSC value
UCHAR CipherAlg; // 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128
UCHAR KeyLen;
-#ifdef CONFIG_STA_SUPPORT
UCHAR BssId[6];
-#endif // CONFIG_STA_SUPPORT //
// Key length for each key, 0: entry is invalid
UCHAR Type; // Indicate Pairwise/Group when reporting MIC error
} CIPHER_KEY, *PCIPHER_KEY;
} ABGBAND_STATE;
typedef struct _MLME_STRUCT {
-#ifdef CONFIG_STA_SUPPORT
// STA state machines
STATE_MACHINE CntlMachine;
STATE_MACHINE AssocMachine;
STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE];
STATE_MACHINE_FUNC WpaPskFunc[WPA_PSK_FUNC_SIZE];
STATE_MACHINE_FUNC AironetFunc[AIRONET_FUNC_SIZE];
-#endif // CONFIG_STA_SUPPORT //
STATE_MACHINE_FUNC ActFunc[ACT_FUNC_SIZE];
// Action
STATE_MACHINE ActMachine;
UCHAR RTSShortProt;
UCHAR RTSLongProt;
BOOLEAN bRTSLongProtOn;
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN bLastAtheros;
BOOLEAN bCurrentAtheros;
BOOLEAN bNowAtherosBurstOn;
BOOLEAN bNextDisableRxBA;
BOOLEAN bToggle;
-#endif // CONFIG_STA_SUPPORT //
} IOT_STRUC, *PIOT_STRUC;
// This is the registry setting for 802.11n transmit setting. Used in advanced page.
EDCA_PARM APEdcaParm; // EDCA parameters of the current associated AP
QBSS_LOAD_PARM APQbssLoad; // QBSS load of the current associated AP
UCHAR AckPolicy[4]; // ACK policy of the specified AC. see ACK_xxx
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN bDLSCapable; // 0:disable DLS, 1:enable DLS
-#endif // CONFIG_STA_SUPPORT //
// a bitmap of BOOLEAN flags. each bit represent an operation status of a particular
// BOOLEAN control, either ON or OFF. These flags should always be accessed via
// OPSTATUS_TEST_FLAG(), OPSTATUS_SET_FLAG(), OP_STATUS_CLEAR_FLAG() macros.
#endif // MCAST_RATE_SPECIFIC //
} COMMON_CONFIG, *PCOMMON_CONFIG;
-
-#ifdef CONFIG_STA_SUPPORT
/* Modified by Wu Xi-Kun 4/21/2006 */
// STA configuration and status
typedef struct _STA_ADMIN_CONFIG {
CIPHER_KEY CipherKey;
} RT_ADD_PAIRWISE_KEY_ENTRY,*PRT_ADD_PAIRWISE_KEY_ENTRY;
#endif // RT2870 //
-#endif // CONFIG_STA_SUPPORT //
// ----------- start of AP --------------------------
// AUTH-RSP State Machine Aux data structure
UINT32 TXMCSFailed[16];
UINT32 TXMCSAutoFallBack[16][16];
-#ifdef CONFIG_STA_SUPPORT
ULONG LastBeaconRxTime;
-#endif // CONFIG_STA_SUPPORT //
} MAC_TABLE_ENTRY, *PMAC_TABLE_ENTRY;
typedef struct _MAC_TABLE {
//=======STA===========
-#ifdef CONFIG_STA_SUPPORT
/* Modified by Wu Xi-Kun 4/21/2006 */
// -----------------------------------------------
// STA specific configuration & operation status
STA_ACTIVE_CONFIG StaActive; // valid only when ADHOC_ON(pAd) || INFRA_ON(pAd)
CHAR nickname[IW_ESSID_MAX_SIZE+1]; // nickname, only used in the iwconfig i/f
NDIS_MEDIA_STATE PreMediaState;
-#endif // CONFIG_STA_SUPPORT //
//=======Common===========
// OP mode: either AP or STA
#define fTX_bClearEAPFrame 0x0100
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-
-
#define TX_BLK_ASSIGN_FLAG(_pTxBlk, _flag, value) \
do { \
if (value) \
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem);
-#ifdef CONFIG_STA_SUPPORT
VOID StaPublicAction(
IN PRTMP_ADAPTER pAd,
IN UCHAR Bss2040Coexist);
-#endif // CONFIG_STA_SUPPORT //
-
VOID PeerBSSTranAction(
IN PRTMP_ADAPTER pAd,
IN PRTMP_ADAPTER pAd,
OUT UCHAR *QueIdx);
-#ifdef CONFIG_STA_SUPPORT
VOID RTMPReportMicError(
IN PRTMP_ADAPTER pAd,
IN PCIPHER_KEY pWpaKey);
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
-#endif // CONFIG_STA_SUPPORT //
NDIS_STATUS RTMPCloneNdisPacket(
IN PRTMP_ADAPTER pAd,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
-#ifdef CONFIG_STA_SUPPORT
VOID AsicSleepThenAutoWakeup(
IN PRTMP_ADAPTER pAd,
IN USHORT TbttNumToNextWakeUp);
VOID AsicForceWakeup(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bFromTx);
-#endif // CONFIG_STA_SUPPORT //
VOID AsicSetBssid(
IN PRTMP_ADAPTER pAd,
OUT PQOS_CAPABILITY_PARM pQosCapability,
OUT ULONG *pRalinkIe,
OUT UCHAR *pHtCapabilityLen,
-#ifdef CONFIG_STA_SUPPORT
OUT UCHAR *pPreNHtCapabilityLen,
-#endif // CONFIG_STA_SUPPORT //
OUT HT_CAPABILITY_IE *pHtCapability,
OUT UCHAR *AddHtInfoLen,
OUT ADD_HT_INFO_IE *AddHtInfo,
IN OUT UCHAR SupRate[],
IN OUT UCHAR *SupRateLen);
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN RTMPCheckChannel(
IN PRTMP_ADAPTER pAd,
IN UCHAR CentralChannel,
IN UCHAR Channel);
-#endif // CONFIG_STA_SUPPORT //
BOOLEAN RTMPCheckHt(
IN PRTMP_ADAPTER pAd,
VOID RTMPOPModeSwitching(
IN PRTMP_ADAPTER pAd);
-#ifdef CONFIG_STA_SUPPORT
VOID RTMPAddBSSIDCipher(
IN PRTMP_ADAPTER pAd,
IN UCHAR Aid,
IN PNDIS_802_11_KEY pKey,
IN UCHAR CipherAlg);
-#endif // CONFIG_STA_SUPPORT //
#ifdef DOT11_N_SUPPORT
VOID RTMPSetHT(
IN PUCHAR arg);
#endif // DOT11_N_SUPPORT //
-
-
-#ifdef CONFIG_STA_SUPPORT
//Dls , kathy
VOID RTMPSendDLSTearDownFrame(
IN PRTMP_ADAPTER pAd,
IN RTMP_ADAPTER *pAd);
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-
-
#ifdef DOT11_N_SUPPORT
VOID Handle_BSS_Width_Trigger_Events(
IN PRTMP_ADAPTER pAd);
IN PUCHAR pData,
IN ULONG DataSize);
-
-#ifdef CONFIG_STA_SUPPORT
// remove LLC and get 802_3 Header
#define RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(_pRxBlk, _pHeader802_3) \
{ \
CONVERT_TO_802_3(_pHeader802_3, _pDA, _pSA, _pRxBlk->pData, \
_pRxBlk->DataSize, _pRemovedLLCSNAP); \
}
-#endif // CONFIG_STA_SUPPORT //
-
BOOLEAN APFowardWirelessStaToWirelessSta(
IN PRTMP_ADAPTER pAd,
IN PNDIS_PACKET pPacket,
IN UCHAR FromWhichBSSID);
-
-#ifdef CONFIG_STA_SUPPORT
#define ANNOUNCE_OR_FORWARD_802_3_PACKET(_pAd, _pPacket, _FromWhichBSS)\
Sta_Announce_or_Forward_802_3_Packet(_pAd, _pPacket, _FromWhichBSS);
//announce_802_3_packet(_pAd, _pPacket);
-#endif // CONFIG_STA_SUPPORT //
-
PNDIS_PACKET DuplicatePacket(
IN PRTMP_ADAPTER pAd,
IN RX_BLK *pRxBlk);
////////////////////////////////////////
-
-#ifdef CONFIG_STA_SUPPORT
enum {
DIDmsg_lnxind_wlansniffrm = 0x00000044,
DIDmsg_lnxind_wlansniffrm_hosttime = 0x00010044,
VOID RTMPSetDesiredRates(
IN PRTMP_ADAPTER pAdapter,
IN LONG Rates);
-#endif // CONFIG_STA_SUPPORT //
INT Set_FixedTxMode_Proc(
IN PRTMP_ADAPTER pAd,
IN OUT struct ifreq *rq,
IN INT cmd);
-
-#ifdef CONFIG_STA_SUPPORT
INT rt28xx_sta_ioctl(
IN struct net_device *net_dev,
IN OUT struct ifreq *rq,
IN INT cmd);
-#endif // CONFIG_STA_SUPPORT //
BOOLEAN RT28XXSecurityKeyAdd(
IN PRTMP_ADAPTER pAd,
IN USHORT encryMode);
//////////////////////////////////////
-#ifdef CONFIG_STA_SUPPORT
VOID AsicStaBbpTuning(
IN PRTMP_ADAPTER pAd);
IN HT_CAPABILITY_IE *pHtCapability,
IN UCHAR HtCapabilityLen,
IN USHORT CapabilityInfo);
-#endif // CONFIG_STA_SUPPORT //
void RTMP_IndicateMediaState(
IN PRTMP_ADAPTER pAd);
// End - WIRELESS EVENTS definition
-#ifdef CONFIG_STA_SUPPORT
// definition for DLS, kathy
#define MAX_NUM_OF_INIT_DLS_ENTRY 1
#define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY
/* Maximum size of the ESSID and pAd->nickname strings */
#define IW_ESSID_MAX_SIZE 32
#endif
-#endif // CONFIG_STA_SUPPORT //
#ifdef MCAST_RATE_SPECIFIC
#define MCAST_DISABLE 0