diff options
| author | Nishank Aggarwal <naggar@codeaurora.org> | 2016-10-28 16:17:46 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-11-11 19:45:15 +0530 |
| commit | 494e701c7e22918c59ee12f90eb443b7b8601cff (patch) | |
| tree | a72f75e8a8c27be110873f3c2d6c7f6e50e5374f | |
| parent | 37b66dfa8221de434529b0ac1b839396fcdcbc94 (diff) | |
qcacld-2.0: CL 1683879 - update fw common interface files
WMI message to allow Specific Absorbtion Rate / tx power
limits to be set per band, chain, or modulation class.
Change-Id: Iece786a4e731462fd282e3eb3107541338a3af30
CRs-Fixed: 865207
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_tlv_defs.h | 9 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_unified.h | 108 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_version.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMI/wmi_unified.c | 1 |
4 files changed, 119 insertions, 1 deletions
diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h index bfc6f21c6f9e..64cc160309ff 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -755,6 +755,8 @@ typedef enum { WMITLV_TAG_STRUC_wmi_pdev_band_to_mac, WMITLV_TAG_STRUC_wmi_tbtt_offset_info, WMITLV_TAG_STRUC_wmi_tbtt_offset_ext_event_fixed_param, + WMITLV_TAG_STRUC_wmi_sar_limits_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_sar_limit_cmd_row, } WMITLV_TAG_ID; /* @@ -1059,6 +1061,7 @@ typedef enum { OP(WMI_PDEV_SET_STATS_THRESHOLD_CMDID) \ OP(WMI_REQUEST_WLAN_STATS_CMDID) \ OP(WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID) \ + OP(WMI_SAR_LIMITS_CMDID) \ /* add new CMD_LIST elements above this line */ /* @@ -2528,6 +2531,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_END_REQ_CMDID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_modem_power_state_cmd_param, wmi_modem_power_state_cmd_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_MODEM_POWER_STATE_CMDID); +/* SAR limit update cmd */ +#define WMITLV_TABLE_WMI_SAR_LIMITS_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_sar_limits_cmd_fixed_param, wmi_sar_limits_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_sar_limit_cmd_row, sar_limits, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_SAR_LIMITS_CMDID); + /* get estimated link speed cmd */ #define WMITLV_TABLE_WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_peer_get_estimated_linkspeed_cmd_fixed_param, wmi_peer_get_estimated_linkspeed_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index 5e828cdc5852..bd4147704a0b 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -894,6 +894,7 @@ typedef enum { WMI_COEX_CONFIG_CMDID, WMI_CHAN_AVOID_RPT_ALLOW_CMDID, WMI_COEX_GET_ANTENNA_ISOLATION_CMDID, + WMI_SAR_LIMITS_CMDID, /** * OBSS scan offload enable/disable commands @@ -12367,6 +12368,113 @@ enum { WMI_MODEM_STATE_ON }; +/** + * This command is sent from WLAN host driver to firmware to + * notify the updated Specific Absorption Rate (SAR) limits. + * A critical regulation for FCC compliance, OEMs require methods to set + * limits on TX power of WLAN/WWAN. + * Host would receive instructions on what to set the limits per + * band/chain/modulation to, it would then interpret and send the limits + * to FW using this WMI message. + * Since it is possible to have too many commands to fit into one message, + * FW will keep receiving the messages, until it finds one with + * commit_limits = 1, at which point it will apply all the received + * specifications. +*/ + +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_sar_limits_cmd_param */ + A_UINT32 tlv_header; + + /** when set to WMI_SAR_FEATURE_ON, enable SAR feature; + * if set to WMI_SAR_FEATURE_OFF, disable feature; + * if set to WMI_SAR_FEATURE_NO_CHANGE, do not alter state of feature; + */ + + A_UINT32 sar_enable; + + /** number of items in sar_limits[] */ + A_UINT32 num_limit_rows; + /** once received and is set to 1, FW will calculate the power limits + * and send set_power command to apply them. + * Otherwise just update local values stored in FW until a future msg + * with commit_limits=1 arrives. + */ + + A_UINT32 commit_limits; + + /** + * TLV (tag length value) parameters follow the sar_limit_cmd_row + * structure. The TLV's are: + * wmi_sar_limit_cmd_row sar_limits[]; + */ +} wmi_sar_limits_cmd_fixed_param; + +enum wmi_sar_feature_state_flags { + WMI_SAR_FEATURE_OFF = 0, + WMI_SAR_FEATURE_ON_SET_0, + WMI_SAR_FEATURE_ON_SET_1, + WMI_SAR_FEATURE_ON_SET_2, + WMI_SAR_FEATURE_ON_SET_3, + WMI_SAR_FEATURE_ON_SET_4, + WMI_SAR_FEATURE_NO_CHANGE +}; + +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_sar_limit_cmd_row */ + + /** Current values: WMI_SAR_2G_ID, WMI_SAR_5G_ID. Can be extended by adding + * new band_id values . + */ + A_UINT32 band_id; + + A_UINT32 chain_id; + + /** Current values: WMI_SAR_MOD_CCK, WMI_SAR_MOD_OFDM */ + A_UINT32 mod_id; + + /** actual power limit value, in steps of 0.5 dBm */ + A_UINT32 limit_value; + + /** in case the OEM doesn't care about one of the qualifiers from above, + * the bit for that qualifier within the validity_bitmap can be set to 0 + * so that limit is applied to all possible cases of this qualifier + * (i.e. if a qualifier's validity_bitmap flag is 0, the qualifier is + * treated as a wildcard). + * Current masks: + * WMI_SAR_BAND_ID_VALID_MASK + * WMI_SAR_CHAIN_ID_VALID_MASK + * WMI_SAR_MOD_ID_VALID_MASK + * Example: if !WMI_IS_SAR_MOD_ID_VALID(bitmap), + * it means apply same limit_value to both WMI_SAR_MOD_CCK and + * WMI_SAR_MOD_OFDM cases. + */ + + A_UINT32 validity_bitmap; +} wmi_sar_limit_cmd_row; + +enum wmi_sar_band_id_flags { + WMI_SAR_2G_ID = 0, + WMI_SAR_5G_ID +}; + +enum wmi_sar_mod_id_flags { + WMI_SAR_MOD_CCK = 0, + WMI_SAR_MOD_OFDM +}; + +#define WMI_SAR_BAND_ID_VALID_MASK (0x1) +#define WMI_SAR_CHAIN_ID_VALID_MASK (0x2) +#define WMI_SAR_MOD_ID_VALID_MASK (0x4) + +#define WMI_SET_SAR_BAND_ID_VALID(bitmap) ((bitmap) |= WMI_SAR_BAND_ID_VALID_MASK) +#define WMI_SET_SAR_CHAIN_ID_VALID(bitmap) ((bitmap) |= WMI_SAR_CHAIN_ID_VALID_MASK) +#define WMI_SET_SAR_MOD_ID_VALID(bitmap) ((bitmap) |= WMI_SAR_MOD_ID_VALID_MASK) + +#define WMI_IS_SAR_BAND_ID_VALID(bitmap) ((bitmap) & WMI_SAR_BAND_ID_VALID_MASK) +#define WMI_IS_SAR_CHAIN_ID_VALID(bitmap) ((bitmap) & WMI_SAR_CHAIN_ID_VALID_MASK) +#define WMI_IS_SAR_MOD_ID_VALID(bitmap) ((bitmap) & WMI_SAR_MOD_ID_VALID_MASK) + #define WMI_ROAM_AUTH_STATUS_CONNECTED 0x1 /** connected, but not authenticated */ #define WMI_ROAM_AUTH_STATUS_AUTHENTICATED 0x2 /** connected and authenticated */ diff --git a/CORE/SERVICES/COMMON/wmi_version.h b/CORE/SERVICES/COMMON/wmi_version.h index 0d79ff51a53f..2360fb1b474b 100644 --- a/CORE/SERVICES/COMMON/wmi_version.h +++ b/CORE/SERVICES/COMMON/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 304 +#define __WMI_REVISION_ 305 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index c5c5a312c17d..11f5fce59fb5 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -720,6 +720,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_PDEV_SET_STATS_THRESHOLD_CMDID); CASE_RETURN_STRING(WMI_REQUEST_WLAN_STATS_CMDID); CASE_RETURN_STRING(WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID); + CASE_RETURN_STRING(WMI_SAR_LIMITS_CMDID); } return "Invalid WMI cmd"; } |
