mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device
[ Upstream commit c636fa85feb450ca414a10010ed05361a73c93a6 ]
The band_idx variable in the function wlc_lcnphy_tx_iqlo_cal() will
never be set to 1 as BCM4313 is the only device for which the LCN PHY
code is used. This is a 2G-only device.
Fixes: 5b435de0d7 ("net: wireless: add brcm80211 drivers")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240509231037.2014109-1-samasth.norway.ananda@oracle.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
50b568af74
commit
0216644f28
@@ -2567,7 +2567,6 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
|
|||||||
|
|
||||||
struct lcnphy_txgains cal_gains, temp_gains;
|
struct lcnphy_txgains cal_gains, temp_gains;
|
||||||
u16 hash;
|
u16 hash;
|
||||||
u8 band_idx;
|
|
||||||
int j;
|
int j;
|
||||||
u16 ncorr_override[5];
|
u16 ncorr_override[5];
|
||||||
u16 syst_coeffs[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
u16 syst_coeffs[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||||
@@ -2599,6 +2598,9 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
|
|||||||
u16 *values_to_save;
|
u16 *values_to_save;
|
||||||
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
|
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
|
||||||
|
|
||||||
|
if (WARN_ON(CHSPEC_IS5G(pi->radio_chanspec)))
|
||||||
|
return;
|
||||||
|
|
||||||
values_to_save = kmalloc_array(20, sizeof(u16), GFP_ATOMIC);
|
values_to_save = kmalloc_array(20, sizeof(u16), GFP_ATOMIC);
|
||||||
if (NULL == values_to_save)
|
if (NULL == values_to_save)
|
||||||
return;
|
return;
|
||||||
@@ -2662,20 +2664,18 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
|
|||||||
hash = (target_gains->gm_gain << 8) |
|
hash = (target_gains->gm_gain << 8) |
|
||||||
(target_gains->pga_gain << 4) | (target_gains->pad_gain);
|
(target_gains->pga_gain << 4) | (target_gains->pad_gain);
|
||||||
|
|
||||||
band_idx = (CHSPEC_IS5G(pi->radio_chanspec) ? 1 : 0);
|
|
||||||
|
|
||||||
cal_gains = *target_gains;
|
cal_gains = *target_gains;
|
||||||
memset(ncorr_override, 0, sizeof(ncorr_override));
|
memset(ncorr_override, 0, sizeof(ncorr_override));
|
||||||
for (j = 0; j < iqcal_gainparams_numgains_lcnphy[band_idx]; j++) {
|
for (j = 0; j < iqcal_gainparams_numgains_lcnphy[0]; j++) {
|
||||||
if (hash == tbl_iqcal_gainparams_lcnphy[band_idx][j][0]) {
|
if (hash == tbl_iqcal_gainparams_lcnphy[0][j][0]) {
|
||||||
cal_gains.gm_gain =
|
cal_gains.gm_gain =
|
||||||
tbl_iqcal_gainparams_lcnphy[band_idx][j][1];
|
tbl_iqcal_gainparams_lcnphy[0][j][1];
|
||||||
cal_gains.pga_gain =
|
cal_gains.pga_gain =
|
||||||
tbl_iqcal_gainparams_lcnphy[band_idx][j][2];
|
tbl_iqcal_gainparams_lcnphy[0][j][2];
|
||||||
cal_gains.pad_gain =
|
cal_gains.pad_gain =
|
||||||
tbl_iqcal_gainparams_lcnphy[band_idx][j][3];
|
tbl_iqcal_gainparams_lcnphy[0][j][3];
|
||||||
memcpy(ncorr_override,
|
memcpy(ncorr_override,
|
||||||
&tbl_iqcal_gainparams_lcnphy[band_idx][j][3],
|
&tbl_iqcal_gainparams_lcnphy[0][j][3],
|
||||||
sizeof(ncorr_override));
|
sizeof(ncorr_override));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user