Prechádzať zdrojové kódy

qcacld-3.0: Unmap nbuf of pending mgmt frames

As part of wlan_mgmt_txrx_pdev_close only nbuf is freed
in case of cleanup path due to SSR or drive unload and
dma unmap is not done. In this change register a callback
to mgmt_txrx component tx ops which does dma unmap of nbuf
as part of pdev close.

Change-Id: Ia0fa6684f66a3b732e5c599f2df4ea7f33ebc4f8
CRs-Fixed: 2308372
Sravan Kumar Kairam 6 rokov pred
rodič
commit
0fbaefea1b
3 zmenil súbory, kde vykonal 34 pridanie a 0 odobranie
  1. 12 0
      core/wma/inc/wma.h
  2. 3 0
      core/wma/src/wma_main.c
  3. 19 0
      core/wma/src/wma_mgmt.c

+ 12 - 0
core/wma/inc/wma.h

@@ -1983,6 +1983,18 @@ QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
 				qdf_nbuf_t buf, uint32_t desc_id,
 				void *mgmt_tx_params);
 
+/**
+ * wma_mgmt_nbuf_unmap_cb() - dma unmap for pending mgmt pkts
+ * @pdev: objmgr pdev
+ * @buf: buffer
+ *
+ * This function does the dma unmap of the pending mgmt packet cleanup
+ *
+ * Return: None
+ */
+void wma_mgmt_nbuf_unmap_cb(struct wlan_objmgr_pdev *pdev,
+			    qdf_nbuf_t buf);
+
 /**
  * wma_chan_info_event_handler() - chan info event handler
  * @handle: wma handle

+ 3 - 0
core/wma/src/wma_main.c

@@ -2231,6 +2231,9 @@ wma_register_tx_ops_handler(struct wlan_lmac_if_tx_ops *tx_ops)
 	/* mgmt_txrx component's tx ops */
 	tx_ops->mgmt_txrx_tx_ops.mgmt_tx_send = wma_mgmt_unified_cmd_send;
 
+	/* mgmt txrx component nbuf op for nbuf dma unmap */
+	tx_ops->mgmt_txrx_tx_ops.tx_drain_nbuf_op = wma_mgmt_nbuf_unmap_cb;
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 19 - 0
core/wma/src/wma_mgmt.c

@@ -4368,3 +4368,22 @@ QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_SUCCESS;
 }
 
+void wma_mgmt_nbuf_unmap_cb(struct wlan_objmgr_pdev *pdev,
+			    qdf_nbuf_t buf)
+{
+	tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+
+	if (!wma_handle) {
+		WMA_LOGE("%s: wma handle is NULL", __func__);
+		return;
+	}
+
+	if (!buf)
+		return;
+
+	if (wmi_service_enabled(wma_handle->wmi_handle,
+				wmi_service_mgmt_tx_wmi)) {
+		qdf_nbuf_unmap_single(wma_handle->qdf_dev, buf,
+				      QDF_DMA_TO_DEVICE);
+	}
+}