Browse Source

qcacld-3.0: Refine the Thermal Level callback API

The Thermal Level callback currently specifies a void pointer for the
context. In the case of this API the context is actually known to be
an HDD handle, so update the API to explicitly use this type. This
will allow the compiler to verify that the correct type of parameter
is being passed.

Change-Id: Ifa6f9fb5d3e27470b3f5292552b871d072150988
CRs-Fixed: 2278586
Jeff Johnson 6 years ago
parent
commit
0e96308f39
2 changed files with 6 additions and 5 deletions
  1. 4 4
      core/hdd/src/wlan_hdd_main.c
  2. 2 1
      core/sme/inc/sme_internal.h

+ 4 - 4
core/hdd/src/wlan_hdd_main.c

@@ -8133,7 +8133,7 @@ void hdd_enable_fastpath(struct hdd_config *hdd_cfg,
 #if defined(FEATURE_WLAN_CH_AVOID)
 /**
  * hdd_set_thermal_level_cb() - set thermal level callback function
- * @context:	hdd context pointer
+ * @hdd_handle:	opaque handle for the hdd context
  * @level:	thermal level
  *
  * Change IPA data path to SW path when the thermal throttle level greater
@@ -8141,9 +8141,9 @@ void hdd_enable_fastpath(struct hdd_config *hdd_cfg,
  *
  * Return: none
  */
-static void hdd_set_thermal_level_cb(void *context, u_int8_t level)
+static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
 {
-	struct hdd_context *hdd_ctx = context;
+	struct hdd_context *hdd_ctx = hdd_handle_to_context(hdd_handle);
 
 	/* Change IPA to SW path when throttle level greater than 0 */
 	if (level > THROTTLE_LEVEL_0)
@@ -8550,7 +8550,7 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
 {
 }
 
-static void hdd_set_thermal_level_cb(void *context, u_int8_t level)
+static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
 {
 }
 

+ 2 - 1
core/sme/inc/sme_internal.h

@@ -148,7 +148,8 @@ typedef void (*ext_scan_ind_cb)(hdd_handle_t hdd_handle,
 				const uint16_t, void *);
 
 typedef void (*ocb_callback)(void *context, void *response);
-typedef void (*sme_set_thermal_level_callback)(void *context, u_int8_t level);
+typedef void (*sme_set_thermal_level_callback)(hdd_handle_t hdd_handle,
+					       u_int8_t level);
 typedef void (*p2p_lo_callback)(void *context, void *event);
 #ifdef FEATURE_OEM_DATA_SUPPORT
 typedef void (*sme_send_oem_data_rsp_msg)(struct oem_data_rsp *);