Skip to content

Commit 582a686

Browse files
Phil Sutterdavem330
authored andcommitted
device: bus_type: Introduce num_vf callback
This allows for bus types to implement their own method of retrieving the number of virtual functions a NIC on that type of bus supports. Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6c59ebd commit 582a686

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/device.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
8888
*
8989
* @suspend: Called when a device on this bus wants to go to sleep mode.
9090
* @resume: Called to bring a device on this bus out of sleep mode.
91+
* @num_vf: Called to find out how many virtual functions a device on this
92+
* bus supports.
9193
* @pm: Power management operations of this bus, callback the specific
9294
* device driver's pm-ops.
9395
* @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU
@@ -127,6 +129,8 @@ struct bus_type {
127129
int (*suspend)(struct device *dev, pm_message_t state);
128130
int (*resume)(struct device *dev);
129131

132+
int (*num_vf)(struct device *dev);
133+
130134
const struct dev_pm_ops *pm;
131135

132136
const struct iommu_ops *iommu_ops;

0 commit comments

Comments
 (0)