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.
22 * Purpose: Implement functions to access baseband
29 * BBuGetFrameTime - Calculate data frame transmitting time
30 * BBvCalculateParameter - Calculate PhyLength, PhyService and Phy Signal parameter for baseband Tx
31 * BBbVT3184Init - VIA VT3184 baseband chip init code
48 static int msglevel
=MSG_LEVEL_INFO
;
49 //static int msglevel =MSG_LEVEL_DEBUG;
51 u8 abyVT3184_AGC
[] = {
55 0x02, //3 //RobertYu:20060505, 0x04, //3
57 0x04, //5 //RobertYu:20060505, 0x06, //5
118 u8 abyVT3184_AL2230
[] = {
128 0x45,//tx //0x64 for FPGA
146 0x8e, //RobertYu:20060522, //0x8d,
147 0x0a, //RobertYu:20060515, //0x09,
166 0x0c, //RobertYu:20060522, //0x10,
199 0x00,//50 //RobertYu:20060505, //0x15,//50
208 0xd0, //RobertYu:20060505, //0xb0,
227 0x00, //0x80 for FPGA
257 0x1f, //RobertYu:20060516, //0x0f,
262 0x00, //RobertYu:20060505, //0x02,
263 0x20,//90 //RobertYu:20060505, //0x22,//90
292 0x15, //RobertYu:20060516, //0x00,
316 0xff, //RobertYu:20060509, //0x2c,
317 0x0e, //RobertYu:20060530, //0x0c,
320 0x00, //RobertYu:20060505, //0x01,
321 0x82, //RobertYu:20060516, //0x8f,
325 0x30, //RobertYu:20060627, //0x0b,
326 0x05, //RobertYu:20060516, //0x25,
344 0xf3, //RobertYu:20060516, //0xd3,
350 0x12, //RobertYu:20060627, //0x10,
358 0x05, //RobertYu:20060516, //0x0c,
377 //{{RobertYu:20060515, new BB setting for VT3226D0
378 u8 abyVT3184_VT3226D0
[] = {
388 0x45,//tx //0x64 for FPGA
406 0x8e, //RobertYu:20060525, //0x8d,
407 0x0a, //RobertYu:20060515, //0x09,
426 0x0c, //RobertYu:20060525, //0x10,
459 0x00,//50 //RobertYu:20060505, //0x15,//50
468 0xd0, //RobertYu:20060505, //0xb0,
487 0x00, //0x80 for FPGA
517 0x1f, //RobertYu:20060515, //0x0f,
522 0x00, //RobertYu:20060505, //0x02,
523 0x20,//90 //RobertYu:20060505, //0x22,//90
576 0xff, //RobertYu:20060509, //0x2c,
577 0x10, //RobertYu:20060525, //0x0c,
580 0x00, //RobertYu:20060505, //0x01,
581 0x84, //RobertYu:20060525, //0x8f,
585 0x24, //RobertYu:20060627, //0x18,
586 0x05, //RobertYu:20060515, //0x25,
604 0xf3, //RobertYu:20060515, //0xd3,
610 0x10, //RobertYu:20060627, //0x0e,
618 0x08, //RobertYu:20060515, //0x0c,
637 const u16 awcFrameTime
[MAX_RATE
] =
638 {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216};
643 s_ulGetLowSQ3(PSDevice pDevice);
647 s_ulGetRatio(PSDevice pDevice);
651 s_vClearSQ3Value(PSDevice pDevice);
655 * Description: Calculate data frame transmitting time
659 * byPreambleType - Preamble Type
660 * byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
661 * cbFrameLength - Baseband Type
665 * Return Value: FrameTime
672 unsigned int cbFrameLength
,
676 unsigned int uFrameTime
;
677 unsigned int uPreamble
;
679 unsigned int uRateIdx
= (unsigned int)wRate
;
680 unsigned int uRate
= 0;
682 if (uRateIdx
> RATE_54M
) {
687 uRate
= (unsigned int)awcFrameTime
[uRateIdx
];
689 if (uRateIdx
<= 3) { //CCK mode
691 if (byPreambleType
== 1) {//Short
696 uFrameTime
= (cbFrameLength
* 80) / uRate
; //?????
697 uTmp
= (uFrameTime
* uRate
) / 80;
698 if (cbFrameLength
!= uTmp
) {
702 return (uPreamble
+ uFrameTime
);
705 uFrameTime
= (cbFrameLength
* 8 + 22) / uRate
; //????????
706 uTmp
= ((uFrameTime
* uRate
) - 22) / 8;
707 if(cbFrameLength
!= uTmp
) {
710 uFrameTime
= uFrameTime
* 4; //???????
711 if(byPktType
!= PK_TYPE_11A
) {
714 return (20 + uFrameTime
); //??????
719 * Description: Calculate Length, Service, and Signal fields of Phy for Tx
723 * pDevice - Device Structure
724 * cbFrameLength - Tx Frame Length
727 * pwPhyLen - pointer to Phy Length field
728 * pbyPhySrv - pointer to Phy Service field
729 * pbyPhySgn - pointer to Phy Signal field
734 void BBvCalculateParameter(struct vnt_private
*pDevice
, u32 cbFrameLength
,
735 u16 wRate
, u8 byPacketType
, u16
*pwPhyLen
, u8
*pbyPhySrv
,
742 u8 byPreambleType
= pDevice
->byPreambleType
;
743 int bCCK
= pDevice
->bCCK
;
745 cbBitCount
= cbFrameLength
* 8;
750 cbUsCount
= cbBitCount
;
755 cbUsCount
= cbBitCount
/ 2;
756 if (byPreambleType
== 1)
758 else // long preamble
765 cbUsCount
= (cbBitCount
* 10) / 55;
766 cbTmp
= (cbUsCount
* 55) / 10;
767 if (cbTmp
!= cbBitCount
)
769 if (byPreambleType
== 1)
771 else // long preamble
779 cbUsCount
= cbBitCount
/ 11;
780 cbTmp
= cbUsCount
* 11;
781 if (cbTmp
!= cbBitCount
) {
783 if ((cbBitCount
- cbTmp
) <= 3)
786 if (byPreambleType
== 1)
788 else // long preamble
793 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
794 *pbyPhySgn
= 0x9B; //1001 1011
797 *pbyPhySgn
= 0x8B; //1000 1011
802 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
803 *pbyPhySgn
= 0x9F; //1001 1111
806 *pbyPhySgn
= 0x8F; //1000 1111
811 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
812 *pbyPhySgn
= 0x9A; //1001 1010
815 *pbyPhySgn
= 0x8A; //1000 1010
820 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
821 *pbyPhySgn
= 0x9E; //1001 1110
824 *pbyPhySgn
= 0x8E; //1000 1110
829 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
830 *pbyPhySgn
= 0x99; //1001 1001
833 *pbyPhySgn
= 0x89; //1000 1001
838 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
839 *pbyPhySgn
= 0x9D; //1001 1101
842 *pbyPhySgn
= 0x8D; //1000 1101
847 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
848 *pbyPhySgn
= 0x98; //1001 1000
851 *pbyPhySgn
= 0x88; //1000 1000
856 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
857 *pbyPhySgn
= 0x9C; //1001 1100
860 *pbyPhySgn
= 0x8C; //1000 1100
865 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
866 *pbyPhySgn
= 0x9C; //1001 1100
869 *pbyPhySgn
= 0x8C; //1000 1100
874 if (byPacketType
== PK_TYPE_11B
) {
877 *pbyPhySrv
= *pbyPhySrv
| 0x80;
878 *pwPhyLen
= (u16
) cbUsCount
;
882 *pwPhyLen
= (u16
)cbFrameLength
;
887 * Description: Set Antenna mode
891 * pDevice - Device Structure
892 * byAntennaMode - Antenna Mode
899 void BBvSetAntennaMode(struct vnt_private
*pDevice
, u8 byAntennaMode
)
901 switch (byAntennaMode
) {
906 pDevice
->byBBRxConf
&= 0xFC;
909 pDevice
->byBBRxConf
&= 0xFE;
910 pDevice
->byBBRxConf
|= 0x02;
914 CONTROLnsRequestOut(pDevice
,
915 MESSAGE_TYPE_SET_ANTMD
,
923 * Description: Set Antenna mode
927 * pDevice - Device Structure
928 * byAntennaMode - Antenna Mode
936 int BBbVT3184Init(struct vnt_private
*pDevice
)
945 ntStatus
= CONTROLnsRequestIn(pDevice
,
948 MESSAGE_REQUEST_EEPROM
,
949 EEP_MAX_CONTEXT_SIZE
,
951 if (ntStatus
!= STATUS_SUCCESS
) {
955 // if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
959 pDevice
->byOriginalZonetype
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
960 if(pDevice
->config_file
.ZoneType
>= 0) { //read zonetype file ok!
961 if ((pDevice
->config_file
.ZoneType
== 0)&&
962 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] !=0x00)){ //for USA
963 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0;
964 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0B;
965 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :USA\n");
967 else if((pDevice
->config_file
.ZoneType
== 1)&&
968 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x01)){ //for Japan
969 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x01;
970 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
971 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Japan\n");
973 else if((pDevice
->config_file
.ZoneType
== 2)&&
974 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x02)){ //for Europe
975 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x02;
976 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
977 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Europe\n");
980 if(pDevice
->config_file
.ZoneType
!=pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
])
981 printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice
->config_file
.ZoneType
,pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]);
983 printk("Read Zonetype file success,use default zonetype setting[%02x]\n",pDevice
->config_file
.ZoneType
);
987 if ( !pDevice
->bZoneRegExist
) {
988 pDevice
->byZoneType
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
990 pDevice
->byRFType
= pDevice
->abyEEPROM
[EEP_OFS_RFTYPE
];
992 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Zone Type %x\n", pDevice
->byZoneType
);
993 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"RF Type %d\n", pDevice
->byRFType
);
995 if ((pDevice
->byRFType
== RF_AL2230
) || (pDevice
->byRFType
== RF_AL2230S
)) {
996 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
997 wLength
= sizeof(abyVT3184_AL2230
);
998 pbyAddr
= abyVT3184_AL2230
;
999 pbyAgc
= abyVT3184_AGC
;
1000 wLengthAgc
= sizeof(abyVT3184_AGC
);
1002 pDevice
->abyBBVGA
[0] = 0x1C;
1003 pDevice
->abyBBVGA
[1] = 0x10;
1004 pDevice
->abyBBVGA
[2] = 0x0;
1005 pDevice
->abyBBVGA
[3] = 0x0;
1006 pDevice
->ldBmThreshold
[0] = -70;
1007 pDevice
->ldBmThreshold
[1] = -48;
1008 pDevice
->ldBmThreshold
[2] = 0;
1009 pDevice
->ldBmThreshold
[3] = 0;
1011 else if (pDevice
->byRFType
== RF_AIROHA7230
) {
1012 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
1013 wLength
= sizeof(abyVT3184_AL2230
);
1014 pbyAddr
= abyVT3184_AL2230
;
1015 pbyAgc
= abyVT3184_AGC
;
1016 wLengthAgc
= sizeof(abyVT3184_AGC
);
1018 // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1019 //pbyAddr[0x09] = 0x41;
1020 // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1021 //pbyAddr[0x0a] = 0x28;
1022 // Select VC1/VC2, CR215 = 0x02->0x06
1023 pbyAddr
[0xd7] = 0x06;
1025 pDevice
->abyBBVGA
[0] = 0x1C;
1026 pDevice
->abyBBVGA
[1] = 0x10;
1027 pDevice
->abyBBVGA
[2] = 0x0;
1028 pDevice
->abyBBVGA
[3] = 0x0;
1029 pDevice
->ldBmThreshold
[0] = -70;
1030 pDevice
->ldBmThreshold
[1] = -48;
1031 pDevice
->ldBmThreshold
[2] = 0;
1032 pDevice
->ldBmThreshold
[3] = 0;
1034 else if ( (pDevice
->byRFType
== RF_VT3226
) || (pDevice
->byRFType
== RF_VT3226D0
) ) {
1035 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10]; //RobertYu:20060515
1036 wLength
= sizeof(abyVT3184_VT3226D0
); //RobertYu:20060515
1037 pbyAddr
= abyVT3184_VT3226D0
; //RobertYu:20060515
1038 pbyAgc
= abyVT3184_AGC
;
1039 wLengthAgc
= sizeof(abyVT3184_AGC
);
1041 pDevice
->abyBBVGA
[0] = 0x20; //RobertYu:20060104, reguest by Jack
1042 pDevice
->abyBBVGA
[1] = 0x10;
1043 pDevice
->abyBBVGA
[2] = 0x0;
1044 pDevice
->abyBBVGA
[3] = 0x0;
1045 pDevice
->ldBmThreshold
[0] = -70;
1046 pDevice
->ldBmThreshold
[1] = -48;
1047 pDevice
->ldBmThreshold
[2] = 0;
1048 pDevice
->ldBmThreshold
[3] = 0;
1049 // Fix VT3226 DFC system timing issue
1050 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1052 //{{RobertYu:20060609
1053 } else if ( (pDevice
->byRFType
== RF_VT3342A0
) ) {
1054 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10];
1055 wLength
= sizeof(abyVT3184_VT3226D0
);
1056 pbyAddr
= abyVT3184_VT3226D0
;
1057 pbyAgc
= abyVT3184_AGC
;
1058 wLengthAgc
= sizeof(abyVT3184_AGC
);
1060 pDevice
->abyBBVGA
[0] = 0x20;
1061 pDevice
->abyBBVGA
[1] = 0x10;
1062 pDevice
->abyBBVGA
[2] = 0x0;
1063 pDevice
->abyBBVGA
[3] = 0x0;
1064 pDevice
->ldBmThreshold
[0] = -70;
1065 pDevice
->ldBmThreshold
[1] = -48;
1066 pDevice
->ldBmThreshold
[2] = 0;
1067 pDevice
->ldBmThreshold
[3] = 0;
1068 // Fix VT3226 DFC system timing issue
1069 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1075 memcpy(abyArray
, pbyAddr
, wLength
);
1076 CONTROLnsRequestOut(pDevice
,
1079 MESSAGE_REQUEST_BBREG
,
1084 memcpy(abyArray
, pbyAgc
, wLengthAgc
);
1085 CONTROLnsRequestOut(pDevice
,
1088 MESSAGE_REQUEST_BBAGC
,
1093 if ((pDevice
->byRFType
== RF_VT3226
) || //RobertYu:20051116, 20060111 remove VT3226D0
1094 (pDevice
->byRFType
== RF_VT3342A0
) //RobertYu:20060609
1096 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x23);
1097 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1099 else if (pDevice
->byRFType
== RF_VT3226D0
)
1101 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x11);
1102 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1105 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x04,0x7F);
1106 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x0D,0x01);
1108 RFbRFTableDownload(pDevice
);
1109 return true;//ntStatus;
1113 * Description: Set ShortSlotTime mode
1117 * pDevice - Device Structure
1121 * Return Value: none
1124 void BBvSetShortSlotTime(struct vnt_private
*pDevice
)
1128 if (pDevice
->bShortSlotTime
)
1129 pDevice
->byBBRxConf
&= 0xDF;//1101 1111
1131 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1133 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, &byBBVGA
);
1134 if (byBBVGA
== pDevice
->abyBBVGA
[0])
1135 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1137 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);
1140 void BBvSetVGAGainOffset(struct vnt_private
*pDevice
, u8 byData
)
1143 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, byData
);
1145 // patch for 3253B0 Baseband with Cardbus module
1146 if (pDevice
->bShortSlotTime
)
1147 pDevice
->byBBRxConf
&= 0xDF; /* 1101 1111 */
1149 pDevice
->byBBRxConf
|= 0x20; /* 0010 0000 */
1151 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);//CR10
1155 * Description: BBvSetDeepSleep
1159 * pDevice - Device Structure
1163 * Return Value: none
1166 void BBvSetDeepSleep(struct vnt_private
*pDevice
)
1168 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0c, 0x17);//CR12
1169 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0xB9);//CR13
1172 void BBvExitDeepSleep(struct vnt_private
*pDevice
)
1174 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0C, 0x00);//CR12
1175 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0x01);//CR13
1178 static unsigned long s_ulGetLowSQ3(struct vnt_private
*pDevice
)
1181 unsigned long ulSQ3
= 0;
1182 unsigned long ulMaxPacket
;
1184 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1185 if (pDevice
->aulPktNum
[RATE_54M
] != 0)
1186 ulSQ3
= pDevice
->aulSQ3Val
[RATE_54M
] / pDevice
->aulPktNum
[RATE_54M
];
1188 for (ii
= RATE_48M
; ii
>= RATE_6M
; ii
--)
1189 if (pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1190 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1191 ulSQ3
= pDevice
->aulSQ3Val
[ii
] / pDevice
->aulPktNum
[ii
];
1197 static unsigned long s_ulGetRatio(struct vnt_private
*pDevice
)
1200 unsigned long ulRatio
= 0;
1201 unsigned long ulMaxPacket
;
1202 unsigned long ulPacketNum
;
1204 //This is a thousand-ratio
1205 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1206 if ( pDevice
->aulPktNum
[RATE_54M
] != 0 ) {
1207 ulPacketNum
= pDevice
->aulPktNum
[RATE_54M
];
1208 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1209 ulRatio
+= TOP_RATE_54M
;
1211 for (ii
= RATE_48M
; ii
>= RATE_1M
; ii
--)
1212 if ( pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1214 for ( jj
=RATE_54M
;jj
>=ii
;jj
--)
1215 ulPacketNum
+= pDevice
->aulPktNum
[jj
];
1216 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1217 ulRatio
+= TOP_RATE_48M
;
1218 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1224 static void s_vClearSQ3Value(struct vnt_private
*pDevice
)
1227 pDevice
->uDiversityCnt
= 0;
1229 for ( ii
=RATE_1M
;ii
<MAX_RATE
;ii
++) {
1230 pDevice
->aulPktNum
[ii
] = 0;
1231 pDevice
->aulSQ3Val
[ii
] = 0;
1236 * Description: Antenna Diversity
1240 * pDevice - Device Structure
1241 * byRSR - RSR from received packet
1242 * bySQ3 - SQ3 value from received packet
1246 * Return Value: none
1250 void BBvAntennaDiversity(struct vnt_private
*pDevice
,
1251 u8 byRxRate
, u8 bySQ3
)
1254 pDevice
->uDiversityCnt
++;
1255 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"pDevice->uDiversityCnt = %d\n", (int)pDevice
->uDiversityCnt
);
1257 if (byRxRate
== 2) {
1258 pDevice
->aulPktNum
[RATE_1M
]++;
1260 else if (byRxRate
==4) {
1261 pDevice
->aulPktNum
[RATE_2M
]++;
1263 else if (byRxRate
==11) {
1264 pDevice
->aulPktNum
[RATE_5M
]++;
1266 else if (byRxRate
==22) {
1267 pDevice
->aulPktNum
[RATE_11M
]++;
1269 else if(byRxRate
==12){
1270 pDevice
->aulPktNum
[RATE_6M
]++;
1271 pDevice
->aulSQ3Val
[RATE_6M
] += bySQ3
;
1273 else if(byRxRate
==18){
1274 pDevice
->aulPktNum
[RATE_9M
]++;
1275 pDevice
->aulSQ3Val
[RATE_9M
] += bySQ3
;
1277 else if(byRxRate
==24){
1278 pDevice
->aulPktNum
[RATE_12M
]++;
1279 pDevice
->aulSQ3Val
[RATE_12M
] += bySQ3
;
1281 else if(byRxRate
==36){
1282 pDevice
->aulPktNum
[RATE_18M
]++;
1283 pDevice
->aulSQ3Val
[RATE_18M
] += bySQ3
;
1285 else if(byRxRate
==48){
1286 pDevice
->aulPktNum
[RATE_24M
]++;
1287 pDevice
->aulSQ3Val
[RATE_24M
] += bySQ3
;
1289 else if(byRxRate
==72){
1290 pDevice
->aulPktNum
[RATE_36M
]++;
1291 pDevice
->aulSQ3Val
[RATE_36M
] += bySQ3
;
1293 else if(byRxRate
==96){
1294 pDevice
->aulPktNum
[RATE_48M
]++;
1295 pDevice
->aulSQ3Val
[RATE_48M
] += bySQ3
;
1297 else if(byRxRate
==108){
1298 pDevice
->aulPktNum
[RATE_54M
]++;
1299 pDevice
->aulSQ3Val
[RATE_54M
] += bySQ3
;
1302 if (pDevice
->byAntennaState
== 0) {
1304 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityNValue
) {
1305 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ulDiversityNValue=[%d],54M-[%d]\n",(int)pDevice
->ulDiversityNValue
, (int)pDevice
->aulPktNum
[RATE_54M
]);
1307 pDevice
->ulSQ3_State0
= s_ulGetLowSQ3(pDevice
);
1308 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1309 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0, SQ3= [%08x] rate = [%08x]\n",(int)pDevice
->ulSQ3_State0
,(int)pDevice
->ulRatio_State0
);
1311 if ( ((pDevice
->aulPktNum
[RATE_54M
] < pDevice
->ulDiversityNValue
/2) &&
1312 (pDevice
->ulSQ3_State0
> pDevice
->ulSQ3TH
) ) ||
1313 (pDevice
->ulSQ3_State0
== 0 ) ) {
1315 if ( pDevice
->byTMax
== 0 )
1318 bScheduleCommand((void *) pDevice
,
1319 WLAN_CMD_CHANGE_ANTENNA
,
1322 pDevice
->byAntennaState
= 1;
1324 del_timer(&pDevice
->TimerSQ3Tmax3
);
1325 del_timer(&pDevice
->TimerSQ3Tmax2
);
1326 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1327 add_timer(&pDevice
->TimerSQ3Tmax1
);
1330 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1331 add_timer(&pDevice
->TimerSQ3Tmax3
);
1333 s_vClearSQ3Value(pDevice
);
1336 } else { //byAntennaState == 1
1338 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityMValue
) {
1340 del_timer(&pDevice
->TimerSQ3Tmax1
);
1341 pDevice
->ulSQ3_State1
= s_ulGetLowSQ3(pDevice
);
1342 pDevice
->ulRatio_State1
= s_ulGetRatio(pDevice
);
1343 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State1, rate0 = %08x,rate1 = %08x\n",(int)pDevice
->ulRatio_State0
,(int)pDevice
->ulRatio_State1
);
1345 if ( ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
!= 0)) ||
1346 ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
== 0) && (pDevice
->ulRatio_State1
< pDevice
->ulRatio_State0
)) ||
1347 ((pDevice
->ulSQ3_State1
!= 0) && (pDevice
->ulSQ3_State0
!= 0) && (pDevice
->ulSQ3_State0
< pDevice
->ulSQ3_State1
))
1350 bScheduleCommand((void *) pDevice
,
1351 WLAN_CMD_CHANGE_ANTENNA
,
1354 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1355 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1356 add_timer(&pDevice
->TimerSQ3Tmax3
);
1357 add_timer(&pDevice
->TimerSQ3Tmax2
);
1360 pDevice
->byAntennaState
= 0;
1361 s_vClearSQ3Value(pDevice
);
1369 * Timer for SQ3 antenna diversity
1374 * hDeviceContext - Pointer to the adapter
1380 * Return Value: none
1384 void TimerSQ3CallBack(struct vnt_private
*pDevice
)
1387 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3CallBack...");
1388 spin_lock_irq(&pDevice
->lock
);
1390 bScheduleCommand((void *) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1391 pDevice
->byAntennaState
= 0;
1392 s_vClearSQ3Value(pDevice
);
1393 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1394 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1395 add_timer(&pDevice
->TimerSQ3Tmax3
);
1396 add_timer(&pDevice
->TimerSQ3Tmax2
);
1398 spin_unlock_irq(&pDevice
->lock
);
1404 * Timer for SQ3 antenna diversity
1409 * hDeviceContext - Pointer to the adapter
1415 * Return Value: none
1419 void TimerSQ3Tmax3CallBack(struct vnt_private
*pDevice
)
1422 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3Tmax3CallBack...");
1423 spin_lock_irq(&pDevice
->lock
);
1425 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1426 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0 = [%08x]\n",(int)pDevice
->ulRatio_State0
);
1428 s_vClearSQ3Value(pDevice
);
1429 if ( pDevice
->byTMax
== 0 ) {
1430 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1431 add_timer(&pDevice
->TimerSQ3Tmax3
);
1432 spin_unlock_irq(&pDevice
->lock
);
1436 bScheduleCommand((void *) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1437 pDevice
->byAntennaState
= 1;
1438 del_timer(&pDevice
->TimerSQ3Tmax3
);
1439 del_timer(&pDevice
->TimerSQ3Tmax2
);
1440 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1441 add_timer(&pDevice
->TimerSQ3Tmax1
);
1443 spin_unlock_irq(&pDevice
->lock
);
1446 void BBvUpdatePreEDThreshold(struct vnt_private
*pDevice
, int bScanning
)
1449 switch(pDevice
->byRFType
)
1454 //RobertYu:20060627, update new table
1457 { // need Max sensitivity //RSSI -69, -70,....
1458 if(pDevice
->byBBPreEDIndex
== 0) break;
1459 pDevice
->byBBPreEDIndex
= 0;
1460 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1461 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1462 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70, -71,...\n");
1466 if(pDevice
->byBBPreEDRSSI
<= 45) { // RSSI 0, -1,-2,....-45
1467 if(pDevice
->byBBPreEDIndex
== 20) break;
1468 pDevice
->byBBPreEDIndex
= 20;
1469 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1470 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1471 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-45\n");
1472 } else if(pDevice
->byBBPreEDRSSI
<= 46) { //RSSI -46
1473 if(pDevice
->byBBPreEDIndex
== 19) break;
1474 pDevice
->byBBPreEDIndex
= 19;
1475 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x1A); //CR201(0xC9)
1476 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1477 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46\n");
1478 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -47
1479 if(pDevice
->byBBPreEDIndex
== 18) break;
1480 pDevice
->byBBPreEDIndex
= 18;
1481 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x15); //CR201(0xC9)
1482 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1483 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -47\n");
1484 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1485 if(pDevice
->byBBPreEDIndex
== 17) break;
1486 pDevice
->byBBPreEDIndex
= 17;
1487 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0E); //CR201(0xC9)
1488 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1489 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1490 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1491 if(pDevice
->byBBPreEDIndex
== 16) break;
1492 pDevice
->byBBPreEDIndex
= 16;
1493 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x09); //CR201(0xC9)
1494 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1495 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1496 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1497 if(pDevice
->byBBPreEDIndex
== 15) break;
1498 pDevice
->byBBPreEDIndex
= 15;
1499 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x06); //CR201(0xC9)
1500 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1501 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1502 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1503 if(pDevice
->byBBPreEDIndex
== 14) break;
1504 pDevice
->byBBPreEDIndex
= 14;
1505 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x03); //CR201(0xC9)
1506 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1507 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1508 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1509 if(pDevice
->byBBPreEDIndex
== 13) break;
1510 pDevice
->byBBPreEDIndex
= 13;
1511 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1512 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1513 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1514 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1515 if(pDevice
->byBBPreEDIndex
== 12) break;
1516 pDevice
->byBBPreEDIndex
= 12;
1517 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1518 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x20); //CR206(0xCE)
1519 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1520 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1521 if(pDevice
->byBBPreEDIndex
== 11) break;
1522 pDevice
->byBBPreEDIndex
= 11;
1523 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1524 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1525 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1526 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1527 if(pDevice
->byBBPreEDIndex
== 10) break;
1528 pDevice
->byBBPreEDIndex
= 10;
1529 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1530 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x54); //CR206(0xCE)
1531 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1532 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1533 if(pDevice
->byBBPreEDIndex
== 9) break;
1534 pDevice
->byBBPreEDIndex
= 9;
1535 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1536 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x18); //CR206(0xCE)
1537 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1538 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1539 if(pDevice
->byBBPreEDIndex
== 8) break;
1540 pDevice
->byBBPreEDIndex
= 8;
1541 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1542 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xE3); //CR206(0xCE)
1543 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1544 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1545 if(pDevice
->byBBPreEDIndex
== 7) break;
1546 pDevice
->byBBPreEDIndex
= 7;
1547 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1548 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB9); //CR206(0xCE)
1549 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1550 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1551 if(pDevice
->byBBPreEDIndex
== 6) break;
1552 pDevice
->byBBPreEDIndex
= 6;
1553 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1554 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x93); //CR206(0xCE)
1555 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1556 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1557 if(pDevice
->byBBPreEDIndex
== 5) break;
1558 pDevice
->byBBPreEDIndex
= 5;
1559 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1560 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x79); //CR206(0xCE)
1561 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1562 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1563 if(pDevice
->byBBPreEDIndex
== 4) break;
1564 pDevice
->byBBPreEDIndex
= 4;
1565 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1566 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x62); //CR206(0xCE)
1567 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1568 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1569 if(pDevice
->byBBPreEDIndex
== 3) break;
1570 pDevice
->byBBPreEDIndex
= 3;
1571 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1572 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x51); //CR206(0xCE)
1573 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1574 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1575 if(pDevice
->byBBPreEDIndex
== 2) break;
1576 pDevice
->byBBPreEDIndex
= 2;
1577 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1578 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1579 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1580 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1581 if(pDevice
->byBBPreEDIndex
== 1) break;
1582 pDevice
->byBBPreEDIndex
= 1;
1583 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1584 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1585 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1586 } else { //RSSI -69, -70,....
1587 if(pDevice
->byBBPreEDIndex
== 0) break;
1588 pDevice
->byBBPreEDIndex
= 0;
1589 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1590 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1591 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,...\n");
1597 //RobertYu:20060627, update new table
1600 { // need Max sensitivity //RSSI -69, -70, ...
1601 if(pDevice
->byBBPreEDIndex
== 0) break;
1602 pDevice
->byBBPreEDIndex
= 0;
1603 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1604 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1605 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1609 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1610 if(pDevice
->byBBPreEDIndex
== 22) break;
1611 pDevice
->byBBPreEDIndex
= 22;
1612 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1613 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1614 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1615 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1616 if(pDevice
->byBBPreEDIndex
== 21) break;
1617 pDevice
->byBBPreEDIndex
= 21;
1618 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1619 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1620 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1621 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1622 if(pDevice
->byBBPreEDIndex
== 20) break;
1623 pDevice
->byBBPreEDIndex
= 20;
1624 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1625 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1626 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1627 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1628 if(pDevice
->byBBPreEDIndex
== 19) break;
1629 pDevice
->byBBPreEDIndex
= 19;
1630 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1631 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1632 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1633 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1634 if(pDevice
->byBBPreEDIndex
== 18) break;
1635 pDevice
->byBBPreEDIndex
= 18;
1636 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
1637 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1638 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
1639 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1640 if(pDevice
->byBBPreEDIndex
== 17) break;
1641 pDevice
->byBBPreEDIndex
= 17;
1642 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
1643 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1644 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1645 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1646 if(pDevice
->byBBPreEDIndex
== 16) break;
1647 pDevice
->byBBPreEDIndex
= 16;
1648 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
1649 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1650 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1651 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1652 if(pDevice
->byBBPreEDIndex
== 15) break;
1653 pDevice
->byBBPreEDIndex
= 15;
1654 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
1655 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1656 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1657 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1658 if(pDevice
->byBBPreEDIndex
== 14) break;
1659 pDevice
->byBBPreEDIndex
= 14;
1660 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1661 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1662 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1663 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1664 if(pDevice
->byBBPreEDIndex
== 13) break;
1665 pDevice
->byBBPreEDIndex
= 13;
1666 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1667 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1668 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1669 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1670 if(pDevice
->byBBPreEDIndex
== 12) break;
1671 pDevice
->byBBPreEDIndex
= 12;
1672 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1673 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
1674 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1675 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1676 if(pDevice
->byBBPreEDIndex
== 11) break;
1677 pDevice
->byBBPreEDIndex
= 11;
1678 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1679 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
1680 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1681 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1682 if(pDevice
->byBBPreEDIndex
== 10) break;
1683 pDevice
->byBBPreEDIndex
= 10;
1684 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1685 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1686 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1687 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1688 if(pDevice
->byBBPreEDIndex
== 9) break;
1689 pDevice
->byBBPreEDIndex
= 9;
1690 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1691 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
1692 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1693 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1694 if(pDevice
->byBBPreEDIndex
== 8) break;
1695 pDevice
->byBBPreEDIndex
= 8;
1696 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1697 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1698 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1699 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1700 if(pDevice
->byBBPreEDIndex
== 7) break;
1701 pDevice
->byBBPreEDIndex
= 7;
1702 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1703 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
1704 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1705 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1706 if(pDevice
->byBBPreEDIndex
== 6) break;
1707 pDevice
->byBBPreEDIndex
= 6;
1708 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1709 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
1710 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1711 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1712 if(pDevice
->byBBPreEDIndex
== 5) break;
1713 pDevice
->byBBPreEDIndex
= 5;
1714 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1715 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
1716 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1717 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1718 if(pDevice
->byBBPreEDIndex
== 4) break;
1719 pDevice
->byBBPreEDIndex
= 4;
1720 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1721 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
1722 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1723 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1724 if(pDevice
->byBBPreEDIndex
== 3) break;
1725 pDevice
->byBBPreEDIndex
= 3;
1726 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1727 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1728 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1729 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1730 if(pDevice
->byBBPreEDIndex
== 2) break;
1731 pDevice
->byBBPreEDIndex
= 2;
1732 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1733 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1734 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1735 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1736 if(pDevice
->byBBPreEDIndex
== 1) break;
1737 pDevice
->byBBPreEDIndex
= 1;
1738 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1739 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x2D); //CR206(0xCE)
1740 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1741 } else { //RSSI -69, -70, ...
1742 if(pDevice
->byBBPreEDIndex
== 0) break;
1743 pDevice
->byBBPreEDIndex
= 0;
1744 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1745 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1746 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1750 case RF_VT3342A0
: //RobertYu:20060627, testing table
1752 { // need Max sensitivity //RSSI -67, -68, ...
1753 if(pDevice
->byBBPreEDIndex
== 0) break;
1754 pDevice
->byBBPreEDIndex
= 0;
1755 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1756 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
1757 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");
1761 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1762 if(pDevice
->byBBPreEDIndex
== 20) break;
1763 pDevice
->byBBPreEDIndex
= 20;
1764 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1765 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1766 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1767 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1768 if(pDevice
->byBBPreEDIndex
== 19) break;
1769 pDevice
->byBBPreEDIndex
= 19;
1770 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1771 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1772 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1773 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1774 if(pDevice
->byBBPreEDIndex
== 18) break;
1775 pDevice
->byBBPreEDIndex
= 18;
1776 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1777 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1778 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1779 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1780 if(pDevice
->byBBPreEDIndex
== 17) break;
1781 pDevice
->byBBPreEDIndex
= 17;
1782 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1783 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1784 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1785 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1786 if(pDevice
->byBBPreEDIndex
== 16) break;
1787 pDevice
->byBBPreEDIndex
= 16;
1788 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
1789 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1790 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
1791 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1792 if(pDevice
->byBBPreEDIndex
== 15) break;
1793 pDevice
->byBBPreEDIndex
= 15;
1794 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
1795 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1796 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1797 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1798 if(pDevice
->byBBPreEDIndex
== 14) break;
1799 pDevice
->byBBPreEDIndex
= 14;
1800 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
1801 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1802 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1803 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1804 if(pDevice
->byBBPreEDIndex
== 13) break;
1805 pDevice
->byBBPreEDIndex
= 13;
1806 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
1807 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1808 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1809 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1810 if(pDevice
->byBBPreEDIndex
== 12) break;
1811 pDevice
->byBBPreEDIndex
= 12;
1812 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1813 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1814 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1815 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1816 if(pDevice
->byBBPreEDIndex
== 11) break;
1817 pDevice
->byBBPreEDIndex
= 11;
1818 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1819 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1820 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1821 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1822 if(pDevice
->byBBPreEDIndex
== 10) break;
1823 pDevice
->byBBPreEDIndex
= 10;
1824 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1825 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
1826 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1827 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1828 if(pDevice
->byBBPreEDIndex
== 9) break;
1829 pDevice
->byBBPreEDIndex
= 9;
1830 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1831 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
1832 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1833 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1834 if(pDevice
->byBBPreEDIndex
== 8) break;
1835 pDevice
->byBBPreEDIndex
= 8;
1836 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1837 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1838 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1839 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1840 if(pDevice
->byBBPreEDIndex
== 7) break;
1841 pDevice
->byBBPreEDIndex
= 7;
1842 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1843 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
1844 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1845 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1846 if(pDevice
->byBBPreEDIndex
== 6) break;
1847 pDevice
->byBBPreEDIndex
= 6;
1848 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1849 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1850 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1851 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1852 if(pDevice
->byBBPreEDIndex
== 5) break;
1853 pDevice
->byBBPreEDIndex
= 5;
1854 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1855 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
1856 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1857 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1858 if(pDevice
->byBBPreEDIndex
== 4) break;
1859 pDevice
->byBBPreEDIndex
= 4;
1860 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1861 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
1862 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1863 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1864 if(pDevice
->byBBPreEDIndex
== 3) break;
1865 pDevice
->byBBPreEDIndex
= 3;
1866 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1867 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
1868 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1869 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1870 if(pDevice
->byBBPreEDIndex
== 2) break;
1871 pDevice
->byBBPreEDIndex
= 2;
1872 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1873 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
1874 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1875 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1876 if(pDevice
->byBBPreEDIndex
== 1) break;
1877 pDevice
->byBBPreEDIndex
= 1;
1878 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1879 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1880 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1881 } else { //RSSI -67, -68, ...
1882 if(pDevice
->byBBPreEDIndex
== 0) break;
1883 pDevice
->byBBPreEDIndex
= 0;
1884 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1885 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
1886 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");