Search Linux Wireless

Re: [PATCH 1/2] wifi: ath12k: Add Support to Parse TPC Event from Firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/20/2024 12:36 PM, Roopni Devanathan wrote:
...
> diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
> index 562b0615ed06..93c4c2344b44 100644
> --- a/drivers/net/wireless/ath/ath12k/wmi.c
> +++ b/drivers/net/wireless/ath/ath12k/wmi.c
> @@ -7404,6 +7404,382 @@ static void ath12k_wmi_event_teardown_complete(struct ath12k_base *ab,
>  	kfree(tb);
>  }
>  
> +static int ath12k_wmi_tpc_stats_copy_buffer(struct ath12k_base *ab,
> +					    const void *ptr, u16 tag, u16 len,
> +					    struct wmi_tpc_stats_info *tpc_stats)
> +{
> +	u32 len1, len2, len3, len4;
> +	s16 *dst_ptr;
> +	s8 *dst_ptr_ctl;
> +
> +	len1 = le32_to_cpu(tpc_stats->max_reg_allowed_power.tpc_reg_pwr.reg_array_len);
> +	len2 = le32_to_cpu(tpc_stats->rates_array1.tpc_rates_array.rate_array_len);
> +	len3 = le32_to_cpu(tpc_stats->rates_array2.tpc_rates_array.rate_array_len);
> +	len4 = le32_to_cpu(tpc_stats->ctl_array.tpc_ctl_pwr.ctl_array_len);
> +
> +	switch (le32_to_cpu(tpc_stats->event_count)) {

drivers/net/wireless/ath/ath12k/wmi.c:7434:17: warning: cast to restricted __le32

note the tpc_stats event_count is defined as u32, not __le32

...

> +static void ath12k_process_tpc_stats(struct ath12k_base *ab,
> +				     struct sk_buff *skb)
> +{
> +	struct ath12k_wmi_pdev_tpc_stats_event_fixed_params *fixed_param;
> +	struct wmi_tpc_stats_info *tpc_stats;
> +	const struct wmi_tlv *tlv;
> +	void *ptr = skb->data;
> +	struct ath12k *ar;
> +	u16 tlv_tag;
> +	u32 event_count;
> +	int ret;
> +

...

> +	}
> +	tpc_stats->pdev_id = fixed_param->pdev_id;
> +	tpc_stats->end_of_event = fixed_param->end_of_event;
> +	tpc_stats->event_count = fixed_param->event_count;

drivers/net/wireless/ath/ath12k/wmi.c:7773:28: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath12k/wmi.c:7773:28:    expected unsigned int [usertype] pdev_id
drivers/net/wireless/ath/ath12k/wmi.c:7773:28:    got restricted __le32 [usertype] pdev_id
drivers/net/wireless/ath/ath12k/wmi.c:7774:33: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath12k/wmi.c:7774:33:    expected unsigned int [usertype] end_of_event
drivers/net/wireless/ath/ath12k/wmi.c:7774:33:    got restricted __le32 [usertype] end_of_event
drivers/net/wireless/ath/ath12k/wmi.c:7775:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath12k/wmi.c:7775:32:    expected unsigned int [usertype] event_count
drivers/net/wireless/ath/ath12k/wmi.c:7775:32:    got restricted __le32 [usertype] event_count

These all need le32_to_cpu()

...

> diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
> index b6a197389277..5193f4a7fed1 100644
> --- a/drivers/net/wireless/ath/ath12k/wmi.h
> +++ b/drivers/net/wireless/ath/ath12k/wmi.h

...

> +struct wmi_tpc_stats_info {
> +	u32 pdev_id;
> +	u32 event_count;
> +	u32 end_of_event;
> +	u32 tlvs_rcvd;
> +	struct wmi_max_reg_power_allowed_params max_reg_allowed_power;
> +	struct wmi_tpc_rates_array_params rates_array1;
> +	struct wmi_tpc_rates_array_params rates_array2;
> +	struct wmi_tpc_config_params tpc_config;
> +	struct wmi_tpc_ctl_pwr_table_params ctl_array;
> +};





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux