• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/rt2860/common/

Lines Matching refs:pAd

108 void BuildChannelList(struct rt_rtmp_adapter *pAd)
113 NdisZeroMemory(pAd->ChannelList,
117 if ((pAd->CommonCfg.PhyMode != PHY_11A)
118 && (pAd->CommonCfg.PhyMode != PHY_11AN_MIXED)
119 && (pAd->CommonCfg.PhyMode != PHY_11N_5G)
121 switch (pAd->CommonCfg.CountryRegion & 0x7f) {
123 NdisMoveMemory(&pAd->ChannelList[index],
124 &pAd->TxPower[BG_BAND_REGION_0_START],
130 NdisMoveMemory(&pAd->ChannelList[index],
131 &pAd->TxPower[BG_BAND_REGION_1_START],
137 NdisMoveMemory(&pAd->ChannelList[index],
138 &pAd->TxPower[BG_BAND_REGION_2_START],
144 NdisMoveMemory(&pAd->ChannelList[index],
145 &pAd->TxPower[BG_BAND_REGION_3_START],
151 NdisMoveMemory(&pAd->ChannelList[index],
152 &pAd->TxPower[BG_BAND_REGION_4_START],
158 NdisMoveMemory(&pAd->ChannelList[index],
159 &pAd->TxPower[BG_BAND_REGION_5_START],
165 NdisMoveMemory(&pAd->ChannelList[index],
166 &pAd->TxPower[BG_BAND_REGION_6_START],
172 NdisMoveMemory(&pAd->ChannelList[index],
173 &pAd->TxPower[BG_BAND_REGION_7_START],
179 NdisMoveMemory(&pAd->ChannelList[index],
180 &pAd->TxPower[BG_BAND_REGION_31_START],
189 pAd->ChannelList[i].MaxTxPwr = 20;
192 if ((pAd->CommonCfg.PhyMode == PHY_11A)
193 || (pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
194 || (pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED)
195 || (pAd->CommonCfg.PhyMode == PHY_11AN_MIXED)
196 || (pAd->CommonCfg.PhyMode == PHY_11AGN_MIXED)
197 || (pAd->CommonCfg.PhyMode == PHY_11N_5G)
199 switch (pAd->CommonCfg.CountryRegionForABand & 0x7f) {
301 pAd->CommonCfg.CountryRegionForABand));
312 pAd->TxPower[j].Channel)
313 NdisMoveMemory(&pAd->
316 &pAd->TxPower[j],
322 pAd->ChannelList[index +
326 pAd->ChannelList[index + i].MaxTxPwr = 20;
332 pAd->ChannelListNum = index;
335 pAd->CommonCfg.CountryRegion,
336 pAd->CommonCfg.CountryRegionForABand, pAd->RfIcType,
337 pAd->CommonCfg.PhyMode, pAd->ChannelListNum));
339 for (i = 0; i < pAd->ChannelListNum; i++) {
342 pAd->ChannelList[i].Channel,
343 pAd->ChannelList[i].Power,
344 pAd->ChannelList[i].Power2));
362 u8 FirstChannel(struct rt_rtmp_adapter *pAd)
364 return pAd->ChannelList[0].Channel;
378 u8 NextChannel(struct rt_rtmp_adapter *pAd, u8 channel)
383 for (i = 0; i < (pAd->ChannelListNum - 1); i++)
384 if (channel == pAd->ChannelList[i].Channel) {
385 next_channel = pAd->ChannelList[i + 1].Channel;
411 void ChangeToCellPowerLimit(struct rt_rtmp_adapter *pAd,
420 pAd->CommonCfg.TxPowerPercentage = 6;
422 pAd->CommonCfg.TxPowerPercentage = 10;
424 pAd->CommonCfg.TxPowerPercentage = 25;
426 pAd->CommonCfg.TxPowerPercentage = 50;
428 pAd->CommonCfg.TxPowerPercentage = 75;
430 pAd->CommonCfg.TxPowerPercentage = 100; /*else used maximum */
432 if (pAd->CommonCfg.TxPowerPercentage > pAd->CommonCfg.TxPowerDefault)
433 pAd->CommonCfg.TxPowerPercentage =
434 pAd->CommonCfg.TxPowerDefault;
438 char ConvertToRssi(struct rt_rtmp_adapter *pAd, char Rssi, u8 RssiNumber)
446 LNAGain = GET_LNA_GAIN(pAd);
447 if (pAd->LatchRfRegs.Channel > 14) {
449 RssiOffset = pAd->ARssiOffset0;
451 RssiOffset = pAd->ARssiOffset1;
453 RssiOffset = pAd->ARssiOffset2;
456 RssiOffset = pAd->BGRssiOffset0;
458 RssiOffset = pAd->BGRssiOffset1;
460 RssiOffset = pAd->BGRssiOffset2;
472 void ScanNextChannel(struct rt_rtmp_adapter *pAd)
478 u8 SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0;
484 if (MONITOR_ON(pAd))
488 if (pAd->MlmeAux.Channel == 0) {
489 if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
490 && (INFRA_ON(pAd)
491 || (pAd->OpMode == OPMODE_AP))
493 AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel,
495 AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
496 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
499 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
502 pAd->CommonCfg.CentralChannel,
503 pAd->ScanTab.BssNr));
505 AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
506 AsicLockChannel(pAd, pAd->CommonCfg.Channel);
509 pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
519 (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
520 && (INFRA_ON(pAd))) {
522 MlmeAllocateMemory(pAd,
526 MgtMacHeaderInit(pAd, pHdr80211,
528 pAd->CommonCfg.Bssid,
529 pAd->CommonCfg.Bssid);
533 (pAd->StaCfg.Psm == PWR_SAVE);
536 MiniportMMRequest(pAd, 0, pOutBuffer,
541 MlmeFreeMemory(pAd, pOutBuffer);
546 pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
548 MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF,
552 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
555 else if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)
556 && (pAd->OpMode == OPMODE_STA)) {
557 pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
558 MlmeCntlConfirm(pAd, MT2_SCAN_CONF, MLME_FAIL_NO_RESOURCE);
564 if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
565 AsicForceWakeup(pAd, TRUE);
568 if (pAd->StaCfg.Psm == PWR_SAVE)
569 RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE);
572 AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, TRUE);
573 AsicLockChannel(pAd, pAd->MlmeAux.Channel);
576 if (pAd->MlmeAux.Channel > 14) {
577 if ((pAd->CommonCfg.bIEEE80211H == 1)
578 && RadarChannelCheck(pAd,
579 pAd->MlmeAux.
588 if ((pAd->MlmeAux.Channel <= 14) && (pAd->MlmeAux.Channel >= 12)
589 && ((pAd->CommonCfg.CountryRegion & 0x7f) ==
596 RTMPSetTimer(&pAd->MlmeAux.ScanTimer,
600 if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
601 || (pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED)
602 || (pAd->CommonCfg.PhyMode == PHY_11AGN_MIXED)
604 if (pAd->MlmeAux.Channel > 14)
605 RTMPSetTimer(&pAd->MlmeAux.ScanTimer,
608 RTMPSetTimer(&pAd->MlmeAux.ScanTimer,
611 RTMPSetTimer(&pAd->MlmeAux.ScanTimer,
618 NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
624 pAd->Mlme.SyncMachine.CurrState =
627 MlmeEnqueue(pAd,
638 SsidLen = pAd->MlmeAux.SsidLen;
642 MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0,
647 pAd->MlmeAux.Ssid, 1, &SupRateIe, 1,
648 &pAd->CommonCfg.SupRateLen,
649 pAd->CommonCfg.SupRateLen,
650 pAd->CommonCfg.SupRate, END_OF_ARGS);
652 if (pAd->CommonCfg.ExtRateLen) {
656 1, &pAd->CommonCfg.ExtRateLen,
657 pAd->CommonCfg.ExtRateLen,
658 pAd->CommonCfg.ExtRate,
663 if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) {
668 if (pAd->bBroadComHT == TRUE) {
670 pAd->MlmeAux.HtCapabilityLen + 4;
676 pAd->MlmeAux.
678 &pAd->MlmeAux.
682 HtLen = pAd->MlmeAux.HtCapabilityLen;
687 &pAd->CommonCfg.
694 MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
695 MlmeFreeMemory(pAd, pOutBuffer);
699 pAd->Mlme.SyncMachine.CurrState = SCAN_LISTEN;
703 void MgtProbReqMacHeaderInit(struct rt_rtmp_adapter *pAd,
716 COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);