|
@@ -4544,6 +4544,30 @@ u32 cnss_pci_get_wake_msi(struct cnss_pci_data *pci_priv)
|
|
|
return user_base_data;
|
|
|
}
|
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
|
|
|
+static inline int cnss_pci_set_dma_mask(struct pci_dev *pci_dev, u64 mask)
|
|
|
+{
|
|
|
+ return dma_set_mask(&pci_dev->dev, mask);
|
|
|
+}
|
|
|
+
|
|
|
+static inline int cnss_pci_set_coherent_dma_mask(struct pci_dev *pci_dev,
|
|
|
+ u64 mask)
|
|
|
+{
|
|
|
+ return dma_set_coherent_mask(&pci_dev->dev, mask);
|
|
|
+}
|
|
|
+#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) */
|
|
|
+static inline int cnss_pci_set_dma_mask(struct pci_dev *pci_dev, u64 mask)
|
|
|
+{
|
|
|
+ return pci_set_dma_mask(pci_dev, mask);
|
|
|
+}
|
|
|
+
|
|
|
+static inline int cnss_pci_set_coherent_dma_mask(struct pci_dev *pci_dev,
|
|
|
+ u64 mask)
|
|
|
+{
|
|
|
+ return pci_set_consistent_dma_mask(pci_dev, mask);
|
|
|
+}
|
|
|
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) */
|
|
|
+
|
|
|
static int cnss_pci_enable_bus(struct cnss_pci_data *pci_priv)
|
|
|
{
|
|
|
int ret = 0;
|
|
@@ -4593,15 +4617,15 @@ static int cnss_pci_enable_bus(struct cnss_pci_data *pci_priv)
|
|
|
|
|
|
cnss_pr_dbg("Set PCI DMA MASK (0x%llx)\n", pci_priv->dma_bit_mask);
|
|
|
|
|
|
- ret = pci_set_dma_mask(pci_dev, pci_priv->dma_bit_mask);
|
|
|
+ ret = cnss_pci_set_dma_mask(pci_dev, pci_priv->dma_bit_mask);
|
|
|
if (ret) {
|
|
|
cnss_pr_err("Failed to set PCI DMA mask, err = %d\n", ret);
|
|
|
goto release_region;
|
|
|
}
|
|
|
|
|
|
- ret = pci_set_consistent_dma_mask(pci_dev, pci_priv->dma_bit_mask);
|
|
|
+ ret = cnss_pci_set_coherent_dma_mask(pci_dev, pci_priv->dma_bit_mask);
|
|
|
if (ret) {
|
|
|
- cnss_pr_err("Failed to set PCI consistent DMA mask, err = %d\n",
|
|
|
+ cnss_pr_err("Failed to set PCI coherent DMA mask, err = %d\n",
|
|
|
ret);
|
|
|
goto release_region;
|
|
|
}
|