2023-10-14 03:27:29

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 0/2] wifi: ath11k: rename the variable naming convention

Currently, the identifier sc is used to represent an instance of
SoC structure. But in ath11k ab is refer to the SoC data structure.
So rename the variable name.

Karthikeyan Periyasamy (2):
wifi: ath11k: rename the wmi_sc naming convention to wmi_ab
wifi: ath11k: rename the sc naming convention to ab

drivers/net/wireless/ath/ath11k/hif.h | 54 +++++++++++------------
drivers/net/wireless/ath/ath11k/pcic.c | 6 +--
drivers/net/wireless/ath/ath11k/thermal.c | 22 ++++-----
drivers/net/wireless/ath/ath11k/thermal.h | 8 ++--
drivers/net/wireless/ath/ath11k/wmi.c | 32 +++++++-------
5 files changed, 61 insertions(+), 61 deletions(-)


base-commit: acbc21b2b1b18429244266f70a44b7043d391eae
--
2.17.1


2023-10-14 03:27:39

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 1/2] wifi: ath11k: rename the wmi_sc naming convention to wmi_ab

In WMI layer module, the identifier wmi_sc is used to represent
an instance of ath11k_wmi_base structure. However, within ath11k,
the convention is to use "ab" to represent an SoC "base" struct.
So change the all instances of wmi_sc to wmi_ab.

Compile tested only.

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath11k/wmi.c | 32 +++++++++++++--------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 26d416aa9c1f..8fd946437858 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -292,18 +292,18 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_pdev_wmi *wmi, struct sk_buf
int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
u32 cmd_id)
{
- struct ath11k_wmi_base *wmi_sc = wmi->wmi_ab;
+ struct ath11k_wmi_base *wmi_ab = wmi->wmi_ab;
int ret = -EOPNOTSUPP;
- struct ath11k_base *ab = wmi_sc->ab;
+ struct ath11k_base *ab = wmi_ab->ab;

might_sleep();

if (ab->hw_params.credit_flow) {
- wait_event_timeout(wmi_sc->tx_credits_wq, ({
+ wait_event_timeout(wmi_ab->tx_credits_wq, ({
ret = ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id);

if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH,
- &wmi_sc->ab->dev_flags))
+ &wmi_ab->ab->dev_flags))
ret = -ESHUTDOWN;

(ret != -EAGAIN);
@@ -313,7 +313,7 @@ int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
ret = ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id);

if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH,
- &wmi_sc->ab->dev_flags))
+ &wmi_ab->ab->dev_flags))
ret = -ESHUTDOWN;

(ret != -ENOBUFS);
@@ -321,10 +321,10 @@ int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
}

if (ret == -EAGAIN)
- ath11k_warn(wmi_sc->ab, "wmi command %d timeout\n", cmd_id);
+ ath11k_warn(wmi_ab->ab, "wmi command %d timeout\n", cmd_id);

if (ret == -ENOBUFS)
- ath11k_warn(wmi_sc->ab, "ce desc not available for wmi command %d\n",
+ ath11k_warn(wmi_ab->ab, "ce desc not available for wmi command %d\n",
cmd_id);

return ret;
@@ -611,10 +611,10 @@ static int ath11k_service_ready_event(struct ath11k_base *ab, struct sk_buff *sk
return 0;
}

-struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len)
+struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_ab, u32 len)
{
struct sk_buff *skb;
- struct ath11k_base *ab = wmi_sc->ab;
+ struct ath11k_base *ab = wmi_ab->ab;
u32 round_len = roundup(len, 4);

skb = ath11k_htc_alloc_skb(ab, WMI_SKB_HEADROOM + round_len);
@@ -4291,7 +4291,7 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,

int ath11k_wmi_cmd_init(struct ath11k_base *ab)
{
- struct ath11k_wmi_base *wmi_sc = &ab->wmi_ab;
+ struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab;
struct wmi_init_cmd_param init_param;
struct target_resource_config config;

@@ -4304,12 +4304,12 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab)
ab->wmi_ab.svc_map))
config.is_reg_cc_ext_event_supported = 1;

- memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config));
+ memcpy(&wmi_ab->wlan_resource_config, &config, sizeof(config));

- init_param.res_cfg = &wmi_sc->wlan_resource_config;
- init_param.num_mem_chunks = wmi_sc->num_mem_chunks;
- init_param.hw_mode_id = wmi_sc->preferred_hw_mode;
- init_param.mem_chunks = wmi_sc->mem_chunks;
+ init_param.res_cfg = &wmi_ab->wlan_resource_config;
+ init_param.num_mem_chunks = wmi_ab->num_mem_chunks;
+ init_param.hw_mode_id = wmi_ab->preferred_hw_mode;
+ init_param.mem_chunks = wmi_ab->mem_chunks;

if (ab->hw_params.single_pdev_only)
init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX;
@@ -4317,7 +4317,7 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab)
init_param.num_band_to_mac = ab->num_radios;
ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);

- return ath11k_init_cmd_send(&wmi_sc->wmi[0], &init_param);
+ return ath11k_init_cmd_send(&wmi_ab->wmi[0], &init_param);
}

int ath11k_wmi_vdev_spectral_conf(struct ath11k *ar,
--
2.17.1

2023-10-14 03:27:50

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 2/2] wifi: ath11k: rename the sc naming convention to ab

In PCI, thermal and HAL interface layer module, the identifier
sc is used to represent an instance of ath11k_base structure.
However, within ath11k, the convention is to use "ab" to
represent an SoC "base" struct. So change the all instances
of sc to ab.

Compile tested only.

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath11k/hif.h | 54 +++++++++++------------
drivers/net/wireless/ath/ath11k/pcic.c | 6 +--
drivers/net/wireless/ath/ath11k/thermal.c | 22 ++++-----
drivers/net/wireless/ath/ath11k/thermal.h | 8 ++--
4 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/ath/ath11k/hif.h
index 659b80d2abd4..d68ed4214dec 100644
--- a/drivers/net/wireless/ath/ath11k/hif.h
+++ b/drivers/net/wireless/ath/ath11k/hif.h
@@ -9,18 +9,18 @@
#include "core.h"

struct ath11k_hif_ops {
- u32 (*read32)(struct ath11k_base *sc, u32 address);
- void (*write32)(struct ath11k_base *sc, u32 address, u32 data);
+ u32 (*read32)(struct ath11k_base *ab, u32 address);
+ void (*write32)(struct ath11k_base *ab, u32 address, u32 data);
int (*read)(struct ath11k_base *ab, void *buf, u32 start, u32 end);
- void (*irq_enable)(struct ath11k_base *sc);
- void (*irq_disable)(struct ath11k_base *sc);
- int (*start)(struct ath11k_base *sc);
- void (*stop)(struct ath11k_base *sc);
- int (*power_up)(struct ath11k_base *sc);
- void (*power_down)(struct ath11k_base *sc);
+ void (*irq_enable)(struct ath11k_base *ab);
+ void (*irq_disable)(struct ath11k_base *ab);
+ int (*start)(struct ath11k_base *ab);
+ void (*stop)(struct ath11k_base *ab);
+ int (*power_up)(struct ath11k_base *ab);
+ void (*power_down)(struct ath11k_base *ab);
int (*suspend)(struct ath11k_base *ab);
int (*resume)(struct ath11k_base *ab);
- int (*map_service_to_pipe)(struct ath11k_base *sc, u16 service_id,
+ int (*map_service_to_pipe)(struct ath11k_base *ab, u16 service_id,
u8 *ul_pipe, u8 *dl_pipe);
int (*get_user_msi_vector)(struct ath11k_base *ab, char *user_name,
int *num_vectors, u32 *user_base_data,
@@ -44,34 +44,34 @@ static inline void ath11k_hif_ce_irq_disable(struct ath11k_base *ab)
ab->hif.ops->ce_irq_disable(ab);
}

-static inline int ath11k_hif_start(struct ath11k_base *sc)
+static inline int ath11k_hif_start(struct ath11k_base *ab)
{
- return sc->hif.ops->start(sc);
+ return ab->hif.ops->start(ab);
}

-static inline void ath11k_hif_stop(struct ath11k_base *sc)
+static inline void ath11k_hif_stop(struct ath11k_base *ab)
{
- sc->hif.ops->stop(sc);
+ ab->hif.ops->stop(ab);
}

-static inline void ath11k_hif_irq_enable(struct ath11k_base *sc)
+static inline void ath11k_hif_irq_enable(struct ath11k_base *ab)
{
- sc->hif.ops->irq_enable(sc);
+ ab->hif.ops->irq_enable(ab);
}

-static inline void ath11k_hif_irq_disable(struct ath11k_base *sc)
+static inline void ath11k_hif_irq_disable(struct ath11k_base *ab)
{
- sc->hif.ops->irq_disable(sc);
+ ab->hif.ops->irq_disable(ab);
}

-static inline int ath11k_hif_power_up(struct ath11k_base *sc)
+static inline int ath11k_hif_power_up(struct ath11k_base *ab)
{
- return sc->hif.ops->power_up(sc);
+ return ab->hif.ops->power_up(ab);
}

-static inline void ath11k_hif_power_down(struct ath11k_base *sc)
+static inline void ath11k_hif_power_down(struct ath11k_base *ab)
{
- sc->hif.ops->power_down(sc);
+ ab->hif.ops->power_down(ab);
}

static inline int ath11k_hif_suspend(struct ath11k_base *ab)
@@ -90,14 +90,14 @@ static inline int ath11k_hif_resume(struct ath11k_base *ab)
return 0;
}

-static inline u32 ath11k_hif_read32(struct ath11k_base *sc, u32 address)
+static inline u32 ath11k_hif_read32(struct ath11k_base *ab, u32 address)
{
- return sc->hif.ops->read32(sc, address);
+ return ab->hif.ops->read32(ab, address);
}

-static inline void ath11k_hif_write32(struct ath11k_base *sc, u32 address, u32 data)
+static inline void ath11k_hif_write32(struct ath11k_base *ab, u32 address, u32 data)
{
- sc->hif.ops->write32(sc, address, data);
+ ab->hif.ops->write32(ab, address, data);
}

static inline int ath11k_hif_read(struct ath11k_base *ab, void *buf,
@@ -109,10 +109,10 @@ static inline int ath11k_hif_read(struct ath11k_base *ab, void *buf,
return ab->hif.ops->read(ab, buf, start, end);
}

-static inline int ath11k_hif_map_service_to_pipe(struct ath11k_base *sc, u16 service_id,
+static inline int ath11k_hif_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
u8 *ul_pipe, u8 *dl_pipe)
{
- return sc->hif.ops->map_service_to_pipe(sc, service_id, ul_pipe, dl_pipe);
+ return ab->hif.ops->map_service_to_pipe(ab, service_id, ul_pipe, dl_pipe);
}

static inline int ath11k_get_user_msi_vector(struct ath11k_base *ab, char *user_name,
diff --git a/drivers/net/wireless/ath/ath11k/pcic.c b/drivers/net/wireless/ath/ath11k/pcic.c
index c63083633b37..16d1e332193f 100644
--- a/drivers/net/wireless/ath/ath11k/pcic.c
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
@@ -422,14 +422,14 @@ static void ath11k_pcic_ext_grp_disable(struct ath11k_ext_irq_grp *irq_grp)
disable_irq_nosync(irq_grp->ab->irq_num[irq_grp->irqs[i]]);
}

-static void __ath11k_pcic_ext_irq_disable(struct ath11k_base *sc)
+static void __ath11k_pcic_ext_irq_disable(struct ath11k_base *ab)
{
int i;

- clear_bit(ATH11K_FLAG_EXT_IRQ_ENABLED, &sc->dev_flags);
+ clear_bit(ATH11K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);

for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
- struct ath11k_ext_irq_grp *irq_grp = &sc->ext_irq_grp[i];
+ struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];

ath11k_pcic_ext_grp_disable(irq_grp);

diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c
index 23ed01bd44f9..c9b012f97ba5 100644
--- a/drivers/net/wireless/ath/ath11k/thermal.c
+++ b/drivers/net/wireless/ath/ath11k/thermal.c
@@ -125,7 +125,7 @@ ATTRIBUTE_GROUPS(ath11k_hwmon);

int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
{
- struct ath11k_base *sc = ar->ab;
+ struct ath11k_base *ab = ar->ab;
struct thermal_mitigation_params param;
int ret = 0;

@@ -147,14 +147,14 @@ int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)

ret = ath11k_wmi_send_thermal_mitigation_param_cmd(ar, &param);
if (ret) {
- ath11k_warn(sc, "failed to send thermal mitigation duty cycle %u ret %d\n",
+ ath11k_warn(ab, "failed to send thermal mitigation duty cycle %u ret %d\n",
throttle_state, ret);
}

return ret;
}

-int ath11k_thermal_register(struct ath11k_base *sc)
+int ath11k_thermal_register(struct ath11k_base *ab)
{
struct thermal_cooling_device *cdev;
struct device *hwmon_dev;
@@ -162,8 +162,8 @@ int ath11k_thermal_register(struct ath11k_base *sc)
struct ath11k_pdev *pdev;
int i, ret;

- for (i = 0; i < sc->num_radios; i++) {
- pdev = &sc->pdevs[i];
+ for (i = 0; i < ab->num_radios; i++) {
+ pdev = &ab->pdevs[i];
ar = pdev->ar;
if (!ar)
continue;
@@ -172,7 +172,7 @@ int ath11k_thermal_register(struct ath11k_base *sc)
&ath11k_thermal_ops);

if (IS_ERR(cdev)) {
- ath11k_err(sc, "failed to setup thermal device result: %ld\n",
+ ath11k_err(ab, "failed to setup thermal device result: %ld\n",
PTR_ERR(cdev));
ret = -EINVAL;
goto err_thermal_destroy;
@@ -183,7 +183,7 @@ int ath11k_thermal_register(struct ath11k_base *sc)
ret = sysfs_create_link(&ar->hw->wiphy->dev.kobj, &cdev->device.kobj,
"cooling_device");
if (ret) {
- ath11k_err(sc, "failed to create cooling device symlink\n");
+ ath11k_err(ab, "failed to create cooling device symlink\n");
goto err_thermal_destroy;
}

@@ -204,18 +204,18 @@ int ath11k_thermal_register(struct ath11k_base *sc)
return 0;

err_thermal_destroy:
- ath11k_thermal_unregister(sc);
+ ath11k_thermal_unregister(ab);
return ret;
}

-void ath11k_thermal_unregister(struct ath11k_base *sc)
+void ath11k_thermal_unregister(struct ath11k_base *ab)
{
struct ath11k *ar;
struct ath11k_pdev *pdev;
int i;

- for (i = 0; i < sc->num_radios; i++) {
- pdev = &sc->pdevs[i];
+ for (i = 0; i < ab->num_radios; i++) {
+ pdev = &ab->pdevs[i];
ar = pdev->ar;
if (!ar)
continue;
diff --git a/drivers/net/wireless/ath/ath11k/thermal.h b/drivers/net/wireless/ath/ath11k/thermal.h
index 3e39675ef7f5..83cb67686733 100644
--- a/drivers/net/wireless/ath/ath11k/thermal.h
+++ b/drivers/net/wireless/ath/ath11k/thermal.h
@@ -26,17 +26,17 @@ struct ath11k_thermal {
};

#if IS_REACHABLE(CONFIG_THERMAL)
-int ath11k_thermal_register(struct ath11k_base *sc);
-void ath11k_thermal_unregister(struct ath11k_base *sc);
+int ath11k_thermal_register(struct ath11k_base *ab);
+void ath11k_thermal_unregister(struct ath11k_base *ab);
int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
void ath11k_thermal_event_temperature(struct ath11k *ar, int temperature);
#else
-static inline int ath11k_thermal_register(struct ath11k_base *sc)
+static inline int ath11k_thermal_register(struct ath11k_base *ab)
{
return 0;
}

-static inline void ath11k_thermal_unregister(struct ath11k_base *sc)
+static inline void ath11k_thermal_unregister(struct ath11k_base *ab)
{
}

--
2.17.1

2023-10-16 15:06:50

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: ath11k: rename the wmi_sc naming convention to wmi_ab

On 10/13/2023 8:26 PM, Karthikeyan Periyasamy wrote:
> In WMI layer module, the identifier wmi_sc is used to represent
> an instance of ath11k_wmi_base structure. However, within ath11k,
> the convention is to use "ab" to represent an SoC "base" struct.
> So change the all instances of wmi_sc to wmi_ab.
>
> Compile tested only.
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>

Acked-by: Jeff Johnson <[email protected]>

2023-10-16 15:06:50

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 2/2] wifi: ath11k: rename the sc naming convention to ab

On 10/13/2023 8:26 PM, Karthikeyan Periyasamy wrote:
> In PCI, thermal and HAL interface layer module, the identifier
> sc is used to represent an instance of ath11k_base structure.
> However, within ath11k, the convention is to use "ab" to
> represent an SoC "base" struct. So change the all instances
> of sc to ab.
>
> Compile tested only.
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>

Acked-by: Jeff Johnson <[email protected]>

2023-10-18 08:34:21

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: ath11k: rename the wmi_sc naming convention to wmi_ab

Karthikeyan Periyasamy <[email protected]> wrote:

> In WMI layer module, the identifier wmi_sc is used to represent
> an instance of ath11k_wmi_base structure. However, within ath11k,
> the convention is to use "ab" to represent an SoC "base" struct.
> So change the all instances of wmi_sc to wmi_ab.
>
> Compile tested only.
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
> Acked-by: Jeff Johnson <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

2 patches applied to ath-next branch of ath.git, thanks.

265c038ac9c2 wifi: ath11k: rename the wmi_sc naming convention to wmi_ab
2e66190e0d87 wifi: ath11k: rename the sc naming convention to ab

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches