summaryrefslogtreecommitdiff
path: root/include/linux/pci-epf.h
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2021-02-01 22:58:01 +0300
committerBjorn Helgaas <bhelgaas@google.com>2021-02-23 23:11:31 +0300
commit256ae475201b16fd69e00dd6c2d14035e4ea5745 (patch)
tree80a3be4e40b155a0100d00cd5f84fc9b361519eb /include/linux/pci-epf.h
parent87d5972e476f6c4e98a0abce713c54c6f40661b0 (diff)
downloadlinux-256ae475201b16fd69e00dd6c2d14035e4ea5745.tar.xz
PCI: endpoint: Add pci_epf_ops to expose function-specific attrs
In addition to the attributes that are generic across function drivers documented in Documentation/PCI/endpoint/pci-endpoint-cfs.rst, there could be function-specific attributes that has to be exposed by the function driver to be configured by the user. Add ->add_cfs() in pci_epf_ops to be populated by the function driver if it has to expose any function-specific attributes and pci_epf_type_add_cfs() to be invoked by pci-ep-cfs.c when sub-directory to main function directory is created. Link: https://lore.kernel.org/r/20210201195809.7342-10-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/pci-epf.h')
-rw-r--r--include/linux/pci-epf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h
index 1dc66824f5a8..b241e7dd171f 100644
--- a/include/linux/pci-epf.h
+++ b/include/linux/pci-epf.h
@@ -62,10 +62,13 @@ struct pci_epf_header {
* @bind: ops to perform when a EPC device has been bound to EPF device
* @unbind: ops to perform when a binding has been lost between a EPC device
* and EPF device
+ * @add_cfs: ops to initialize function specific configfs attributes
*/
struct pci_epf_ops {
int (*bind)(struct pci_epf *epf);
void (*unbind)(struct pci_epf *epf);
+ struct config_group *(*add_cfs)(struct pci_epf *epf,
+ struct config_group *group);
};
/**
@@ -188,4 +191,6 @@ void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar,
enum pci_epc_interface_type type);
int pci_epf_bind(struct pci_epf *epf);
void pci_epf_unbind(struct pci_epf *epf);
+struct config_group *pci_epf_type_add_cfs(struct pci_epf *epf,
+ struct config_group *group);
#endif /* __LINUX_PCI_EPF_H */