From fe2c815b7733d1b9cbbf477b9db73186d0141127 Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Fri, 6 May 2016 20:20:25 +0530 Subject: [PATCH] qcacmn: Add non-tlv implementation in common wmi layer( part 2) Add non-tlv fixes for issues observed during L1 validation in WIN platform. Change-Id: I20efe25021258137a97dc408b93c9fdc3714f367 Acked-by: Sathish Kumar CRs-Fixed: 1005778 --- wmi/inc/wmi_unified_api.h | 2 +- wmi/inc/wmi_unified_param.h | 17 +++++----------- wmi/inc/wmi_unified_priv.h | 3 ++- wmi/src/wmi_unified_api.c | 5 +++-- wmi/src/wmi_unified_non_tlv.c | 38 ++++++++++++++++++++++++++++------- 5 files changed, 42 insertions(+), 23 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 9e445f7a20..8d33244633 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1185,7 +1185,7 @@ QDF_STATUS wmi_extract_composite_phyerr(void *wmi_hdl, void *evt_buf, QDF_STATUS wmi_extract_profile_ctx(void *wmi_hdl, void *evt_buf, wmi_host_wlan_profile_ctx_t *profile_ctx); -QDF_STATUS wmi_extract_profile_data(void *wmi_hdl, void *evt_buf, +QDF_STATUS wmi_extract_profile_data(void *wmi_hdl, void *evt_buf, uint8_t idx, wmi_host_wlan_profile_t *profile_data); QDF_STATUS wmi_extract_chan_info_event(void *wmi_hdl, void *evt_buf, diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 54fc8ecd47..88cf7a2d87 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -118,6 +118,7 @@ #define RTT_TIMEOUT_MS 180 #define MAX_SUPPORTED_RATES 128 #define WMI_HOST_MAX_BUFFER_SIZE 1712 +#define WMI_HAL_MAX_SANTENNA 4 #define WMI_HOST_F_MS(_v, _f) \ (((_v) & (_f)) >> (_f##_S)) @@ -3244,13 +3245,15 @@ struct thermal_mitigation_params { * @enable: Enable/Disable * @mode: SA mode * @rx_antenna: RX antenna config - * @is_ar900b: Is target ar900b + * @gpio_pin : GPIO pin config + * @gpio_func : GPIO function config */ struct smart_ant_enable_params { uint32_t enable; uint32_t mode; uint32_t rx_antenna; - bool is_ar900b; + uint32_t gpio_pin[WMI_HAL_MAX_SANTENNA]; + uint32_t gpio_func[WMI_HAL_MAX_SANTENNA]; }; /** @@ -6177,16 +6180,6 @@ typedef struct { uint32_t bin_count; } wmi_host_wlan_profile_ctx_t; -/** - * struct wmi_host_profile_stats_event - Profile stats event - * @profile_ctx: wmi_host_wlan_profile_ctx_t - * @profile_data: wmi_host_wlan_profile_t - */ -typedef struct { - wmi_host_wlan_profile_ctx_t profile_ctx; - wmi_host_wlan_profile_t profile_data[WMI_HOST_MAX_PROFILE]; -} wmi_host_profile_stats_event; - /** * struct wmi_host_chan_info_event - Channel info WMI event * @err_code: Error code diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 65b50a2d0b..0c7896b16e 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -999,7 +999,8 @@ QDF_STATUS (*extract_profile_ctx)(wmi_unified_t wmi_handle, void *evt_buf, wmi_host_wlan_profile_ctx_t *profile_ctx); QDF_STATUS (*extract_profile_data)(wmi_unified_t wmi_handle, void *evt_buf, - wmi_host_wlan_profile_t *profile_data); + uint8_t idx, + wmi_host_wlan_profile_t *profile_data); QDF_STATUS (*extract_chan_info_event)(wmi_unified_t wmi_handle, void *evt_buf, wmi_host_chan_info_event *chan_info); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 603f7c890b..ec9d89b821 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -5878,18 +5878,19 @@ QDF_STATUS wmi_extract_thermal_level_stats(void *wmi_hdl, void *evt_buf, * wmi_extract_profile_data() - extract profile data from event * @wmi_handle: wmi handle * @param evt_buf: pointer to event buffer + * @idx index: index of profile data * @param profile_data: Pointer to hold profile data * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ -QDF_STATUS wmi_extract_profile_data(void *wmi_hdl, void *evt_buf, +QDF_STATUS wmi_extract_profile_data(void *wmi_hdl, void *evt_buf, uint8_t idx, wmi_host_wlan_profile_t *profile_data) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; if (wmi_handle->ops->extract_profile_data) return wmi_handle->ops->extract_profile_data(wmi_handle, - evt_buf, profile_data); + evt_buf, idx, profile_data); return QDF_STATUS_E_FAILURE; } diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 3401aba030..0fb02a1811 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -2217,6 +2217,29 @@ QDF_STATUS send_smart_ant_enable_cmd_non_tlv(wmi_unified_t wmi_handle, cmd->rx_antenna = param->rx_antenna; cmd->tx_default_antenna = param->rx_antenna; + if (param->mode == SMART_ANT_MODE_SERIAL) { + cmd->gpio_pin[0] = param->gpio_pin[0]; + cmd->gpio_pin[1] = param->gpio_pin[1]; + cmd->gpio_pin[2] = 0; + cmd->gpio_pin[3] = 0; + + cmd->gpio_func[0] = param->gpio_func[0]; + cmd->gpio_func[1] = param->gpio_func[1]; + cmd->gpio_func[2] = 0; + cmd->gpio_func[3] = 0; + + } else if (param->mode == SMART_ANT_MODE_PARALLEL) { + cmd->gpio_pin[0] = param->gpio_pin[0]; + cmd->gpio_pin[1] = param->gpio_pin[1]; + cmd->gpio_pin[2] = param->gpio_pin[2]; + cmd->gpio_pin[3] = param->gpio_pin[3]; + + cmd->gpio_func[0] = param->gpio_func[0]; + cmd->gpio_func[1] = param->gpio_func[1]; + cmd->gpio_func[2] = param->gpio_func[2]; + cmd->gpio_func[3] = param->gpio_func[3]; + } + ret = wmi_unified_cmd_send(wmi_handle, buf, len, @@ -6992,19 +7015,17 @@ static QDF_STATUS extract_profile_ctx_non_tlv(wmi_unified_t wmi_handle, * Return: 0 for success or error code */ static QDF_STATUS extract_profile_data_non_tlv(wmi_unified_t wmi_handle, - void *evt_buf, + void *evt_buf, uint8_t idx, wmi_host_wlan_profile_t *profile_data) { wmi_profile_stats_event *profile_ev = (wmi_profile_stats_event *)evt_buf; - uint32_t i; - for (i = 0; i < profile_ev->profile_ctx.bin_count; i++) { + if (idx > profile_ev->profile_ctx.bin_count) + return QDF_STATUS_E_INVAL; - qdf_mem_copy((profile_data+i), &profile_ev->profile_data[i], - sizeof(wmi_host_wlan_profile_t)); - - } + qdf_mem_copy(profile_data, &profile_ev->profile_data[idx], + sizeof(wmi_host_wlan_profile_t)); return QDF_STATUS_SUCCESS; } @@ -7310,6 +7331,9 @@ struct wmi_ops non_tlv_ops = { .extract_tx_data_traffic_ctrl_ev = extract_tx_data_traffic_ctrl_ev_non_tlv, .extract_vdev_extd_stats = extract_vdev_extd_stats_non_tlv, + .extract_fips_event_data = extract_fips_event_data_non_tlv, + .extract_fips_event_error_status = + extract_fips_event_error_status_non_tlv, }; /**