From: Felix Fietkau Date: Tue, 28 May 2013 16:07:29 +0000 (+0000) Subject: ath9k: fix some issues in PA predistortion (still disabled by default) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e875338294db0a1866a764b265bedba369c5f72a;p=openwrt%2Fstaging%2Fblocktrron.git ath9k: fix some issues in PA predistortion (still disabled by default) Signed-off-by: Felix Fietkau SVN-Revision: 36744 --- diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index 8c43574ee8..33120a0903 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -4570,3 +4570,44 @@ return -EINVAL; trace_drv_add_interface(local, sdata); +--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +@@ -454,6 +454,8 @@ static bool create_pa_curve(u32 *data_L, + if (accum_cnt <= thresh_accum_cnt) + continue; + ++ max_index++; ++ + /* sum(tx amplitude) */ + accum_tx = ((data_L[i] >> 16) & 0xffff) | + ((data_U[i] & 0x7ff) << 16); +@@ -468,20 +470,21 @@ static bool create_pa_curve(u32 *data_L, + + accum_tx <<= scale_factor; + accum_rx <<= scale_factor; +- x_est[i + 1] = (((accum_tx + accum_cnt) / accum_cnt) + 32) >> +- scale_factor; ++ x_est[max_index] = ++ (((accum_tx + accum_cnt) / accum_cnt) + 32) >> ++ scale_factor; + +- Y[i + 1] = ((((accum_rx + accum_cnt) / accum_cnt) + 32) >> ++ Y[max_index] = ++ ((((accum_rx + accum_cnt) / accum_cnt) + 32) >> + scale_factor) + +- (1 << scale_factor) * max_index + 16; ++ (1 << scale_factor) * i + 16; + + if (accum_ang >= (1 << 26)) + accum_ang -= 1 << 27; + +- theta[i + 1] = ((accum_ang * (1 << scale_factor)) + accum_cnt) / +- accum_cnt; +- +- max_index++; ++ theta[max_index] = ++ ((accum_ang * (1 << scale_factor)) + accum_cnt) / ++ accum_cnt; + } + + /*