|
@@ -2539,6 +2539,48 @@ end:
|
|
|
return qdf_status;
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * populate_tx_send_params - Populate TX param TLV for mgmt and offchan tx
|
|
|
+ *
|
|
|
+ * @bufp: Pointer to buffer
|
|
|
+ * @param: Pointer to tx param
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS for success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+static inline QDF_STATUS populate_tx_send_params(uint8_t *bufp,
|
|
|
+ struct tx_send_params param)
|
|
|
+{
|
|
|
+ wmi_tx_send_params *tx_param;
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
+
|
|
|
+ if (!bufp) {
|
|
|
+ status = QDF_STATUS_E_FAILURE;
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+ tx_param = (wmi_tx_send_params *)bufp;
|
|
|
+ WMITLV_SET_HDR(&tx_param->tlv_header,
|
|
|
+ WMITLV_TAG_STRUC_wmi_tx_send_params,
|
|
|
+ WMITLV_GET_STRUCT_TLVLEN(wmi_tx_send_params));
|
|
|
+ WMI_TX_SEND_PARAM_PWR_SET(tx_param->tx_param_dword0, param.pwr);
|
|
|
+ WMI_TX_SEND_PARAM_MCS_MASK_SET(tx_param->tx_param_dword0,
|
|
|
+ param.mcs_mask);
|
|
|
+ WMI_TX_SEND_PARAM_NSS_MASK_SET(tx_param->tx_param_dword0,
|
|
|
+ param.nss_mask);
|
|
|
+ WMI_TX_SEND_PARAM_RETRY_LIMIT_SET(tx_param->tx_param_dword0,
|
|
|
+ param.retry_limit);
|
|
|
+ WMI_TX_SEND_PARAM_CHAIN_MASK_SET(tx_param->tx_param_dword1,
|
|
|
+ param.chain_mask);
|
|
|
+ WMI_TX_SEND_PARAM_BW_MASK_SET(tx_param->tx_param_dword1,
|
|
|
+ param.bw_mask);
|
|
|
+ WMI_TX_SEND_PARAM_PREAMBLE_SET(tx_param->tx_param_dword1,
|
|
|
+ param.preamble_type);
|
|
|
+ WMI_TX_SEND_PARAM_FRAME_TYPE_SET(tx_param->tx_param_dword1,
|
|
|
+ param.frame_type);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* send_mgmt_cmd_tlv() - WMI scan start function
|
|
|
* @wmi_handle : handle to WMI.
|
|
@@ -2555,14 +2597,15 @@ static QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
uint64_t dma_addr;
|
|
|
void *qdf_ctx = param->qdf_ctx;
|
|
|
uint8_t *bufp;
|
|
|
- QDF_STATUS status;
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
int32_t bufp_len = (param->frm_len < mgmt_tx_dl_frm_len) ? param->frm_len :
|
|
|
mgmt_tx_dl_frm_len;
|
|
|
|
|
|
cmd_len = sizeof(wmi_mgmt_tx_send_cmd_fixed_param) +
|
|
|
- WMI_TLV_HDR_SIZE + roundup(bufp_len, sizeof(uint32_t));
|
|
|
+ WMI_TLV_HDR_SIZE +
|
|
|
+ roundup(bufp_len, sizeof(uint32_t));
|
|
|
|
|
|
- buf = wmi_buf_alloc(wmi_handle, cmd_len);
|
|
|
+ buf = wmi_buf_alloc(wmi_handle, sizeof(wmi_tx_send_params) + cmd_len);
|
|
|
if (!buf) {
|
|
|
WMI_LOGE("%s:wmi_buf_alloc failed", __func__);
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
@@ -2599,10 +2642,22 @@ static QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
#endif
|
|
|
cmd->frame_len = param->frm_len;
|
|
|
cmd->buf_len = bufp_len;
|
|
|
+ cmd->tx_params_valid = param->tx_params_valid;
|
|
|
|
|
|
wmi_mgmt_cmd_record(wmi_handle, WMI_MGMT_TX_SEND_CMDID,
|
|
|
bufp, cmd->vdev_id, cmd->chanfreq);
|
|
|
|
|
|
+ bufp += roundup(bufp_len, sizeof(uint32_t));
|
|
|
+ if (param->tx_params_valid) {
|
|
|
+ status = populate_tx_send_params(bufp, param->tx_param);
|
|
|
+ if (status != QDF_STATUS_SUCCESS) {
|
|
|
+ WMI_LOGE("%s: Populate TX send params failed",
|
|
|
+ __func__);
|
|
|
+ goto err1;
|
|
|
+ }
|
|
|
+ cmd_len += sizeof(wmi_tx_send_params);
|
|
|
+ }
|
|
|
+
|
|
|
if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len,
|
|
|
WMI_MGMT_TX_SEND_CMDID)) {
|
|
|
WMI_LOGE("%s: Failed to send mgmt Tx", __func__);
|
|
@@ -2633,11 +2688,13 @@ static QDF_STATUS send_offchan_data_tx_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
uint8_t *bufp;
|
|
|
int32_t bufp_len = (param->frm_len < mgmt_tx_dl_frm_len) ?
|
|
|
param->frm_len : mgmt_tx_dl_frm_len;
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
|
|
|
cmd_len = sizeof(wmi_offchan_data_tx_send_cmd_fixed_param) +
|
|
|
- WMI_TLV_HDR_SIZE + roundup(bufp_len, sizeof(uint32_t));
|
|
|
+ WMI_TLV_HDR_SIZE +
|
|
|
+ roundup(bufp_len, sizeof(uint32_t));
|
|
|
|
|
|
- buf = wmi_buf_alloc(wmi_handle, cmd_len);
|
|
|
+ buf = wmi_buf_alloc(wmi_handle, sizeof(wmi_tx_send_params) + cmd_len);
|
|
|
if (!buf) {
|
|
|
WMI_LOGE("%s:wmi_buf_alloc failed", __func__);
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
@@ -2667,18 +2724,33 @@ static QDF_STATUS send_offchan_data_tx_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
#endif
|
|
|
cmd->frame_len = param->frm_len;
|
|
|
cmd->buf_len = bufp_len;
|
|
|
+ cmd->tx_params_valid = param->tx_params_valid;
|
|
|
|
|
|
wmi_mgmt_cmd_record(wmi_handle, WMI_OFFCHAN_DATA_TX_SEND_CMDID,
|
|
|
bufp, cmd->vdev_id, cmd->chanfreq);
|
|
|
|
|
|
+ bufp += roundup(bufp_len, sizeof(uint32_t));
|
|
|
+ if (param->tx_params_valid) {
|
|
|
+ status = populate_tx_send_params(bufp, param->tx_param);
|
|
|
+ if (status != QDF_STATUS_SUCCESS) {
|
|
|
+ WMI_LOGE("%s: Populate TX send params failed",
|
|
|
+ __func__);
|
|
|
+ goto err1;
|
|
|
+ }
|
|
|
+ cmd_len += sizeof(wmi_tx_send_params);
|
|
|
+ }
|
|
|
+
|
|
|
if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len,
|
|
|
WMI_OFFCHAN_DATA_TX_SEND_CMDID)) {
|
|
|
WMI_LOGE("%s: Failed to offchan data Tx", __func__);
|
|
|
- wmi_buf_free(buf);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ goto err1;
|
|
|
}
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
+
|
|
|
+err1:
|
|
|
+ wmi_buf_free(buf);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
/**
|