qcacmn: Add support for sendaddba/senddelba cmd in HK
HK needs support for sendaddba/senddelba cmds. These commands
need to be sent to the FW in tlv format. Make the necessary
changes.
Change-Id: Ia069a05dbbd710393ecab31c5bd2c1bcf28d0e1e
CRs-fixed: 2171669
diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c
index 8fd2e6d..22d5bbe 100644
--- a/wmi_unified_tlv.c
+++ b/wmi_unified_tlv.c
@@ -16523,6 +16523,103 @@
}
/**
+ * send_addba_send_cmd_tlv() - send addba send command to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to delba send params
+ * @macaddr: peer mac address
+ *
+ * Send WMI_ADDBA_SEND_CMDID command to firmware
+ * Return: QDF_STATUS_SUCCESS on success. QDF_STATUS_E** on error
+ */
+static QDF_STATUS
+send_addba_send_cmd_tlv(wmi_unified_t wmi_handle,
+ uint8_t macaddr[IEEE80211_ADDR_LEN],
+ struct addba_send_params *param)
+{
+ wmi_addba_send_cmd_fixed_param *cmd;
+ wmi_buf_t buf;
+ uint16_t len;
+ QDF_STATUS ret;
+
+ len = sizeof(*cmd);
+
+ buf = wmi_buf_alloc(wmi_handle, len);
+ if (!buf) {
+ WMI_LOGE("%s : wmi_buf_alloc failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ cmd = (wmi_addba_send_cmd_fixed_param *)wmi_buf_data(buf);
+
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_addba_send_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_addba_send_cmd_fixed_param));
+
+ cmd->vdev_id = param->vdev_id;
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
+ cmd->tid = param->tidno;
+ cmd->buffersize = param->buffersize;
+
+ ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_ADDBA_SEND_CMDID);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ WMI_LOGE("%s: Failed to send cmd to fw, ret=%d", __func__, ret);
+ wmi_buf_free(buf);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * send_delba_send_cmd_tlv() - send delba send command to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to delba send params
+ * @macaddr: peer mac address
+ *
+ * Send WMI_DELBA_SEND_CMDID command to firmware
+ * Return: QDF_STATUS_SUCCESS on success. QDF_STATUS_E** on error
+ */
+static QDF_STATUS
+send_delba_send_cmd_tlv(wmi_unified_t wmi_handle,
+ uint8_t macaddr[IEEE80211_ADDR_LEN],
+ struct delba_send_params *param)
+{
+ wmi_delba_send_cmd_fixed_param *cmd;
+ wmi_buf_t buf;
+ uint16_t len;
+ QDF_STATUS ret;
+
+ len = sizeof(*cmd);
+
+ buf = wmi_buf_alloc(wmi_handle, len);
+ if (!buf) {
+ WMI_LOGE("%s : wmi_buf_alloc failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ cmd = (wmi_delba_send_cmd_fixed_param *)wmi_buf_data(buf);
+
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_delba_send_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_delba_send_cmd_fixed_param));
+
+ cmd->vdev_id = param->vdev_id;
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
+ cmd->tid = param->tidno;
+ cmd->initiator = param->initiator;
+ cmd->reasoncode = param->reasoncode;
+
+ ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_DELBA_SEND_CMDID);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ WMI_LOGE("%s: Failed to send cmd to fw, ret=%d", __func__, ret);
+ wmi_buf_free(buf);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
* send_bcn_offload_control_cmd_tlv - send beacon ofload control cmd to fw
* @wmi_handle: wmi handle
* @bcn_ctrl_param: pointer to bcn_offload_control param
@@ -21152,6 +21249,8 @@
.send_coex_config_cmd = send_coex_config_cmd_tlv,
.send_set_country_cmd = send_set_country_cmd_tlv,
.send_bcn_offload_control_cmd = send_bcn_offload_control_cmd_tlv,
+ .send_addba_send_cmd = send_addba_send_cmd_tlv,
+ .send_delba_send_cmd = send_delba_send_cmd_tlv,
.get_target_cap_from_service_ready = extract_service_ready_tlv,
.extract_hal_reg_cap = extract_hal_reg_cap_tlv,
.extract_host_mem_req = extract_host_mem_req_tlv,