Commit bc5892c9 authored by Chaoming Li's avatar Chaoming Li Committed by John W. Linville

rtlwifi: Fix firmware upload errors

When the source code from Realtek was prepared for kernel inclusion,
some routines were refactored to reduce the level of indentation. This
patch repairs errors introduced in that process.
Signed-off-by: default avatarChaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent acd9f9cc
...@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) ...@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
} }
static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
u8 efuse_data, u8 offset, int *bcontinual, u8 efuse_data, u8 offset, int *bcontinual,
u8 *write_state, struct pgpkt_struct target_pkt, u8 *write_state, struct pgpkt_struct *target_pkt,
int *repeat_times, int *bresult, u8 word_en) int *repeat_times, int *bresult, u8 word_en)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct pgpkt_struct tmp_pkt; struct pgpkt_struct tmp_pkt;
...@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
tmp_pkt.word_en = tmp_header & 0x0F; tmp_pkt.word_en = tmp_header & 0x0F;
tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en);
if (tmp_pkt.offset != target_pkt.offset) { if (tmp_pkt.offset != target_pkt->offset) {
efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} else { } else {
for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) {
...@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
if (bdataempty == false) { if (bdataempty == false) {
efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} else { } else {
match_word_en = 0x0F; match_word_en = 0x0F;
if (!((target_pkt.word_en & BIT(0)) | if (!((target_pkt->word_en & BIT(0)) |
(tmp_pkt.word_en & BIT(0)))) (tmp_pkt.word_en & BIT(0))))
match_word_en &= (~BIT(0)); match_word_en &= (~BIT(0));
if (!((target_pkt.word_en & BIT(1)) | if (!((target_pkt->word_en & BIT(1)) |
(tmp_pkt.word_en & BIT(1)))) (tmp_pkt.word_en & BIT(1))))
match_word_en &= (~BIT(1)); match_word_en &= (~BIT(1));
if (!((target_pkt.word_en & BIT(2)) | if (!((target_pkt->word_en & BIT(2)) |
(tmp_pkt.word_en & BIT(2)))) (tmp_pkt.word_en & BIT(2))))
match_word_en &= (~BIT(2)); match_word_en &= (~BIT(2));
if (!((target_pkt.word_en & BIT(3)) | if (!((target_pkt->word_en & BIT(3)) |
(tmp_pkt.word_en & BIT(3)))) (tmp_pkt.word_en & BIT(3))))
match_word_en &= (~BIT(3)); match_word_en &= (~BIT(3));
...@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
badworden = efuse_word_enable_data_write( badworden = efuse_word_enable_data_write(
hw, *efuse_addr + 1, hw, *efuse_addr + 1,
tmp_pkt.word_en, tmp_pkt.word_en,
target_pkt.data); target_pkt->data);
if (0x0F != (badworden & 0x0F)) { if (0x0F != (badworden & 0x0F)) {
u8 reorg_offset = offset; u8 reorg_offset = offset;
...@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
tmp_word_en = 0x0F; tmp_word_en = 0x0F;
if ((target_pkt.word_en & BIT(0)) ^ if ((target_pkt->word_en & BIT(0)) ^
(match_word_en & BIT(0))) (match_word_en & BIT(0)))
tmp_word_en &= (~BIT(0)); tmp_word_en &= (~BIT(0));
if ((target_pkt.word_en & BIT(1)) ^ if ((target_pkt->word_en & BIT(1)) ^
(match_word_en & BIT(1))) (match_word_en & BIT(1)))
tmp_word_en &= (~BIT(1)); tmp_word_en &= (~BIT(1));
if ((target_pkt.word_en & BIT(2)) ^ if ((target_pkt->word_en & BIT(2)) ^
(match_word_en & BIT(2))) (match_word_en & BIT(2)))
tmp_word_en &= (~BIT(2)); tmp_word_en &= (~BIT(2));
if ((target_pkt.word_en & BIT(3)) ^ if ((target_pkt->word_en & BIT(3)) ^
(match_word_en & BIT(3))) (match_word_en & BIT(3)))
tmp_word_en &= (~BIT(3)); tmp_word_en &= (~BIT(3));
if ((tmp_word_en & 0x0F) != 0x0F) { if ((tmp_word_en & 0x0F) != 0x0F) {
*efuse_addr = efuse_get_current_size(hw); *efuse_addr = efuse_get_current_size(hw);
target_pkt.offset = offset; target_pkt->offset = offset;
target_pkt.word_en = tmp_word_en; target_pkt->word_en = tmp_word_en;
} else } else
*bcontinual = false; *bcontinual = false;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
...@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, ...@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
} }
} else { } else {
*efuse_addr += (2 * tmp_word_cnts) + 1; *efuse_addr += (2 * tmp_word_cnts) + 1;
target_pkt.offset = offset; target_pkt->offset = offset;
target_pkt.word_en = word_en; target_pkt->word_en = word_en;
*write_state = PG_STATE_HEADER; *write_state = PG_STATE_HEADER;
} }
} }
...@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw, ...@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
efuse_write_data_case1(hw, &efuse_addr, efuse_write_data_case1(hw, &efuse_addr,
efuse_data, offset, efuse_data, offset,
&bcontinual, &bcontinual,
&write_state, target_pkt, &write_state, &target_pkt,
&repeat_times, &bresult, &repeat_times, &bresult,
word_en); word_en);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment