qcacmn: Add API to set dma mask for device

Currently DMA mask for the device is set during hif_enable_bus.
If the datapath memory prealloc feature is enabled, there are
a few dma memory allocation which is done before the DMA mask
is set for the device. This leads to the aforementioned dma
memory pre-allocation to be attempted at the default DMA mask.
Due to this the entire device capability of dma address might
not be used.

Add hif api to set dma mask before hif is initialized. This
is needed to set dma mask in case of datapath memory pre allocation.

Change-Id: I6fd25d9cb6ab3aaacd6f959abe4e060e23f37095
CRs-Fixed: 2845020
这个提交包含在:
Rakesh Pillai
2020-11-26 22:50:44 +05:30
提交者 snandini
父节点 ab63a2735b
当前提交 4138c9b7d8
修改 2 个文件,包含 35 行新增0 行删除

查看文件

@@ -916,6 +916,19 @@ struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx,
struct hif_driver_state_callbacks *cbk,
struct wlan_objmgr_psoc *psoc);
/**
* hif_init_dma_mask() - Set dma mask for the dev
* @dev: dev for which DMA mask is to be set
* @bus_type: bus type for the target
*
* This API sets the DMA mask for the device. before the datapath
* memory pre-allocation is done. If the DMA mask is not set before
* requesting the DMA memory, kernel defaults to a 32-bit DMA mask,
* and does not utilize the full device capability.
*
* Return: 0 - success, non-zero on failure.
*/
int hif_init_dma_mask(struct device *dev, enum qdf_bus_type bus_type);
void hif_close(struct hif_opaque_softc *hif_ctx);
QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
void *bdev, const struct hif_bus_id *bid,