|
@@ -384,6 +384,40 @@ config_sar_failed:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void hdd_send_sar_unsolicited_event(struct hdd_context *hdd_ctx)
|
|
|
+{
|
|
|
+ struct sk_buff *vendor_event;
|
|
|
+ uint32_t len;
|
|
|
+
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err_rl("hdd context is null");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ len = NLMSG_HDRLEN;
|
|
|
+ vendor_event =
|
|
|
+ cfg80211_vendor_event_alloc(
|
|
|
+ hdd_ctx->wiphy, NULL, len,
|
|
|
+ QCA_NL80211_VENDOR_SUBCMD_REQUEST_SAR_LIMITS_INDEX,
|
|
|
+ GFP_KERNEL);
|
|
|
+
|
|
|
+ if (!vendor_event) {
|
|
|
+ hdd_err("cfg80211_vendor_event_alloc failed");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
|
|
|
+}
|
|
|
+
|
|
|
+static void hdd_sar_unsolicited_timer_cb(void *user_data)
|
|
|
+{
|
|
|
+ struct hdd_context *hdd_ctx = (struct hdd_context *)user_data;
|
|
|
+
|
|
|
+ hdd_nofl_debug("Sar unsolicited timer expired");
|
|
|
+
|
|
|
+ hdd_send_sar_unsolicited_event(hdd_ctx);
|
|
|
+}
|
|
|
+
|
|
|
static void hdd_sar_safety_timer_cb(void *user_data)
|
|
|
{
|
|
|
struct hdd_context *hdd_ctx = (struct hdd_context *)user_data;
|
|
@@ -392,6 +426,19 @@ static void hdd_sar_safety_timer_cb(void *user_data)
|
|
|
hdd_configure_sar_index(hdd_ctx, hdd_ctx->config->sar_safety_index);
|
|
|
}
|
|
|
|
|
|
+void wlan_hdd_sar_unsolicited_timer_start(struct hdd_context *hdd_ctx)
|
|
|
+{
|
|
|
+ if (!hdd_ctx->config->enable_sar_safety)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (QDF_TIMER_STATE_RUNNING !=
|
|
|
+ qdf_mc_timer_get_current_state(
|
|
|
+ &hdd_ctx->sar_safety_unsolicited_timer))
|
|
|
+ qdf_mc_timer_start(
|
|
|
+ &hdd_ctx->sar_safety_unsolicited_timer,
|
|
|
+ hdd_ctx->config->sar_safety_unsolicited_timeout);
|
|
|
+}
|
|
|
+
|
|
|
void wlan_hdd_sar_timers_reset(struct hdd_context *hdd_ctx)
|
|
|
{
|
|
|
if (!hdd_ctx->config->enable_sar_safety)
|
|
@@ -406,6 +453,11 @@ void wlan_hdd_sar_timers_reset(struct hdd_context *hdd_ctx)
|
|
|
|
|
|
qdf_mc_timer_start(&hdd_ctx->sar_safety_timer,
|
|
|
hdd_ctx->config->sar_safety_timeout);
|
|
|
+
|
|
|
+ if (QDF_TIMER_STATE_RUNNING ==
|
|
|
+ qdf_mc_timer_get_current_state(
|
|
|
+ &hdd_ctx->sar_safety_unsolicited_timer))
|
|
|
+ qdf_mc_timer_stop(&hdd_ctx->sar_safety_unsolicited_timer);
|
|
|
}
|
|
|
|
|
|
void wlan_hdd_sar_timers_init(struct hdd_context *hdd_ctx)
|
|
@@ -415,6 +467,10 @@ void wlan_hdd_sar_timers_init(struct hdd_context *hdd_ctx)
|
|
|
|
|
|
qdf_mc_timer_init(&hdd_ctx->sar_safety_timer, QDF_TIMER_TYPE_SW,
|
|
|
hdd_sar_safety_timer_cb, hdd_ctx);
|
|
|
+
|
|
|
+ qdf_mc_timer_init(&hdd_ctx->sar_safety_unsolicited_timer,
|
|
|
+ QDF_TIMER_TYPE_SW,
|
|
|
+ hdd_sar_unsolicited_timer_cb, hdd_ctx);
|
|
|
}
|
|
|
|
|
|
void wlan_hdd_sar_timers_deinit(struct hdd_context *hdd_ctx)
|
|
@@ -427,6 +483,14 @@ void wlan_hdd_sar_timers_deinit(struct hdd_context *hdd_ctx)
|
|
|
qdf_mc_timer_stop(&hdd_ctx->sar_safety_timer);
|
|
|
|
|
|
qdf_mc_timer_destroy(&hdd_ctx->sar_safety_timer);
|
|
|
+
|
|
|
+ if (QDF_TIMER_STATE_RUNNING ==
|
|
|
+ qdf_mc_timer_get_current_state(
|
|
|
+ &hdd_ctx->sar_safety_unsolicited_timer))
|
|
|
+ qdf_mc_timer_stop(&hdd_ctx->sar_safety_unsolicited_timer);
|
|
|
+
|
|
|
+ qdf_mc_timer_destroy(&hdd_ctx->sar_safety_unsolicited_timer);
|
|
|
+
|
|
|
}
|
|
|
#endif
|
|
|
|