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 int msglevel =MSG_LEVEL_DEBUG;
64 static int msglevel
=MSG_LEVEL_INFO
;
66 //const u16 cwRXBCNTSFOff[MAX_RATE] =
67 //{17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3};
69 const u16 cwRXBCNTSFOff
[MAX_RATE
] =
70 {192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3};
73 * Description: Set NIC media channel
77 * pDevice - The adapter to be set
78 * uConnectionChannel - Channel to be set
82 void CARDbSetMediaChannel(struct vnt_private
*pDevice
, u32 uConnectionChannel
)
85 if (pDevice
->byBBType
== BB_TYPE_11A
) { // 15 ~ 38
86 if ((uConnectionChannel
< (CB_MAX_CHANNEL_24G
+1)) || (uConnectionChannel
> CB_MAX_CHANNEL
))
87 uConnectionChannel
= (CB_MAX_CHANNEL_24G
+1);
89 if ((uConnectionChannel
> CB_MAX_CHANNEL_24G
) || (uConnectionChannel
== 0)) // 1 ~ 14
90 uConnectionChannel
= 1;
94 MACvRegBitsOn(pDevice
, MAC_REG_MACCR
, MACCR_CLRNAV
);
96 // Set Channel[7] = 0 to tell H/W channel is changing now.
97 MACvRegBitsOff(pDevice
, MAC_REG_CHANNEL
, 0x80);
99 //if (pMgmt->uCurrChannel == uConnectionChannel)
102 CONTROLnsRequestOut(pDevice
,
103 MESSAGE_TYPE_SELECT_CHANNLE
,
104 (u16
) uConnectionChannel
,
110 //{{ RobertYu: 20041202
111 //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput
113 if (pDevice
->byBBType
== BB_TYPE_11A
) {
114 pDevice
->byCurPwr
= 0xFF;
115 RFbRawSetPower(pDevice
, pDevice
->abyOFDMAPwrTbl
[uConnectionChannel
-15], RATE_54M
);
116 } else if (pDevice
->byBBType
== BB_TYPE_11G
) {
117 pDevice
->byCurPwr
= 0xFF;
118 RFbRawSetPower(pDevice
, pDevice
->abyOFDMPwrTbl
[uConnectionChannel
-1], RATE_54M
);
120 pDevice
->byCurPwr
= 0xFF;
121 RFbRawSetPower(pDevice
, pDevice
->abyCCKPwrTbl
[uConnectionChannel
-1], RATE_1M
);
123 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_CHANNEL
,(u8
)(uConnectionChannel
|0x80));
127 * Description: Get CCK mode basic rate
131 * pDevice - The adapter to be set
132 * wRateIdx - Receiving data rate
136 * Return Value: response Control frame rate
139 static u16
swGetCCKControlRate(struct vnt_private
*pDevice
, u16 wRateIdx
)
143 while (ui
> RATE_1M
) {
144 if (pDevice
->wBasicRate
& (1 << ui
))
153 * Description: Get OFDM mode basic rate
157 * pDevice - The adapter to be set
158 * wRateIdx - Receiving data rate
162 * Return Value: response Control frame rate
165 static u16
swGetOFDMControlRate(struct vnt_private
*pDevice
, u16 wRateIdx
)
169 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"BASIC RATE: %X\n",
170 pDevice
->wBasicRate
);
172 if (!CARDbIsOFDMinBasicRate(pDevice
)) {
173 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
174 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx
);
175 if (wRateIdx
> RATE_24M
)
180 while (ui
> RATE_11M
) {
181 if (pDevice
->wBasicRate
& (1 << ui
)) {
182 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
183 "swGetOFDMControlRate: %d\n", ui
);
189 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"swGetOFDMControlRate: 6M\n");
195 * Description: Calculate TxRate and RsvTime fields for RSPINF in OFDM mode.
200 * byPktType - Tx Packet type
202 * pbyTxRate - pointer to RSPINF TxRate field
203 * pbyRsvTime - pointer to RSPINF RsvTime field
209 CARDvCalculateOFDMRParameter (
218 if (byBBType
== BB_TYPE_11A
) {//5GHZ
229 if (byBBType
== BB_TYPE_11A
) {//5GHZ
240 if (byBBType
== BB_TYPE_11A
) {//5GHZ
251 if (byBBType
== BB_TYPE_11A
) {//5GHZ
262 if (byBBType
== BB_TYPE_11A
) {//5GHZ
273 if (byBBType
== BB_TYPE_11A
) {//5GHZ
284 if (byBBType
== BB_TYPE_11A
) {//5GHZ
296 if (byBBType
== BB_TYPE_11A
) {//5GHZ
309 * Description: Set RSPINF
313 * pDevice - The adapter to be set
317 * Return Value: None.
320 void CARDvSetRSPINF(struct vnt_private
*pDevice
, u8 byBBType
)
322 u8 abyServ
[4] = {0, 0, 0, 0}; /* For CCK */
323 u8 abySignal
[4] = {0, 0, 0, 0};
324 u16 awLen
[4] = {0, 0, 0, 0};
325 u8 abyTxRate
[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; /* For OFDM */
326 u8 abyRsvTime
[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
331 BBvCalculateParameter(pDevice
,
333 swGetCCKControlRate(pDevice
, RATE_1M
),
341 BBvCalculateParameter(pDevice
,
343 swGetCCKControlRate(pDevice
, RATE_2M
),
351 BBvCalculateParameter(pDevice
,
353 swGetCCKControlRate(pDevice
, RATE_5M
),
361 BBvCalculateParameter(pDevice
,
363 swGetCCKControlRate(pDevice
, RATE_11M
),
371 CARDvCalculateOFDMRParameter (RATE_6M
,
377 CARDvCalculateOFDMRParameter (RATE_9M
,
383 CARDvCalculateOFDMRParameter (RATE_12M
,
389 CARDvCalculateOFDMRParameter (RATE_18M
,
395 CARDvCalculateOFDMRParameter (RATE_24M
,
401 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_36M
),
407 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_48M
),
413 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_54M
),
419 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_54M
),
424 abyData
[0] = (u8
)(awLen
[0]&0xFF);
425 abyData
[1] = (u8
)(awLen
[0]>>8);
426 abyData
[2] = abySignal
[0];
427 abyData
[3] = abyServ
[0];
429 abyData
[4] = (u8
)(awLen
[1]&0xFF);
430 abyData
[5] = (u8
)(awLen
[1]>>8);
431 abyData
[6] = abySignal
[1];
432 abyData
[7] = abyServ
[1];
434 abyData
[8] = (u8
)(awLen
[2]&0xFF);
435 abyData
[9] = (u8
)(awLen
[2]>>8);
436 abyData
[10] = abySignal
[2];
437 abyData
[11] = abyServ
[2];
439 abyData
[12] = (u8
)(awLen
[3]&0xFF);
440 abyData
[13] = (u8
)(awLen
[3]>>8);
441 abyData
[14] = abySignal
[3];
442 abyData
[15] = abyServ
[3];
444 for (i
= 0; i
< 9; i
++) {
445 abyData
[16+i
*2] = abyTxRate
[i
];
446 abyData
[16+i
*2+1] = abyRsvTime
[i
];
449 CONTROLnsRequestOut(pDevice
,
452 MESSAGE_REQUEST_MACREG
,
459 * Description: Update IFS
463 * pDevice - The adapter to be set
467 * Return Value: None.
470 void vUpdateIFS(struct vnt_private
*pDevice
)
475 if (pDevice
->byPacketType
==PK_TYPE_11A
) {//0000 0000 0000 0000,11a
476 pDevice
->uSlot
= C_SLOT_SHORT
;
477 pDevice
->uSIFS
= C_SIFS_A
;
478 pDevice
->uDIFS
= C_SIFS_A
+ 2*C_SLOT_SHORT
;
479 pDevice
->uCwMin
= C_CWMIN_A
;
482 else if (pDevice
->byPacketType
==PK_TYPE_11B
) {//0000 0001 0000 0000,11b
483 pDevice
->uSlot
= C_SLOT_LONG
;
484 pDevice
->uSIFS
= C_SIFS_BG
;
485 pDevice
->uDIFS
= C_SIFS_BG
+ 2*C_SLOT_LONG
;
486 pDevice
->uCwMin
= C_CWMIN_B
;
489 else {// PK_TYPE_11GA & PK_TYPE_11GB
491 bool bOFDMRate
= false;
493 PWLAN_IE_SUPP_RATES pItemRates
= NULL
;
495 pDevice
->uSIFS
= C_SIFS_BG
;
496 if (pDevice
->bShortSlotTime
) {
497 pDevice
->uSlot
= C_SLOT_SHORT
;
499 pDevice
->uSlot
= C_SLOT_LONG
;
501 pDevice
->uDIFS
= C_SIFS_BG
+ 2*pDevice
->uSlot
;
503 pItemRates
= (PWLAN_IE_SUPP_RATES
)pDevice
->vnt_mgmt
.abyCurrSuppRates
;
504 for (ii
= 0; ii
< pItemRates
->len
; ii
++) {
505 byRate
= (u8
)(pItemRates
->abyRates
[ii
]&0x7F);
506 if (RATEwGetRateIdx(byRate
) > RATE_11M
) {
511 if (bOFDMRate
== false) {
512 pItemRates
= (PWLAN_IE_SUPP_RATES
)pDevice
->vnt_mgmt
513 .abyCurrExtSuppRates
;
514 for (ii
= 0; ii
< pItemRates
->len
; ii
++) {
515 byRate
= (u8
)(pItemRates
->abyRates
[ii
]&0x7F);
516 if (RATEwGetRateIdx(byRate
) > RATE_11M
) {
522 if (bOFDMRate
== true) {
523 pDevice
->uCwMin
= C_CWMIN_A
;
526 pDevice
->uCwMin
= C_CWMIN_B
;
531 pDevice
->uCwMax
= C_CWMAX
;
532 pDevice
->uEIFS
= C_EIFS
;
534 byData
[0] = (u8
)pDevice
->uSIFS
;
535 byData
[1] = (u8
)pDevice
->uDIFS
;
536 byData
[2] = (u8
)pDevice
->uEIFS
;
537 byData
[3] = (u8
)pDevice
->uSlot
;
538 CONTROLnsRequestOut(pDevice
,
541 MESSAGE_REQUEST_MACREG
,
545 byMaxMin
|= 0xA0;//1010 1111,C_CWMAX = 1023
546 CONTROLnsRequestOut(pDevice
,
549 MESSAGE_REQUEST_MACREG
,
554 void CARDvUpdateBasicTopRate(struct vnt_private
*pDevice
)
556 u8 byTopOFDM
= RATE_24M
, byTopCCK
= RATE_1M
;
559 //Determines the highest basic rate.
560 for (ii
= RATE_54M
; ii
>= RATE_6M
; ii
--) {
561 if ( (pDevice
->wBasicRate
) & ((u16
)(1<<ii
)) ) {
566 pDevice
->byTopOFDMBasicRate
= byTopOFDM
;
568 for (ii
= RATE_11M
;; ii
--) {
569 if ( (pDevice
->wBasicRate
) & ((u16
)(1<<ii
)) ) {
576 pDevice
->byTopCCKBasicRate
= byTopCCK
;
580 * Description: Set NIC Tx Basic Rate
584 * pDevice - The adapter to be set
585 * wBasicRate - Basic Rate to be set
589 * Return Value: true if succeeded; false if failed.
592 void CARDbAddBasicRate(struct vnt_private
*pDevice
, u16 wRateIdx
)
594 u16 wRate
= (1 << wRateIdx
);
596 pDevice
->wBasicRate
|= wRate
;
598 //Determines the highest basic rate.
599 CARDvUpdateBasicTopRate(pDevice
);
602 int CARDbIsOFDMinBasicRate(struct vnt_private
*pDevice
)
606 for (ii
= RATE_54M
; ii
>= RATE_6M
; ii
--) {
607 if ((pDevice
->wBasicRate
) & ((u16
)(1<<ii
)))
613 u8
CARDbyGetPktType(struct vnt_private
*pDevice
)
616 if (pDevice
->byBBType
== BB_TYPE_11A
|| pDevice
->byBBType
== BB_TYPE_11B
) {
617 return (u8
)pDevice
->byBBType
;
619 else if (CARDbIsOFDMinBasicRate(pDevice
)) {
628 * Description: Calculate TSF offset of two TSF input
629 * Get TSF Offset from RxBCN's TSF and local TSF
633 * pDevice - The adapter to be sync.
634 * qwTSF1 - Rx BCN's TSF
639 * Return Value: TSF Offset value
642 u64
CARDqGetTSFOffset(u8 byRxRate
, u64 qwTSF1
, u64 qwTSF2
)
645 u16 wRxBcnTSFOffst
= 0;
647 wRxBcnTSFOffst
= cwRXBCNTSFOff
[byRxRate
% MAX_RATE
];
649 qwTSF2
+= (u64
)wRxBcnTSFOffst
;
651 qwTSFOffset
= qwTSF1
- qwTSF2
;
657 * Description: Sync. TSF counter to BSS
658 * Get TSF offset and write to HW
662 * pDevice - The adapter to be sync.
663 * qwBSSTimestamp - Rx BCN's TSF
664 * qwLocalTSF - Local TSF
671 void CARDvAdjustTSF(struct vnt_private
*pDevice
, u8 byRxRate
,
672 u64 qwBSSTimestamp
, u64 qwLocalTSF
)
677 qwTSFOffset
= CARDqGetTSFOffset(byRxRate
, qwBSSTimestamp
, qwLocalTSF
);
679 // HW's TSF add TSF Offset reg
681 pbyData
[0] = (u8
)qwTSFOffset
;
682 pbyData
[1] = (u8
)(qwTSFOffset
>> 8);
683 pbyData
[2] = (u8
)(qwTSFOffset
>> 16);
684 pbyData
[3] = (u8
)(qwTSFOffset
>> 24);
685 pbyData
[4] = (u8
)(qwTSFOffset
>> 32);
686 pbyData
[5] = (u8
)(qwTSFOffset
>> 40);
687 pbyData
[6] = (u8
)(qwTSFOffset
>> 48);
688 pbyData
[7] = (u8
)(qwTSFOffset
>> 56);
690 CONTROLnsRequestOut(pDevice
,
691 MESSAGE_TYPE_SET_TSFTBTT
,
700 * Description: Read NIC TSF counter
701 * Get local TSF counter
705 * pDevice - The adapter to be read
707 * qwCurrTSF - Current TSF counter
709 * Return Value: true if success; otherwise false
712 bool CARDbGetCurrentTSF(struct vnt_private
*pDevice
, u64
*pqwCurrTSF
)
715 *pqwCurrTSF
= pDevice
->qwCurrTSF
;
721 * Description: Clear NIC TSF counter
722 * Clear local TSF counter
726 * pDevice - The adapter to be read
728 * Return Value: true if success; otherwise false
731 bool CARDbClearCurrentTSF(struct vnt_private
*pDevice
)
734 MACvRegBitsOn(pDevice
, MAC_REG_TFTCTL
, TFTCTL_TSFCNTRST
);
736 pDevice
->qwCurrTSF
= 0;
742 * Description: Read NIC TSF counter
743 * Get NEXTTBTT from adjusted TSF and Beacon Interval
747 * qwTSF - Current TSF counter
748 * wbeaconInterval - Beacon Interval
750 * qwCurrTSF - Current TSF counter
752 * Return Value: TSF value of next Beacon
755 u64
CARDqGetNextTBTT(u64 qwTSF
, u16 wBeaconInterval
)
758 unsigned int uLowNextTBTT
;
759 unsigned int uHighRemain
, uLowRemain
;
760 unsigned int uBeaconInterval
;
762 uBeaconInterval
= wBeaconInterval
* 1024;
763 // Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval
764 uLowNextTBTT
= ((qwTSF
& 0xffffffffU
) >> 10) << 10;
765 uLowRemain
= (uLowNextTBTT
) % uBeaconInterval
;
766 uHighRemain
= ((0x80000000 % uBeaconInterval
) * 2 * (u32
)(qwTSF
>> 32))
768 uLowRemain
= (uHighRemain
+ uLowRemain
) % uBeaconInterval
;
769 uLowRemain
= uBeaconInterval
- uLowRemain
;
771 // check if carry when add one beacon interval
772 if ((~uLowNextTBTT
) < uLowRemain
)
773 qwTSF
= ((qwTSF
>> 32) + 1) << 32;
775 qwTSF
= (qwTSF
& 0xffffffff00000000ULL
) |
776 (u64
)(uLowNextTBTT
+ uLowRemain
);
782 * Description: Set NIC TSF counter for first Beacon time
783 * Get NEXTTBTT from adjusted TSF and Beacon Interval
788 * wBeaconInterval - Beacon Interval
795 void CARDvSetFirstNextTBTT(struct vnt_private
*pDevice
, u16 wBeaconInterval
)
800 CARDbClearCurrentTSF(pDevice
);
801 //CARDbGetCurrentTSF(pDevice, &qwNextTBTT); //Get Local TSF counter
802 qwNextTBTT
= CARDqGetNextTBTT(qwNextTBTT
, wBeaconInterval
);
805 pbyData
[0] = (u8
)qwNextTBTT
;
806 pbyData
[1] = (u8
)(qwNextTBTT
>> 8);
807 pbyData
[2] = (u8
)(qwNextTBTT
>> 16);
808 pbyData
[3] = (u8
)(qwNextTBTT
>> 24);
809 pbyData
[4] = (u8
)(qwNextTBTT
>> 32);
810 pbyData
[5] = (u8
)(qwNextTBTT
>> 40);
811 pbyData
[6] = (u8
)(qwNextTBTT
>> 48);
812 pbyData
[7] = (u8
)(qwNextTBTT
>> 56);
814 CONTROLnsRequestOut(pDevice
,
815 MESSAGE_TYPE_SET_TSFTBTT
,
816 MESSAGE_REQUEST_TBTT
,
826 * Description: Sync NIC TSF counter for Beacon time
827 * Get NEXTTBTT and write to HW
831 * pDevice - The adapter to be set
832 * qwTSF - Current TSF counter
833 * wBeaconInterval - Beacon Interval
840 void CARDvUpdateNextTBTT(struct vnt_private
*pDevice
, u64 qwTSF
,
845 qwTSF
= CARDqGetNextTBTT(qwTSF
, wBeaconInterval
);
849 pbyData
[0] = (u8
)qwTSF
;
850 pbyData
[1] = (u8
)(qwTSF
>> 8);
851 pbyData
[2] = (u8
)(qwTSF
>> 16);
852 pbyData
[3] = (u8
)(qwTSF
>> 24);
853 pbyData
[4] = (u8
)(qwTSF
>> 32);
854 pbyData
[5] = (u8
)(qwTSF
>> 40);
855 pbyData
[6] = (u8
)(qwTSF
>> 48);
856 pbyData
[7] = (u8
)(qwTSF
>> 56);
858 CONTROLnsRequestOut(pDevice
,
859 MESSAGE_TYPE_SET_TSFTBTT
,
860 MESSAGE_REQUEST_TBTT
,
866 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
867 "Card:Update Next TBTT[%8lx]\n", (unsigned long)qwTSF
);
873 * Description: Turn off Radio power
877 * pDevice - The adapter to be turned off
881 * Return Value: true if success; otherwise false
884 int CARDbRadioPowerOff(struct vnt_private
*pDevice
)
888 //if (pDevice->bRadioOff == true)
891 pDevice
->bRadioOff
= true;
893 switch (pDevice
->byRFType
) {
897 case RF_VT3226
: //RobertYu:20051111
899 case RF_VT3342A0
: //RobertYu:20060609
900 MACvRegBitsOff(pDevice
, MAC_REG_SOFTPWRCTL
, (SOFTPWRCTL_SWPE2
| SOFTPWRCTL_SWPE3
));
904 MACvRegBitsOff(pDevice
, MAC_REG_HOSTCR
, HOSTCR_RXON
);
906 BBvSetDeepSleep(pDevice
);
912 * Description: Turn on Radio power
916 * pDevice - The adapter to be turned on
920 * Return Value: true if success; otherwise false
923 int CARDbRadioPowerOn(struct vnt_private
*pDevice
)
927 if ((pDevice
->bHWRadioOff
== true) || (pDevice
->bRadioControlOff
== true)) {
931 //if (pDevice->bRadioOff == false)
934 pDevice
->bRadioOff
= false;
936 BBvExitDeepSleep(pDevice
);
938 MACvRegBitsOn(pDevice
, MAC_REG_HOSTCR
, HOSTCR_RXON
);
940 switch (pDevice
->byRFType
) {
944 case RF_VT3226
: //RobertYu:20051111
946 case RF_VT3342A0
: //RobertYu:20060609
947 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL
, (SOFTPWRCTL_SWPE2
| SOFTPWRCTL_SWPE3
));
954 void CARDvSetBSSMode(struct vnt_private
*pDevice
)
956 // Set BB and packet type at the same time.//{{RobertYu:20050222, AL7230 have two TX PA output, only connet to b/g now
957 // so in 11a mode need to set the MAC Reg0x4C to 11b/g mode to turn on PA
958 if( (pDevice
->byRFType
== RF_AIROHA7230
) && (pDevice
->byBBType
== BB_TYPE_11A
) )
960 MACvSetBBType(pDevice
, BB_TYPE_11G
);
964 MACvSetBBType(pDevice
, pDevice
->byBBType
);
966 pDevice
->byPacketType
= CARDbyGetPktType(pDevice
);
968 if (pDevice
->byBBType
== BB_TYPE_11A
) {
969 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x03);
970 } else if (pDevice
->byBBType
== BB_TYPE_11B
) {
971 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x02);
972 } else if (pDevice
->byBBType
== BB_TYPE_11G
) {
973 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x08);
977 CARDvSetRSPINF(pDevice
, (u8
)pDevice
->byBBType
);
979 if ( pDevice
->byBBType
== BB_TYPE_11A
) {
980 //request by Jack 2005-04-26
981 if (pDevice
->byRFType
== RF_AIROHA7230
) {
982 pDevice
->abyBBVGA
[0] = 0x20;
983 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, pDevice
->abyBBVGA
[0]);
985 pDevice
->abyBBVGA
[2] = 0x10;
986 pDevice
->abyBBVGA
[3] = 0x10;
988 //request by Jack 2005-04-26
989 if (pDevice
->byRFType
== RF_AIROHA7230
) {
990 pDevice
->abyBBVGA
[0] = 0x1C;
991 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, pDevice
->abyBBVGA
[0]);
993 pDevice
->abyBBVGA
[2] = 0x0;
994 pDevice
->abyBBVGA
[3] = 0x0;