The doorbell test requires the EPC driver to support dynamic inbound
mapping so the host can map the doorbell target address into a BAR
aperture.
Expose epc_features->dynamic_inbound_mapping via a new
CAP_DYNAMIC_INBOUND_MAPPING bit in the pci-epf-test capability register,
so the host-side pci_endpoint_test driver can detect missing support and
return -EOPNOTSUPP instead of running the test fruitlessly.
Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260215150334.3391943-2-den@valinux.co.jp
#define CAP_MSIX BIT(2)
#define CAP_INTX BIT(3)
#define CAP_SUBRANGE_MAPPING BIT(4)
+#define CAP_DYNAMIC_INBOUND_MAPPING BIT(5)
#define PCI_EPF_TEST_BAR_SUBRANGE_NSUB 2
if (epf_test->epc_features->intx_capable)
caps |= CAP_INTX;
+ if (epf_test->epc_features->dynamic_inbound_mapping)
+ caps |= CAP_DYNAMIC_INBOUND_MAPPING;
+
if (epf_test->epc_features->dynamic_inbound_mapping &&
epf_test->epc_features->subrange_mapping)
caps |= CAP_SUBRANGE_MAPPING;