rcu_read_unlock();
}
+static void ath12k_wmi_thermal_throt_stats_event(struct ath12k_base *ab,
+ struct sk_buff *skb)
+{
+ const struct wmi_therm_throt_stats_event *ev;
+ struct ath12k *ar;
+ const void **tb;
+
+ tb = ath12k_wmi_tlv_parse(ab, skb);
+ if (IS_ERR(tb)) {
+ ath12k_err(ab, "failed to parse thermal throttling stats tlv: %ld\n",
+ PTR_ERR(tb));
+ return;
+ }
+
+ ev = tb[WMI_TAG_THERM_THROT_STATS_EVENT];
+ if (!ev) {
+ ath12k_err(ab, "failed to fetch thermal throt stats ev\n");
+ return;
+ }
+
+ rcu_read_lock();
+ ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev->pdev_id));
+ if (!ar) {
+ ath12k_warn(ab, "received thermal_throt_stats in invalid pdev %u\n",
+ le32_to_cpu(ev->pdev_id));
+ rcu_read_unlock();
+ return;
+ }
+ rcu_read_unlock();
+
+ ath12k_dbg(ab, ATH12K_DBG_WMI,
+ "thermal stats ev level %u pdev_id %u temp %u throt_levels %u\n",
+ le32_to_cpu(ev->level), le32_to_cpu(ev->pdev_id),
+ le32_to_cpu(ev->temp), le32_to_cpu(ev->therm_throt_levels));
+}
+
static void ath12k_fils_discovery_event(struct ath12k_base *ab,
struct sk_buff *skb)
{
case WMI_PDEV_TEMPERATURE_EVENTID:
ath12k_wmi_pdev_temperature_event(ab, skb);
break;
+ case WMI_THERM_THROT_STATS_EVENTID:
+ ath12k_wmi_thermal_throt_stats_event(ab, skb);
+ break;
case WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID:
ath12k_wmi_pdev_dma_ring_buf_release_event(ab, skb);
break;
WMI_READ_DATA_FROM_FLASH_EVENTID,
WMI_REPORT_RX_AGGR_FAILURE_EVENTID,
WMI_PKGID_EVENTID,
+ WMI_THERM_THROT_STATS_EVENTID,
WMI_GPIO_INPUT_EVENTID = WMI_TLV_CMD(WMI_GRP_GPIO),
WMI_UPLOADH_EVENTID,
WMI_CAPTUREH_EVENTID,
ALPHA_IS_SET,
};
+struct wmi_therm_throt_stats_event {
+ __le32 pdev_id;
+ __le32 temp;
+ __le32 level;
+ __le32 therm_throt_levels;
+} __packed;
+
struct ath12k_wmi_init_country_arg {
union {
u16 country_code;