Skip to content

Commit

Permalink
rtlwifi: Fix firmware upload errors
Browse files Browse the repository at this point in the history
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: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Chaoming Li authored and John W. Linville committed Jan 27, 2011
1 parent acd9f9c commit bc5892c
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions drivers/net/wireless/rtlwifi/efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
u8 efuse_data, u8 offset, int *bcontinual,
u8 *write_state, struct pgpkt_struct target_pkt,
int *repeat_times, int *bresult, u8 word_en)
u8 efuse_data, u8 offset, int *bcontinual,
u8 *write_state, struct pgpkt_struct *target_pkt,
int *repeat_times, int *bresult, u8 word_en)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct pgpkt_struct tmp_pkt;
Expand All @@ -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_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en);

if (tmp_pkt.offset != target_pkt.offset) {
efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1;
if (tmp_pkt.offset != target_pkt->offset) {
*efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1;
*write_state = PG_STATE_HEADER;
} else {
for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) {
Expand All @@ -756,31 +756,31 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
}

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;
} else {
match_word_en = 0x0F;
if (!((target_pkt.word_en & BIT(0)) |
if (!((target_pkt->word_en & BIT(0)) |
(tmp_pkt.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))))
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))))
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))))
match_word_en &= (~BIT(3));

if ((match_word_en & 0x0F) != 0x0F) {
badworden = efuse_word_enable_data_write(
hw, *efuse_addr + 1,
tmp_pkt.word_en,
target_pkt.data);
target_pkt->data);

if (0x0F != (badworden & 0x0F)) {
u8 reorg_offset = offset;
Expand All @@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
}

tmp_word_en = 0x0F;
if ((target_pkt.word_en & BIT(0)) ^
if ((target_pkt->word_en & BIT(0)) ^
(match_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)))
tmp_word_en &= (~BIT(1));

if ((target_pkt.word_en & BIT(2)) ^
if ((target_pkt->word_en & BIT(2)) ^
(match_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)))
tmp_word_en &= (~BIT(3));

if ((tmp_word_en & 0x0F) != 0x0F) {
*efuse_addr = efuse_get_current_size(hw);
target_pkt.offset = offset;
target_pkt.word_en = tmp_word_en;
target_pkt->offset = offset;
target_pkt->word_en = tmp_word_en;
} else
*bcontinual = false;
*write_state = PG_STATE_HEADER;
Expand All @@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
}
} else {
*efuse_addr += (2 * tmp_word_cnts) + 1;
target_pkt.offset = offset;
target_pkt.word_en = word_en;
target_pkt->offset = offset;
target_pkt->word_en = word_en;
*write_state = PG_STATE_HEADER;
}
}
Expand Down Expand Up @@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
efuse_write_data_case1(hw, &efuse_addr,
efuse_data, offset,
&bcontinual,
&write_state, target_pkt,
&write_state, &target_pkt,
&repeat_times, &bresult,
word_en);
else
Expand Down

0 comments on commit bc5892c

Please sign in to comment.