qcacmn: update for new wmi cmd and evt
Support WMI command/events to dynamically enable/disable calibration in FW command: set_halphy_cal command usage: cfg80211tool set_halphy_cal <<value>> <<channel>> value: bitmap value to be passed ( 0 - 1023) channel: 0 (home), 1 (scan), 2 (both) Change-Id: I1d3ab39cf24d0880bf5feac5749b5a93e6d03761
This commit is contained in:

committed by
Madan Koyyalamudi

parent
c9c8ccb8cb
commit
d73851c8e5
@@ -4356,4 +4356,28 @@ QDF_STATUS
|
|||||||
wmi_extract_halphy_cal_status_ev_param(wmi_unified_t wmi_handle,
|
wmi_extract_halphy_cal_status_ev_param(wmi_unified_t wmi_handle,
|
||||||
void *evt_buf,
|
void *evt_buf,
|
||||||
struct wmi_host_pdev_get_halphy_cal_status_event *param);
|
struct wmi_host_pdev_get_halphy_cal_status_event *param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_unified_send_set_halphy_cal() - send set halphy cal bmap
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @param: set halphy cal input info
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||||
|
*/
|
||||||
|
QDF_STATUS wmi_unified_send_set_halphy_cal(wmi_unified_t wmi_handle,
|
||||||
|
struct wmi_host_send_set_halphy_cal_info *param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_extract_halphy_cal_ev_param() - extract halphy cal status from FW event
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @evt_buf: pointer to event buf
|
||||||
|
* @param: halphy cal status info
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||||
|
*/
|
||||||
|
QDF_STATUS
|
||||||
|
wmi_extract_halphy_cal_ev_param(wmi_unified_t wmi_handle,
|
||||||
|
void *evt_buf,
|
||||||
|
struct wmi_host_pdev_set_halphy_cal_event *param);
|
||||||
|
|
||||||
#endif /* _WMI_UNIFIED_API_H_ */
|
#endif /* _WMI_UNIFIED_API_H_ */
|
||||||
|
@@ -4683,6 +4683,7 @@ typedef enum {
|
|||||||
wmi_vdev_smart_monitor_event_id,
|
wmi_vdev_smart_monitor_event_id,
|
||||||
#endif
|
#endif
|
||||||
wmi_pdev_get_halphy_cal_status_event_id,
|
wmi_pdev_get_halphy_cal_status_event_id,
|
||||||
|
wmi_pdev_set_halphy_cal_event_id,
|
||||||
wmi_pdev_aoa_phasedelta_event_id,
|
wmi_pdev_aoa_phasedelta_event_id,
|
||||||
wmi_events_max,
|
wmi_events_max,
|
||||||
} wmi_conv_event_id;
|
} wmi_conv_event_id;
|
||||||
@@ -5273,6 +5274,7 @@ typedef enum {
|
|||||||
#endif
|
#endif
|
||||||
wmi_service_sae_eapol_offload_support,
|
wmi_service_sae_eapol_offload_support,
|
||||||
wmi_service_ampdu_tx_buf_size_256_support,
|
wmi_service_ampdu_tx_buf_size_256_support,
|
||||||
|
wmi_service_halphy_cal_enable_disable_support,
|
||||||
wmi_service_halphy_cal_status,
|
wmi_service_halphy_cal_status,
|
||||||
wmi_service_rtt_ap_initiator_staggered_mode_supported,
|
wmi_service_rtt_ap_initiator_staggered_mode_supported,
|
||||||
wmi_service_rtt_ap_initiator_bursted_mode_supported,
|
wmi_service_rtt_ap_initiator_bursted_mode_supported,
|
||||||
@@ -8078,6 +8080,32 @@ struct wmi_host_pdev_get_halphy_cal_status_event {
|
|||||||
uint32_t halphy_cal_status;
|
uint32_t halphy_cal_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum wmi_host_set_halphy_cal_chan_sel - channel select values for
|
||||||
|
* set halphy cal
|
||||||
|
* @WMI_HOST_SET_HALPHY_CAL_HOME_CHANNEL: Home channel
|
||||||
|
* @WMI_HOST_SET_HALPHY_CAL_SCAN_CHANNEL: Scan channel
|
||||||
|
* @WMI_HOST_SET_HALPHY_CAL_BOTH_CHANNELS: Both (Home + Scan) channels
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum wmi_host_set_halphy_cal_chan_sel {
|
||||||
|
WMI_HOST_SET_HALPHY_CAL_HOME_CHANNEL = 0,
|
||||||
|
WMI_HOST_SET_HALPHY_CAL_SCAN_CHANNEL = 1,
|
||||||
|
WMI_HOST_SET_HALPHY_CAL_BOTH_CHANNELS = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct wmi_host_send_set_halphy_cal_info
|
||||||
|
* @pdev_id: pdev id
|
||||||
|
* @value: bmap value
|
||||||
|
* @chan_Sel: channel for calibration - HOME/SCAN/BOTH
|
||||||
|
*/
|
||||||
|
struct wmi_host_send_set_halphy_cal_info {
|
||||||
|
uint8_t pdev_id;
|
||||||
|
uint32_t value;
|
||||||
|
enum wmi_host_set_halphy_cal_chan_sel chan_sel;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct wmi_install_key_comp_event - params of install key complete event
|
* struct wmi_install_key_comp_event - params of install key complete event
|
||||||
* @vdev_id: unique id identifying the VDEV, generated by the caller
|
* @vdev_id: unique id identifying the VDEV, generated by the caller
|
||||||
@@ -8094,4 +8122,25 @@ struct wmi_install_key_comp_event {
|
|||||||
uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
|
uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_host_set_halphy_cal_status - status values from
|
||||||
|
* WMI_PDEV_SET_HALPHY_CAL_BMAP_EVENTID
|
||||||
|
* @WMI_HOST_SET_HALPHY_CAL_STATUS_SUCCESS: set halphy cal success
|
||||||
|
* @WMI_HOST_SET_HALPHY_CAL_STATUS_FAIL: set halphy cal failure
|
||||||
|
*/
|
||||||
|
enum wmi_host_set_halphy_cal_status {
|
||||||
|
WMI_HOST_SET_HALPHY_CAL_STATUS_SUCCESS = 0,
|
||||||
|
WMI_HOST_SET_HALPHY_CAL_STATUS_FAIL = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct wmi_host_send_set_halphy_cal_event
|
||||||
|
* @pdev_id: pdev id
|
||||||
|
* @status: PASS/FAIL
|
||||||
|
*/
|
||||||
|
struct wmi_host_pdev_set_halphy_cal_event {
|
||||||
|
uint32_t pdev_id;
|
||||||
|
enum wmi_host_set_halphy_cal_status status;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* _WMI_UNIFIED_PARAM_H_ */
|
#endif /* _WMI_UNIFIED_PARAM_H_ */
|
||||||
|
@@ -2624,6 +2624,14 @@ QDF_STATUS
|
|||||||
void *evt_buf,
|
void *evt_buf,
|
||||||
struct wmi_cfr_phase_delta_param *param);
|
struct wmi_cfr_phase_delta_param *param);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QDF_STATUS (*send_set_halphy_cal)(wmi_unified_t wmi_handle,
|
||||||
|
struct wmi_host_send_set_halphy_cal_info *param);
|
||||||
|
|
||||||
|
QDF_STATUS
|
||||||
|
(*extract_halphy_cal_ev_param)(wmi_unified_t wmi_handle,
|
||||||
|
void *evt_buf,
|
||||||
|
struct wmi_host_pdev_set_halphy_cal_event *param);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Forward declartion for psoc*/
|
/* Forward declartion for psoc*/
|
||||||
|
@@ -3474,3 +3474,25 @@ wmi_extract_halphy_cal_status_ev_param(wmi_unified_t wmi_handle,
|
|||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS
|
||||||
|
wmi_extract_halphy_cal_ev_param(wmi_unified_t wmi_handle,
|
||||||
|
void *evt_buf,
|
||||||
|
struct wmi_host_pdev_set_halphy_cal_event *param)
|
||||||
|
{
|
||||||
|
if (wmi_handle->ops->extract_halphy_cal_ev_param)
|
||||||
|
return wmi_handle->ops->extract_halphy_cal_ev_param(
|
||||||
|
wmi_handle, evt_buf, param);
|
||||||
|
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_STATUS
|
||||||
|
wmi_unified_send_set_halphy_cal(wmi_unified_t wmi_handle,
|
||||||
|
struct wmi_host_send_set_halphy_cal_info *param)
|
||||||
|
{
|
||||||
|
if (wmi_handle->ops->send_set_halphy_cal)
|
||||||
|
return wmi_handle->ops->send_set_halphy_cal(wmi_handle, param);
|
||||||
|
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
@@ -15253,6 +15253,54 @@ extract_halphy_cal_status_ev_param_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_halphy_cal_fw_status_to_host_status() - Convert set halphy cal status to host enum
|
||||||
|
* @fw_status: set halphy cal status from WMI_PDEV_SET_HALPHY_CAL_BMAP_EVENTID event
|
||||||
|
*
|
||||||
|
* Return: host_set_halphy_cal_status
|
||||||
|
*/
|
||||||
|
static enum wmi_host_set_halphy_cal_status
|
||||||
|
set_halphy_cal_fw_status_to_host_status(uint32_t fw_status)
|
||||||
|
{
|
||||||
|
if (fw_status == 0)
|
||||||
|
return WMI_HOST_SET_HALPHY_CAL_STATUS_SUCCESS;
|
||||||
|
else if (fw_status == 1)
|
||||||
|
return WMI_HOST_SET_HALPHY_CAL_STATUS_FAIL;
|
||||||
|
|
||||||
|
wmi_debug("Unknown set halphy status code(%u) from WMI", fw_status);
|
||||||
|
return WMI_HOST_SET_HALPHY_CAL_STATUS_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extract_halphy_cal_ev_param_tlv() - extract dpd status from FW event
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @evt_buf: event buffer
|
||||||
|
* @param: set halphy cal status info
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS for success or error code
|
||||||
|
*/
|
||||||
|
static QDF_STATUS
|
||||||
|
extract_halphy_cal_ev_param_tlv(wmi_unified_t wmi_handle,
|
||||||
|
void *evt_buf,
|
||||||
|
struct wmi_host_pdev_set_halphy_cal_event *param)
|
||||||
|
{
|
||||||
|
WMI_PDEV_SET_HALPHY_CAL_BMAP_EVENTID_param_tlvs *param_buf;
|
||||||
|
wmi_pdev_set_halphy_cal_bmap_evt_fixed_param *set_halphy_status;
|
||||||
|
|
||||||
|
param_buf = (WMI_PDEV_SET_HALPHY_CAL_BMAP_EVENTID_param_tlvs *)evt_buf;
|
||||||
|
if (!param_buf) {
|
||||||
|
wmi_err("Invalid set halphy_status event");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_halphy_status = param_buf->fixed_param;
|
||||||
|
param->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host
|
||||||
|
(wmi_handle, set_halphy_status->pdev_id);
|
||||||
|
param->status = set_halphy_cal_fw_status_to_host_status(set_halphy_status->status);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extract_install_key_comp_event_tlv() - extract install key complete event tlv
|
* extract_install_key_comp_event_tlv() - extract install key complete event tlv
|
||||||
* @wmi_handle: wmi handle
|
* @wmi_handle: wmi handle
|
||||||
@@ -15297,6 +15345,42 @@ extract_install_key_comp_event_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QDF_STATUS
|
||||||
|
send_set_halphy_cal_tlv(wmi_unified_t wmi_handle,
|
||||||
|
struct wmi_host_send_set_halphy_cal_info *param)
|
||||||
|
{
|
||||||
|
wmi_buf_t buf;
|
||||||
|
wmi_pdev_set_halphy_cal_bmap_cmd_fixed_param *cmd;
|
||||||
|
QDF_STATUS ret;
|
||||||
|
uint32_t len;
|
||||||
|
|
||||||
|
len = sizeof(*cmd);
|
||||||
|
|
||||||
|
buf = wmi_buf_alloc(wmi_handle, len);
|
||||||
|
if (!buf)
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
cmd = (void *)wmi_buf_data(buf);
|
||||||
|
|
||||||
|
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||||
|
WMITLV_TAG_STRUC_wmi_pdev_set_halphy_cal_bmap_cmd_fixed_param,
|
||||||
|
WMITLV_GET_STRUCT_TLVLEN(wmi_pdev_set_halphy_cal_bmap_cmd_fixed_param));
|
||||||
|
|
||||||
|
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(wmi_handle,
|
||||||
|
param->pdev_id);
|
||||||
|
cmd->online_halphy_cals_bmap = param->value;
|
||||||
|
cmd->home_scan_channel = param->chan_sel;
|
||||||
|
|
||||||
|
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||||
|
WMI_PDEV_SET_HALPHY_CAL_BMAP_CMDID);
|
||||||
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
|
wmi_err("WMI_PDEV_SET_HALPHY_CAL_BMAP_CMDID send returned Error %d",ret);
|
||||||
|
wmi_buf_free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
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,
|
||||||
@@ -15675,6 +15759,8 @@ struct wmi_ops tlv_ops = {
|
|||||||
.extract_dpd_status_ev_param = extract_dpd_status_ev_param_tlv,
|
.extract_dpd_status_ev_param = extract_dpd_status_ev_param_tlv,
|
||||||
.extract_install_key_comp_event = extract_install_key_comp_event_tlv,
|
.extract_install_key_comp_event = extract_install_key_comp_event_tlv,
|
||||||
.extract_halphy_cal_status_ev_param = extract_halphy_cal_status_ev_param_tlv,
|
.extract_halphy_cal_status_ev_param = extract_halphy_cal_status_ev_param_tlv,
|
||||||
|
.send_set_halphy_cal = send_set_halphy_cal_tlv,
|
||||||
|
.extract_halphy_cal_ev_param = extract_halphy_cal_ev_param_tlv,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16089,6 +16175,8 @@ event_ids[wmi_roam_scan_chan_list_id] =
|
|||||||
#endif
|
#endif
|
||||||
event_ids[wmi_pdev_get_halphy_cal_status_event_id] =
|
event_ids[wmi_pdev_get_halphy_cal_status_event_id] =
|
||||||
WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID;
|
WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID;
|
||||||
|
event_ids[wmi_pdev_set_halphy_cal_event_id] =
|
||||||
|
WMI_PDEV_SET_HALPHY_CAL_BMAP_EVENTID;
|
||||||
event_ids[wmi_pdev_aoa_phasedelta_event_id] =
|
event_ids[wmi_pdev_aoa_phasedelta_event_id] =
|
||||||
WMI_PDEV_AOA_PHASEDELTA_EVENTID;
|
WMI_PDEV_AOA_PHASEDELTA_EVENTID;
|
||||||
}
|
}
|
||||||
@@ -16499,6 +16587,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
|
|||||||
#endif
|
#endif
|
||||||
wmi_service[wmi_service_ampdu_tx_buf_size_256_support] =
|
wmi_service[wmi_service_ampdu_tx_buf_size_256_support] =
|
||||||
WMI_SERVICE_AMPDU_TX_BUF_SIZE_256_SUPPORT;
|
WMI_SERVICE_AMPDU_TX_BUF_SIZE_256_SUPPORT;
|
||||||
|
wmi_service[wmi_service_halphy_cal_enable_disable_support] =
|
||||||
|
WMI_SERVICE_HALPHY_CAL_ENABLE_DISABLE_SUPPORT;
|
||||||
wmi_service[wmi_service_halphy_cal_status] =
|
wmi_service[wmi_service_halphy_cal_status] =
|
||||||
WMI_SERVICE_HALPHY_CAL_STATUS;
|
WMI_SERVICE_HALPHY_CAL_STATUS;
|
||||||
wmi_service[wmi_service_rtt_ap_initiator_staggered_mode_supported] =
|
wmi_service[wmi_service_rtt_ap_initiator_staggered_mode_supported] =
|
||||||
|
Reference in New Issue
Block a user