PCI: EPF: Add lpci_epc_map_addr for pre-v5.15 Linux kernels

Build the Tegra PCI vnet driver fails with Linux v5.14 because the
lpci_epc_map_addr() have the incorrect number of arguments.
The arguments to the lpci_epc_map_addr() functions were updated
in Linux v5.12 but the current Tegra PCI EPF driver assumes that they
were updating after Linux v5.14. Update the Tegra PCI EPF driver to
use the correct arguments for v5.12 onwards.

Bug 4456727
Bug 4451567

Change-Id: Ie4ef36854d380e0a896a0f256d846ab8b89ca447
Signed-off-by: Jason Mei <jianjunm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3070170
(cherry picked from commit 5a65235c0d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3084983
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
This commit is contained in:
Jason Mei
2024-02-05 14:14:16 +08:00
committed by mobile promotions
parent a1d5f342d5
commit fe07e96ce3

View File

@@ -1,8 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0+ */ /* SPDX-License-Identifier: GPL-2.0-only
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* /*
* PCIe EDMA Framework * PCIe EDMA Framework
*
* Copyright (C) 2022 NVIDIA Corporation. All rights reserved.
*/ */
#ifndef PCI_EPF_WRAPPER_H #ifndef PCI_EPF_WRAPPER_H
@@ -24,6 +37,7 @@
#define lpci_epc_clear_bar(A, B, C) pci_epc_clear_bar(A, B, 0, C) #define lpci_epc_clear_bar(A, B, C) pci_epc_clear_bar(A, B, 0, C)
#define lpci_epc_set_msi(A, B, C) pci_epc_set_msi(A, B, 0, C) #define lpci_epc_set_msi(A, B, C) pci_epc_set_msi(A, B, 0, C)
#define lpci_epc_set_bar(A, B, C) pci_epc_set_bar(A, B, 0, C) #define lpci_epc_set_bar(A, B, C) pci_epc_set_bar(A, B, 0, C)
#define lpci_epc_map_addr(A, B, C, D, E) pci_epc_map_addr(A, B, 0, C, D, E)
#define lpci_epc_unmap_addr(A, B, C) pci_epc_unmap_addr(A, B, 0, C) #define lpci_epc_unmap_addr(A, B, C) pci_epc_unmap_addr(A, B, 0, C)
#else #else
#define lpci_epc_write_header(A, B, C) pci_epc_write_header(A, B, C) #define lpci_epc_write_header(A, B, C) pci_epc_write_header(A, B, C)
@@ -31,6 +45,7 @@
#define lpci_epc_clear_bar(A, B, C) pci_epc_clear_bar(A, B, C) #define lpci_epc_clear_bar(A, B, C) pci_epc_clear_bar(A, B, C)
#define lpci_epc_set_msi(A, B, C) pci_epc_set_msi(A, B, C) #define lpci_epc_set_msi(A, B, C) pci_epc_set_msi(A, B, C)
#define lpci_epc_set_bar(A, B, C) pci_epc_set_bar(A, B, C) #define lpci_epc_set_bar(A, B, C) pci_epc_set_bar(A, B, C)
#define lpci_epc_map_addr(A, B, C, D, E) pci_epc_map_addr(A, B, C, D, E)
#define lpci_epc_unmap_addr(A, B, C) pci_epc_unmap_addr(A, B, C) #define lpci_epc_unmap_addr(A, B, C) pci_epc_unmap_addr(A, B, C)
#endif /* LINUX_VERSION_CODE */ #endif /* LINUX_VERSION_CODE */