qcacmn: Extract OEM response params
Add API to extract OEM response parameters from corresponding WMI event. Change-Id: I9a45bdac4a9091bf21ad8b9877e485baad4a75db CRs-Fixed: 2467938
This commit is contained in:

committed by
nshrivas

parent
5e9e4549d9
commit
94748b3c46
@@ -84,7 +84,7 @@ static QDF_STATUS target_if_wifi_pos_replenish_ring(
|
|||||||
|
|
||||||
static QDF_STATUS target_if_wifi_pos_get_indirect_data(
|
static QDF_STATUS target_if_wifi_pos_get_indirect_data(
|
||||||
struct wifi_pos_psoc_priv_obj *priv_obj,
|
struct wifi_pos_psoc_priv_obj *priv_obj,
|
||||||
wmi_oem_indirect_data *indirect,
|
struct wmi_host_oem_indirect_data *indirect,
|
||||||
struct oem_data_rsp *rsp, uint32_t *cookie)
|
struct oem_data_rsp *rsp, uint32_t *cookie)
|
||||||
{
|
{
|
||||||
void *paddr = NULL;
|
void *paddr = NULL;
|
||||||
@@ -127,7 +127,7 @@ static QDF_STATUS target_if_wifi_pos_replenish_ring(
|
|||||||
|
|
||||||
static QDF_STATUS target_if_wifi_pos_get_indirect_data(
|
static QDF_STATUS target_if_wifi_pos_get_indirect_data(
|
||||||
struct wifi_pos_psoc_priv_obj *priv_obj,
|
struct wifi_pos_psoc_priv_obj *priv_obj,
|
||||||
wmi_oem_indirect_data *indirect,
|
struct wmi_host_oem_indirect_data *indirect,
|
||||||
struct oem_data_rsp *rsp, uint32_t *cookie)
|
struct oem_data_rsp *rsp, uint32_t *cookie)
|
||||||
{
|
{
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
@@ -151,13 +151,13 @@ static int target_if_wifi_pos_oem_rsp_ev_handler(ol_scn_t scn,
|
|||||||
uint8_t ring_idx = 0;
|
uint8_t ring_idx = 0;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
uint32_t cookie = 0;
|
uint32_t cookie = 0;
|
||||||
wmi_oem_indirect_data *indirect;
|
struct wmi_host_oem_indirect_data *indirect;
|
||||||
struct oem_data_rsp oem_rsp = {0};
|
struct oem_data_rsp oem_rsp = {0};
|
||||||
struct wifi_pos_psoc_priv_obj *priv_obj;
|
struct wifi_pos_psoc_priv_obj *priv_obj;
|
||||||
struct wlan_objmgr_psoc *psoc = wifi_pos_get_psoc();
|
struct wlan_objmgr_psoc *psoc = wifi_pos_get_psoc();
|
||||||
struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops = NULL;
|
struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops = NULL;
|
||||||
WMI_OEM_RESPONSE_EVENTID_param_tlvs *param_buf =
|
struct wmi_oem_response_param oem_resp_param = {0};
|
||||||
(WMI_OEM_RESPONSE_EVENTID_param_tlvs *)data_buf;
|
wmi_unified_t wmi_handle;
|
||||||
|
|
||||||
if (!psoc) {
|
if (!psoc) {
|
||||||
target_if_err("psoc is null");
|
target_if_err("psoc is null");
|
||||||
@@ -166,6 +166,13 @@ static int target_if_wifi_pos_oem_rsp_ev_handler(ol_scn_t scn,
|
|||||||
|
|
||||||
wlan_objmgr_psoc_get_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
wlan_objmgr_psoc_get_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||||
|
|
||||||
|
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||||
|
if (!wmi_handle) {
|
||||||
|
target_if_err("wmi_handle is null");
|
||||||
|
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||||
|
return QDF_STATUS_NOT_INITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
priv_obj = wifi_pos_get_psoc_priv_obj(psoc);
|
priv_obj = wifi_pos_get_psoc_priv_obj(psoc);
|
||||||
if (!priv_obj) {
|
if (!priv_obj) {
|
||||||
target_if_err("priv_obj is null");
|
target_if_err("priv_obj is null");
|
||||||
@@ -180,15 +187,19 @@ static int target_if_wifi_pos_oem_rsp_ev_handler(ol_scn_t scn,
|
|||||||
return QDF_STATUS_NOT_INITIALIZED;
|
return QDF_STATUS_NOT_INITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
oem_rsp.rsp_len_1 = param_buf->num_data;
|
ret = wmi_extract_oem_response_param(wmi_handle,
|
||||||
oem_rsp.data_1 = param_buf->data;
|
data_buf,
|
||||||
|
&oem_resp_param);
|
||||||
|
|
||||||
if (param_buf->num_data2) {
|
oem_rsp.rsp_len_1 = oem_resp_param.num_data1;
|
||||||
oem_rsp.rsp_len_2 = param_buf->num_data2;
|
oem_rsp.data_1 = oem_resp_param.data_1;
|
||||||
oem_rsp.data_2 = param_buf->data2;
|
|
||||||
|
if (oem_resp_param.num_data2) {
|
||||||
|
oem_rsp.rsp_len_2 = oem_resp_param.num_data2;
|
||||||
|
oem_rsp.data_2 = oem_resp_param.data_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
indirect = (wmi_oem_indirect_data *)param_buf->indirect_data;
|
indirect = &oem_resp_param.indirect_data;
|
||||||
status = target_if_wifi_pos_get_indirect_data(priv_obj, indirect,
|
status = target_if_wifi_pos_get_indirect_data(priv_obj, indirect,
|
||||||
&oem_rsp, &cookie);
|
&oem_rsp, &cookie);
|
||||||
if (QDF_IS_STATUS_ERROR(status)) {
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
|
@@ -2451,4 +2451,18 @@ wmi_extract_cfr_peer_tx_event_param(void *wmi_hdl, void *evt_buf,
|
|||||||
wmi_cfr_peer_tx_event_param *peer_tx_event);
|
wmi_cfr_peer_tx_event_param *peer_tx_event);
|
||||||
|
|
||||||
#endif /* WLAN_CFR_ENABLE */
|
#endif /* WLAN_CFR_ENABLE */
|
||||||
|
|
||||||
|
#ifdef WIFI_POS_CONVERGED
|
||||||
|
/**
|
||||||
|
* wmi_extract_oem_response_param() - WMI function to extract OEM response param
|
||||||
|
* @wmi_hdl: WMI handle
|
||||||
|
* @resp_buf: Buffer holding response data
|
||||||
|
* @oem_resp_param: zero-filled structure pointer to hold oem response data
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS if success, else returns proper error code.
|
||||||
|
*/
|
||||||
|
QDF_STATUS
|
||||||
|
wmi_extract_oem_response_param(wmi_unified_t wmi_hdl, void *resp_buf,
|
||||||
|
struct wmi_oem_response_param *oem_resp_param);
|
||||||
|
#endif /* WIFI_POS_CONVERGED */
|
||||||
#endif /* _WMI_UNIFIED_API_H_ */
|
#endif /* _WMI_UNIFIED_API_H_ */
|
||||||
|
@@ -7854,6 +7854,34 @@ typedef struct {
|
|||||||
uint32_t chain_rssi[WMI_HOST_MAX_CHAINS];
|
uint32_t chain_rssi[WMI_HOST_MAX_CHAINS];
|
||||||
} wmi_cfr_peer_tx_event_param;
|
} wmi_cfr_peer_tx_event_param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct wmi_host_oem_indirect_data - Indirect OEM data
|
||||||
|
* @pdev_id: pdev id
|
||||||
|
* @addr: 36 bit address
|
||||||
|
* @len: length of data in bytes
|
||||||
|
*/
|
||||||
|
struct wmi_host_oem_indirect_data {
|
||||||
|
uint32_t pdev_id;
|
||||||
|
uint64_t addr;
|
||||||
|
uint32_t len;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct wmi_oem_response_param - OEM response info
|
||||||
|
* @num_data1: First data response length
|
||||||
|
* @data_1: First data
|
||||||
|
* @num_data2: Second data response length
|
||||||
|
* @data_2: Second data
|
||||||
|
* @indirect_data: Indirect data
|
||||||
|
*/
|
||||||
|
struct wmi_oem_response_param {
|
||||||
|
uint32_t num_data1;
|
||||||
|
uint8_t *data_1;
|
||||||
|
uint32_t num_data2;
|
||||||
|
uint8_t *data_2;
|
||||||
|
struct wmi_host_oem_indirect_data indirect_data;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct mws_coex_state - Modem Wireless Subsystem(MWS) coex info
|
* struct mws_coex_state - Modem Wireless Subsystem(MWS) coex info
|
||||||
* @vdev_id : vdev id
|
* @vdev_id : vdev id
|
||||||
|
@@ -1984,6 +1984,11 @@ QDF_STATUS (*send_mws_coex_status_req_cmd)(wmi_unified_t wmi_handle,
|
|||||||
QDF_STATUS (*set_rx_pkt_type_routing_tag_cmd)(
|
QDF_STATUS (*set_rx_pkt_type_routing_tag_cmd)(
|
||||||
wmi_unified_t wmi_hdl, struct wmi_rx_pkt_protocol_routing_info *param);
|
wmi_unified_t wmi_hdl, struct wmi_rx_pkt_protocol_routing_info *param);
|
||||||
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
|
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
|
||||||
|
#ifdef WIFI_POS_CONVERGED
|
||||||
|
QDF_STATUS (*extract_oem_response_param)
|
||||||
|
(wmi_unified_t wmi_hdl, void *resp_buf,
|
||||||
|
struct wmi_oem_response_param *oem_resp_param);
|
||||||
|
#endif /* WIFI_POS_CONVERGED */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Forward declartion for psoc*/
|
/* Forward declartion for psoc*/
|
||||||
|
@@ -4069,3 +4069,17 @@ QDF_STATUS wmi_unified_send_mws_coex_req_cmd(struct wmi_unified *wmi_handle,
|
|||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIFI_POS_CONVERGED
|
||||||
|
QDF_STATUS
|
||||||
|
wmi_extract_oem_response_param(wmi_unified_t wmi_hdl, void *resp_buf,
|
||||||
|
struct wmi_oem_response_param *oem_resp_param)
|
||||||
|
{
|
||||||
|
if (wmi_hdl->ops->extract_oem_response_param)
|
||||||
|
return wmi_hdl->ops->extract_oem_response_param(wmi_hdl,
|
||||||
|
resp_buf,
|
||||||
|
oem_resp_param);
|
||||||
|
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
#endif /* WIFI_POS_CONVERGED */
|
||||||
|
@@ -11642,6 +11642,53 @@ static QDF_STATUS send_mws_coex_status_req_cmd_tlv(wmi_unified_t wmi_handle,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIFI_POS_CONVERGED
|
||||||
|
/**
|
||||||
|
* extract_oem_response_param_tlv() - Extract oem response params
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @resp_buf: response buffer
|
||||||
|
* @oem_resp_param: pointer to hold oem response params
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS on success or proper error code.
|
||||||
|
*/
|
||||||
|
static QDF_STATUS
|
||||||
|
extract_oem_response_param_tlv(wmi_unified_t wmi_handle, void *resp_buf,
|
||||||
|
struct wmi_oem_response_param *oem_resp_param)
|
||||||
|
{
|
||||||
|
uint64_t temp_addr;
|
||||||
|
WMI_OEM_RESPONSE_EVENTID_param_tlvs *param_buf =
|
||||||
|
(WMI_OEM_RESPONSE_EVENTID_param_tlvs *)resp_buf;
|
||||||
|
|
||||||
|
if (!param_buf) {
|
||||||
|
WMI_LOGE("Invalid OEM response");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param_buf->num_data) {
|
||||||
|
oem_resp_param->num_data1 = param_buf->num_data;
|
||||||
|
oem_resp_param->data_1 = param_buf->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param_buf->num_data2) {
|
||||||
|
oem_resp_param->num_data2 = param_buf->num_data2;
|
||||||
|
oem_resp_param->data_2 = param_buf->data2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param_buf->indirect_data) {
|
||||||
|
oem_resp_param->indirect_data.pdev_id =
|
||||||
|
param_buf->indirect_data->pdev_id;
|
||||||
|
temp_addr = (param_buf->indirect_data->addr_hi) & 0xf;
|
||||||
|
oem_resp_param->indirect_data.addr =
|
||||||
|
param_buf->indirect_data->addr_lo +
|
||||||
|
((uint64_t)temp_addr << 32);
|
||||||
|
oem_resp_param->indirect_data.len =
|
||||||
|
param_buf->indirect_data->len;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif /* WIFI_POS_CONVERGED */
|
||||||
|
|
||||||
struct wmi_ops tlv_ops = {
|
struct wmi_ops tlv_ops = {
|
||||||
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
|
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
|
||||||
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
|
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
|
||||||
@@ -11913,6 +11960,9 @@ struct wmi_ops tlv_ops = {
|
|||||||
send_peer_cfr_capture_cmd_tlv,
|
send_peer_cfr_capture_cmd_tlv,
|
||||||
.extract_cfr_peer_tx_event_param = extract_cfr_peer_tx_event_param_tlv,
|
.extract_cfr_peer_tx_event_param = extract_cfr_peer_tx_event_param_tlv,
|
||||||
#endif /* WLAN_CFR_ENABLE */
|
#endif /* WLAN_CFR_ENABLE */
|
||||||
|
#ifdef WIFI_POS_CONVERGED
|
||||||
|
.extract_oem_response_param = extract_oem_response_param_tlv,
|
||||||
|
#endif /* WIFI_POS_CONVERGED */
|
||||||
#ifdef WLAN_MWS_INFO_DEBUGFS
|
#ifdef WLAN_MWS_INFO_DEBUGFS
|
||||||
.send_mws_coex_status_req_cmd = send_mws_coex_status_req_cmd_tlv,
|
.send_mws_coex_status_req_cmd = send_mws_coex_status_req_cmd_tlv,
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user