b43: N-PHY: define channel table struct for rev3+ devices
[linux-2.6/btrfs-unstable.git] / drivers / net / wireless / b43 / radio_2056.c
blobf710c01f2cc4b9d46fe3c763eaf31a2b92eff636
1 /*
3 Broadcom B43 wireless driver
4 IEEE 802.11n 2056 radio device data tables
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19 Boston, MA 02110-1301, USA.
23 #include "b43.h"
24 #include "radio_2056.h"
25 #include "phy_common.h"
27 #define RADIOREGS3(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \
28 r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \
29 r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, \
30 r30, r31, r32, r33, r34, r35, r36) \
31 .radio_syn_pll_vcocal1 = r00, \
32 .radio_syn_pll_vcocal2 = r01, \
33 .radio_syn_pll_refdiv = r02, \
34 .radio_syn_pll_mmd2 = r03, \
35 .radio_syn_pll_mmd1 = r04, \
36 .radio_syn_pll_loopfilter1 = r05, \
37 .radio_syn_pll_loopfilter2 = r06, \
38 .radio_syn_pll_loopfilter3 = r07, \
39 .radio_syn_pll_loopfilter4 = r08, \
40 .radio_syn_pll_loopfilter5 = r09, \
41 .radio_syn_reserved_addr27 = r10, \
42 .radio_syn_reserved_addr28 = r11, \
43 .radio_syn_reserved_addr29 = r12, \
44 .radio_syn_logen_vcobuf1 = r13, \
45 .radio_syn_logen_mixer2 = r14, \
46 .radio_syn_logen_buf3 = r15, \
47 .radio_syn_logen_buf4 = r16, \
48 .radio_rx0_lnaa_tune = r17, \
49 .radio_rx0_lnag_tune = r18, \
50 .radio_tx0_intpaa_boost_tune = r19, \
51 .radio_tx0_intpag_boost_tune = r20, \
52 .radio_tx0_pada_boost_tune = r21, \
53 .radio_tx0_padg_boost_tune = r22, \
54 .radio_tx0_pgaa_boost_tune = r23, \
55 .radio_tx0_pgag_boost_tune = r24, \
56 .radio_tx0_mixa_boost_tune = r25, \
57 .radio_tx0_mixg_boost_tune = r26, \
58 .radio_rx1_lnaa_tune = r27, \
59 .radio_rx1_lnag_tune = r28, \
60 .radio_tx1_intpaa_boost_tune = r29, \
61 .radio_tx1_intpag_boost_tune = r30, \
62 .radio_tx1_pada_boost_tune = r31, \
63 .radio_tx1_padg_boost_tune = r32, \
64 .radio_tx1_pgaa_boost_tune = r33, \
65 .radio_tx1_pgag_boost_tune = r34, \
66 .radio_tx1_mixa_boost_tune = r35, \
67 .radio_tx1_mixg_boost_tune = r36
69 #define PHYREGS(r0, r1, r2, r3, r4, r5) \
70 .phy_regs.phy_bw1a = r0, \
71 .phy_regs.phy_bw2 = r1, \
72 .phy_regs.phy_bw3 = r2, \
73 .phy_regs.phy_bw4 = r3, \
74 .phy_regs.phy_bw5 = r4, \
75 .phy_regs.phy_bw6 = r5
77 static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev3[] = {
80 /* TODO: add support for rev4+ devices by searching in rev4+ tables */
81 const struct b43_nphy_channeltab_entry_rev3 *
82 b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq)
84 const struct b43_nphy_channeltab_entry_rev3 *e;
85 unsigned int i;
87 for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab_rev3); i++) {
88 e = &(b43_nphy_channeltab_rev3[i]);
89 if (e->freq == freq)
90 return e;
93 return NULL;