diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-03-16 18:40:01 -0400 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2013-04-23 06:27:55 -0400 |
commit | 9a0bc41e1c85d2be2f3e7e7772319d58afe28f1b (patch) | |
tree | 91269d7b8f8dd29900a3870a6eee50cf8f4cf0b9 /drivers/net/wireless/b43 | |
parent | d6657db90a917595b5ed96669239d35a5f69db94 (diff) |
b43: HT-PHY: tables: don't duplicate core-generic regs
Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/b43/radio_2059.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/b43/radio_2059.h | 8 |
3 files changed, 23 insertions, 59 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index d40e799b8dbc..3d0bddb64b3d 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c | |||
@@ -37,8 +37,9 @@ | |||
37 | static void b43_radio_2059_channel_setup(struct b43_wldev *dev, | 37 | static void b43_radio_2059_channel_setup(struct b43_wldev *dev, |
38 | const struct b43_phy_ht_channeltab_e_radio2059 *e) | 38 | const struct b43_phy_ht_channeltab_e_radio2059 *e) |
39 | { | 39 | { |
40 | u8 i; | 40 | static const u16 routing[] = { R2059_C1, R2059_C2, R2059_C3, }; |
41 | u16 routing; | 41 | u16 r; |
42 | int core; | ||
42 | 43 | ||
43 | b43_radio_write(dev, 0x16, e->radio_syn16); | 44 | b43_radio_write(dev, 0x16, e->radio_syn16); |
44 | b43_radio_write(dev, 0x17, e->radio_syn17); | 45 | b43_radio_write(dev, 0x17, e->radio_syn17); |
@@ -53,25 +54,17 @@ static void b43_radio_2059_channel_setup(struct b43_wldev *dev, | |||
53 | b43_radio_write(dev, 0x41, e->radio_syn41); | 54 | b43_radio_write(dev, 0x41, e->radio_syn41); |
54 | b43_radio_write(dev, 0x43, e->radio_syn43); | 55 | b43_radio_write(dev, 0x43, e->radio_syn43); |
55 | b43_radio_write(dev, 0x47, e->radio_syn47); | 56 | b43_radio_write(dev, 0x47, e->radio_syn47); |
56 | b43_radio_write(dev, 0x4a, e->radio_syn4a); | 57 | |
57 | b43_radio_write(dev, 0x58, e->radio_syn58); | 58 | for (core = 0; core < 3; core++) { |
58 | b43_radio_write(dev, 0x5a, e->radio_syn5a); | 59 | r = routing[core]; |
59 | b43_radio_write(dev, 0x6a, e->radio_syn6a); | 60 | b43_radio_write(dev, r | 0x4a, e->radio_rxtx4a); |
60 | b43_radio_write(dev, 0x6d, e->radio_syn6d); | 61 | b43_radio_write(dev, r | 0x58, e->radio_rxtx58); |
61 | b43_radio_write(dev, 0x6e, e->radio_syn6e); | 62 | b43_radio_write(dev, r | 0x5a, e->radio_rxtx5a); |
62 | b43_radio_write(dev, 0x92, e->radio_syn92); | 63 | b43_radio_write(dev, r | 0x6a, e->radio_rxtx6a); |
63 | b43_radio_write(dev, 0x98, e->radio_syn98); | 64 | b43_radio_write(dev, r | 0x6d, e->radio_rxtx6d); |
64 | 65 | b43_radio_write(dev, r | 0x6e, e->radio_rxtx6e); | |
65 | for (i = 0; i < 2; i++) { | 66 | b43_radio_write(dev, r | 0x92, e->radio_rxtx92); |
66 | routing = i ? R2059_C3 : R2059_C2; | 67 | b43_radio_write(dev, r | 0x98, e->radio_rxtx98); |
67 | b43_radio_write(dev, routing | 0x4a, e->radio_rxtx4a); | ||
68 | b43_radio_write(dev, routing | 0x58, e->radio_rxtx58); | ||
69 | b43_radio_write(dev, routing | 0x5a, e->radio_rxtx5a); | ||
70 | b43_radio_write(dev, routing | 0x6a, e->radio_rxtx6a); | ||
71 | b43_radio_write(dev, routing | 0x6d, e->radio_rxtx6d); | ||
72 | b43_radio_write(dev, routing | 0x6e, e->radio_rxtx6e); | ||
73 | b43_radio_write(dev, routing | 0x92, e->radio_rxtx92); | ||
74 | b43_radio_write(dev, routing | 0x98, e->radio_rxtx98); | ||
75 | } | 68 | } |
76 | 69 | ||
77 | udelay(50); | 70 | udelay(50); |
diff --git a/drivers/net/wireless/b43/radio_2059.c b/drivers/net/wireless/b43/radio_2059.c index d4ce8a12ff9a..38e31d857e3e 100644 --- a/drivers/net/wireless/b43/radio_2059.c +++ b/drivers/net/wireless/b43/radio_2059.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #define RADIOREGS(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \ | 28 | #define RADIOREGS(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \ |
29 | r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \ | 29 | r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \ |
30 | r20, r21, r22, r23, r24, r25, r26, r27, r28) \ | 30 | r20) \ |
31 | .radio_syn16 = r00, \ | 31 | .radio_syn16 = r00, \ |
32 | .radio_syn17 = r01, \ | 32 | .radio_syn17 = r01, \ |
33 | .radio_syn22 = r02, \ | 33 | .radio_syn22 = r02, \ |
@@ -41,22 +41,14 @@ | |||
41 | .radio_syn41 = r10, \ | 41 | .radio_syn41 = r10, \ |
42 | .radio_syn43 = r11, \ | 42 | .radio_syn43 = r11, \ |
43 | .radio_syn47 = r12, \ | 43 | .radio_syn47 = r12, \ |
44 | .radio_syn4a = r13, \ | 44 | .radio_rxtx4a = r13, \ |
45 | .radio_syn58 = r14, \ | 45 | .radio_rxtx58 = r14, \ |
46 | .radio_syn5a = r15, \ | 46 | .radio_rxtx5a = r15, \ |
47 | .radio_syn6a = r16, \ | 47 | .radio_rxtx6a = r16, \ |
48 | .radio_syn6d = r17, \ | 48 | .radio_rxtx6d = r17, \ |
49 | .radio_syn6e = r18, \ | 49 | .radio_rxtx6e = r18, \ |
50 | .radio_syn92 = r19, \ | 50 | .radio_rxtx92 = r19, \ |
51 | .radio_syn98 = r20, \ | 51 | .radio_rxtx98 = r20 |
52 | .radio_rxtx4a = r21, \ | ||
53 | .radio_rxtx58 = r22, \ | ||
54 | .radio_rxtx5a = r23, \ | ||
55 | .radio_rxtx6a = r24, \ | ||
56 | .radio_rxtx6d = r25, \ | ||
57 | .radio_rxtx6e = r26, \ | ||
58 | .radio_rxtx92 = r27, \ | ||
59 | .radio_rxtx98 = r28 | ||
60 | 52 | ||
61 | #define PHYREGS(r0, r1, r2, r3, r4, r5) \ | 53 | #define PHYREGS(r0, r1, r2, r3, r4, r5) \ |
62 | .phy_regs.bw1 = r0, \ | 54 | .phy_regs.bw1 = r0, \ |
@@ -70,91 +62,78 @@ static const struct b43_phy_ht_channeltab_e_radio2059 b43_phy_ht_channeltab_radi | |||
70 | { .freq = 2412, | 62 | { .freq = 2412, |
71 | RADIOREGS(0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, | 63 | RADIOREGS(0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, |
72 | 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, | 64 | 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, |
73 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
74 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 65 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
75 | PHYREGS(0x03c9, 0x03c5, 0x03c1, 0x043a, 0x043f, 0x0443), | 66 | PHYREGS(0x03c9, 0x03c5, 0x03c1, 0x043a, 0x043f, 0x0443), |
76 | }, | 67 | }, |
77 | { .freq = 2417, | 68 | { .freq = 2417, |
78 | RADIOREGS(0x4b, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x71, | 69 | RADIOREGS(0x4b, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x71, |
79 | 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, | 70 | 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, |
80 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
81 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 71 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
82 | PHYREGS(0x03cb, 0x03c7, 0x03c3, 0x0438, 0x043d, 0x0441), | 72 | PHYREGS(0x03cb, 0x03c7, 0x03c3, 0x0438, 0x043d, 0x0441), |
83 | }, | 73 | }, |
84 | { .freq = 2422, | 74 | { .freq = 2422, |
85 | RADIOREGS(0x4e, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x76, | 75 | RADIOREGS(0x4e, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x76, |
86 | 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, | 76 | 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, |
87 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
88 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 77 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
89 | PHYREGS(0x03cd, 0x03c9, 0x03c5, 0x0436, 0x043a, 0x043f), | 78 | PHYREGS(0x03cd, 0x03c9, 0x03c5, 0x0436, 0x043a, 0x043f), |
90 | }, | 79 | }, |
91 | { .freq = 2427, | 80 | { .freq = 2427, |
92 | RADIOREGS(0x52, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x7b, | 81 | RADIOREGS(0x52, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x7b, |
93 | 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, | 82 | 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, |
94 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
95 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 83 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
96 | PHYREGS(0x03cf, 0x03cb, 0x03c7, 0x0434, 0x0438, 0x043d), | 84 | PHYREGS(0x03cf, 0x03cb, 0x03c7, 0x0434, 0x0438, 0x043d), |
97 | }, | 85 | }, |
98 | { .freq = 2432, | 86 | { .freq = 2432, |
99 | RADIOREGS(0x55, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x80, | 87 | RADIOREGS(0x55, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x80, |
100 | 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, | 88 | 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, |
101 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
102 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 89 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
103 | PHYREGS(0x03d1, 0x03cd, 0x03c9, 0x0431, 0x0436, 0x043a), | 90 | PHYREGS(0x03d1, 0x03cd, 0x03c9, 0x0431, 0x0436, 0x043a), |
104 | }, | 91 | }, |
105 | { .freq = 2437, | 92 | { .freq = 2437, |
106 | RADIOREGS(0x58, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x85, | 93 | RADIOREGS(0x58, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x85, |
107 | 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, | 94 | 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, |
108 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
109 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 95 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
110 | PHYREGS(0x03d3, 0x03cf, 0x03cb, 0x042f, 0x0434, 0x0438), | 96 | PHYREGS(0x03d3, 0x03cf, 0x03cb, 0x042f, 0x0434, 0x0438), |
111 | }, | 97 | }, |
112 | { .freq = 2442, | 98 | { .freq = 2442, |
113 | RADIOREGS(0x5c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8a, | 99 | RADIOREGS(0x5c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8a, |
114 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, | 100 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, |
115 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
116 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 101 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
117 | PHYREGS(0x03d5, 0x03d1, 0x03cd, 0x042d, 0x0431, 0x0436), | 102 | PHYREGS(0x03d5, 0x03d1, 0x03cd, 0x042d, 0x0431, 0x0436), |
118 | }, | 103 | }, |
119 | { .freq = 2447, | 104 | { .freq = 2447, |
120 | RADIOREGS(0x5f, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8f, | 105 | RADIOREGS(0x5f, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8f, |
121 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, | 106 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, |
122 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
123 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 107 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
124 | PHYREGS(0x03d7, 0x03d3, 0x03cf, 0x042b, 0x042f, 0x0434), | 108 | PHYREGS(0x03d7, 0x03d3, 0x03cf, 0x042b, 0x042f, 0x0434), |
125 | }, | 109 | }, |
126 | { .freq = 2452, | 110 | { .freq = 2452, |
127 | RADIOREGS(0x62, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x94, | 111 | RADIOREGS(0x62, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x94, |
128 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, | 112 | 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, |
129 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
130 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 113 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
131 | PHYREGS(0x03d9, 0x03d5, 0x03d1, 0x0429, 0x042d, 0x0431), | 114 | PHYREGS(0x03d9, 0x03d5, 0x03d1, 0x0429, 0x042d, 0x0431), |
132 | }, | 115 | }, |
133 | { .freq = 2457, | 116 | { .freq = 2457, |
134 | RADIOREGS(0x66, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x99, | 117 | RADIOREGS(0x66, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x99, |
135 | 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, | 118 | 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, |
136 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
137 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 119 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
138 | PHYREGS(0x03db, 0x03d7, 0x03d3, 0x0427, 0x042b, 0x042f), | 120 | PHYREGS(0x03db, 0x03d7, 0x03d3, 0x0427, 0x042b, 0x042f), |
139 | }, | 121 | }, |
140 | { .freq = 2462, | 122 | { .freq = 2462, |
141 | RADIOREGS(0x69, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x9e, | 123 | RADIOREGS(0x69, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x9e, |
142 | 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, | 124 | 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, |
143 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
144 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 125 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
145 | PHYREGS(0x03dd, 0x03d9, 0x03d5, 0x0424, 0x0429, 0x042d), | 126 | PHYREGS(0x03dd, 0x03d9, 0x03d5, 0x0424, 0x0429, 0x042d), |
146 | }, | 127 | }, |
147 | { .freq = 2467, | 128 | { .freq = 2467, |
148 | RADIOREGS(0x6c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0xa3, | 129 | RADIOREGS(0x6c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0xa3, |
149 | 0x09, 0x0f, 0x05, 0x00, 0x05, 0x00, 0x61, 0x03, | 130 | 0x09, 0x0f, 0x05, 0x00, 0x05, 0x00, 0x61, 0x03, |
150 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
151 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 131 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
152 | PHYREGS(0x03df, 0x03db, 0x03d7, 0x0422, 0x0427, 0x042b), | 132 | PHYREGS(0x03df, 0x03db, 0x03d7, 0x0422, 0x0427, 0x042b), |
153 | }, | 133 | }, |
154 | { .freq = 2472, | 134 | { .freq = 2472, |
155 | RADIOREGS(0x70, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0xa8, | 135 | RADIOREGS(0x70, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0xa8, |
156 | 0x09, 0x0f, 0x05, 0x00, 0x05, 0x00, 0x61, 0x03, | 136 | 0x09, 0x0f, 0x05, 0x00, 0x05, 0x00, 0x61, 0x03, |
157 | 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x61, 0x03, | ||
158 | 0x00, 0x00, 0x00, 0xf0, 0x00), | 137 | 0x00, 0x00, 0x00, 0xf0, 0x00), |
159 | PHYREGS(0x03e1, 0x03dd, 0x03d9, 0x0420, 0x0424, 0x0429), | 138 | PHYREGS(0x03e1, 0x03dd, 0x03d9, 0x0420, 0x0424, 0x0429), |
160 | }, | 139 | }, |
diff --git a/drivers/net/wireless/b43/radio_2059.h b/drivers/net/wireless/b43/radio_2059.h index a6a61fbb71ec..40a82d7f510c 100644 --- a/drivers/net/wireless/b43/radio_2059.h +++ b/drivers/net/wireless/b43/radio_2059.h | |||
@@ -28,14 +28,6 @@ struct b43_phy_ht_channeltab_e_radio2059 { | |||
28 | u8 radio_syn41; | 28 | u8 radio_syn41; |
29 | u8 radio_syn43; | 29 | u8 radio_syn43; |
30 | u8 radio_syn47; | 30 | u8 radio_syn47; |
31 | u8 radio_syn4a; | ||
32 | u8 radio_syn58; | ||
33 | u8 radio_syn5a; | ||
34 | u8 radio_syn6a; | ||
35 | u8 radio_syn6d; | ||
36 | u8 radio_syn6e; | ||
37 | u8 radio_syn92; | ||
38 | u8 radio_syn98; | ||
39 | u8 radio_rxtx4a; | 31 | u8 radio_rxtx4a; |
40 | u8 radio_rxtx58; | 32 | u8 radio_rxtx58; |
41 | u8 radio_rxtx5a; | 33 | u8 radio_rxtx5a; |