conftest: Add test for pci_epc_bar_desc

The pci_epc_features structure was updated in Linux v6.9 to move various
fields under a new pci_epc_bar_desc structure. Add a test to conftest to
determine if the new pci_epc_bar_desc structure is present.

Bug 4627271

Change-Id: I5c473cb5172ac10e6f36c165be5a03f1fb90ebeb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129468
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
This commit is contained in:
Jon Hunter
2024-05-01 15:24:21 +01:00
committed by mobile promotions
parent 048c7dd793
commit 2ff1c3c6c9
2 changed files with 18 additions and 0 deletions

View File

@@ -144,6 +144,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_chip_struct_has_base_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_config
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_core_deinit
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_features_struct_has_bar
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_enable_pcie_error_reporting
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epf_alloc_space_has_epc_features_arg

View File

@@ -7352,6 +7352,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT" "" "types"
;;
pci_epc_features_struct_has_bar)
#
# Determine if the pci_epc_features struct has a member 'bar'.
#
# Commit e01c9797c0eb ("PCI: endpoint: Clean up hardware description for BARs")
# added 'struct pci_epc_bar_desc bar' to the pci_epc_features structure in
# Linux v6.9.
#
CODE="
#include <linux/pci-epc.h>
int conftest_pci_epc_features_struct_has_pci_epc_bar_desc(void) {
return offsetof(struct pci_epc_features, bar);
}"
compile_check_conftest "$CODE" "NV_PCI_EPC_FEATURES_STRUCT_HAS_BAR" "" "types"
;;
pci_disable_pcie_error_reporting)
#
# Determine if the pci_disable_pcie_error_reporting() API available or not.