mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-19 07:27:50 +00:00
Staging: rt2870: prepare for rt{28,30}70/sta/*.[ch] merge
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d763794962
commit
e70b8c30f7
@ -454,6 +454,11 @@ VOID MlmeAssocReqAction(
|
||||
RSNIe = IE_WPA2;
|
||||
}
|
||||
|
||||
#ifdef RT30xx
|
||||
#ifdef SIOCSIWGENIE
|
||||
if (pAd->StaCfg.WpaSupplicantUP != 1)
|
||||
#endif // SIOCSIWGENIE //
|
||||
#endif
|
||||
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0);
|
||||
|
||||
// Check for WPA PMK cache list
|
||||
@ -480,6 +485,17 @@ VOID MlmeAssocReqAction(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RT30xx
|
||||
#ifdef SIOCSIWGENIE
|
||||
if (pAd->StaCfg.WpaSupplicantUP == 1)
|
||||
{
|
||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||
pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
|
||||
END_OF_ARGS);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||
1, &RSNIe,
|
||||
@ -490,6 +506,11 @@ VOID MlmeAssocReqAction(
|
||||
|
||||
FrameLen += tmp;
|
||||
|
||||
#ifdef RT30xx
|
||||
#ifdef SIOCSIWGENIE
|
||||
if (pAd->StaCfg.WpaSupplicantUP != 1)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
// Append Variable IE
|
||||
NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &RSNIe, 1);
|
||||
|
@ -1133,6 +1133,20 @@ VOID LinkUp(
|
||||
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_ADHOC_ON);
|
||||
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
|
||||
|
||||
#ifdef RT30xx
|
||||
if ((pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
|
||||
(pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE))
|
||||
{
|
||||
pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2;
|
||||
}
|
||||
else if ((pAd->CommonCfg.Channel > 2) &&
|
||||
(pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
|
||||
(pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW))
|
||||
{
|
||||
pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
|
||||
AdhocTurnOnQos(pAd);
|
||||
|
||||
@ -1514,6 +1528,9 @@ VOID LinkUp(
|
||||
pAd->MacTab.Size = 1; // infra mode always set MACtab size =1.
|
||||
pAd->MacTab.Content[BSSID_WCID].Sst = SST_ASSOC;
|
||||
pAd->MacTab.Content[BSSID_WCID].AuthState = SST_ASSOC;
|
||||
#ifdef RT30xx
|
||||
pAd->MacTab.Content[BSSID_WCID].AuthMode = pAd->StaCfg.AuthMode;
|
||||
#endif
|
||||
pAd->MacTab.Content[BSSID_WCID].WepStatus = pAd->StaCfg.WepStatus;
|
||||
NdisReleaseSpinLock(&pAd->MacTabLock);
|
||||
|
||||
@ -1637,8 +1654,15 @@ VOID LinkUp(
|
||||
// Txop can only be modified when RDG is off, WMM is disable and TxBurst is enable
|
||||
//
|
||||
// if 1. Legacy AP WMM on, or 2. 11n AP, AMPDU disable. Force turn off burst no matter what bEnableTxBurst is.
|
||||
#ifdef RT30xx
|
||||
if (!((pAd->CommonCfg.RxStream == 1)&&(pAd->CommonCfg.TxStream == 1)) &&
|
||||
(((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
|
||||
|| ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE))))
|
||||
#endif
|
||||
#ifndef RT30xx
|
||||
if (((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED)))
|
||||
|| ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE)))
|
||||
#endif
|
||||
{
|
||||
RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
|
||||
Data &= 0xFFFFFF00;
|
||||
@ -1977,6 +2001,22 @@ VOID LinkDown(
|
||||
memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
|
||||
wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
|
||||
}
|
||||
|
||||
#ifdef RT30xx
|
||||
if (IS_RT3090(pAd))
|
||||
{
|
||||
UINT32 macdata;
|
||||
// disable MMPS BBP control register
|
||||
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &ByteValue);
|
||||
ByteValue &= ~(0x04); //bit 2
|
||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, ByteValue);
|
||||
|
||||
// disable MMPS MAC control register
|
||||
RTMP_IO_READ32(pAd, 0x1210, &macdata);
|
||||
macdata &= ~(0x09); //bit 0, 3
|
||||
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
|
||||
}
|
||||
#endif // RT30xx //
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -559,7 +559,13 @@ VOID STAHandleRxMgmtFrame(
|
||||
{
|
||||
|
||||
// We should collect RSSI not only U2M data but also my beacon
|
||||
#ifdef RT30xx
|
||||
if ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))
|
||||
&& (pAd->RxAnt.EvaluatePeriod == 0))
|
||||
#endif
|
||||
#ifndef RT30xx
|
||||
if ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2)))
|
||||
#endif
|
||||
{
|
||||
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
|
||||
|
||||
@ -567,6 +573,18 @@ VOID STAHandleRxMgmtFrame(
|
||||
pAd->StaCfg.LastSNR1 = (UCHAR)(pRxWI->SNR1);
|
||||
}
|
||||
|
||||
#ifdef RT30xx
|
||||
// collect rssi information for antenna diversity
|
||||
if (pAd->NicConfig2.field.AntDiversity)
|
||||
{
|
||||
if ((pRxD->U2M) || ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))))
|
||||
{
|
||||
COLLECT_RX_ANTENNA_AVERAGE_RSSI(pAd, ConvertToRssi(pAd, (UCHAR)pRxWI->RSSI0, RSSI_0), 0); //Note: RSSI2 not used on RT73
|
||||
pAd->StaCfg.NumOfAvgRssiSample ++;
|
||||
}
|
||||
}
|
||||
#endif // RT30xx //
|
||||
|
||||
// First check the size, it MUST not exceed the mlme queue size
|
||||
if (pRxWI->MPDUtotalByteCount > MGMT_DMA_BUFFER_SIZE)
|
||||
{
|
||||
|
@ -1061,6 +1061,10 @@ VOID PeerBeacon(
|
||||
// Add the safeguard against the mismatch of adhoc wep status
|
||||
if (pAd->StaCfg.WepStatus != pAd->ScanTab.BssEntry[Bssidx].WepStatus)
|
||||
{
|
||||
#ifdef RT30xx
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - Not matched wep status %d %d\n", pAd->StaCfg.WepStatus, pAd->ScanTab.BssEntry[Bssidx].WepStatus));
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("bssid=%s\n", pAd->ScanTab.BssEntry[Bssidx].Bssid));
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1384,10 +1384,12 @@ VOID WpaGroupMsg1Action(
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
||||
#ifndef RT30xx
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
||||
#endif
|
||||
|
||||
//hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK);
|
||||
}
|
||||
@ -1764,7 +1766,12 @@ BOOLEAN ParseKeyData(
|
||||
// Get GTK length - refer to IEEE 802.11i-2004 p.82
|
||||
GTKLEN = pKDE->Len -6;
|
||||
|
||||
#ifdef RT30xx
|
||||
if (GTKLEN < LEN_AES_KEY)
|
||||
#endif
|
||||
#ifndef RT30xx
|
||||
if (GTKLEN < MIN_LEN_OF_GTK)
|
||||
#endif
|
||||
{
|
||||
DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN));
|
||||
return FALSE;
|
||||
@ -1790,10 +1797,12 @@ BOOLEAN ParseKeyData(
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
|
||||
#ifndef RT30xx
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||
pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user