Răsfoiți Sursa

qcacmn: Enable notify-frame feature in FW

Enable bits in WMI_INIT command to let the FW know about host's
capability to support notify frame feature. If the feature is enabled,
host can mark certain TX frames as "notify frames" for hardware and they
need not be sent to FW. FW depends on this capability exchange to decide
whether to install HW rules for frames to be sent to HW.

Change-Id: I7158e79ae0fbdc73a2f4096ae1577337e8291246
CRs-Fixed: 3209399
Mohit Khanna 3 ani în urmă
părinte
comite
0c558b779b

+ 2 - 0
dp/inc/cdp_txrx_cmn.h

@@ -2301,6 +2301,8 @@ cdp_get_dp_capabilities(struct cdp_soc_t *soc, enum cdp_capabilities dp_caps)
 	if (soc && soc->ops && soc->ops->cmn_drv_ops &&
 	    soc->ops->cmn_drv_ops->get_dp_capabilities)
 		return soc->ops->cmn_drv_ops->get_dp_capabilities(soc, dp_caps);
+
+	qdf_err("invalid instance");
 	return false;
 }
 

+ 11 - 1
dp/inc/cdp_txrx_cmn_struct.h

@@ -733,7 +733,16 @@ enum txrx_direction {
 };
 
 /**
- * cdp_capabilities- DP capabilities
+ * enum cdp_capabilities- DP capabilities
+ * @CDP_CFG_DP_TSO: TSO capability
+ * @CDP_CFG_DP_LRO: LRO capability
+ * @CDP_CFG_DP_SG: Scatter Gather capability
+ * @CDP_CFG_DP_GRO: GRO capability
+ * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability
+ * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability
+ * @CDP_CFG_DP_RAWMODE: RAW mode capability
+ * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability
+ * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability
  */
 enum cdp_capabilities {
 	CDP_CFG_DP_TSO,
@@ -744,6 +753,7 @@ enum cdp_capabilities {
 	CDP_CFG_DP_OL_RX_CSUM,
 	CDP_CFG_DP_RAWMODE,
 	CDP_CFG_DP_PEER_FLOW_CTRL,
+	CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT,
 };
 
 /**

+ 3 - 0
dp/wifi3.0/be/dp_be.c

@@ -63,6 +63,9 @@ static void dp_soc_cfg_attach_be(struct dp_soc *soc)
 
 	/* this is used only when dmac mode is enabled */
 	soc->num_rx_refill_buf_rings = 1;
+
+	soc->wlan_cfg_ctx->notify_frame_support =
+				DP_MARK_NOTIFY_FRAME_SUPPORT;
 }
 
 qdf_size_t dp_get_context_size_be(enum dp_context_type context_type)

+ 7 - 0
wlan_cfg/cfg_dp.h

@@ -1711,6 +1711,13 @@
 		CFG_DP_MPDU_RETRY_THRESHOLD, \
 		CFG_VALUE_OR_DEFAULT, "DP mpdu retry threshold 2")
 
+#ifdef QCA_SUPPORT_TX_MIN_RATES_FOR_SPECIAL_FRAMES
+/* Macro enabling support marking of notify frames by host */
+#define DP_MARK_NOTIFY_FRAME_SUPPORT 1
+#else
+#define DP_MARK_NOTIFY_FRAME_SUPPORT 0
+#endif /* QCA_SUPPORT_TX_MIN_RATES_FOR_SPECIAL_FRAMES */
+
 #define CFG_DP \
 		CFG(CFG_DP_HTT_PACKET_TYPE) \
 		CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \

+ 2 - 0
wlan_cfg/wlan_cfg.c

@@ -2927,6 +2927,8 @@ wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
 		return cfg->rawmode_enabled;
 	case CDP_CFG_DP_PEER_FLOW_CTRL:
 		return cfg->peer_flow_ctrl_enabled;
+	case CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT:
+		return cfg->notify_frame_support;
 	default:
 		return false;
 	}

+ 4 - 1
wlan_cfg/wlan_cfg.h

@@ -254,7 +254,9 @@ struct wlan_srng_cfg {
  * @txmon_hw_support: TxMON HW support
  * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings
  * @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count
- * @mpdu_retry_threshold_1: MPDU retry threshold 2 to increment tx bad count
+ * @mpdu_retry_threshold_2: MPDU retry threshold 2 to increment tx bad count
+ * napi_scale_factor: scaling factor to be used for napi polls
+ * @notify_frame_support: flag indicating capability to mark notify frames
  */
 struct wlan_cfg_dp_soc_ctxt {
 	int num_int_ctxts;
@@ -428,6 +430,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	uint8_t mpdu_retry_threshold_1;
 	uint8_t mpdu_retry_threshold_2;
 	uint8_t napi_scale_factor;
+	uint8_t notify_frame_support;
 };
 
 /**

+ 4 - 2
wmi/inc/wmi_unified_param.h

@@ -5896,8 +5896,9 @@ struct wmi_host_fw_abi_ver {
  * @afc_outdoor_support: AFC support outdoor deployment
  * @carrier_profile_config: Configuration for per-carrier profile
  * @reo_qdesc_shared_addr_table_enabled: Reo shared qref enhancement enabled
- * @num_max_active_vdevs: number of max active virtual devices (VAPs) to
- *  support
+ * @num_max_active_vdevs: max number of active virtual devices (VAPs) to
+ * support
+ * @notify_frame_support: capability to mark notify frames from host
  */
 typedef struct {
 	uint32_t num_vdevs;
@@ -6023,6 +6024,7 @@ typedef struct {
 	bool sawf;
 	bool reo_qdesc_shared_addr_table_enabled;
 	uint32_t num_max_active_vdevs;
+	uint8_t notify_frame_support;
 } target_resource_config;
 
 /**

+ 4 - 0
wmi/src/wmi_unified_tlv.c

@@ -8330,6 +8330,10 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg,
 
 	WMI_RSRC_CFG_FLAGS2_RX_PEER_METADATA_VERSION_SET(resource_cfg->flags2,
 						 tgt_res_cfg->target_cap_flags);
+	if (tgt_res_cfg->notify_frame_support)
+		WMI_RSRC_CFG_FLAGS2_NOTIFY_FRAME_CONFIG_ENABLE_SET(
+			resource_cfg->flags2, 1);
+
 }
 
 /* copy_hw_mode_id_in_init_cmd() - Helper routine to copy hw_mode in init cmd