Browse Source

qcacmn: Add TX pending indication when sending wake up to FW

FW may experience HWDTIM mode enter and exit, if HOST can't queue
frames fast enough, this will bring 10ms latency for TX under WoW.
This change adds an indication bit to notify FW whether a TX happens
after WoW wakeup, then FW can discard HWDITM and reduce TX latency.

Change-Id: Ib695a0e5d032af4be27fef59f3c5123a35428d7d
CRs-Fixed: 3046987
Yu Tian 3 years ago
parent
commit
dc20d398e8

+ 3 - 1
wmi/inc/wmi_unified_pmo_api.h

@@ -330,13 +330,15 @@ QDF_STATUS wmi_unified_wow_delete_pattern_cmd(wmi_unified_t wmi_handle,
 /**
  * wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw
  * @wmi_handle: wmi handle
+ * @tx_pending_ind: flag of TX has pending frames
  *
  * Sends host wakeup indication to FW. On receiving this indication,
  * FW will come out of WOW.
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle);
+QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle,
+						 bool tx_pending_ind);
 
 /**
  * wmi_unified_wow_timer_pattern_cmd() - set timer pattern tlv, so that

+ 2 - 1
wmi/inc/wmi_unified_priv.h

@@ -960,7 +960,8 @@ QDF_STATUS (*send_wow_delete_pattern_cmd)(wmi_unified_t wmi_handle,
 					  uint8_t ptrn_id,
 					  uint8_t vdev_id);
 
-QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle);
+QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle,
+					     bool tx_pending_ind);
 
 QDF_STATUS (*send_wow_timer_pattern_cmd)(wmi_unified_t wmi_handle,
 			uint8_t vdev_id, uint32_t cookie, uint32_t time);

+ 5 - 2
wmi/src/wmi_unified_pmo_api.c

@@ -308,10 +308,13 @@ QDF_STATUS wmi_unified_wow_delete_pattern_cmd(wmi_unified_t wmi_handle,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle)
+QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle,
+						 bool tx_pending_ind)
 {
 	if (wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd)
-		return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd(wmi_handle);
+		return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd
+						(wmi_handle,
+						 tx_pending_ind);
 
 	return QDF_STATUS_E_FAILURE;
 }

+ 10 - 1
wmi/src/wmi_unified_pmo_tlv.c

@@ -1682,16 +1682,19 @@ QDF_STATUS wmi_unified_cmd_send_chk(struct wmi_unified *wmi_handle,
 }
 #endif
 
+#define WMI_WAKEUP_TX_PEDNING_IND       1
 /**
  * send_host_wakeup_ind_to_fw_cmd_tlv() - send wakeup ind to fw
  * @wmi_handle: wmi handle
+ * @tx_pending_ind: flag of TX has pending frames
  *
  * Sends host wakeup indication to FW. On receiving this indication,
  * FW will come out of WOW.
  *
  * Return: CDF status
  */
-static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle)
+static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle,
+						     bool tx_pending_ind)
 {
 	wmi_wow_hostwakeup_from_sleep_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
@@ -1708,6 +1711,12 @@ static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle)
 
 	cmd = (wmi_wow_hostwakeup_from_sleep_cmd_fixed_param *)
 	      wmi_buf_data(buf);
+
+	if (tx_pending_ind) {
+		wmi_debug("TX pending before WoW wake, indicate FW");
+		cmd->reserved0 |= WMI_WAKEUP_TX_PEDNING_IND;
+	}
+
 	WMITLV_SET_HDR(&cmd->tlv_header,
 		WMITLV_TAG_STRUC_wmi_wow_hostwakeup_from_sleep_cmd_fixed_param,
 		WMITLV_GET_STRUCT_TLVLEN