irqchip/s3c24xx: Mark init_eint as __maybe_unused
[linux/fpc-iii.git] / drivers / staging / vt6656 / card.c
blob927243ebcb5641df7978a22939e309d4382b03b4
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
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.
19 * File: card.c
20 * Purpose: Provide functions to setup NIC operation mode
21 * Functions:
22 * vnt_set_rspinf - Set RSPINF
23 * vnt_update_ifs - Update slotTime,SIFS,DIFS, and EIFS
24 * vnt_update_top_rates - Update BasicTopRate
25 * vnt_add_basic_rate - Add to BasicRateSet
26 * vnt_ofdm_min_rate - Check if any OFDM rate is in BasicRateSet
27 * vnt_get_tsf_offset - Calculate TSFOffset
28 * vnt_get_current_tsf - Read Current NIC TSF counter
29 * vnt_get_next_tbtt - Calculate Next Beacon TSF counter
30 * vnt_reset_next_tbtt - Set NIC Beacon time
31 * vnt_update_next_tbtt - Sync. NIC Beacon time
32 * vnt_radio_power_off - Turn Off NIC Radio Power
33 * vnt_radio_power_on - Turn On NIC Radio Power
35 * Revision History:
36 * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
37 * 08-26-2003 Kyle Hsu: Modify the definition type of dwIoBase.
38 * 09-01-2003 Bryan YC Fan: Add vnt_update_ifs().
42 #include "device.h"
43 #include "card.h"
44 #include "baseband.h"
45 #include "mac.h"
46 #include "desc.h"
47 #include "rf.h"
48 #include "power.h"
49 #include "key.h"
50 #include "usbpipe.h"
52 /* const u16 cwRXBCNTSFOff[MAX_RATE] =
53 {17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3}; */
55 static const u16 cwRXBCNTSFOff[MAX_RATE] = {
56 192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3
60 * Description: Set NIC media channel
62 * Parameters:
63 * In:
64 * pDevice - The adapter to be set
65 * connection_channel - Channel to be set
66 * Out:
67 * none
69 void vnt_set_channel(struct vnt_private *priv, u32 connection_channel)
72 if (connection_channel > CB_MAX_CHANNEL || !connection_channel)
73 return;
75 /* clear NAV */
76 vnt_mac_reg_bits_on(priv, MAC_REG_MACCR, MACCR_CLRNAV);
78 /* Set Channel[7] = 0 to tell H/W channel is changing now. */
79 vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL, 0xb0);
81 vnt_control_out(priv, MESSAGE_TYPE_SELECT_CHANNEL,
82 connection_channel, 0, 0, NULL);
84 vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
85 (u8)(connection_channel | 0x80));
89 * Description: Get CCK mode basic rate
91 * Parameters:
92 * In:
93 * priv - The adapter to be set
94 * rate_idx - Receiving data rate
95 * Out:
96 * none
98 * Return Value: response Control frame rate
101 static u16 vnt_get_cck_rate(struct vnt_private *priv, u16 rate_idx)
103 u16 ui = rate_idx;
105 while (ui > RATE_1M) {
106 if (priv->basic_rates & (1 << ui))
107 return ui;
108 ui--;
111 return RATE_1M;
115 * Description: Get OFDM mode basic rate
117 * Parameters:
118 * In:
119 * priv - The adapter to be set
120 * rate_idx - Receiving data rate
121 * Out:
122 * none
124 * Return Value: response Control frame rate
127 static u16 vnt_get_ofdm_rate(struct vnt_private *priv, u16 rate_idx)
129 u16 ui = rate_idx;
131 dev_dbg(&priv->usb->dev, "%s basic rate: %d\n",
132 __func__, priv->basic_rates);
134 if (!vnt_ofdm_min_rate(priv)) {
135 dev_dbg(&priv->usb->dev, "%s (NO OFDM) %d\n",
136 __func__, rate_idx);
137 if (rate_idx > RATE_24M)
138 rate_idx = RATE_24M;
139 return rate_idx;
142 while (ui > RATE_11M) {
143 if (priv->basic_rates & (1 << ui)) {
144 dev_dbg(&priv->usb->dev, "%s rate: %d\n",
145 __func__, ui);
146 return ui;
148 ui--;
151 dev_dbg(&priv->usb->dev, "%s basic rate: 24M\n", __func__);
153 return RATE_24M;
157 * Description: Calculate TxRate and RsvTime fields for RSPINF in OFDM mode.
159 * Parameters:
160 * In:
161 * rate - Tx Rate
162 * bb_type - Tx Packet type
163 * Out:
164 * tx_rate - pointer to RSPINF TxRate field
165 * rsv_time- pointer to RSPINF RsvTime field
167 * Return Value: none
170 static void vnt_calculate_ofdm_rate(u16 rate, u8 bb_type,
171 u8 *tx_rate, u8 *rsv_time)
174 switch (rate) {
175 case RATE_6M:
176 if (bb_type == BB_TYPE_11A) {
177 *tx_rate = 0x9b;
178 *rsv_time = 24;
179 } else {
180 *tx_rate = 0x8b;
181 *rsv_time = 30;
183 break;
184 case RATE_9M:
185 if (bb_type == BB_TYPE_11A) {
186 *tx_rate = 0x9f;
187 *rsv_time = 16;
188 } else {
189 *tx_rate = 0x8f;
190 *rsv_time = 22;
192 break;
193 case RATE_12M:
194 if (bb_type == BB_TYPE_11A) {
195 *tx_rate = 0x9a;
196 *rsv_time = 12;
197 } else {
198 *tx_rate = 0x8a;
199 *rsv_time = 18;
201 break;
202 case RATE_18M:
203 if (bb_type == BB_TYPE_11A) {
204 *tx_rate = 0x9e;
205 *rsv_time = 8;
206 } else {
207 *tx_rate = 0x8e;
208 *rsv_time = 14;
210 break;
211 case RATE_36M:
212 if (bb_type == BB_TYPE_11A) {
213 *tx_rate = 0x9d;
214 *rsv_time = 4;
215 } else {
216 *tx_rate = 0x8d;
217 *rsv_time = 10;
219 break;
220 case RATE_48M:
221 if (bb_type == BB_TYPE_11A) {
222 *tx_rate = 0x98;
223 *rsv_time = 4;
224 } else {
225 *tx_rate = 0x88;
226 *rsv_time = 10;
228 break;
229 case RATE_54M:
230 if (bb_type == BB_TYPE_11A) {
231 *tx_rate = 0x9c;
232 *rsv_time = 4;
233 } else {
234 *tx_rate = 0x8c;
235 *rsv_time = 10;
237 break;
238 case RATE_24M:
239 default:
240 if (bb_type == BB_TYPE_11A) {
241 *tx_rate = 0x99;
242 *rsv_time = 8;
243 } else {
244 *tx_rate = 0x89;
245 *rsv_time = 14;
247 break;
252 * Description: Set RSPINF
254 * Parameters:
255 * In:
256 * pDevice - The adapter to be set
257 * Out:
258 * none
260 * Return Value: None.
264 void vnt_set_rspinf(struct vnt_private *priv, u8 bb_type)
266 struct vnt_phy_field phy[4];
267 u8 tx_rate[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; /* For OFDM */
268 u8 rsv_time[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
269 u8 data[34];
270 int i;
272 /*RSPINF_b_1*/
273 vnt_get_phy_field(priv, 14,
274 vnt_get_cck_rate(priv, RATE_1M), PK_TYPE_11B, &phy[0]);
276 /*RSPINF_b_2*/
277 vnt_get_phy_field(priv, 14,
278 vnt_get_cck_rate(priv, RATE_2M), PK_TYPE_11B, &phy[1]);
280 /*RSPINF_b_5*/
281 vnt_get_phy_field(priv, 14,
282 vnt_get_cck_rate(priv, RATE_5M), PK_TYPE_11B, &phy[2]);
284 /*RSPINF_b_11*/
285 vnt_get_phy_field(priv, 14,
286 vnt_get_cck_rate(priv, RATE_11M), PK_TYPE_11B, &phy[3]);
288 /*RSPINF_a_6*/
289 vnt_calculate_ofdm_rate(RATE_6M, bb_type, &tx_rate[0], &rsv_time[0]);
291 /*RSPINF_a_9*/
292 vnt_calculate_ofdm_rate(RATE_9M, bb_type, &tx_rate[1], &rsv_time[1]);
294 /*RSPINF_a_12*/
295 vnt_calculate_ofdm_rate(RATE_12M, bb_type, &tx_rate[2], &rsv_time[2]);
297 /*RSPINF_a_18*/
298 vnt_calculate_ofdm_rate(RATE_18M, bb_type, &tx_rate[3], &rsv_time[3]);
300 /*RSPINF_a_24*/
301 vnt_calculate_ofdm_rate(RATE_24M, bb_type, &tx_rate[4], &rsv_time[4]);
303 /*RSPINF_a_36*/
304 vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_36M),
305 bb_type, &tx_rate[5], &rsv_time[5]);
307 /*RSPINF_a_48*/
308 vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_48M),
309 bb_type, &tx_rate[6], &rsv_time[6]);
311 /*RSPINF_a_54*/
312 vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_54M),
313 bb_type, &tx_rate[7], &rsv_time[7]);
315 /*RSPINF_a_72*/
316 vnt_calculate_ofdm_rate(vnt_get_ofdm_rate(priv, RATE_54M),
317 bb_type, &tx_rate[8], &rsv_time[8]);
319 put_unaligned(phy[0].len, (u16 *)&data[0]);
320 data[2] = phy[0].signal;
321 data[3] = phy[0].service;
323 put_unaligned(phy[1].len, (u16 *)&data[4]);
324 data[6] = phy[1].signal;
325 data[7] = phy[1].service;
327 put_unaligned(phy[2].len, (u16 *)&data[8]);
328 data[10] = phy[2].signal;
329 data[11] = phy[2].service;
331 put_unaligned(phy[3].len, (u16 *)&data[12]);
332 data[14] = phy[3].signal;
333 data[15] = phy[3].service;
335 for (i = 0; i < 9; i++) {
336 data[16 + i * 2] = tx_rate[i];
337 data[16 + i * 2 + 1] = rsv_time[i];
340 vnt_control_out(priv, MESSAGE_TYPE_WRITE,
341 MAC_REG_RSPINF_B_1, MESSAGE_REQUEST_MACREG, 34, &data[0]);
345 * Description: Update IFS
347 * Parameters:
348 * In:
349 * priv - The adapter to be set
350 * Out:
351 * none
353 * Return Value: None.
356 void vnt_update_ifs(struct vnt_private *priv)
358 u8 max_min = 0;
359 u8 data[4];
361 if (priv->packet_type == PK_TYPE_11A) {
362 priv->slot = C_SLOT_SHORT;
363 priv->sifs = C_SIFS_A;
364 priv->difs = C_SIFS_A + 2 * C_SLOT_SHORT;
365 max_min = 4;
366 } else if (priv->packet_type == PK_TYPE_11B) {
367 priv->slot = C_SLOT_LONG;
368 priv->sifs = C_SIFS_BG;
369 priv->difs = C_SIFS_BG + 2 * C_SLOT_LONG;
370 max_min = 5;
371 } else {/* PK_TYPE_11GA & PK_TYPE_11GB */
372 bool ofdm_rate = false;
373 unsigned int ii = 0;
375 priv->sifs = C_SIFS_BG;
377 if (priv->short_slot_time)
378 priv->slot = C_SLOT_SHORT;
379 else
380 priv->slot = C_SLOT_LONG;
382 priv->difs = C_SIFS_BG + 2 * priv->slot;
384 for (ii = RATE_54M; ii >= RATE_6M; ii--) {
385 if (priv->basic_rates & ((u32)(0x1 << ii))) {
386 ofdm_rate = true;
387 break;
391 if (ofdm_rate)
392 max_min = 4;
393 else
394 max_min = 5;
397 priv->eifs = C_EIFS;
399 switch (priv->rf_type) {
400 case RF_VT3226D0:
401 if (priv->bb_type != BB_TYPE_11B) {
402 priv->sifs -= 1;
403 priv->difs -= 1;
404 break;
406 case RF_AIROHA7230:
407 case RF_AL2230:
408 case RF_AL2230S:
409 if (priv->bb_type != BB_TYPE_11B)
410 break;
411 case RF_RFMD2959:
412 case RF_VT3226:
413 case RF_VT3342A0:
414 priv->sifs -= 3;
415 priv->difs -= 3;
416 break;
417 case RF_MAXIM2829:
418 if (priv->bb_type == BB_TYPE_11A) {
419 priv->sifs -= 5;
420 priv->difs -= 5;
421 } else {
422 priv->sifs -= 2;
423 priv->difs -= 2;
426 break;
429 data[0] = (u8)priv->sifs;
430 data[1] = (u8)priv->difs;
431 data[2] = (u8)priv->eifs;
432 data[3] = (u8)priv->slot;
434 vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_SIFS,
435 MESSAGE_REQUEST_MACREG, 4, &data[0]);
437 max_min |= 0xa0;
439 vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_CWMAXMIN0,
440 MESSAGE_REQUEST_MACREG, 1, &max_min);
443 void vnt_update_top_rates(struct vnt_private *priv)
445 u8 top_ofdm = RATE_24M, top_cck = RATE_1M;
446 u8 i;
448 /*Determines the highest basic rate.*/
449 for (i = RATE_54M; i >= RATE_6M; i--) {
450 if (priv->basic_rates & (u16)(1 << i)) {
451 top_ofdm = i;
452 break;
456 priv->top_ofdm_basic_rate = top_ofdm;
458 for (i = RATE_11M;; i--) {
459 if (priv->basic_rates & (u16)(1 << i)) {
460 top_cck = i;
461 break;
463 if (i == RATE_1M)
464 break;
467 priv->top_cck_basic_rate = top_cck;
470 int vnt_ofdm_min_rate(struct vnt_private *priv)
472 int ii;
474 for (ii = RATE_54M; ii >= RATE_6M; ii--) {
475 if ((priv->basic_rates) & ((u16)BIT(ii)))
476 return true;
479 return false;
482 u8 vnt_get_pkt_type(struct vnt_private *priv)
485 if (priv->bb_type == BB_TYPE_11A || priv->bb_type == BB_TYPE_11B)
486 return (u8)priv->bb_type;
487 else if (vnt_ofdm_min_rate(priv))
488 return PK_TYPE_11GA;
489 return PK_TYPE_11GB;
493 * Description: Calculate TSF offset of two TSF input
494 * Get TSF Offset from RxBCN's TSF and local TSF
496 * Parameters:
497 * In:
498 * rx_rate - rx rate.
499 * tsf1 - Rx BCN's TSF
500 * tsf2 - Local TSF
501 * Out:
502 * none
504 * Return Value: TSF Offset value
507 u64 vnt_get_tsf_offset(u8 rx_rate, u64 tsf1, u64 tsf2)
509 u64 tsf_offset = 0;
510 u16 rx_bcn_offset;
512 rx_bcn_offset = cwRXBCNTSFOff[rx_rate % MAX_RATE];
514 tsf2 += (u64)rx_bcn_offset;
516 tsf_offset = tsf1 - tsf2;
518 return tsf_offset;
522 * Description: Sync. TSF counter to BSS
523 * Get TSF offset and write to HW
525 * Parameters:
526 * In:
527 * priv - The adapter to be sync.
528 * time_stamp - Rx BCN's TSF
529 * local_tsf - Local TSF
530 * Out:
531 * none
533 * Return Value: none
536 void vnt_adjust_tsf(struct vnt_private *priv, u8 rx_rate,
537 u64 time_stamp, u64 local_tsf)
539 u64 tsf_offset = 0;
540 u8 data[8];
542 tsf_offset = vnt_get_tsf_offset(rx_rate, time_stamp, local_tsf);
544 data[0] = (u8)tsf_offset;
545 data[1] = (u8)(tsf_offset >> 8);
546 data[2] = (u8)(tsf_offset >> 16);
547 data[3] = (u8)(tsf_offset >> 24);
548 data[4] = (u8)(tsf_offset >> 32);
549 data[5] = (u8)(tsf_offset >> 40);
550 data[6] = (u8)(tsf_offset >> 48);
551 data[7] = (u8)(tsf_offset >> 56);
553 vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
554 MESSAGE_REQUEST_TSF, 0, 8, data);
557 * Description: Read NIC TSF counter
558 * Get local TSF counter
560 * Parameters:
561 * In:
562 * priv - The adapter to be read
563 * Out:
564 * current_tsf - Current TSF counter
566 * Return Value: true if success; otherwise false
569 bool vnt_get_current_tsf(struct vnt_private *priv, u64 *current_tsf)
572 *current_tsf = priv->current_tsf;
574 return true;
578 * Description: Clear NIC TSF counter
579 * Clear local TSF counter
581 * Parameters:
582 * In:
583 * priv - The adapter to be read
585 * Return Value: true if success; otherwise false
588 bool vnt_clear_current_tsf(struct vnt_private *priv)
591 vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
593 priv->current_tsf = 0;
595 return true;
599 * Description: Read NIC TSF counter
600 * Get NEXTTBTT from adjusted TSF and Beacon Interval
602 * Parameters:
603 * In:
604 * tsf - Current TSF counter
605 * beacon_interval - Beacon Interval
606 * Out:
607 * tsf - Current TSF counter
609 * Return Value: TSF value of next Beacon
612 u64 vnt_get_next_tbtt(u64 tsf, u16 beacon_interval)
614 u32 beacon_int;
616 beacon_int = beacon_interval * 1024;
618 /* Next TBTT =
619 * ((local_current_TSF / beacon_interval) + 1) * beacon_interval
621 if (beacon_int) {
622 do_div(tsf, beacon_int);
623 tsf += 1;
624 tsf *= beacon_int;
627 return tsf;
631 * Description: Set NIC TSF counter for first Beacon time
632 * Get NEXTTBTT from adjusted TSF and Beacon Interval
634 * Parameters:
635 * In:
636 * dwIoBase - IO Base
637 * beacon_interval - Beacon Interval
638 * Out:
639 * none
641 * Return Value: none
644 void vnt_reset_next_tbtt(struct vnt_private *priv, u16 beacon_interval)
646 u64 next_tbtt = 0;
647 u8 data[8];
649 vnt_clear_current_tsf(priv);
651 next_tbtt = vnt_get_next_tbtt(next_tbtt, beacon_interval);
653 data[0] = (u8)next_tbtt;
654 data[1] = (u8)(next_tbtt >> 8);
655 data[2] = (u8)(next_tbtt >> 16);
656 data[3] = (u8)(next_tbtt >> 24);
657 data[4] = (u8)(next_tbtt >> 32);
658 data[5] = (u8)(next_tbtt >> 40);
659 data[6] = (u8)(next_tbtt >> 48);
660 data[7] = (u8)(next_tbtt >> 56);
662 vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
663 MESSAGE_REQUEST_TBTT, 0, 8, data);
667 * Description: Sync NIC TSF counter for Beacon time
668 * Get NEXTTBTT and write to HW
670 * Parameters:
671 * In:
672 * priv - The adapter to be set
673 * tsf - Current TSF counter
674 * beacon_interval - Beacon Interval
675 * Out:
676 * none
678 * Return Value: none
681 void vnt_update_next_tbtt(struct vnt_private *priv, u64 tsf,
682 u16 beacon_interval)
684 u8 data[8];
686 tsf = vnt_get_next_tbtt(tsf, beacon_interval);
688 data[0] = (u8)tsf;
689 data[1] = (u8)(tsf >> 8);
690 data[2] = (u8)(tsf >> 16);
691 data[3] = (u8)(tsf >> 24);
692 data[4] = (u8)(tsf >> 32);
693 data[5] = (u8)(tsf >> 40);
694 data[6] = (u8)(tsf >> 48);
695 data[7] = (u8)(tsf >> 56);
697 vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
698 MESSAGE_REQUEST_TBTT, 0, 8, data);
700 dev_dbg(&priv->usb->dev, "%s TBTT: %8llx\n", __func__, tsf);
704 * Description: Turn off Radio power
706 * Parameters:
707 * In:
708 * priv - The adapter to be turned off
709 * Out:
710 * none
712 * Return Value: true if success; otherwise false
715 int vnt_radio_power_off(struct vnt_private *priv)
717 int ret = true;
719 switch (priv->rf_type) {
720 case RF_AL2230:
721 case RF_AL2230S:
722 case RF_AIROHA7230:
723 case RF_VT3226:
724 case RF_VT3226D0:
725 case RF_VT3342A0:
726 vnt_mac_reg_bits_off(priv, MAC_REG_SOFTPWRCTL,
727 (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
728 break;
731 vnt_mac_reg_bits_off(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
733 vnt_set_deep_sleep(priv);
735 vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
737 return ret;
741 * Description: Turn on Radio power
743 * Parameters:
744 * In:
745 * priv - The adapter to be turned on
746 * Out:
747 * none
749 * Return Value: true if success; otherwise false
752 int vnt_radio_power_on(struct vnt_private *priv)
754 int ret = true;
756 vnt_exit_deep_sleep(priv);
758 vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
760 switch (priv->rf_type) {
761 case RF_AL2230:
762 case RF_AL2230S:
763 case RF_AIROHA7230:
764 case RF_VT3226:
765 case RF_VT3226D0:
766 case RF_VT3342A0:
767 vnt_mac_reg_bits_on(priv, MAC_REG_SOFTPWRCTL,
768 (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
769 break;
772 vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
774 return ret;
777 void vnt_set_bss_mode(struct vnt_private *priv)
779 if (priv->rf_type == RF_AIROHA7230 && priv->bb_type == BB_TYPE_11A)
780 vnt_mac_set_bb_type(priv, BB_TYPE_11G);
781 else
782 vnt_mac_set_bb_type(priv, priv->bb_type);
784 priv->packet_type = vnt_get_pkt_type(priv);
786 if (priv->bb_type == BB_TYPE_11A)
787 vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
788 else if (priv->bb_type == BB_TYPE_11B)
789 vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
790 else if (priv->bb_type == BB_TYPE_11G)
791 vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
793 vnt_update_ifs(priv);
794 vnt_set_rspinf(priv, (u8)priv->bb_type);
796 if (priv->bb_type == BB_TYPE_11A) {
797 if (priv->rf_type == RF_AIROHA7230) {
798 priv->bb_vga[0] = 0x20;
800 vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
801 0xe7, priv->bb_vga[0]);
804 priv->bb_vga[2] = 0x10;
805 priv->bb_vga[3] = 0x10;
806 } else {
807 if (priv->rf_type == RF_AIROHA7230) {
808 priv->bb_vga[0] = 0x1c;
810 vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
811 0xe7, priv->bb_vga[0]);
814 priv->bb_vga[2] = 0x0;
815 priv->bb_vga[3] = 0x0;
818 vnt_set_vga_gain_offset(priv, priv->bb_vga[0]);