aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/tables_nphy.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-01-20 11:31:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-22 16:01:29 -0500
commite03e8ddbfd1f04fc1437e5e3e7a8ec05a1355c5f (patch)
tree11f4117cc4565da10c0b1f3132d9cd0aafcdab45 /drivers/net/wireless/b43/tables_nphy.c
parent708d019fd1d2d1bf184e797ebe934c90a6527d50 (diff)
b43: N-PHY: fix gain in b43_nphy_get_gain_ctl_workaround_ent()
There were no break statements in this switch statement so everything used the default settings. Per Walter Harms's suggestion, I've replaced the switch statement and done a little cleanup. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/tables_nphy.c')
-rw-r--r--drivers/net/wireless/b43/tables_nphy.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index 97d4e27bf36f..aaca60c6f575 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -3226,8 +3226,6 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
3226{ 3226{
3227 struct nphy_gain_ctl_workaround_entry *e; 3227 struct nphy_gain_ctl_workaround_entry *e;
3228 u8 phy_idx; 3228 u8 phy_idx;
3229 u8 tr_iso = ghz5 ? dev->dev->bus_sprom->fem.ghz5.tr_iso :
3230 dev->dev->bus_sprom->fem.ghz2.tr_iso;
3231 3229
3232 if (!ghz5 && dev->phy.rev >= 6 && dev->phy.radio_rev == 11) 3230 if (!ghz5 && dev->phy.rev >= 6 && dev->phy.radio_rev == 11)
3233 return &nphy_gain_ctl_wa_phy6_radio11_ghz2; 3231 return &nphy_gain_ctl_wa_phy6_radio11_ghz2;
@@ -3249,6 +3247,10 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
3249 !b43_channel_type_is_40mhz(dev->phy.channel_type)) 3247 !b43_channel_type_is_40mhz(dev->phy.channel_type))
3250 e->cliplo_gain = 0x2d; 3248 e->cliplo_gain = 0x2d;
3251 } else if (!ghz5 && dev->phy.rev >= 5) { 3249 } else if (!ghz5 && dev->phy.rev >= 5) {
3250 static const int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a,
3251 0x106c, 0x1074, 0x107c, 0x207c};
3252 u8 tr_iso = dev->dev->bus_sprom->fem.ghz2.tr_iso;
3253
3252 if (ext_lna) { 3254 if (ext_lna) {
3253 e->rfseq_init[0] &= ~0x4000; 3255 e->rfseq_init[0] &= ~0x4000;
3254 e->rfseq_init[1] &= ~0x4000; 3256 e->rfseq_init[1] &= ~0x4000;
@@ -3256,26 +3258,10 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
3256 e->rfseq_init[3] &= ~0x4000; 3258 e->rfseq_init[3] &= ~0x4000;
3257 e->init_gain &= ~0x4000; 3259 e->init_gain &= ~0x4000;
3258 } 3260 }
3259 switch (tr_iso) { 3261 if (tr_iso > 7)
3260 case 0: 3262 tr_iso = 3;
3261 e->cliplo_gain = 0x0062; 3263 e->cliplo_gain = gain_data[tr_iso];
3262 case 1: 3264
3263 e->cliplo_gain = 0x0064;
3264 case 2:
3265 e->cliplo_gain = 0x006a;
3266 case 3:
3267 e->cliplo_gain = 0x106a;
3268 case 4:
3269 e->cliplo_gain = 0x106c;
3270 case 5:
3271 e->cliplo_gain = 0x1074;
3272 case 6:
3273 e->cliplo_gain = 0x107c;
3274 case 7:
3275 e->cliplo_gain = 0x207c;
3276 default:
3277 e->cliplo_gain = 0x106a;
3278 }
3279 } else if (ghz5 && dev->phy.rev == 4 && ext_lna) { 3265 } else if (ghz5 && dev->phy.rev == 4 && ext_lna) {
3280 e->rfseq_init[0] &= ~0x4000; 3266 e->rfseq_init[0] &= ~0x4000;
3281 e->rfseq_init[1] &= ~0x4000; 3267 e->rfseq_init[1] &= ~0x4000;