diff options
author | Daniel Drake <dsd@gentoo.org> | 2007-05-23 20:07:15 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-08 22:16:37 -0400 |
commit | aaf83d4fc4a596929306c894d341e17fbdfba758 (patch) | |
tree | cf54c8bcc0d8be6b895e754f6cff6f9681b759ee /drivers/net/wireless/zd1211rw | |
parent | 4481d6093e62e168ab06e9bbb4e67a9bebb8c7f7 (diff) |
[PATCH] zd1211rw: Make CCK gain patching conditional on RF type
The vendor driver code suggests that CR47 patching happens on every channel
change for every RF (depending on bit 8 in POD).
Due to a bug in their driver (upper bits of RF_Mode get zeroed out, then
are examined for 1s when setting some other flags), this isn't actually
what happens, and their generic CCK patching routine never takes effect.
Some of their RF configurations do include explicit (duplicated) code
for CR47 patching though. This patch makes zd1211rw match that
behaviour.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_rf.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_rf_al2230.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_rf_al7230b.c | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 4a2ceb93aaad..5b624bfc01a6 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -1286,7 +1286,7 @@ static int patch_cck_gain(struct zd_chip *chip) | |||
1286 | int r; | 1286 | int r; |
1287 | u32 value; | 1287 | u32 value; |
1288 | 1288 | ||
1289 | if (!chip->patch_cck_gain) | 1289 | if (!chip->patch_cck_gain || !zd_rf_should_patch_cck_gain(&chip->rf)) |
1290 | return 0; | 1290 | return 0; |
1291 | 1291 | ||
1292 | ZD_ASSERT(mutex_is_locked(&chip->mutex)); | 1292 | ZD_ASSERT(mutex_is_locked(&chip->mutex)); |
diff --git a/drivers/net/wireless/zd1211rw/zd_rf.h b/drivers/net/wireless/zd1211rw/zd_rf.h index 6dced2ae5a11..c6dfd8227f6e 100644 --- a/drivers/net/wireless/zd1211rw/zd_rf.h +++ b/drivers/net/wireless/zd1211rw/zd_rf.h | |||
@@ -52,6 +52,12 @@ struct zd_rf { | |||
52 | * defaults to 1 (yes) */ | 52 | * defaults to 1 (yes) */ |
53 | u8 update_channel_int:1; | 53 | u8 update_channel_int:1; |
54 | 54 | ||
55 | /* whether CR47 should be patched from the EEPROM, if the appropriate | ||
56 | * flag is set in the POD. The vendor driver suggests that this should | ||
57 | * be done for all RF's, but a bug in their code prevents but their | ||
58 | * HW_OverWritePhyRegFromE2P() routine from ever taking effect. */ | ||
59 | u8 patch_cck_gain:1; | ||
60 | |||
55 | /* private RF driver data */ | 61 | /* private RF driver data */ |
56 | void *priv; | 62 | void *priv; |
57 | 63 | ||
@@ -84,6 +90,14 @@ static inline int zd_rf_should_update_pwr_int(struct zd_rf *rf) | |||
84 | return rf->update_channel_int; | 90 | return rf->update_channel_int; |
85 | } | 91 | } |
86 | 92 | ||
93 | static inline int zd_rf_should_patch_cck_gain(struct zd_rf *rf) | ||
94 | { | ||
95 | return rf->patch_cck_gain; | ||
96 | } | ||
97 | |||
98 | int zd_rf_patch_6m_band_edge(struct zd_rf *rf, u8 channel); | ||
99 | int zd_rf_generic_patch_6m(struct zd_rf *rf, u8 channel); | ||
100 | |||
87 | /* Functions for individual RF chips */ | 101 | /* Functions for individual RF chips */ |
88 | 102 | ||
89 | int zd_rf_init_rf2959(struct zd_rf *rf); | 103 | int zd_rf_init_rf2959(struct zd_rf *rf); |
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_al2230.c b/drivers/net/wireless/zd1211rw/zd_rf_al2230.c index 511392acfedf..e7a4ecf7b6e2 100644 --- a/drivers/net/wireless/zd1211rw/zd_rf_al2230.c +++ b/drivers/net/wireless/zd1211rw/zd_rf_al2230.c | |||
@@ -432,5 +432,6 @@ int zd_rf_init_al2230(struct zd_rf *rf) | |||
432 | rf->switch_radio_on = zd1211_al2230_switch_radio_on; | 432 | rf->switch_radio_on = zd1211_al2230_switch_radio_on; |
433 | } | 433 | } |
434 | rf->patch_6m_band_edge = zd_rf_generic_patch_6m; | 434 | rf->patch_6m_band_edge = zd_rf_generic_patch_6m; |
435 | rf->patch_cck_gain = 1; | ||
435 | return 0; | 436 | return 0; |
436 | } | 437 | } |
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_al7230b.c b/drivers/net/wireless/zd1211rw/zd_rf_al7230b.c index 5e5e9ddc6a74..f4e8b6ada854 100644 --- a/drivers/net/wireless/zd1211rw/zd_rf_al7230b.c +++ b/drivers/net/wireless/zd1211rw/zd_rf_al7230b.c | |||
@@ -483,6 +483,7 @@ int zd_rf_init_al7230b(struct zd_rf *rf) | |||
483 | rf->switch_radio_on = zd1211_al7230b_switch_radio_on; | 483 | rf->switch_radio_on = zd1211_al7230b_switch_radio_on; |
484 | rf->set_channel = zd1211_al7230b_set_channel; | 484 | rf->set_channel = zd1211_al7230b_set_channel; |
485 | rf->patch_6m_band_edge = zd_rf_generic_patch_6m; | 485 | rf->patch_6m_band_edge = zd_rf_generic_patch_6m; |
486 | rf->patch_cck_gain = 1; | ||
486 | } | 487 | } |
487 | 488 | ||
488 | rf->switch_radio_off = al7230b_switch_radio_off; | 489 | rf->switch_radio_off = al7230b_switch_radio_off; |