Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c299b70f authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge b0a57f7e on remote branch

Change-Id: If4f11f834253aa5116dc922898b092866f0746c8
parents 5f44ff8a b0a57f7e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1271,7 +1271,8 @@ FWOL_OS_IF_SRC := os_if/fw_offload/src
FWOL_INC := -I$(WLAN_ROOT)/$(FWOL_CORE_INC) \
	    -I$(WLAN_ROOT)/$(FWOL_DISPATCHER_INC) \
	    -I$(WLAN_ROOT)/$(FWOL_TARGET_IF_INC) \
	    -I$(WLAN_ROOT)/$(FWOL_OS_IF_INC)
	    -I$(WLAN_ROOT)/$(FWOL_OS_IF_INC) \
	    -I$(WLAN_COMMON_INC)/umac/thermal/dispatcher/inc

ifeq ($(CONFIG_WLAN_FW_OFFLOAD), y)
FWOL_OBJS :=	$(FWOL_CORE_SRC)/wlan_fw_offload_main.o \
@@ -2602,6 +2603,7 @@ cppflags-y += -DANI_OS_TYPE_ANDROID=6 \
		-Werror\
		-D__linux__

cppflags-$(CONFIG_THERMAL_STATS_SUPPORT) += -DTHERMAL_STATS_SUPPORT
cppflags-$(CONFIG_PTT_SOCK_SVC_ENABLE) += -DPTT_SOCK_SVC_ENABLE
cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DFEATURE_WLAN_WAPI
cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DATH_SUPPORT_WAPI
+22 −0
Original line number Diff line number Diff line
@@ -51,10 +51,12 @@
/**
 * enum wlan_fwol_southbound_event - fw offload south bound event type
 * @WLAN_FWOL_EVT_GET_ELNA_BYPASS_RESPONSE: get eLNA bypass response
 * @WLAN_FWOL_EVT_GET_THERMAL_STATS_RESPONSE: get Thermal Stats response
 */
enum wlan_fwol_southbound_event {
	WLAN_FWOL_EVT_INVALID = 0,
	WLAN_FWOL_EVT_GET_ELNA_BYPASS_RESPONSE,
	WLAN_FWOL_EVT_GET_THERMAL_STATS_RESPONSE,
	WLAN_FWOL_EVT_LAST,
	WLAN_FWOL_EVT_MAX = WLAN_FWOL_EVT_LAST - 1
};
@@ -116,6 +118,7 @@ struct wlan_fwol_coex_config {
 * @priority_apps: Priority of the apps mitigation to consider by fw
 * @priority_wpps: Priority of the wpps mitigation to consider by fw
 * @thermal_action: thermal action as defined enum thermal_mgmt_action_code
 * @therm_stats_offset: thermal temp offset as set in gThermalStatsTempOffset
 */
struct wlan_fwol_thermal_temp {
	bool     thermal_mitigation_enable;
@@ -128,6 +131,9 @@ struct wlan_fwol_thermal_temp {
	uint8_t priority_apps;
	uint8_t priority_wpps;
	enum thermal_mgmt_action_code thermal_action;
#ifdef THERMAL_STATS_SUPPORT
	uint8_t therm_stats_offset;
#endif
};

/**
@@ -275,18 +281,30 @@ struct wlan_fwol_cfg {
	bool disable_hw_assist;
};

/**
 * struct wlan_fwol_capability_info - FW offload capability component
 * @fw_thermal_stats_cap: Thermal Stats Fw capability
 **/
struct wlan_fwol_capability_info {
#ifdef THERMAL_STATS_SUPPORT
	bool fw_thermal_stats_cap;
#endif
};

/**
 * struct wlan_fwol_psoc_obj - FW offload psoc priv object
 * @cfg:     cfg items
 * @cbs:     callback functions
 * @tx_ops: tx operations for target interface
 * @rx_ops: rx operations for target interface
 * @capability_info: fwol capability info
 */
struct wlan_fwol_psoc_obj {
	struct wlan_fwol_cfg cfg;
	struct wlan_fwol_callbacks cbs;
	struct wlan_fwol_tx_ops tx_ops;
	struct wlan_fwol_rx_ops rx_ops;
	struct wlan_fwol_capability_info capability_info;
};

/**
@@ -294,6 +312,7 @@ struct wlan_fwol_psoc_obj {
 * @psoc: psoc handle
 * @event_id: event ID
 * @get_elna_bypass_response: get eLNA bypass response
 * @get_thermal_stats_response: get thermal stats response
 */
struct wlan_fwol_rx_event {
	struct wlan_objmgr_psoc *psoc;
@@ -301,6 +320,9 @@ struct wlan_fwol_rx_event {
	union {
#ifdef WLAN_FEATURE_ELNA
		struct get_elna_bypass_response get_elna_bypass_response;
#endif
#ifdef THERMAL_STATS_SUPPORT
		struct thermal_throttle_info get_thermal_stats_response;
#endif
	};
};
+73 −1
Original line number Diff line number Diff line
@@ -111,6 +111,22 @@ fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
						    CFG_BLE_SCAN_COEX_POLICY);
}

#ifdef THERMAL_STATS_SUPPORT
static void
fwol_init_thermal_stats_in_cfg(struct wlan_objmgr_psoc *psoc,
			       struct wlan_fwol_thermal_temp *thermal_temp)
{
	thermal_temp->therm_stats_offset =
				cfg_get(psoc, CFG_THERMAL_STATS_TEMP_OFFSET);
}
#else
static void
fwol_init_thermal_stats_in_cfg(struct wlan_objmgr_psoc *psoc,
			       struct wlan_fwol_thermal_temp *thermal_temp)
{
}
#endif

static void
fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
			      struct wlan_fwol_thermal_temp *thermal_temp)
@@ -155,7 +171,7 @@ fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
				cfg_get(psoc, CFG_THERMAL_WPPS_PRIOITY);
	thermal_temp->thermal_action =
				cfg_get(psoc, CFG_THERMAL_MGMT_ACTION);

	fwol_init_thermal_stats_in_cfg(psoc, thermal_temp);
}

QDF_STATUS fwol_init_neighbor_report_cfg(struct wlan_objmgr_psoc *psoc,
@@ -622,6 +638,59 @@ fwol_process_get_elna_bypass_resp(struct wlan_fwol_rx_event *event)
}
#endif /* WLAN_FEATURE_ELNA */

#ifdef THERMAL_STATS_SUPPORT
/**
 * fwol_process_get_thermal_stats_resp() - Process get thermal stats response
 * @event: response event
 *
 * Return: QDF_STATUS_SUCCESS on success
 */
static QDF_STATUS
fwol_process_get_thermal_stats_resp(struct wlan_fwol_rx_event *event)
{
	QDF_STATUS status = QDF_STATUS_SUCCESS;
	struct wlan_objmgr_psoc *psoc;
	struct wlan_fwol_psoc_obj *fwol_obj;
	struct wlan_fwol_callbacks *cbs;
	struct thermal_throttle_info *resp;

	if (!event) {
		fwol_err("Event buffer is NULL");
		return QDF_STATUS_E_FAILURE;
	}

	psoc = event->psoc;
	if (!psoc) {
		fwol_err("psoc is NULL");
		return QDF_STATUS_E_INVAL;
	}

	fwol_obj = fwol_get_psoc_obj(psoc);
	if (!fwol_obj) {
		fwol_err("Failed to get FWOL Obj");
		return QDF_STATUS_E_INVAL;
	}

	cbs = &fwol_obj->cbs;
	if (cbs && cbs->get_thermal_stats_callback) {
		resp = &event->get_thermal_stats_response;
		cbs->get_thermal_stats_callback(cbs->get_thermal_stats_context,
						resp);
	} else {
		fwol_err("NULL pointer for callback");
		status = QDF_STATUS_E_IO;
	}

	return status;
}
#else
static QDF_STATUS
fwol_process_get_thermal_stats_resp(struct wlan_fwol_rx_event *event)
{
	return QDF_STATUS_E_NOSUPPORT;
}
#endif /* THERMAL_STATS_SUPPORT */

QDF_STATUS fwol_process_event(struct scheduler_msg *msg)
{
	QDF_STATUS status;
@@ -641,6 +710,9 @@ QDF_STATUS fwol_process_event(struct scheduler_msg *msg)
	case WLAN_FWOL_EVT_GET_ELNA_BYPASS_RESPONSE:
		status = fwol_process_get_elna_bypass_resp(event);
		break;
	case WLAN_FWOL_EVT_GET_THERMAL_STATS_RESPONSE:
		status = fwol_process_get_thermal_stats_resp(event);
		break;
	default:
		status = QDF_STATUS_E_INVAL;
		break;
+28 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2018,2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2018,2020-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -430,6 +430,31 @@
				CFG_VALUE_OR_DEFAULT, \
				"Thermal management action")

/* <ini>
 * gThermalStatsTempOffset - Configure the thermal stats offset
 *
 * @Min: 0
 * @Max: 10
 * @Default: 5
 *
 * This ini will configure Thermal temperature offset value for capturing
 * thermal stats in  thermal range.
 * Thermal STATS start capturing from temperature threshold to temperature
 * threshold + offset.
 * If the value 0 is given then then thermal STATS capture is disabled
 *
 * Usage: External
 *
 * </ini>
 */
#define CFG_THERMAL_STATS_TEMP_OFFSET CFG_INI_UINT( \
					"gThermalStatsTempOffset", \
					0, \
					10, \
					5, \
					CFG_VALUE_OR_DEFAULT, \
					"Thermal Stats Temperature Offset")

#define CFG_THERMAL_TEMP_ALL \
	CFG(CFG_THERMAL_TEMP_MIN_LEVEL0) \
	CFG(CFG_THERMAL_TEMP_MAX_LEVEL0) \
@@ -450,6 +475,7 @@
	CFG(CFG_THERMAL_SAMPLING_TIME) \
	CFG(CFG_THERMAL_APPS_PRIORITY) \
	CFG(CFG_THERMAL_WPPS_PRIOITY) \
	CFG(CFG_THERMAL_MGMT_ACTION)
	CFG(CFG_THERMAL_MGMT_ACTION) \
	CFG(CFG_THERMAL_STATS_TEMP_OFFSET)
#endif
+37 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -24,6 +24,8 @@
#define _WLAN_FWOL_PUBLIC_STRUCTS_H_

#include "wlan_objmgr_psoc_obj.h"
#include "wlan_thermal_public_struct.h"
#include "wmi_unified.h"

#ifdef WLAN_FEATURE_ELNA
/**
@@ -57,10 +59,28 @@ struct get_elna_bypass_response {
};
#endif

/**
 * struct thermal_throttle_info - thermal throttle info from Target
 * @temperature: current temperature in c Degree
 * @level: target thermal level info
 * @pdev_id: pdev id
 * @therm_throt_levels: Number of thermal throttle levels
 * @level_info: Thermal Stats for each level
 */
struct thermal_throttle_info {
	uint32_t temperature;
	enum thermal_throttle_level level;
	uint32_t pdev_id;
	uint32_t therm_throt_levels;
	struct thermal_throt_level_stats level_info[WMI_THERMAL_STATS_TEMP_THRESH_LEVEL_MAX];
};

/**
 * struct wlan_fwol_callbacks - fw offload callbacks
 * @get_elna_bypass_callback: callback for get eLNA bypass
 * @get_elna_bypass_context: context for get eLNA bypass
 * @get_thermal_stats_callback: callback for get thermal stats
 * @get_thermal_stats_context: context for get thermal stats
 */
struct wlan_fwol_callbacks {
#ifdef WLAN_FEATURE_ELNA
@@ -68,6 +88,11 @@ struct wlan_fwol_callbacks {
				     struct get_elna_bypass_response *response);
	void *get_elna_bypass_context;
#endif
#ifdef THERMAL_STATS_SUPPORT
	void (*get_thermal_stats_callback)(void *context,
				     struct thermal_throttle_info *response);
	void *get_thermal_stats_context;
#endif
};

/**
@@ -77,6 +102,7 @@ struct wlan_fwol_callbacks {
 * @reg_evt_handler: register event handler
 * @unreg_evt_handler: unregister event handler
 * @send_dscp_up_map_to_fw: send dscp-to-up map values to FW
 * @get_thermal_stats: send get_thermal_stats cmd to FW
 */
struct wlan_fwol_tx_ops {
#ifdef WLAN_FEATURE_ELNA
@@ -94,17 +120,27 @@ struct wlan_fwol_tx_ops {
			struct wlan_objmgr_psoc *psoc,
			uint32_t *dscp_to_up_map);
#endif
#ifdef THERMAL_STATS_SUPPORT
	QDF_STATUS (*get_thermal_stats)(struct wlan_objmgr_psoc *psoc,
				        enum thermal_stats_request_type req_type,
				        uint8_t therm_stats_offset);
#endif
};

/**
 * struct wlan_fwol_rx_ops - structure of rx func pointers
 * @get_elna_bypass_resp: get eLNA bypass response
 * @get_thermal_stats_resp: thermal stats cmd response callback to fwol
 */
struct wlan_fwol_rx_ops {
#ifdef WLAN_FEATURE_ELNA
	QDF_STATUS (*get_elna_bypass_resp)(struct wlan_objmgr_psoc *psoc,
					 struct get_elna_bypass_response *resp);
#endif
#ifdef THERMAL_STATS_SUPPORT
	QDF_STATUS (*get_thermal_stats_resp)(struct wlan_objmgr_psoc *psoc,
					    struct thermal_throttle_info *resp);
#endif
};

#endif /* _WLAN_FWOL_PUBLIC_STRUCTS_H_ */
Loading