ソースを参照

qcacld-3.0: Populate legacy flow control ops for HL

1) Populate legacy flow control ops 'cdp_lflowctl_ops'
for HL netdev flow control.
2) Also call cdp_hl_fc_register() to register HL flow control
callback.
3) Increase number of netdev queues to 5

Change-Id: I6bdb015b3325e54386f2aad093c89f6f782c24ed
CRs-fixed: 2236321
Ajit Pal Singh 7 年 前
コミット
5d269618d5

+ 35 - 2
core/dp/txrx/ol_txrx.c

@@ -5007,6 +5007,30 @@ static inline int ol_txrx_drop_nbuf_list(qdf_nbuf_t buf_list)
 	return num_dropped;
 }
 
+#ifdef QCA_HL_NETDEV_FLOW_CONTROL
+/**
+ * ol_txrx_register_hl_flow_control() -register hl netdev flow control callback
+ * @vdev_id: vdev_id
+ * @flowControl: flow control callback
+ *
+ * Return: 0 for success or error code
+ */
+static int ol_txrx_register_hl_flow_control(struct cdp_soc_t *soc,
+					    tx_pause_callback flowcontrol)
+{
+	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
+	if (!pdev || !flowcontrol) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "pdev or pause_cb is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	pdev->pause_cb = flowcontrol;
+	return 0;
+}
+#endif /* QCA_HL_NETDEV_FLOW_CONTROL */
+
 /**
  * ol_rx_data_cb() - data rx callback
  * @peer: peer
@@ -5994,8 +6018,8 @@ static struct cdp_flowctl_ops ol_ops_flowctl = {
 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
 };
 
+#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL)
 static struct cdp_lflowctl_ops ol_ops_l_flowctl = {
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
 	.register_tx_flow_control = ol_txrx_register_tx_flow_control,
 	.deregister_tx_flow_control_cb = ol_txrx_deregister_tx_flow_control_cb,
 	.flow_control_cb = ol_txrx_flow_control_cb,
@@ -6004,8 +6028,17 @@ static struct cdp_lflowctl_ops ol_ops_l_flowctl = {
 	.vdev_flush = ol_txrx_vdev_flush,
 	.vdev_pause = ol_txrx_vdev_pause,
 	.vdev_unpause = ol_txrx_vdev_unpause
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
+}; /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
+#elif defined(QCA_HL_NETDEV_FLOW_CONTROL)
+static struct cdp_lflowctl_ops ol_ops_l_flowctl = {
+	.register_tx_flow_control = ol_txrx_register_hl_flow_control,
+	.vdev_flush = ol_txrx_vdev_flush,
+	.vdev_pause = ol_txrx_vdev_pause,
+	.vdev_unpause = ol_txrx_vdev_unpause
 };
+#else /* QCA_HL_NETDEV_FLOW_CONTROL */
+static struct cdp_lflowctl_ops ol_ops_l_flowctl = { };
+#endif
 
 #ifdef IPA_OFFLOAD
 static struct cdp_ipa_ops ol_ops_ipa = {

+ 1 - 1
core/hdd/inc/wlan_hdd_main.h

@@ -99,7 +99,7 @@
  */
 
 /** Number of Tx Queues */
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
+#if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_HL_NETDEV_FLOW_CONTROL)
 #define NUM_TX_QUEUES 5
 #else
 #define NUM_TX_QUEUES 4

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -9836,6 +9836,8 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	cdp_register_pause_cb(soc, wlan_hdd_txrx_pause_cb);
+	/* Register HL netdev flow control callback */
+	cdp_hl_fc_register(soc, wlan_hdd_txrx_pause_cb);
 	/*
 	 * Set 802.11p config
 	 * TODO-OCB: This has been temporarily added here to ensure this

+ 1 - 1
core/hdd/src/wlan_hdd_wmm.c

@@ -1534,7 +1534,7 @@ static uint16_t __hdd_get_queue_index(uint16_t up)
 	return hdd_linux_up_to_ac_map[up];
 }
 
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
+#if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_HL_NETDEV_FLOW_CONTROL)
 /**
  * hdd_get_queue_index() - get queue index
  * @up: user priority