Commit 80429a86 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: 8192de: use le32 to access cckswing tables

The cckswing tables cckswing_table_ch1ch13 and cckswing_table_ch14 are
u8 array in little-endian order. To compare four u8 value with register
u32 value, cast the value to cpu order.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 0e7d3813
...@@ -680,6 +680,7 @@ static void rtl92d_bandtype_2_4G(struct ieee80211_hw *hw, long *temp_cckg, ...@@ -680,6 +680,7 @@ static void rtl92d_bandtype_2_4G(struct ieee80211_hw *hw, long *temp_cckg,
int i; int i;
unsigned long flag = 0; unsigned long flag = 0;
long temp_cck; long temp_cck;
const u8 *cckswing;
/* Query CCK default setting From 0xa24 */ /* Query CCK default setting From 0xa24 */
rtl92d_acquire_cckandrw_pagea_ctl(hw, &flag); rtl92d_acquire_cckandrw_pagea_ctl(hw, &flag);
...@@ -687,28 +688,19 @@ static void rtl92d_bandtype_2_4G(struct ieee80211_hw *hw, long *temp_cckg, ...@@ -687,28 +688,19 @@ static void rtl92d_bandtype_2_4G(struct ieee80211_hw *hw, long *temp_cckg,
MASKDWORD) & MASKCCK; MASKDWORD) & MASKCCK;
rtl92d_release_cckandrw_pagea_ctl(hw, &flag); rtl92d_release_cckandrw_pagea_ctl(hw, &flag);
for (i = 0; i < CCK_TABLE_LENGTH; i++) { for (i = 0; i < CCK_TABLE_LENGTH; i++) {
if (rtlpriv->dm.cck_inch14) { if (rtlpriv->dm.cck_inch14)
if (!memcmp((void *)&temp_cck, cckswing = &cckswing_table_ch14[i][2];
(void *)&cckswing_table_ch14[i][2], 4)) { else
*cck_index_old = (u8) i; cckswing = &cckswing_table_ch1ch13[i][2];
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
"Initial reg0x%x = 0x%lx, cck_index=0x%x, ch 14 %d\n", if (temp_cck == le32_to_cpu(*((__le32 *)cckswing))) {
RCCK0_TXFILTER2, temp_cck, *cck_index_old = (u8)i;
*cck_index_old, RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
rtlpriv->dm.cck_inch14); "Initial reg0x%x = 0x%lx, cck_index = 0x%x, ch14 %d\n",
break; RCCK0_TXFILTER2, temp_cck,
} *cck_index_old,
} else { rtlpriv->dm.cck_inch14);
if (!memcmp((void *) &temp_cck, break;
&cckswing_table_ch1ch13[i][2], 4)) {
*cck_index_old = (u8) i;
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
"Initial reg0x%x = 0x%lx, cck_index = 0x%x, ch14 %d\n",
RCCK0_TXFILTER2, temp_cck,
*cck_index_old,
rtlpriv->dm.cck_inch14);
break;
}
} }
} }
*temp_cckg = temp_cck; *temp_cckg = temp_cck;
......
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