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 struct vnt_phy_field phy
[4];
323 u8 abyTxRate
[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; /* For OFDM */
324 u8 abyRsvTime
[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
329 BBvCalculateParameter(pDevice
, 14,
330 swGetCCKControlRate(pDevice
, RATE_1M
), PK_TYPE_11B
, &phy
[0]);
333 BBvCalculateParameter(pDevice
, 14,
334 swGetCCKControlRate(pDevice
, RATE_2M
), PK_TYPE_11B
, &phy
[1]);
337 BBvCalculateParameter(pDevice
, 14,
338 swGetCCKControlRate(pDevice
, RATE_5M
), PK_TYPE_11B
, &phy
[2]);
341 BBvCalculateParameter(pDevice
, 14,
342 swGetCCKControlRate(pDevice
, RATE_11M
), PK_TYPE_11B
, &phy
[3]);
345 CARDvCalculateOFDMRParameter (RATE_6M
,
351 CARDvCalculateOFDMRParameter (RATE_9M
,
357 CARDvCalculateOFDMRParameter (RATE_12M
,
363 CARDvCalculateOFDMRParameter (RATE_18M
,
369 CARDvCalculateOFDMRParameter (RATE_24M
,
375 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_36M
),
381 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_48M
),
387 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_54M
),
393 CARDvCalculateOFDMRParameter (swGetOFDMControlRate(pDevice
, RATE_54M
),
398 put_unaligned(phy
[0].len
, (u16
*)&abyData
[0]);
399 abyData
[2] = phy
[0].signal
;
400 abyData
[3] = phy
[0].service
;
402 put_unaligned(phy
[1].len
, (u16
*)&abyData
[4]);
403 abyData
[6] = phy
[1].signal
;
404 abyData
[7] = phy
[1].service
;
406 put_unaligned(phy
[2].len
, (u16
*)&abyData
[8]);
407 abyData
[10] = phy
[2].signal
;
408 abyData
[11] = phy
[2].service
;
410 put_unaligned(phy
[3].len
, (u16
*)&abyData
[12]);
411 abyData
[14] = phy
[3].signal
;
412 abyData
[15] = phy
[3].service
;
414 for (i
= 0; i
< 9; i
++) {
415 abyData
[16+i
*2] = abyTxRate
[i
];
416 abyData
[16+i
*2+1] = abyRsvTime
[i
];
419 CONTROLnsRequestOut(pDevice
,
422 MESSAGE_REQUEST_MACREG
,
429 * Description: Update IFS
433 * pDevice - The adapter to be set
437 * Return Value: None.
440 void vUpdateIFS(struct vnt_private
*pDevice
)
445 if (pDevice
->byPacketType
==PK_TYPE_11A
) {//0000 0000 0000 0000,11a
446 pDevice
->uSlot
= C_SLOT_SHORT
;
447 pDevice
->uSIFS
= C_SIFS_A
;
448 pDevice
->uDIFS
= C_SIFS_A
+ 2*C_SLOT_SHORT
;
449 pDevice
->uCwMin
= C_CWMIN_A
;
452 else if (pDevice
->byPacketType
==PK_TYPE_11B
) {//0000 0001 0000 0000,11b
453 pDevice
->uSlot
= C_SLOT_LONG
;
454 pDevice
->uSIFS
= C_SIFS_BG
;
455 pDevice
->uDIFS
= C_SIFS_BG
+ 2*C_SLOT_LONG
;
456 pDevice
->uCwMin
= C_CWMIN_B
;
459 else {// PK_TYPE_11GA & PK_TYPE_11GB
461 bool bOFDMRate
= false;
463 PWLAN_IE_SUPP_RATES pItemRates
= NULL
;
465 pDevice
->uSIFS
= C_SIFS_BG
;
466 if (pDevice
->bShortSlotTime
) {
467 pDevice
->uSlot
= C_SLOT_SHORT
;
469 pDevice
->uSlot
= C_SLOT_LONG
;
471 pDevice
->uDIFS
= C_SIFS_BG
+ 2*pDevice
->uSlot
;
473 pItemRates
= (PWLAN_IE_SUPP_RATES
)pDevice
->vnt_mgmt
.abyCurrSuppRates
;
474 for (ii
= 0; ii
< pItemRates
->len
; ii
++) {
475 byRate
= (u8
)(pItemRates
->abyRates
[ii
]&0x7F);
476 if (RATEwGetRateIdx(byRate
) > RATE_11M
) {
481 if (bOFDMRate
== false) {
482 pItemRates
= (PWLAN_IE_SUPP_RATES
)pDevice
->vnt_mgmt
483 .abyCurrExtSuppRates
;
484 for (ii
= 0; ii
< pItemRates
->len
; ii
++) {
485 byRate
= (u8
)(pItemRates
->abyRates
[ii
]&0x7F);
486 if (RATEwGetRateIdx(byRate
) > RATE_11M
) {
492 if (bOFDMRate
== true) {
493 pDevice
->uCwMin
= C_CWMIN_A
;
496 pDevice
->uCwMin
= C_CWMIN_B
;
501 pDevice
->uCwMax
= C_CWMAX
;
502 pDevice
->uEIFS
= C_EIFS
;
504 byData
[0] = (u8
)pDevice
->uSIFS
;
505 byData
[1] = (u8
)pDevice
->uDIFS
;
506 byData
[2] = (u8
)pDevice
->uEIFS
;
507 byData
[3] = (u8
)pDevice
->uSlot
;
508 CONTROLnsRequestOut(pDevice
,
511 MESSAGE_REQUEST_MACREG
,
515 byMaxMin
|= 0xA0;//1010 1111,C_CWMAX = 1023
516 CONTROLnsRequestOut(pDevice
,
519 MESSAGE_REQUEST_MACREG
,
524 void CARDvUpdateBasicTopRate(struct vnt_private
*pDevice
)
526 u8 byTopOFDM
= RATE_24M
, byTopCCK
= RATE_1M
;
529 //Determines the highest basic rate.
530 for (ii
= RATE_54M
; ii
>= RATE_6M
; ii
--) {
531 if ( (pDevice
->wBasicRate
) & ((u16
)(1<<ii
)) ) {
536 pDevice
->byTopOFDMBasicRate
= byTopOFDM
;
538 for (ii
= RATE_11M
;; ii
--) {
539 if ( (pDevice
->wBasicRate
) & ((u16
)(1<<ii
)) ) {
546 pDevice
->byTopCCKBasicRate
= byTopCCK
;
550 * Description: Set NIC Tx Basic Rate
554 * pDevice - The adapter to be set
555 * wBasicRate - Basic Rate to be set
559 * Return Value: true if succeeded; false if failed.
562 void CARDbAddBasicRate(struct vnt_private
*pDevice
, u16 wRateIdx
)
564 u16 wRate
= (1 << wRateIdx
);
566 pDevice
->wBasicRate
|= wRate
;
568 //Determines the highest basic rate.
569 CARDvUpdateBasicTopRate(pDevice
);
572 int CARDbIsOFDMinBasicRate(struct vnt_private
*pDevice
)
576 for (ii
= RATE_54M
; ii
>= RATE_6M
; ii
--) {
577 if ((pDevice
->wBasicRate
) & ((u16
)(1<<ii
)))
583 u8
CARDbyGetPktType(struct vnt_private
*pDevice
)
586 if (pDevice
->byBBType
== BB_TYPE_11A
|| pDevice
->byBBType
== BB_TYPE_11B
) {
587 return (u8
)pDevice
->byBBType
;
589 else if (CARDbIsOFDMinBasicRate(pDevice
)) {
598 * Description: Calculate TSF offset of two TSF input
599 * Get TSF Offset from RxBCN's TSF and local TSF
603 * pDevice - The adapter to be sync.
604 * qwTSF1 - Rx BCN's TSF
609 * Return Value: TSF Offset value
612 u64
CARDqGetTSFOffset(u8 byRxRate
, u64 qwTSF1
, u64 qwTSF2
)
615 u16 wRxBcnTSFOffst
= 0;
617 wRxBcnTSFOffst
= cwRXBCNTSFOff
[byRxRate
% MAX_RATE
];
619 qwTSF2
+= (u64
)wRxBcnTSFOffst
;
621 qwTSFOffset
= qwTSF1
- qwTSF2
;
627 * Description: Sync. TSF counter to BSS
628 * Get TSF offset and write to HW
632 * pDevice - The adapter to be sync.
633 * qwBSSTimestamp - Rx BCN's TSF
634 * qwLocalTSF - Local TSF
641 void CARDvAdjustTSF(struct vnt_private
*pDevice
, u8 byRxRate
,
642 u64 qwBSSTimestamp
, u64 qwLocalTSF
)
647 qwTSFOffset
= CARDqGetTSFOffset(byRxRate
, qwBSSTimestamp
, qwLocalTSF
);
649 // HW's TSF add TSF Offset reg
651 pbyData
[0] = (u8
)qwTSFOffset
;
652 pbyData
[1] = (u8
)(qwTSFOffset
>> 8);
653 pbyData
[2] = (u8
)(qwTSFOffset
>> 16);
654 pbyData
[3] = (u8
)(qwTSFOffset
>> 24);
655 pbyData
[4] = (u8
)(qwTSFOffset
>> 32);
656 pbyData
[5] = (u8
)(qwTSFOffset
>> 40);
657 pbyData
[6] = (u8
)(qwTSFOffset
>> 48);
658 pbyData
[7] = (u8
)(qwTSFOffset
>> 56);
660 CONTROLnsRequestOut(pDevice
,
661 MESSAGE_TYPE_SET_TSFTBTT
,
670 * Description: Read NIC TSF counter
671 * Get local TSF counter
675 * pDevice - The adapter to be read
677 * qwCurrTSF - Current TSF counter
679 * Return Value: true if success; otherwise false
682 bool CARDbGetCurrentTSF(struct vnt_private
*pDevice
, u64
*pqwCurrTSF
)
685 *pqwCurrTSF
= pDevice
->qwCurrTSF
;
691 * Description: Clear NIC TSF counter
692 * Clear local TSF counter
696 * pDevice - The adapter to be read
698 * Return Value: true if success; otherwise false
701 bool CARDbClearCurrentTSF(struct vnt_private
*pDevice
)
704 MACvRegBitsOn(pDevice
, MAC_REG_TFTCTL
, TFTCTL_TSFCNTRST
);
706 pDevice
->qwCurrTSF
= 0;
712 * Description: Read NIC TSF counter
713 * Get NEXTTBTT from adjusted TSF and Beacon Interval
717 * qwTSF - Current TSF counter
718 * wbeaconInterval - Beacon Interval
720 * qwCurrTSF - Current TSF counter
722 * Return Value: TSF value of next Beacon
725 u64
CARDqGetNextTBTT(u64 qwTSF
, u16 wBeaconInterval
)
728 unsigned int uLowNextTBTT
;
729 unsigned int uHighRemain
, uLowRemain
;
730 unsigned int uBeaconInterval
;
732 uBeaconInterval
= wBeaconInterval
* 1024;
733 // Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval
734 uLowNextTBTT
= ((qwTSF
& 0xffffffffULL
) >> 10) << 10;
735 uLowRemain
= (uLowNextTBTT
) % uBeaconInterval
;
736 uHighRemain
= ((0x80000000 % uBeaconInterval
) * 2 * (u32
)(qwTSF
>> 32))
738 uLowRemain
= (uHighRemain
+ uLowRemain
) % uBeaconInterval
;
739 uLowRemain
= uBeaconInterval
- uLowRemain
;
741 // check if carry when add one beacon interval
742 if ((~uLowNextTBTT
) < uLowRemain
)
743 qwTSF
= ((qwTSF
>> 32) + 1) << 32;
745 qwTSF
= (qwTSF
& 0xffffffff00000000ULL
) |
746 (u64
)(uLowNextTBTT
+ uLowRemain
);
752 * Description: Set NIC TSF counter for first Beacon time
753 * Get NEXTTBTT from adjusted TSF and Beacon Interval
758 * wBeaconInterval - Beacon Interval
765 void CARDvSetFirstNextTBTT(struct vnt_private
*pDevice
, u16 wBeaconInterval
)
770 CARDbClearCurrentTSF(pDevice
);
771 //CARDbGetCurrentTSF(pDevice, &qwNextTBTT); //Get Local TSF counter
772 qwNextTBTT
= CARDqGetNextTBTT(qwNextTBTT
, wBeaconInterval
);
775 pbyData
[0] = (u8
)qwNextTBTT
;
776 pbyData
[1] = (u8
)(qwNextTBTT
>> 8);
777 pbyData
[2] = (u8
)(qwNextTBTT
>> 16);
778 pbyData
[3] = (u8
)(qwNextTBTT
>> 24);
779 pbyData
[4] = (u8
)(qwNextTBTT
>> 32);
780 pbyData
[5] = (u8
)(qwNextTBTT
>> 40);
781 pbyData
[6] = (u8
)(qwNextTBTT
>> 48);
782 pbyData
[7] = (u8
)(qwNextTBTT
>> 56);
784 CONTROLnsRequestOut(pDevice
,
785 MESSAGE_TYPE_SET_TSFTBTT
,
786 MESSAGE_REQUEST_TBTT
,
796 * Description: Sync NIC TSF counter for Beacon time
797 * Get NEXTTBTT and write to HW
801 * pDevice - The adapter to be set
802 * qwTSF - Current TSF counter
803 * wBeaconInterval - Beacon Interval
810 void CARDvUpdateNextTBTT(struct vnt_private
*pDevice
, u64 qwTSF
,
815 qwTSF
= CARDqGetNextTBTT(qwTSF
, wBeaconInterval
);
819 pbyData
[0] = (u8
)qwTSF
;
820 pbyData
[1] = (u8
)(qwTSF
>> 8);
821 pbyData
[2] = (u8
)(qwTSF
>> 16);
822 pbyData
[3] = (u8
)(qwTSF
>> 24);
823 pbyData
[4] = (u8
)(qwTSF
>> 32);
824 pbyData
[5] = (u8
)(qwTSF
>> 40);
825 pbyData
[6] = (u8
)(qwTSF
>> 48);
826 pbyData
[7] = (u8
)(qwTSF
>> 56);
828 CONTROLnsRequestOut(pDevice
,
829 MESSAGE_TYPE_SET_TSFTBTT
,
830 MESSAGE_REQUEST_TBTT
,
836 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
837 "Card:Update Next TBTT[%8lx]\n", (unsigned long)qwTSF
);
843 * Description: Turn off Radio power
847 * pDevice - The adapter to be turned off
851 * Return Value: true if success; otherwise false
854 int CARDbRadioPowerOff(struct vnt_private
*pDevice
)
858 //if (pDevice->bRadioOff == true)
861 pDevice
->bRadioOff
= true;
863 switch (pDevice
->byRFType
) {
867 case RF_VT3226
: //RobertYu:20051111
869 case RF_VT3342A0
: //RobertYu:20060609
870 MACvRegBitsOff(pDevice
, MAC_REG_SOFTPWRCTL
, (SOFTPWRCTL_SWPE2
| SOFTPWRCTL_SWPE3
));
874 MACvRegBitsOff(pDevice
, MAC_REG_HOSTCR
, HOSTCR_RXON
);
876 BBvSetDeepSleep(pDevice
);
882 * Description: Turn on Radio power
886 * pDevice - The adapter to be turned on
890 * Return Value: true if success; otherwise false
893 int CARDbRadioPowerOn(struct vnt_private
*pDevice
)
897 if ((pDevice
->bHWRadioOff
== true) || (pDevice
->bRadioControlOff
== true)) {
901 //if (pDevice->bRadioOff == false)
904 pDevice
->bRadioOff
= false;
906 BBvExitDeepSleep(pDevice
);
908 MACvRegBitsOn(pDevice
, MAC_REG_HOSTCR
, HOSTCR_RXON
);
910 switch (pDevice
->byRFType
) {
914 case RF_VT3226
: //RobertYu:20051111
916 case RF_VT3342A0
: //RobertYu:20060609
917 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL
, (SOFTPWRCTL_SWPE2
| SOFTPWRCTL_SWPE3
));
924 void CARDvSetBSSMode(struct vnt_private
*pDevice
)
926 // Set BB and packet type at the same time.//{{RobertYu:20050222, AL7230 have two TX PA output, only connet to b/g now
927 // so in 11a mode need to set the MAC Reg0x4C to 11b/g mode to turn on PA
928 if( (pDevice
->byRFType
== RF_AIROHA7230
) && (pDevice
->byBBType
== BB_TYPE_11A
) )
930 MACvSetBBType(pDevice
, BB_TYPE_11G
);
934 MACvSetBBType(pDevice
, pDevice
->byBBType
);
936 pDevice
->byPacketType
= CARDbyGetPktType(pDevice
);
938 if (pDevice
->byBBType
== BB_TYPE_11A
) {
939 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x03);
940 } else if (pDevice
->byBBType
== BB_TYPE_11B
) {
941 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x02);
942 } else if (pDevice
->byBBType
== BB_TYPE_11G
) {
943 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x08);
947 CARDvSetRSPINF(pDevice
, (u8
)pDevice
->byBBType
);
949 if ( pDevice
->byBBType
== BB_TYPE_11A
) {
950 //request by Jack 2005-04-26
951 if (pDevice
->byRFType
== RF_AIROHA7230
) {
952 pDevice
->abyBBVGA
[0] = 0x20;
953 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, pDevice
->abyBBVGA
[0]);
955 pDevice
->abyBBVGA
[2] = 0x10;
956 pDevice
->abyBBVGA
[3] = 0x10;
958 //request by Jack 2005-04-26
959 if (pDevice
->byRFType
== RF_AIROHA7230
) {
960 pDevice
->abyBBVGA
[0] = 0x1C;
961 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, pDevice
->abyBBVGA
[0]);
963 pDevice
->abyBBVGA
[2] = 0x0;
964 pDevice
->abyBBVGA
[3] = 0x0;