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
) {
686 uRate
= (unsigned int)awcFrameTime
[uRateIdx
];
688 if (uRateIdx
<= 3) { //CCK mode
690 if (byPreambleType
== 1) {//Short
695 uFrameTime
= (cbFrameLength
* 80) / uRate
; //?????
696 uTmp
= (uFrameTime
* uRate
) / 80;
697 if (cbFrameLength
!= uTmp
) {
701 return (uPreamble
+ uFrameTime
);
704 uFrameTime
= (cbFrameLength
* 8 + 22) / uRate
; //????????
705 uTmp
= ((uFrameTime
* uRate
) - 22) / 8;
706 if(cbFrameLength
!= uTmp
) {
709 uFrameTime
= uFrameTime
* 4; //???????
710 if(byPktType
!= PK_TYPE_11A
) {
713 return (20 + uFrameTime
); //??????
718 * Description: Calculate Length, Service, and Signal fields of Phy for Tx
722 * pDevice - Device Structure
723 * cbFrameLength - Tx Frame Length
726 * struct vnt_phy_field *phy
727 * - pointer to Phy Length field
728 * - pointer to Phy Service field
729 * - pointer to Phy Signal field
734 void BBvCalculateParameter(struct vnt_private
*pDevice
, u32 cbFrameLength
,
735 u16 wRate
, u8 byPacketType
, struct vnt_phy_field
*phy
)
741 u8 byPreambleType
= pDevice
->byPreambleType
;
742 int bCCK
= pDevice
->bCCK
;
744 cbBitCount
= cbFrameLength
* 8;
749 cbUsCount
= cbBitCount
;
754 cbUsCount
= cbBitCount
/ 2;
755 if (byPreambleType
== 1)
757 else // long preamble
764 cbUsCount
= (cbBitCount
* 10) / 55;
765 cbTmp
= (cbUsCount
* 55) / 10;
766 if (cbTmp
!= cbBitCount
)
768 if (byPreambleType
== 1)
770 else // long preamble
778 cbUsCount
= cbBitCount
/ 11;
779 cbTmp
= cbUsCount
* 11;
780 if (cbTmp
!= cbBitCount
) {
782 if ((cbBitCount
- cbTmp
) <= 3)
785 if (byPreambleType
== 1)
787 else // long preamble
792 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
801 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
810 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
819 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
828 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
837 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
846 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
855 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
864 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
873 if (byPacketType
== PK_TYPE_11B
) {
876 phy
->service
|= 0x80;
877 phy
->len
= cpu_to_le16((u16
)cbUsCount
);
880 phy
->len
= cpu_to_le16((u16
)cbFrameLength
);
885 * Description: Set Antenna mode
889 * pDevice - Device Structure
890 * byAntennaMode - Antenna Mode
897 void BBvSetAntennaMode(struct vnt_private
*pDevice
, u8 byAntennaMode
)
899 switch (byAntennaMode
) {
904 pDevice
->byBBRxConf
&= 0xFC;
907 pDevice
->byBBRxConf
&= 0xFE;
908 pDevice
->byBBRxConf
|= 0x02;
912 CONTROLnsRequestOut(pDevice
,
913 MESSAGE_TYPE_SET_ANTMD
,
921 * Description: Set Antenna mode
925 * pDevice - Device Structure
926 * byAntennaMode - Antenna Mode
934 int BBbVT3184Init(struct vnt_private
*pDevice
)
944 ntStatus
= CONTROLnsRequestIn(pDevice
,
947 MESSAGE_REQUEST_EEPROM
,
948 EEP_MAX_CONTEXT_SIZE
,
950 if (ntStatus
!= STATUS_SUCCESS
) {
954 // if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
958 pDevice
->byOriginalZonetype
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
959 if(pDevice
->config_file
.ZoneType
>= 0) { //read zonetype file ok!
960 if ((pDevice
->config_file
.ZoneType
== 0)&&
961 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] !=0x00)){ //for USA
962 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0;
963 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0B;
964 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :USA\n");
966 else if((pDevice
->config_file
.ZoneType
== 1)&&
967 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x01)){ //for Japan
968 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x01;
969 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
970 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Japan\n");
972 else if((pDevice
->config_file
.ZoneType
== 2)&&
973 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x02)){ //for Europe
974 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x02;
975 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
976 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Europe\n");
979 if(pDevice
->config_file
.ZoneType
!=pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
])
980 printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice
->config_file
.ZoneType
,pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]);
982 printk("Read Zonetype file success,use default zonetype setting[%02x]\n",pDevice
->config_file
.ZoneType
);
986 if ( !pDevice
->bZoneRegExist
) {
987 pDevice
->byZoneType
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
989 pDevice
->byRFType
= pDevice
->abyEEPROM
[EEP_OFS_RFTYPE
];
991 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Zone Type %x\n", pDevice
->byZoneType
);
992 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"RF Type %d\n", pDevice
->byRFType
);
994 if ((pDevice
->byRFType
== RF_AL2230
) || (pDevice
->byRFType
== RF_AL2230S
)) {
995 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
996 wLength
= sizeof(abyVT3184_AL2230
);
997 pbyAddr
= abyVT3184_AL2230
;
998 pbyAgc
= abyVT3184_AGC
;
999 wLengthAgc
= sizeof(abyVT3184_AGC
);
1001 pDevice
->abyBBVGA
[0] = 0x1C;
1002 pDevice
->abyBBVGA
[1] = 0x10;
1003 pDevice
->abyBBVGA
[2] = 0x0;
1004 pDevice
->abyBBVGA
[3] = 0x0;
1005 pDevice
->ldBmThreshold
[0] = -70;
1006 pDevice
->ldBmThreshold
[1] = -48;
1007 pDevice
->ldBmThreshold
[2] = 0;
1008 pDevice
->ldBmThreshold
[3] = 0;
1010 else if (pDevice
->byRFType
== RF_AIROHA7230
) {
1011 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
1012 wLength
= sizeof(abyVT3184_AL2230
);
1013 pbyAddr
= abyVT3184_AL2230
;
1014 pbyAgc
= abyVT3184_AGC
;
1015 wLengthAgc
= sizeof(abyVT3184_AGC
);
1017 // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1018 //pbyAddr[0x09] = 0x41;
1019 // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1020 //pbyAddr[0x0a] = 0x28;
1021 // Select VC1/VC2, CR215 = 0x02->0x06
1022 pbyAddr
[0xd7] = 0x06;
1024 pDevice
->abyBBVGA
[0] = 0x1C;
1025 pDevice
->abyBBVGA
[1] = 0x10;
1026 pDevice
->abyBBVGA
[2] = 0x0;
1027 pDevice
->abyBBVGA
[3] = 0x0;
1028 pDevice
->ldBmThreshold
[0] = -70;
1029 pDevice
->ldBmThreshold
[1] = -48;
1030 pDevice
->ldBmThreshold
[2] = 0;
1031 pDevice
->ldBmThreshold
[3] = 0;
1033 else if ( (pDevice
->byRFType
== RF_VT3226
) || (pDevice
->byRFType
== RF_VT3226D0
) ) {
1034 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10]; //RobertYu:20060515
1035 wLength
= sizeof(abyVT3184_VT3226D0
); //RobertYu:20060515
1036 pbyAddr
= abyVT3184_VT3226D0
; //RobertYu:20060515
1037 pbyAgc
= abyVT3184_AGC
;
1038 wLengthAgc
= sizeof(abyVT3184_AGC
);
1040 pDevice
->abyBBVGA
[0] = 0x20; //RobertYu:20060104, reguest by Jack
1041 pDevice
->abyBBVGA
[1] = 0x10;
1042 pDevice
->abyBBVGA
[2] = 0x0;
1043 pDevice
->abyBBVGA
[3] = 0x0;
1044 pDevice
->ldBmThreshold
[0] = -70;
1045 pDevice
->ldBmThreshold
[1] = -48;
1046 pDevice
->ldBmThreshold
[2] = 0;
1047 pDevice
->ldBmThreshold
[3] = 0;
1048 // Fix VT3226 DFC system timing issue
1049 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1051 //{{RobertYu:20060609
1052 } else if ( (pDevice
->byRFType
== RF_VT3342A0
) ) {
1053 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10];
1054 wLength
= sizeof(abyVT3184_VT3226D0
);
1055 pbyAddr
= abyVT3184_VT3226D0
;
1056 pbyAgc
= abyVT3184_AGC
;
1057 wLengthAgc
= sizeof(abyVT3184_AGC
);
1059 pDevice
->abyBBVGA
[0] = 0x20;
1060 pDevice
->abyBBVGA
[1] = 0x10;
1061 pDevice
->abyBBVGA
[2] = 0x0;
1062 pDevice
->abyBBVGA
[3] = 0x0;
1063 pDevice
->ldBmThreshold
[0] = -70;
1064 pDevice
->ldBmThreshold
[1] = -48;
1065 pDevice
->ldBmThreshold
[2] = 0;
1066 pDevice
->ldBmThreshold
[3] = 0;
1067 // Fix VT3226 DFC system timing issue
1068 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1074 memcpy(abyArray
, pbyAddr
, wLength
);
1075 CONTROLnsRequestOut(pDevice
,
1078 MESSAGE_REQUEST_BBREG
,
1083 memcpy(abyArray
, pbyAgc
, wLengthAgc
);
1084 CONTROLnsRequestOut(pDevice
,
1087 MESSAGE_REQUEST_BBAGC
,
1092 if ((pDevice
->byRFType
== RF_VT3226
) || //RobertYu:20051116, 20060111 remove VT3226D0
1093 (pDevice
->byRFType
== RF_VT3342A0
) //RobertYu:20060609
1095 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x23);
1096 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1098 else if (pDevice
->byRFType
== RF_VT3226D0
)
1100 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x11);
1101 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1104 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x04,0x7F);
1105 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x0D,0x01);
1107 RFbRFTableDownload(pDevice
);
1109 /* Fix for TX USB resets from vendors driver */
1110 CONTROLnsRequestIn(pDevice
, MESSAGE_TYPE_READ
, USB_REG4
,
1111 MESSAGE_REQUEST_MEM
, sizeof(data
), &data
);
1115 CONTROLnsRequestOut(pDevice
, MESSAGE_TYPE_WRITE
, USB_REG4
,
1116 MESSAGE_REQUEST_MEM
, sizeof(data
), &data
);
1118 return true;//ntStatus;
1122 * Description: Set ShortSlotTime mode
1126 * pDevice - Device Structure
1130 * Return Value: none
1133 void BBvSetShortSlotTime(struct vnt_private
*pDevice
)
1137 if (pDevice
->bShortSlotTime
)
1138 pDevice
->byBBRxConf
&= 0xDF;//1101 1111
1140 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1142 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, &byBBVGA
);
1143 if (byBBVGA
== pDevice
->abyBBVGA
[0])
1144 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1146 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);
1149 void BBvSetVGAGainOffset(struct vnt_private
*pDevice
, u8 byData
)
1152 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, byData
);
1154 // patch for 3253B0 Baseband with Cardbus module
1155 if (pDevice
->bShortSlotTime
)
1156 pDevice
->byBBRxConf
&= 0xDF; /* 1101 1111 */
1158 pDevice
->byBBRxConf
|= 0x20; /* 0010 0000 */
1160 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);//CR10
1164 * Description: BBvSetDeepSleep
1168 * pDevice - Device Structure
1172 * Return Value: none
1175 void BBvSetDeepSleep(struct vnt_private
*pDevice
)
1177 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0c, 0x17);//CR12
1178 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0xB9);//CR13
1181 void BBvExitDeepSleep(struct vnt_private
*pDevice
)
1183 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0C, 0x00);//CR12
1184 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0x01);//CR13
1187 static unsigned long s_ulGetLowSQ3(struct vnt_private
*pDevice
)
1190 unsigned long ulSQ3
= 0;
1191 unsigned long ulMaxPacket
;
1193 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1194 if (pDevice
->aulPktNum
[RATE_54M
] != 0)
1195 ulSQ3
= pDevice
->aulSQ3Val
[RATE_54M
] / pDevice
->aulPktNum
[RATE_54M
];
1197 for (ii
= RATE_48M
; ii
>= RATE_6M
; ii
--)
1198 if (pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1199 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1200 ulSQ3
= pDevice
->aulSQ3Val
[ii
] / pDevice
->aulPktNum
[ii
];
1206 static unsigned long s_ulGetRatio(struct vnt_private
*pDevice
)
1209 unsigned long ulRatio
= 0;
1210 unsigned long ulMaxPacket
;
1211 unsigned long ulPacketNum
;
1213 //This is a thousand-ratio
1214 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1215 if ( pDevice
->aulPktNum
[RATE_54M
] != 0 ) {
1216 ulPacketNum
= pDevice
->aulPktNum
[RATE_54M
];
1217 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1218 ulRatio
+= TOP_RATE_54M
;
1220 for (ii
= RATE_48M
; ii
>= RATE_1M
; ii
--)
1221 if ( pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1223 for ( jj
=RATE_54M
;jj
>=ii
;jj
--)
1224 ulPacketNum
+= pDevice
->aulPktNum
[jj
];
1225 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1226 ulRatio
+= TOP_RATE_48M
;
1227 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1233 static void s_vClearSQ3Value(struct vnt_private
*pDevice
)
1236 pDevice
->uDiversityCnt
= 0;
1238 for ( ii
=RATE_1M
;ii
<MAX_RATE
;ii
++) {
1239 pDevice
->aulPktNum
[ii
] = 0;
1240 pDevice
->aulSQ3Val
[ii
] = 0;
1245 * Description: Antenna Diversity
1249 * pDevice - Device Structure
1250 * byRSR - RSR from received packet
1251 * bySQ3 - SQ3 value from received packet
1255 * Return Value: none
1259 void BBvAntennaDiversity(struct vnt_private
*pDevice
,
1260 u8 byRxRate
, u8 bySQ3
)
1263 pDevice
->uDiversityCnt
++;
1264 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"pDevice->uDiversityCnt = %d\n", (int)pDevice
->uDiversityCnt
);
1266 if (byRxRate
== 2) {
1267 pDevice
->aulPktNum
[RATE_1M
]++;
1269 else if (byRxRate
==4) {
1270 pDevice
->aulPktNum
[RATE_2M
]++;
1272 else if (byRxRate
==11) {
1273 pDevice
->aulPktNum
[RATE_5M
]++;
1275 else if (byRxRate
==22) {
1276 pDevice
->aulPktNum
[RATE_11M
]++;
1278 else if(byRxRate
==12){
1279 pDevice
->aulPktNum
[RATE_6M
]++;
1280 pDevice
->aulSQ3Val
[RATE_6M
] += bySQ3
;
1282 else if(byRxRate
==18){
1283 pDevice
->aulPktNum
[RATE_9M
]++;
1284 pDevice
->aulSQ3Val
[RATE_9M
] += bySQ3
;
1286 else if(byRxRate
==24){
1287 pDevice
->aulPktNum
[RATE_12M
]++;
1288 pDevice
->aulSQ3Val
[RATE_12M
] += bySQ3
;
1290 else if(byRxRate
==36){
1291 pDevice
->aulPktNum
[RATE_18M
]++;
1292 pDevice
->aulSQ3Val
[RATE_18M
] += bySQ3
;
1294 else if(byRxRate
==48){
1295 pDevice
->aulPktNum
[RATE_24M
]++;
1296 pDevice
->aulSQ3Val
[RATE_24M
] += bySQ3
;
1298 else if(byRxRate
==72){
1299 pDevice
->aulPktNum
[RATE_36M
]++;
1300 pDevice
->aulSQ3Val
[RATE_36M
] += bySQ3
;
1302 else if(byRxRate
==96){
1303 pDevice
->aulPktNum
[RATE_48M
]++;
1304 pDevice
->aulSQ3Val
[RATE_48M
] += bySQ3
;
1306 else if(byRxRate
==108){
1307 pDevice
->aulPktNum
[RATE_54M
]++;
1308 pDevice
->aulSQ3Val
[RATE_54M
] += bySQ3
;
1311 if (pDevice
->byAntennaState
== 0) {
1313 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityNValue
) {
1314 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ulDiversityNValue=[%d],54M-[%d]\n",(int)pDevice
->ulDiversityNValue
, (int)pDevice
->aulPktNum
[RATE_54M
]);
1316 pDevice
->ulSQ3_State0
= s_ulGetLowSQ3(pDevice
);
1317 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1318 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0, SQ3= [%08x] rate = [%08x]\n",(int)pDevice
->ulSQ3_State0
,(int)pDevice
->ulRatio_State0
);
1320 if ( ((pDevice
->aulPktNum
[RATE_54M
] < pDevice
->ulDiversityNValue
/2) &&
1321 (pDevice
->ulSQ3_State0
> pDevice
->ulSQ3TH
) ) ||
1322 (pDevice
->ulSQ3_State0
== 0 ) ) {
1324 if ( pDevice
->byTMax
== 0 )
1327 bScheduleCommand((void *) pDevice
,
1328 WLAN_CMD_CHANGE_ANTENNA
,
1331 pDevice
->byAntennaState
= 1;
1333 del_timer(&pDevice
->TimerSQ3Tmax3
);
1334 del_timer(&pDevice
->TimerSQ3Tmax2
);
1335 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1336 add_timer(&pDevice
->TimerSQ3Tmax1
);
1339 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1340 add_timer(&pDevice
->TimerSQ3Tmax3
);
1342 s_vClearSQ3Value(pDevice
);
1345 } else { //byAntennaState == 1
1347 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityMValue
) {
1349 del_timer(&pDevice
->TimerSQ3Tmax1
);
1350 pDevice
->ulSQ3_State1
= s_ulGetLowSQ3(pDevice
);
1351 pDevice
->ulRatio_State1
= s_ulGetRatio(pDevice
);
1352 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State1, rate0 = %08x,rate1 = %08x\n",(int)pDevice
->ulRatio_State0
,(int)pDevice
->ulRatio_State1
);
1354 if ( ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
!= 0)) ||
1355 ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
== 0) && (pDevice
->ulRatio_State1
< pDevice
->ulRatio_State0
)) ||
1356 ((pDevice
->ulSQ3_State1
!= 0) && (pDevice
->ulSQ3_State0
!= 0) && (pDevice
->ulSQ3_State0
< pDevice
->ulSQ3_State1
))
1359 bScheduleCommand((void *) pDevice
,
1360 WLAN_CMD_CHANGE_ANTENNA
,
1363 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1364 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1365 add_timer(&pDevice
->TimerSQ3Tmax3
);
1366 add_timer(&pDevice
->TimerSQ3Tmax2
);
1369 pDevice
->byAntennaState
= 0;
1370 s_vClearSQ3Value(pDevice
);
1378 * Timer for SQ3 antenna diversity
1383 * hDeviceContext - Pointer to the adapter
1389 * Return Value: none
1393 void TimerSQ3CallBack(struct vnt_private
*pDevice
)
1396 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3CallBack...");
1397 spin_lock_irq(&pDevice
->lock
);
1399 bScheduleCommand((void *) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1400 pDevice
->byAntennaState
= 0;
1401 s_vClearSQ3Value(pDevice
);
1402 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1403 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1404 add_timer(&pDevice
->TimerSQ3Tmax3
);
1405 add_timer(&pDevice
->TimerSQ3Tmax2
);
1407 spin_unlock_irq(&pDevice
->lock
);
1413 * Timer for SQ3 antenna diversity
1418 * hDeviceContext - Pointer to the adapter
1424 * Return Value: none
1428 void TimerSQ3Tmax3CallBack(struct vnt_private
*pDevice
)
1431 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3Tmax3CallBack...");
1432 spin_lock_irq(&pDevice
->lock
);
1434 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1435 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0 = [%08x]\n",(int)pDevice
->ulRatio_State0
);
1437 s_vClearSQ3Value(pDevice
);
1438 if ( pDevice
->byTMax
== 0 ) {
1439 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1440 add_timer(&pDevice
->TimerSQ3Tmax3
);
1441 spin_unlock_irq(&pDevice
->lock
);
1445 bScheduleCommand((void *) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1446 pDevice
->byAntennaState
= 1;
1447 del_timer(&pDevice
->TimerSQ3Tmax3
);
1448 del_timer(&pDevice
->TimerSQ3Tmax2
);
1449 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1450 add_timer(&pDevice
->TimerSQ3Tmax1
);
1452 spin_unlock_irq(&pDevice
->lock
);
1455 void BBvUpdatePreEDThreshold(struct vnt_private
*pDevice
, int bScanning
)
1458 switch(pDevice
->byRFType
)
1463 //RobertYu:20060627, update new table
1466 { // need Max sensitivity //RSSI -69, -70,....
1467 pDevice
->byBBPreEDIndex
= 0;
1468 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1469 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1470 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70, -71,...\n");
1474 if(pDevice
->byBBPreEDRSSI
<= 45) { // RSSI 0, -1,-2,....-45
1475 if(pDevice
->byBBPreEDIndex
== 20) break;
1476 pDevice
->byBBPreEDIndex
= 20;
1477 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1478 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1479 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-45\n");
1480 } else if(pDevice
->byBBPreEDRSSI
<= 46) { //RSSI -46
1481 if(pDevice
->byBBPreEDIndex
== 19) break;
1482 pDevice
->byBBPreEDIndex
= 19;
1483 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x1A); //CR201(0xC9)
1484 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1485 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46\n");
1486 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -47
1487 if(pDevice
->byBBPreEDIndex
== 18) break;
1488 pDevice
->byBBPreEDIndex
= 18;
1489 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x15); //CR201(0xC9)
1490 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1491 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -47\n");
1492 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1493 if(pDevice
->byBBPreEDIndex
== 17) break;
1494 pDevice
->byBBPreEDIndex
= 17;
1495 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0E); //CR201(0xC9)
1496 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1497 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1498 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1499 if(pDevice
->byBBPreEDIndex
== 16) break;
1500 pDevice
->byBBPreEDIndex
= 16;
1501 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x09); //CR201(0xC9)
1502 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1503 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1504 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1505 if(pDevice
->byBBPreEDIndex
== 15) break;
1506 pDevice
->byBBPreEDIndex
= 15;
1507 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x06); //CR201(0xC9)
1508 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1509 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1510 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1511 if(pDevice
->byBBPreEDIndex
== 14) break;
1512 pDevice
->byBBPreEDIndex
= 14;
1513 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x03); //CR201(0xC9)
1514 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1515 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1516 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1517 if(pDevice
->byBBPreEDIndex
== 13) break;
1518 pDevice
->byBBPreEDIndex
= 13;
1519 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1520 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1521 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1522 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1523 if(pDevice
->byBBPreEDIndex
== 12) break;
1524 pDevice
->byBBPreEDIndex
= 12;
1525 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1526 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x20); //CR206(0xCE)
1527 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1528 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1529 if(pDevice
->byBBPreEDIndex
== 11) break;
1530 pDevice
->byBBPreEDIndex
= 11;
1531 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1532 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1533 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1534 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1535 if(pDevice
->byBBPreEDIndex
== 10) break;
1536 pDevice
->byBBPreEDIndex
= 10;
1537 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1538 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x54); //CR206(0xCE)
1539 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1540 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1541 if(pDevice
->byBBPreEDIndex
== 9) break;
1542 pDevice
->byBBPreEDIndex
= 9;
1543 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1544 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x18); //CR206(0xCE)
1545 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1546 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1547 if(pDevice
->byBBPreEDIndex
== 8) break;
1548 pDevice
->byBBPreEDIndex
= 8;
1549 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1550 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xE3); //CR206(0xCE)
1551 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1552 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1553 if(pDevice
->byBBPreEDIndex
== 7) break;
1554 pDevice
->byBBPreEDIndex
= 7;
1555 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1556 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB9); //CR206(0xCE)
1557 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1558 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1559 if(pDevice
->byBBPreEDIndex
== 6) break;
1560 pDevice
->byBBPreEDIndex
= 6;
1561 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1562 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x93); //CR206(0xCE)
1563 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1564 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1565 if(pDevice
->byBBPreEDIndex
== 5) break;
1566 pDevice
->byBBPreEDIndex
= 5;
1567 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1568 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x79); //CR206(0xCE)
1569 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1570 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1571 if(pDevice
->byBBPreEDIndex
== 4) break;
1572 pDevice
->byBBPreEDIndex
= 4;
1573 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1574 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x62); //CR206(0xCE)
1575 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1576 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1577 if(pDevice
->byBBPreEDIndex
== 3) break;
1578 pDevice
->byBBPreEDIndex
= 3;
1579 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1580 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x51); //CR206(0xCE)
1581 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1582 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1583 if(pDevice
->byBBPreEDIndex
== 2) break;
1584 pDevice
->byBBPreEDIndex
= 2;
1585 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1586 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1587 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1588 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1589 if(pDevice
->byBBPreEDIndex
== 1) break;
1590 pDevice
->byBBPreEDIndex
= 1;
1591 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1592 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1593 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1594 } else { //RSSI -69, -70,....
1595 if(pDevice
->byBBPreEDIndex
== 0) break;
1596 pDevice
->byBBPreEDIndex
= 0;
1597 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1598 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1599 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,...\n");
1605 //RobertYu:20060627, update new table
1608 { // need Max sensitivity //RSSI -69, -70, ...
1609 pDevice
->byBBPreEDIndex
= 0;
1610 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1611 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1612 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1616 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1617 if(pDevice
->byBBPreEDIndex
== 22) break;
1618 pDevice
->byBBPreEDIndex
= 22;
1619 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1620 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1621 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1622 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1623 if(pDevice
->byBBPreEDIndex
== 21) break;
1624 pDevice
->byBBPreEDIndex
= 21;
1625 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1626 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1627 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1628 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1629 if(pDevice
->byBBPreEDIndex
== 20) break;
1630 pDevice
->byBBPreEDIndex
= 20;
1631 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1632 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1633 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1634 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1635 if(pDevice
->byBBPreEDIndex
== 19) break;
1636 pDevice
->byBBPreEDIndex
= 19;
1637 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1638 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1639 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1640 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1641 if(pDevice
->byBBPreEDIndex
== 18) break;
1642 pDevice
->byBBPreEDIndex
= 18;
1643 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
1644 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1645 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
1646 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1647 if(pDevice
->byBBPreEDIndex
== 17) break;
1648 pDevice
->byBBPreEDIndex
= 17;
1649 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
1650 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1651 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1652 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1653 if(pDevice
->byBBPreEDIndex
== 16) break;
1654 pDevice
->byBBPreEDIndex
= 16;
1655 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
1656 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1657 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1658 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1659 if(pDevice
->byBBPreEDIndex
== 15) break;
1660 pDevice
->byBBPreEDIndex
= 15;
1661 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
1662 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1663 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1664 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1665 if(pDevice
->byBBPreEDIndex
== 14) break;
1666 pDevice
->byBBPreEDIndex
= 14;
1667 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1668 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1669 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1670 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1671 if(pDevice
->byBBPreEDIndex
== 13) break;
1672 pDevice
->byBBPreEDIndex
= 13;
1673 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1674 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1675 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1676 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1677 if(pDevice
->byBBPreEDIndex
== 12) break;
1678 pDevice
->byBBPreEDIndex
= 12;
1679 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1680 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
1681 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1682 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1683 if(pDevice
->byBBPreEDIndex
== 11) break;
1684 pDevice
->byBBPreEDIndex
= 11;
1685 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1686 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
1687 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1688 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1689 if(pDevice
->byBBPreEDIndex
== 10) break;
1690 pDevice
->byBBPreEDIndex
= 10;
1691 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1692 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1693 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1694 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1695 if(pDevice
->byBBPreEDIndex
== 9) break;
1696 pDevice
->byBBPreEDIndex
= 9;
1697 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1698 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
1699 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1700 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1701 if(pDevice
->byBBPreEDIndex
== 8) break;
1702 pDevice
->byBBPreEDIndex
= 8;
1703 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1704 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1705 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1706 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1707 if(pDevice
->byBBPreEDIndex
== 7) break;
1708 pDevice
->byBBPreEDIndex
= 7;
1709 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1710 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
1711 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1712 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1713 if(pDevice
->byBBPreEDIndex
== 6) break;
1714 pDevice
->byBBPreEDIndex
= 6;
1715 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1716 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
1717 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1718 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1719 if(pDevice
->byBBPreEDIndex
== 5) break;
1720 pDevice
->byBBPreEDIndex
= 5;
1721 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1722 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
1723 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1724 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1725 if(pDevice
->byBBPreEDIndex
== 4) break;
1726 pDevice
->byBBPreEDIndex
= 4;
1727 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1728 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
1729 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1730 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1731 if(pDevice
->byBBPreEDIndex
== 3) break;
1732 pDevice
->byBBPreEDIndex
= 3;
1733 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1734 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1735 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1736 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1737 if(pDevice
->byBBPreEDIndex
== 2) break;
1738 pDevice
->byBBPreEDIndex
= 2;
1739 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1740 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1741 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1742 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1743 if(pDevice
->byBBPreEDIndex
== 1) break;
1744 pDevice
->byBBPreEDIndex
= 1;
1745 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1746 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x2D); //CR206(0xCE)
1747 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1748 } else { //RSSI -69, -70, ...
1749 if(pDevice
->byBBPreEDIndex
== 0) break;
1750 pDevice
->byBBPreEDIndex
= 0;
1751 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1752 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1753 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1757 case RF_VT3342A0
: //RobertYu:20060627, testing table
1759 { // need Max sensitivity //RSSI -67, -68, ...
1760 pDevice
->byBBPreEDIndex
= 0;
1761 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1762 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
1763 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");
1767 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1768 if(pDevice
->byBBPreEDIndex
== 20) break;
1769 pDevice
->byBBPreEDIndex
= 20;
1770 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1771 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1772 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1773 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1774 if(pDevice
->byBBPreEDIndex
== 19) break;
1775 pDevice
->byBBPreEDIndex
= 19;
1776 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1777 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1778 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1779 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1780 if(pDevice
->byBBPreEDIndex
== 18) break;
1781 pDevice
->byBBPreEDIndex
= 18;
1782 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1783 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1784 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1785 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1786 if(pDevice
->byBBPreEDIndex
== 17) break;
1787 pDevice
->byBBPreEDIndex
= 17;
1788 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1789 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1790 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1791 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1792 if(pDevice
->byBBPreEDIndex
== 16) break;
1793 pDevice
->byBBPreEDIndex
= 16;
1794 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
1795 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1796 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
1797 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1798 if(pDevice
->byBBPreEDIndex
== 15) break;
1799 pDevice
->byBBPreEDIndex
= 15;
1800 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
1801 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1802 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1803 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1804 if(pDevice
->byBBPreEDIndex
== 14) break;
1805 pDevice
->byBBPreEDIndex
= 14;
1806 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
1807 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1808 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1809 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1810 if(pDevice
->byBBPreEDIndex
== 13) break;
1811 pDevice
->byBBPreEDIndex
= 13;
1812 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
1813 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1814 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1815 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1816 if(pDevice
->byBBPreEDIndex
== 12) break;
1817 pDevice
->byBBPreEDIndex
= 12;
1818 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1819 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1820 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1821 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1822 if(pDevice
->byBBPreEDIndex
== 11) break;
1823 pDevice
->byBBPreEDIndex
= 11;
1824 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1825 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1826 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1827 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1828 if(pDevice
->byBBPreEDIndex
== 10) break;
1829 pDevice
->byBBPreEDIndex
= 10;
1830 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1831 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
1832 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1833 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1834 if(pDevice
->byBBPreEDIndex
== 9) break;
1835 pDevice
->byBBPreEDIndex
= 9;
1836 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1837 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
1838 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1839 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1840 if(pDevice
->byBBPreEDIndex
== 8) break;
1841 pDevice
->byBBPreEDIndex
= 8;
1842 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1843 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1844 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1845 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1846 if(pDevice
->byBBPreEDIndex
== 7) break;
1847 pDevice
->byBBPreEDIndex
= 7;
1848 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1849 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
1850 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1851 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1852 if(pDevice
->byBBPreEDIndex
== 6) break;
1853 pDevice
->byBBPreEDIndex
= 6;
1854 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1855 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1856 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1857 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1858 if(pDevice
->byBBPreEDIndex
== 5) break;
1859 pDevice
->byBBPreEDIndex
= 5;
1860 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1861 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
1862 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1863 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1864 if(pDevice
->byBBPreEDIndex
== 4) break;
1865 pDevice
->byBBPreEDIndex
= 4;
1866 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1867 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
1868 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1869 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1870 if(pDevice
->byBBPreEDIndex
== 3) break;
1871 pDevice
->byBBPreEDIndex
= 3;
1872 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1873 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
1874 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1875 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1876 if(pDevice
->byBBPreEDIndex
== 2) break;
1877 pDevice
->byBBPreEDIndex
= 2;
1878 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1879 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
1880 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1881 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1882 if(pDevice
->byBBPreEDIndex
== 1) break;
1883 pDevice
->byBBPreEDIndex
= 1;
1884 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1885 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1886 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1887 } else { //RSSI -67, -68, ...
1888 if(pDevice
->byBBPreEDIndex
== 0) break;
1889 pDevice
->byBBPreEDIndex
= 0;
1890 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1891 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
1892 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");