1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
8 * Purpose: Implement functions to access baseband
15 * vnt_get_frame_time - Calculate data frame transmitting time
16 * vnt_get_phy_field - Calculate PhyLength, PhyService and Phy
17 * Signal parameter for baseband Tx
18 * vnt_vt3184_init - VIA VT3184 baseband chip init code
30 static u8 vnt_vt3184_agc
[] = {
31 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x06, 0x06,
32 0x08, 0x08, 0x0a, 0x0a, 0x0c, 0x0c, 0x0e, 0x0e, /* 0x0f */
33 0x10, 0x10, 0x12, 0x12, 0x14, 0x14, 0x16, 0x16,
34 0x18, 0x18, 0x1a, 0x1a, 0x1c, 0x1c, 0x1e, 0x1e, /* 0x1f */
35 0x20, 0x20, 0x22, 0x22, 0x24, 0x24, 0x26, 0x26,
36 0x28, 0x28, 0x2a, 0x2a, 0x2c, 0x2c, 0x2e, 0x2e, /* 0x2f */
37 0x30, 0x30, 0x32, 0x32, 0x34, 0x34, 0x36, 0x36,
38 0x38, 0x38, 0x3a, 0x3a, 0x3c, 0x3c, 0x3e, 0x3e /* 0x3f */
41 static u8 vnt_vt3184_al2230
[] = {
42 0x31, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
43 0x70, 0x45, 0x2a, 0x76, 0x00, 0x00, 0x80, 0x00, /* 0x0f */
44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
45 0x00, 0x00, 0x00, 0x8e, 0x0a, 0x00, 0x00, 0x00, /* 0x1f */
46 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
47 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x0c, /* 0x2f */
48 0x26, 0x5b, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa,
49 0xff, 0xff, 0x79, 0x00, 0x00, 0x0b, 0x48, 0x04, /* 0x3f */
50 0x00, 0x08, 0x00, 0x08, 0x08, 0x14, 0x05, 0x09,
51 0x00, 0x00, 0x00, 0x00, 0x09, 0x73, 0x00, 0xc5, /* 0x4f */
52 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5f */
54 0xe4, 0x80, 0x00, 0x00, 0x00, 0x00, 0x98, 0x0a,
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, /* 0x6f */
56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7f */
58 0x8c, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
59 0x08, 0x00, 0x1f, 0xb7, 0x88, 0x47, 0xaa, 0x00, /* 0x8f */
60 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb,
61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0x9f */
62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
63 0x18, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x18, /* 0xaf */
64 0x38, 0x30, 0x00, 0x00, 0xff, 0x0f, 0xe4, 0xe2,
65 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, /* 0xbf */
66 0x18, 0x20, 0x07, 0x18, 0xff, 0xff, 0x0e, 0x0a,
67 0x0e, 0x00, 0x82, 0xa7, 0x3c, 0x10, 0x30, 0x05, /* 0xcf */
68 0x40, 0x12, 0x00, 0x00, 0x10, 0x28, 0x80, 0x2a,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xdf */
70 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x12,
71 0x00, 0xf4, 0x00, 0xff, 0x79, 0x20, 0x30, 0x05, /* 0xef */
72 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xff */
76 /* {{RobertYu:20060515, new BB setting for VT3226D0 */
77 static u8 vnt_vt3184_vt3226d0
[] = {
78 0x31, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
79 0x70, 0x45, 0x2a, 0x76, 0x00, 0x00, 0x80, 0x00, /* 0x0f */
80 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
81 0x00, 0x00, 0x00, 0x8e, 0x0a, 0x00, 0x00, 0x00, /* 0x1f */
82 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
83 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x0c, /* 0x2f */
84 0x26, 0x5b, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa,
85 0xff, 0xff, 0x79, 0x00, 0x00, 0x0b, 0x48, 0x04, /* 0x3f */
86 0x00, 0x08, 0x00, 0x08, 0x08, 0x14, 0x05, 0x09,
87 0x00, 0x00, 0x00, 0x00, 0x09, 0x73, 0x00, 0xc5, /* 0x4f */
88 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5f */
90 0xe4, 0x80, 0x00, 0x00, 0x00, 0x00, 0x98, 0x0a,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, /* 0x6f */
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7f */
94 0x8c, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
95 0x08, 0x00, 0x1f, 0xb7, 0x88, 0x47, 0xaa, 0x00, /* 0x8f */
96 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0x9f */
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
99 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, /* 0xaf */
100 0x38, 0x30, 0x00, 0x00, 0xff, 0x0f, 0xe4, 0xe2,
101 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, /* 0xbf */
102 0x18, 0x20, 0x07, 0x18, 0xff, 0xff, 0x10, 0x0a,
103 0x0e, 0x00, 0x84, 0xa7, 0x3c, 0x10, 0x24, 0x05, /* 0xcf */
104 0x40, 0x12, 0x00, 0x00, 0x10, 0x28, 0x80, 0x2a,
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xdf */
106 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10,
107 0x00, 0xf4, 0x00, 0xff, 0x79, 0x20, 0x30, 0x08, /* 0xef */
108 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xff */
112 static const u16 vnt_frame_time
[MAX_RATE
] = {
113 10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216
117 * Description: Calculate data frame transmitting time
121 * preamble_type - Preamble Type
122 * pkt_type - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
123 * frame_length - Baseband Type
127 * Return Value: FrameTime
130 unsigned int vnt_get_frame_time(u8 preamble_type
, u8 pkt_type
,
131 unsigned int frame_length
, u16 tx_rate
)
133 unsigned int frame_time
;
134 unsigned int preamble
;
136 unsigned int rate
= 0;
138 if (tx_rate
> RATE_54M
)
141 rate
= (unsigned int)vnt_frame_time
[tx_rate
];
144 if (preamble_type
== 1)
149 frame_time
= (frame_length
* 80) / rate
;
150 tmp
= (frame_time
* rate
) / 80;
152 if (frame_length
!= tmp
)
155 return preamble
+ frame_time
;
157 frame_time
= (frame_length
* 8 + 22) / rate
;
158 tmp
= ((frame_time
* rate
) - 22) / 8;
160 if (frame_length
!= tmp
)
163 frame_time
= frame_time
* 4;
165 if (pkt_type
!= PK_TYPE_11A
)
167 return 20 + frame_time
;
171 * Description: Calculate Length, Service, and Signal fields of Phy for Tx
175 * priv - Device Structure
176 * frame_length - Tx Frame Length
179 * struct vnt_phy_field *phy
180 * - pointer to Phy Length field
181 * - pointer to Phy Service field
182 * - pointer to Phy Signal field
187 void vnt_get_phy_field(struct vnt_private
*priv
, u32 frame_length
,
188 u16 tx_rate
, u8 pkt_type
, struct vnt_phy_field
*phy
)
194 u8 preamble_type
= priv
->preamble_type
;
196 bit_count
= frame_length
* 8;
207 count
= bit_count
/ 2;
209 if (preamble_type
== 1)
216 count
= (bit_count
* 10) / 55;
217 tmp
= (count
* 55) / 10;
219 if (tmp
!= bit_count
)
222 if (preamble_type
== 1)
229 count
= bit_count
/ 11;
232 if (tmp
!= bit_count
) {
235 if ((bit_count
- tmp
) <= 3)
239 if (preamble_type
== 1)
246 if (pkt_type
== PK_TYPE_11A
)
253 if (pkt_type
== PK_TYPE_11A
)
260 if (pkt_type
== PK_TYPE_11A
)
267 if (pkt_type
== PK_TYPE_11A
)
274 if (pkt_type
== PK_TYPE_11A
)
281 if (pkt_type
== PK_TYPE_11A
)
288 if (pkt_type
== PK_TYPE_11A
)
295 if (pkt_type
== PK_TYPE_11A
)
301 if (pkt_type
== PK_TYPE_11A
)
308 if (pkt_type
== PK_TYPE_11B
) {
311 phy
->service
|= 0x80;
312 phy
->len
= cpu_to_le16((u16
)count
);
315 phy
->len
= cpu_to_le16((u16
)frame_length
);
320 * Description: Set Antenna mode
324 * priv - Device Structure
325 * antenna_mode - Antenna Mode
332 void vnt_set_antenna_mode(struct vnt_private
*priv
, u8 antenna_mode
)
334 switch (antenna_mode
) {
339 priv
->bb_rx_conf
&= 0xFC;
342 priv
->bb_rx_conf
&= 0xFE;
343 priv
->bb_rx_conf
|= 0x02;
347 vnt_control_out(priv
, MESSAGE_TYPE_SET_ANTMD
,
348 (u16
)antenna_mode
, 0, 0, NULL
);
352 * Description: Set Antenna mode
356 * pDevice - Device Structure
357 * byAntennaMode - Antenna Mode
365 int vnt_vt3184_init(struct vnt_private
*priv
)
375 status
= vnt_control_in(priv
, MESSAGE_TYPE_READ
, 0,
376 MESSAGE_REQUEST_EEPROM
, EEP_MAX_CONTEXT_SIZE
,
378 if (status
!= STATUS_SUCCESS
)
381 priv
->rf_type
= priv
->eeprom
[EEP_OFS_RFTYPE
];
383 dev_dbg(&priv
->usb
->dev
, "RF Type %d\n", priv
->rf_type
);
385 if ((priv
->rf_type
== RF_AL2230
) ||
386 (priv
->rf_type
== RF_AL2230S
)) {
387 priv
->bb_rx_conf
= vnt_vt3184_al2230
[10];
388 length
= sizeof(vnt_vt3184_al2230
);
389 addr
= vnt_vt3184_al2230
;
390 agc
= vnt_vt3184_agc
;
391 length_agc
= sizeof(vnt_vt3184_agc
);
393 priv
->bb_vga
[0] = 0x1C;
394 priv
->bb_vga
[1] = 0x10;
395 priv
->bb_vga
[2] = 0x0;
396 priv
->bb_vga
[3] = 0x0;
398 } else if (priv
->rf_type
== RF_AIROHA7230
) {
399 priv
->bb_rx_conf
= vnt_vt3184_al2230
[10];
400 length
= sizeof(vnt_vt3184_al2230
);
401 addr
= vnt_vt3184_al2230
;
402 agc
= vnt_vt3184_agc
;
403 length_agc
= sizeof(vnt_vt3184_agc
);
407 priv
->bb_vga
[0] = 0x1c;
408 priv
->bb_vga
[1] = 0x10;
409 priv
->bb_vga
[2] = 0x0;
410 priv
->bb_vga
[3] = 0x0;
412 } else if ((priv
->rf_type
== RF_VT3226
) ||
413 (priv
->rf_type
== RF_VT3226D0
)) {
414 priv
->bb_rx_conf
= vnt_vt3184_vt3226d0
[10];
415 length
= sizeof(vnt_vt3184_vt3226d0
);
416 addr
= vnt_vt3184_vt3226d0
;
417 agc
= vnt_vt3184_agc
;
418 length_agc
= sizeof(vnt_vt3184_agc
);
420 priv
->bb_vga
[0] = 0x20;
421 priv
->bb_vga
[1] = 0x10;
422 priv
->bb_vga
[2] = 0x0;
423 priv
->bb_vga
[3] = 0x0;
425 /* Fix VT3226 DFC system timing issue */
426 vnt_mac_reg_bits_on(priv
, MAC_REG_SOFTPWRCTL2
,
428 } else if (priv
->rf_type
== RF_VT3342A0
) {
429 priv
->bb_rx_conf
= vnt_vt3184_vt3226d0
[10];
430 length
= sizeof(vnt_vt3184_vt3226d0
);
431 addr
= vnt_vt3184_vt3226d0
;
432 agc
= vnt_vt3184_agc
;
433 length_agc
= sizeof(vnt_vt3184_agc
);
435 priv
->bb_vga
[0] = 0x20;
436 priv
->bb_vga
[1] = 0x10;
437 priv
->bb_vga
[2] = 0x0;
438 priv
->bb_vga
[3] = 0x0;
440 /* Fix VT3226 DFC system timing issue */
441 vnt_mac_reg_bits_on(priv
, MAC_REG_SOFTPWRCTL2
,
447 memcpy(array
, addr
, length
);
449 vnt_control_out(priv
, MESSAGE_TYPE_WRITE
, 0,
450 MESSAGE_REQUEST_BBREG
, length
, array
);
452 memcpy(array
, agc
, length_agc
);
454 vnt_control_out(priv
, MESSAGE_TYPE_WRITE
, 0,
455 MESSAGE_REQUEST_BBAGC
, length_agc
, array
);
457 if ((priv
->rf_type
== RF_VT3226
) ||
458 (priv
->rf_type
== RF_VT3342A0
)) {
459 vnt_control_out_u8(priv
, MESSAGE_REQUEST_MACREG
,
460 MAC_REG_ITRTMSET
, 0x23);
461 vnt_mac_reg_bits_on(priv
, MAC_REG_PAPEDELAY
, 0x01);
462 } else if (priv
->rf_type
== RF_VT3226D0
) {
463 vnt_control_out_u8(priv
, MESSAGE_REQUEST_MACREG
,
464 MAC_REG_ITRTMSET
, 0x11);
465 vnt_mac_reg_bits_on(priv
, MAC_REG_PAPEDELAY
, 0x01);
468 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x04, 0x7f);
469 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0d, 0x01);
471 vnt_rf_table_download(priv
);
473 /* Fix for TX USB resets from vendors driver */
474 vnt_control_in(priv
, MESSAGE_TYPE_READ
, USB_REG4
,
475 MESSAGE_REQUEST_MEM
, sizeof(data
), &data
);
479 vnt_control_out(priv
, MESSAGE_TYPE_WRITE
, USB_REG4
,
480 MESSAGE_REQUEST_MEM
, sizeof(data
), &data
);
486 * Description: Set ShortSlotTime mode
490 * priv - Device Structure
497 void vnt_set_short_slot_time(struct vnt_private
*priv
)
501 if (priv
->short_slot_time
)
502 priv
->bb_rx_conf
&= 0xdf;
504 priv
->bb_rx_conf
|= 0x20;
506 vnt_control_in_u8(priv
, MESSAGE_REQUEST_BBREG
, 0xe7, &bb_vga
);
508 if (bb_vga
== priv
->bb_vga
[0])
509 priv
->bb_rx_conf
|= 0x20;
511 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0a, priv
->bb_rx_conf
);
514 void vnt_set_vga_gain_offset(struct vnt_private
*priv
, u8 data
)
516 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0xE7, data
);
518 /* patch for 3253B0 Baseband with Cardbus module */
519 if (priv
->short_slot_time
)
520 priv
->bb_rx_conf
&= 0xdf; /* 1101 1111 */
522 priv
->bb_rx_conf
|= 0x20; /* 0010 0000 */
524 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0a, priv
->bb_rx_conf
);
528 * Description: vnt_set_deep_sleep
532 * priv - Device Structure
539 void vnt_set_deep_sleep(struct vnt_private
*priv
)
541 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0c, 0x17);/* CR12 */
542 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0d, 0xB9);/* CR13 */
545 void vnt_exit_deep_sleep(struct vnt_private
*priv
)
547 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0c, 0x00);/* CR12 */
548 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0x0d, 0x01);/* CR13 */
551 void vnt_update_pre_ed_threshold(struct vnt_private
*priv
, int scanning
)
553 u8 cr_201
= 0x0, cr_206
= 0x0;
554 u8 ed_inx
= priv
->bb_pre_ed_index
;
556 switch (priv
->rf_type
) {
560 if (scanning
) { /* Max sensitivity */
566 if (priv
->bb_pre_ed_rssi
<= 45) {
569 } else if (priv
->bb_pre_ed_rssi
<= 46) {
572 } else if (priv
->bb_pre_ed_rssi
<= 47) {
575 } else if (priv
->bb_pre_ed_rssi
<= 49) {
578 } else if (priv
->bb_pre_ed_rssi
<= 51) {
581 } else if (priv
->bb_pre_ed_rssi
<= 53) {
584 } else if (priv
->bb_pre_ed_rssi
<= 55) {
587 } else if (priv
->bb_pre_ed_rssi
<= 56) {
591 } else if (priv
->bb_pre_ed_rssi
<= 57) {
595 } else if (priv
->bb_pre_ed_rssi
<= 58) {
599 } else if (priv
->bb_pre_ed_rssi
<= 59) {
603 } else if (priv
->bb_pre_ed_rssi
<= 60) {
607 } else if (priv
->bb_pre_ed_rssi
<= 61) {
610 } else if (priv
->bb_pre_ed_rssi
<= 62) {
613 } else if (priv
->bb_pre_ed_rssi
<= 63) {
616 } else if (priv
->bb_pre_ed_rssi
<= 64) {
619 } else if (priv
->bb_pre_ed_rssi
<= 65) {
622 } else if (priv
->bb_pre_ed_rssi
<= 66) {
625 } else if (priv
->bb_pre_ed_rssi
<= 67) {
628 } else if (priv
->bb_pre_ed_rssi
<= 68) {
639 if (scanning
) { /* Max sensitivity */
645 if (priv
->bb_pre_ed_rssi
<= 41) {
648 } else if (priv
->bb_pre_ed_rssi
<= 42) {
651 } else if (priv
->bb_pre_ed_rssi
<= 43) {
654 } else if (priv
->bb_pre_ed_rssi
<= 45) {
657 } else if (priv
->bb_pre_ed_rssi
<= 47) {
660 } else if (priv
->bb_pre_ed_rssi
<= 49) {
663 } else if (priv
->bb_pre_ed_rssi
<= 51) {
666 } else if (priv
->bb_pre_ed_rssi
<= 53) {
669 } else if (priv
->bb_pre_ed_rssi
<= 55) {
673 } else if (priv
->bb_pre_ed_rssi
<= 56) {
677 } else if (priv
->bb_pre_ed_rssi
<= 57) {
681 } else if (priv
->bb_pre_ed_rssi
<= 58) {
685 } else if (priv
->bb_pre_ed_rssi
<= 59) {
689 } else if (priv
->bb_pre_ed_rssi
<= 60) {
692 } else if (priv
->bb_pre_ed_rssi
<= 61) {
695 } else if (priv
->bb_pre_ed_rssi
<= 62) {
698 } else if (priv
->bb_pre_ed_rssi
<= 63) {
701 } else if (priv
->bb_pre_ed_rssi
<= 64) {
704 } else if (priv
->bb_pre_ed_rssi
<= 65) {
707 } else if (priv
->bb_pre_ed_rssi
<= 66) {
710 } else if (priv
->bb_pre_ed_rssi
<= 67) {
713 } else if (priv
->bb_pre_ed_rssi
<= 68) {
723 if (scanning
) { /* need Max sensitivity */
729 if (priv
->bb_pre_ed_rssi
<= 41) {
732 } else if (priv
->bb_pre_ed_rssi
<= 42) {
735 } else if (priv
->bb_pre_ed_rssi
<= 43) {
738 } else if (priv
->bb_pre_ed_rssi
<= 45) {
741 } else if (priv
->bb_pre_ed_rssi
<= 47) {
744 } else if (priv
->bb_pre_ed_rssi
<= 49) {
747 } else if (priv
->bb_pre_ed_rssi
<= 51) {
750 } else if (priv
->bb_pre_ed_rssi
<= 53) {
753 } else if (priv
->bb_pre_ed_rssi
<= 55) {
757 } else if (priv
->bb_pre_ed_rssi
<= 56) {
761 } else if (priv
->bb_pre_ed_rssi
<= 57) {
765 } else if (priv
->bb_pre_ed_rssi
<= 58) {
769 } else if (priv
->bb_pre_ed_rssi
<= 59) {
773 } else if (priv
->bb_pre_ed_rssi
<= 60) {
776 } else if (priv
->bb_pre_ed_rssi
<= 61) {
779 } else if (priv
->bb_pre_ed_rssi
<= 62) {
782 } else if (priv
->bb_pre_ed_rssi
<= 63) {
785 } else if (priv
->bb_pre_ed_rssi
<= 64) {
788 } else if (priv
->bb_pre_ed_rssi
<= 65) {
791 } else if (priv
->bb_pre_ed_rssi
<= 66) {
801 if (ed_inx
== priv
->bb_pre_ed_index
&& !scanning
)
804 priv
->bb_pre_ed_index
= ed_inx
;
806 dev_dbg(&priv
->usb
->dev
, "%s bb_pre_ed_rssi %d\n",
807 __func__
, priv
->bb_pre_ed_rssi
);
809 if (!cr_201
&& !cr_206
)
812 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0xc9, cr_201
);
813 vnt_control_out_u8(priv
, MESSAGE_REQUEST_BBREG
, 0xce, cr_206
);