* [PATCH] brcmsmac: LCN PHY code is used for BCM4313 2G-only device
@ 2024-05-09 23:10 Samasth Norway Ananda
2024-05-12 18:24 ` Arend van Spriel
2024-05-14 13:31 ` wifi: " Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Samasth Norway Ananda @ 2024-05-09 23:10 UTC (permalink / raw
To: arend.vanspriel; +Cc: linux-wireless, samasth.norway.ananda
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: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
---
.../broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
index aae2cf95fe95..e472591f321b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -2567,7 +2567,6 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
struct lcnphy_txgains cal_gains, temp_gains;
u16 hash;
- u8 band_idx;
int j;
u16 ncorr_override[5];
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;
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);
if (NULL == values_to_save)
return;
@@ -2662,20 +2664,18 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
hash = (target_gains->gm_gain << 8) |
(target_gains->pga_gain << 4) | (target_gains->pad_gain);
- band_idx = (CHSPEC_IS5G(pi->radio_chanspec) ? 1 : 0);
-
cal_gains = *target_gains;
memset(ncorr_override, 0, sizeof(ncorr_override));
- for (j = 0; j < iqcal_gainparams_numgains_lcnphy[band_idx]; j++) {
- if (hash == tbl_iqcal_gainparams_lcnphy[band_idx][j][0]) {
+ for (j = 0; j < iqcal_gainparams_numgains_lcnphy[0]; j++) {
+ if (hash == tbl_iqcal_gainparams_lcnphy[0][j][0]) {
cal_gains.gm_gain =
- tbl_iqcal_gainparams_lcnphy[band_idx][j][1];
+ tbl_iqcal_gainparams_lcnphy[0][j][1];
cal_gains.pga_gain =
- tbl_iqcal_gainparams_lcnphy[band_idx][j][2];
+ tbl_iqcal_gainparams_lcnphy[0][j][2];
cal_gains.pad_gain =
- tbl_iqcal_gainparams_lcnphy[band_idx][j][3];
+ tbl_iqcal_gainparams_lcnphy[0][j][3];
memcpy(ncorr_override,
- &tbl_iqcal_gainparams_lcnphy[band_idx][j][3],
+ &tbl_iqcal_gainparams_lcnphy[0][j][3],
sizeof(ncorr_override));
break;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] brcmsmac: LCN PHY code is used for BCM4313 2G-only device
2024-05-09 23:10 [PATCH] brcmsmac: LCN PHY code is used for BCM4313 2G-only device Samasth Norway Ananda
@ 2024-05-12 18:24 ` Arend van Spriel
2024-05-14 13:31 ` wifi: " Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Arend van Spriel @ 2024-05-12 18:24 UTC (permalink / raw
To: Samasth Norway Ananda; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
On 5/10/2024 1:10 AM, Samasth Norway Ananda wrote:
> 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.
Thanks for the change. You may consider reducing the number of
dimensions of the array variables involved in using band_idx 0, but I am
fine with the change as is so...
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
> Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
> ---
> .../broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device
2024-05-09 23:10 [PATCH] brcmsmac: LCN PHY code is used for BCM4313 2G-only device Samasth Norway Ananda
2024-05-12 18:24 ` Arend van Spriel
@ 2024-05-14 13:31 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-05-14 13:31 UTC (permalink / raw
To: Samasth Norway Ananda
Cc: arend.vanspriel, linux-wireless, samasth.norway.ananda
Samasth Norway Ananda <samasth.norway.ananda@oracle.com> wrote:
> 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: 5b435de0d786 ("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>
Patch applied to wireless-next.git, thanks.
c636fa85feb4 wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240509231037.2014109-1-samasth.norway.ananda@oracle.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-14 13:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 23:10 [PATCH] brcmsmac: LCN PHY code is used for BCM4313 2G-only device Samasth Norway Ananda
2024-05-12 18:24 ` Arend van Spriel
2024-05-14 13:31 ` wifi: " Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.