2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * Purpose: Provide functions to setup NIC operation mode
22 * s_vSafeResetTx - Rest Tx
23 * CARDvSetRSPINF - Set RSPINF
24 * vUpdateIFS - Update slotTime,SIFS,DIFS, and EIFS
25 * CARDvUpdateBasicTopRate - Update BasicTopRate
26 * CARDbAddBasicRate - Add to BasicRateSet
27 * CARDbSetBasicRate - Set Basic Tx Rate
28 * CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet
29 * CARDvSetLoopbackMode - Set Loopback mode
30 * CARDbSoftwareReset - Sortware reset NIC
31 * CARDqGetTSFOffset - Calculate TSFOffset
32 * CARDbGetCurrentTSF - Read Current NIC TSF counter
33 * CARDqGetNextTBTT - Calculate Next Beacon TSF counter
34 * CARDvSetFirstNextTBTT - Set NIC Beacon time
35 * CARDvUpdateNextTBTT - Sync. NIC Beacon time
36 * CARDbRadioPowerOff - Turn Off NIC Radio Power
37 * CARDbRadioPowerOn - Turn On NIC Radio Power
38 * CARDbSetWEPMode - Set NIC Wep mode
39 * CARDbSetTxPower - Set NIC tx power
42 * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
43 * 08-26-2003 Kyle Hsu: Modify the definition type of dwIoBase.
44 * 09-01-2003 Bryan YC Fan: Add vUpdateIFS().
63 /*--------------------- Static Definitions -------------------------*/
65 //static int msglevel =MSG_LEVEL_DEBUG;
66 static int msglevel =MSG_LEVEL_INFO;
69 /*--------------------- Static Definitions -------------------------*/
71 /*--------------------- Static Classes ----------------------------*/
73 /*--------------------- Static Variables --------------------------*/
74 //const WORD cwRXBCNTSFOff[MAX_RATE] =
75 //{17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3};
77 const WORD cwRXBCNTSFOff[MAX_RATE] =
78 {192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3};
80 /*--------------------- Static Functions --------------------------*/
82 /*--------------------- Export Variables --------------------------*/
84 /*--------------------- Export Functions --------------------------*/
86 * Description: Set NIC media channel
90 * pDevice - The adapter to be set
91 * uConnectionChannel - Channel to be set
95 void CARDbSetMediaChannel(struct vnt_private *pDevice, u32 uConnectionChannel)
98 if (pDevice->byBBType == BB_TYPE_11A) { // 15 ~ 38
99 if ((uConnectionChannel < (CB_MAX_CHANNEL_24G+1)) || (uConnectionChannel > CB_MAX_CHANNEL))
100 uConnectionChannel = (CB_MAX_CHANNEL_24G+1);
102 if ((uConnectionChannel > CB_MAX_CHANNEL_24G) || (uConnectionChannel == 0)) // 1 ~ 14
103 uConnectionChannel = 1;
107 MACvRegBitsOn(pDevice, MAC_REG_MACCR, MACCR_CLRNAV);
109 // Set Channel[7] = 0 to tell H/W channel is changing now.
110 MACvRegBitsOff(pDevice, MAC_REG_CHANNEL, 0x80);
112 //if (pMgmt->uCurrChannel == uConnectionChannel)
115 CONTROLnsRequestOut(pDevice,
116 MESSAGE_TYPE_SELECT_CHANNLE,
117 (WORD) uConnectionChannel,
123 //{{ RobertYu: 20041202
124 //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput
126 if (pDevice->byBBType == BB_TYPE_11A) {
127 pDevice->byCurPwr = 0xFF;
128 RFbRawSetPower(pDevice, pDevice->abyOFDMAPwrTbl[uConnectionChannel-15], RATE_54M);
129 } else if (pDevice->byBBType == BB_TYPE_11G) {
130 pDevice->byCurPwr = 0xFF;
131 RFbRawSetPower(pDevice, pDevice->abyOFDMPwrTbl[uConnectionChannel-1], RATE_54M);
133 pDevice->byCurPwr = 0xFF;
134 RFbRawSetPower(pDevice, pDevice->abyCCKPwrTbl[uConnectionChannel-1], RATE_1M);
136 ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_CHANNEL,(BYTE)(uConnectionChannel|0x80));
140 * Description: Get CCK mode basic rate
144 * pDevice - The adapter to be set
145 * wRateIdx - Receiving data rate
149 * Return Value: response Control frame rate
152 static u16 swGetCCKControlRate(struct vnt_private *pDevice, u16 wRateIdx)
156 while (ui > RATE_1M) {
157 if (pDevice->wBasicRate & (1 << ui))
166 * Description: Get OFDM mode basic rate
170 * pDevice - The adapter to be set
171 * wRateIdx - Receiving data rate
175 * Return Value: response Control frame rate
178 static u16 swGetOFDMControlRate(struct vnt_private *pDevice, u16 wRateIdx)
182 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BASIC RATE: %X\n",
183 pDevice->wBasicRate);
185 if (!CARDbIsOFDMinBasicRate(pDevice)) {
186 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
187 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
188 if (wRateIdx > RATE_24M)
193 while (ui > RATE_11M) {
194 if (pDevice->wBasicRate & (1 << ui)) {
195 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
196 "swGetOFDMControlRate: %d\n", ui);
202 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"swGetOFDMControlRate: 6M\n");
208 * Description: Calculate TxRate and RsvTime fields for RSPINF in OFDM mode.
213 * byPktType - Tx Packet type
215 * pbyTxRate - pointer to RSPINF TxRate field
216 * pbyRsvTime - pointer to RSPINF RsvTime field
222 CARDvCalculateOFDMRParameter (
231 if (byBBType == BB_TYPE_11A) {//5GHZ
242 if (byBBType == BB_TYPE_11A) {//5GHZ
253 if (byBBType == BB_TYPE_11A) {//5GHZ
264 if (byBBType == BB_TYPE_11A) {//5GHZ
275 if (byBBType == BB_TYPE_11A) {//5GHZ
286 if (byBBType == BB_TYPE_11A) {//5GHZ
297 if (byBBType == BB_TYPE_11A) {//5GHZ
309 if (byBBType == BB_TYPE_11A) {//5GHZ
322 * Description: Set RSPINF
326 * pDevice - The adapter to be set
330 * Return Value: None.
333 void CARDvSetRSPINF(struct vnt_private *pDevice, u8 byBBType)
335 u8 abyServ[4] = {0, 0, 0, 0}; /* For CCK */
336 u8 abySignal[4] = {0, 0, 0, 0};
337 u16 awLen[4] = {0, 0, 0, 0};
338 u8 abyTxRate[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; /* For OFDM */
339 u8 abyRsvTime[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
344 BBvCalculateParameter(pDevice,
346 swGetCCKControlRate(pDevice, RATE_1M),
354 BBvCalculateParameter(pDevice,
356 swGetCCKControlRate(pDevice, RATE_2M),
364 BBvCalculateParameter(pDevice,
366 swGetCCKControlRate(pDevice, RATE_5M),
374 BBvCalculateParameter(pDevice,
376 swGetCCKControlRate(pDevice, RATE_11M),
384 CARDvCalculateOFDMRParameter (RATE_6M,
390 CARDvCalculateOFDMRParameter (RATE_9M,
396 CARDvCalculateOFDMRParameter (RATE_12M,
402 CARDvCalculateOFDMRParameter (RATE_18M,
408 CARDvCalculateOFDMRParameter (RATE_24M,
414 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice, RATE_36M),
420 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice, RATE_48M),
426 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice, RATE_54M),
432 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice, RATE_54M),
437 abyData[0] = (BYTE)(awLen[0]&0xFF);
438 abyData[1] = (BYTE)(awLen[0]>>8);
439 abyData[2] = abySignal[0];
440 abyData[3] = abyServ[0];
442 abyData[4] = (BYTE)(awLen[1]&0xFF);
443 abyData[5] = (BYTE)(awLen[1]>>8);
444 abyData[6] = abySignal[1];
445 abyData[7] = abyServ[1];
447 abyData[8] = (BYTE)(awLen[2]&0xFF);
448 abyData[9] = (BYTE)(awLen[2]>>8);
449 abyData[10] = abySignal[2];
450 abyData[11] = abyServ[2];
452 abyData[12] = (BYTE)(awLen[3]&0xFF);
453 abyData[13] = (BYTE)(awLen[3]>>8);
454 abyData[14] = abySignal[3];
455 abyData[15] = abyServ[3];
457 for (i = 0; i < 9; i++) {
458 abyData[16+i*2] = abyTxRate[i];
459 abyData[16+i*2+1] = abyRsvTime[i];
462 CONTROLnsRequestOut(pDevice,
465 MESSAGE_REQUEST_MACREG,
472 * Description: Update IFS
476 * pDevice - The adapter to be set
480 * Return Value: None.
483 void vUpdateIFS(struct vnt_private *pDevice)
488 if (pDevice->byPacketType==PK_TYPE_11A) {//0000 0000 0000 0000,11a
489 pDevice->uSlot = C_SLOT_SHORT;
490 pDevice->uSIFS = C_SIFS_A;
491 pDevice->uDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
492 pDevice->uCwMin = C_CWMIN_A;
495 else if (pDevice->byPacketType==PK_TYPE_11B) {//0000 0001 0000 0000,11b
496 pDevice->uSlot = C_SLOT_LONG;
497 pDevice->uSIFS = C_SIFS_BG;
498 pDevice->uDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
499 pDevice->uCwMin = C_CWMIN_B;
502 else {// PK_TYPE_11GA & PK_TYPE_11GB
504 bool bOFDMRate = false;
506 PWLAN_IE_SUPP_RATES pItemRates = NULL;
508 pDevice->uSIFS = C_SIFS_BG;
509 if (pDevice->bShortSlotTime) {
510 pDevice->uSlot = C_SLOT_SHORT;
512 pDevice->uSlot = C_SLOT_LONG;
514 pDevice->uDIFS = C_SIFS_BG + 2*pDevice->uSlot;
516 pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->vnt_mgmt.abyCurrSuppRates;
517 for (ii = 0; ii < pItemRates->len; ii++) {
518 byRate = (BYTE)(pItemRates->abyRates[ii]&0x7F);
519 if (RATEwGetRateIdx(byRate) > RATE_11M) {
524 if (bOFDMRate == false) {
525 pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->vnt_mgmt
526 .abyCurrExtSuppRates;
527 for (ii = 0; ii < pItemRates->len; ii++) {
528 byRate = (BYTE)(pItemRates->abyRates[ii]&0x7F);
529 if (RATEwGetRateIdx(byRate) > RATE_11M) {
535 if (bOFDMRate == true) {
536 pDevice->uCwMin = C_CWMIN_A;
539 pDevice->uCwMin = C_CWMIN_B;
544 pDevice->uCwMax = C_CWMAX;
545 pDevice->uEIFS = C_EIFS;
547 byData[0] = (BYTE)pDevice->uSIFS;
548 byData[1] = (BYTE)pDevice->uDIFS;
549 byData[2] = (BYTE)pDevice->uEIFS;
550 byData[3] = (BYTE)pDevice->uSlot;
551 CONTROLnsRequestOut(pDevice,
554 MESSAGE_REQUEST_MACREG,
558 byMaxMin |= 0xA0;//1010 1111,C_CWMAX = 1023
559 CONTROLnsRequestOut(pDevice,
562 MESSAGE_REQUEST_MACREG,
567 void CARDvUpdateBasicTopRate(struct vnt_private *pDevice)
569 u8 byTopOFDM = RATE_24M, byTopCCK = RATE_1M;
572 //Determines the highest basic rate.
573 for (ii = RATE_54M; ii >= RATE_6M; ii --) {
574 if ( (pDevice->wBasicRate) & ((WORD)(1<<ii)) ) {
579 pDevice->byTopOFDMBasicRate = byTopOFDM;
581 for (ii = RATE_11M;; ii --) {
582 if ( (pDevice->wBasicRate) & ((WORD)(1<<ii)) ) {
589 pDevice->byTopCCKBasicRate = byTopCCK;
593 * Description: Set NIC Tx Basic Rate
597 * pDevice - The adapter to be set
598 * wBasicRate - Basic Rate to be set
602 * Return Value: true if succeeded; false if failed.
605 void CARDbAddBasicRate(struct vnt_private *pDevice, u16 wRateIdx)
607 u16 wRate = (1 << wRateIdx);
609 pDevice->wBasicRate |= wRate;
611 //Determines the highest basic rate.
612 CARDvUpdateBasicTopRate(pDevice);
615 int CARDbIsOFDMinBasicRate(struct vnt_private *pDevice)
619 for (ii = RATE_54M; ii >= RATE_6M; ii --) {
620 if ((pDevice->wBasicRate) & ((WORD)(1<<ii)))
626 u8 CARDbyGetPktType(struct vnt_private *pDevice)
629 if (pDevice->byBBType == BB_TYPE_11A || pDevice->byBBType == BB_TYPE_11B) {
630 return (BYTE)pDevice->byBBType;
632 else if (CARDbIsOFDMinBasicRate(pDevice)) {
642 * Description: Calculate TSF offset of two TSF input
643 * Get TSF Offset from RxBCN's TSF and local TSF
647 * pDevice - The adapter to be sync.
648 * qwTSF1 - Rx BCN's TSF
653 * Return Value: TSF Offset value
656 u64 CARDqGetTSFOffset(BYTE byRxRate, u64 qwTSF1, u64 qwTSF2)
659 WORD wRxBcnTSFOffst = 0;
661 wRxBcnTSFOffst = cwRXBCNTSFOff[byRxRate % MAX_RATE];
663 qwTSF2 += (u64)wRxBcnTSFOffst;
665 qwTSFOffset = qwTSF1 - qwTSF2;
673 * Description: Sync. TSF counter to BSS
674 * Get TSF offset and write to HW
678 * pDevice - The adapter to be sync.
679 * qwBSSTimestamp - Rx BCN's TSF
680 * qwLocalTSF - Local TSF
687 void CARDvAdjustTSF(struct vnt_private *pDevice, u8 byRxRate,
688 u64 qwBSSTimestamp, u64 qwLocalTSF)
694 qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, qwLocalTSF);
696 // HW's TSF add TSF Offset reg
698 pbyData[0] = (u8)qwTSFOffset;
699 pbyData[1] = (u8)(qwTSFOffset >> 8);
700 pbyData[2] = (u8)(qwTSFOffset >> 16);
701 pbyData[3] = (u8)(qwTSFOffset >> 24);
702 pbyData[4] = (u8)(qwTSFOffset >> 32);
703 pbyData[5] = (u8)(qwTSFOffset >> 40);
704 pbyData[6] = (u8)(qwTSFOffset >> 48);
705 pbyData[7] = (u8)(qwTSFOffset >> 56);
707 CONTROLnsRequestOut(pDevice,
708 MESSAGE_TYPE_SET_TSFTBTT,
717 * Description: Read NIC TSF counter
718 * Get local TSF counter
722 * pDevice - The adapter to be read
724 * qwCurrTSF - Current TSF counter
726 * Return Value: true if success; otherwise false
729 bool CARDbGetCurrentTSF(struct vnt_private *pDevice, u64 *pqwCurrTSF)
732 *pqwCurrTSF = pDevice->qwCurrTSF;
739 * Description: Clear NIC TSF counter
740 * Clear local TSF counter
744 * pDevice - The adapter to be read
746 * Return Value: true if success; otherwise false
749 bool CARDbClearCurrentTSF(struct vnt_private *pDevice)
752 MACvRegBitsOn(pDevice, MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
754 pDevice->qwCurrTSF = 0;
760 * Description: Read NIC TSF counter
761 * Get NEXTTBTT from adjusted TSF and Beacon Interval
765 * qwTSF - Current TSF counter
766 * wbeaconInterval - Beacon Interval
768 * qwCurrTSF - Current TSF counter
770 * Return Value: TSF value of next Beacon
773 u64 CARDqGetNextTBTT(u64 qwTSF, WORD wBeaconInterval)
776 unsigned int uLowNextTBTT;
777 unsigned int uHighRemain, uLowRemain;
778 unsigned int uBeaconInterval;
780 uBeaconInterval = wBeaconInterval * 1024;
781 // Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval
782 uLowNextTBTT = ((qwTSF & 0xffffffffU) >> 10) << 10;
783 uLowRemain = (uLowNextTBTT) % uBeaconInterval;
784 uHighRemain = ((0x80000000 % uBeaconInterval) * 2 * (u32)(qwTSF >> 32))
786 uLowRemain = (uHighRemain + uLowRemain) % uBeaconInterval;
787 uLowRemain = uBeaconInterval - uLowRemain;
789 // check if carry when add one beacon interval
790 if ((~uLowNextTBTT) < uLowRemain)
791 qwTSF = ((qwTSF >> 32) + 1) << 32;
793 qwTSF = (qwTSF & 0xffffffff00000000ULL) |
794 (u64)(uLowNextTBTT + uLowRemain);
801 * Description: Set NIC TSF counter for first Beacon time
802 * Get NEXTTBTT from adjusted TSF and Beacon Interval
807 * wBeaconInterval - Beacon Interval
814 void CARDvSetFirstNextTBTT(struct vnt_private *pDevice, WORD wBeaconInterval)
819 CARDbClearCurrentTSF(pDevice);
820 //CARDbGetCurrentTSF(pDevice, &qwNextTBTT); //Get Local TSF counter
821 qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
824 pbyData[0] = (u8)qwNextTBTT;
825 pbyData[1] = (u8)(qwNextTBTT >> 8);
826 pbyData[2] = (u8)(qwNextTBTT >> 16);
827 pbyData[3] = (u8)(qwNextTBTT >> 24);
828 pbyData[4] = (u8)(qwNextTBTT >> 32);
829 pbyData[5] = (u8)(qwNextTBTT >> 40);
830 pbyData[6] = (u8)(qwNextTBTT >> 48);
831 pbyData[7] = (u8)(qwNextTBTT >> 56);
833 CONTROLnsRequestOut(pDevice,
834 MESSAGE_TYPE_SET_TSFTBTT,
835 MESSAGE_REQUEST_TBTT,
846 * Description: Sync NIC TSF counter for Beacon time
847 * Get NEXTTBTT and write to HW
851 * pDevice - The adapter to be set
852 * qwTSF - Current TSF counter
853 * wBeaconInterval - Beacon Interval
860 void CARDvUpdateNextTBTT(struct vnt_private *pDevice, u64 qwTSF,
865 qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
869 pbyData[0] = (u8)qwTSF;
870 pbyData[1] = (u8)(qwTSF >> 8);
871 pbyData[2] = (u8)(qwTSF >> 16);
872 pbyData[3] = (u8)(qwTSF >> 24);
873 pbyData[4] = (u8)(qwTSF >> 32);
874 pbyData[5] = (u8)(qwTSF >> 40);
875 pbyData[6] = (u8)(qwTSF >> 48);
876 pbyData[7] = (u8)(qwTSF >> 56);
878 CONTROLnsRequestOut(pDevice,
879 MESSAGE_TYPE_SET_TSFTBTT,
880 MESSAGE_REQUEST_TBTT,
887 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
888 "Card:Update Next TBTT[%8lx]\n", (unsigned long)qwTSF);
894 * Description: Turn off Radio power
898 * pDevice - The adapter to be turned off
902 * Return Value: true if success; otherwise false
905 int CARDbRadioPowerOff(struct vnt_private *pDevice)
909 //if (pDevice->bRadioOff == true)
912 pDevice->bRadioOff = true;
914 switch (pDevice->byRFType) {
918 case RF_VT3226: //RobertYu:20051111
920 case RF_VT3342A0: //RobertYu:20060609
921 MACvRegBitsOff(pDevice, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
925 MACvRegBitsOff(pDevice, MAC_REG_HOSTCR, HOSTCR_RXON);
927 BBvSetDeepSleep(pDevice);
934 * Description: Turn on Radio power
938 * pDevice - The adapter to be turned on
942 * Return Value: true if success; otherwise false
945 int CARDbRadioPowerOn(struct vnt_private *pDevice)
949 if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) {
953 //if (pDevice->bRadioOff == false)
956 pDevice->bRadioOff = false;
958 BBvExitDeepSleep(pDevice);
960 MACvRegBitsOn(pDevice, MAC_REG_HOSTCR, HOSTCR_RXON);
962 switch (pDevice->byRFType) {
966 case RF_VT3226: //RobertYu:20051111
968 case RF_VT3342A0: //RobertYu:20060609
969 MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
976 void CARDvSetBSSMode(struct vnt_private *pDevice)
978 // Set BB and packet type at the same time.//{{RobertYu:20050222, AL7230 have two TX PA output, only connet to b/g now
979 // so in 11a mode need to set the MAC Reg0x4C to 11b/g mode to turn on PA
980 if( (pDevice->byRFType == RF_AIROHA7230 ) && (pDevice->byBBType == BB_TYPE_11A) )
982 MACvSetBBType(pDevice, BB_TYPE_11G);
986 MACvSetBBType(pDevice, pDevice->byBBType);
988 pDevice->byPacketType = CARDbyGetPktType(pDevice);
990 if (pDevice->byBBType == BB_TYPE_11A) {
991 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
992 } else if (pDevice->byBBType == BB_TYPE_11B) {
993 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
994 } else if (pDevice->byBBType == BB_TYPE_11G) {
995 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
999 CARDvSetRSPINF(pDevice, (BYTE)pDevice->byBBType);
1001 if ( pDevice->byBBType == BB_TYPE_11A ) {
1002 //request by Jack 2005-04-26
1003 if (pDevice->byRFType == RF_AIROHA7230) {
1004 pDevice->abyBBVGA[0] = 0x20;
1005 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, pDevice->abyBBVGA[0]);
1007 pDevice->abyBBVGA[2] = 0x10;
1008 pDevice->abyBBVGA[3] = 0x10;
1010 //request by Jack 2005-04-26
1011 if (pDevice->byRFType == RF_AIROHA7230) {
1012 pDevice->abyBBVGA[0] = 0x1C;
1013 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, pDevice->abyBBVGA[0]);
1015 pDevice->abyBBVGA[2] = 0x0;
1016 pDevice->abyBBVGA[3] = 0x0;
1023 * Do Channel Switch defined in 802.11h
1027 * hDeviceContext - device structure point
1031 * Return Value: none.
1034 int CARDbChannelSwitch(struct vnt_private *pDevice, u8 byMode,
1035 u8 byNewChannel, u8 byCount)
1040 pDevice->vnt_mgmt.uCurrChannel = byNewChannel;
1041 CARDbSetMediaChannel(pDevice, byNewChannel);
1044 pDevice->byChannelSwitchCount = byCount;
1045 pDevice->byNewChannel = byNewChannel;
1046 pDevice->bChannelSwitch = true;
1049 //bResult=CARDbStopTxPacket(pDevice, PKT_TYPE_802_11_ALL);
1050 pDevice->bStopDataPkt = true;