summaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorPhil Sutter2017-01-18 14:04:37 +0100
committerDavid S. Miller2017-01-20 17:43:16 +0100
commit582a686f52d2e002da64093fe4b9aa5befcaf4e4 (patch)
tree3af9cc4b76d7b522d2fb41e15de209c4b61d9410 /include/linux/device.h
parentsock: use hlist_entry_safe (diff)
downloadkernel-qcow2-linux-582a686f52d2e002da64093fe4b9aa5befcaf4e4.tar.gz
kernel-qcow2-linux-582a686f52d2e002da64093fe4b9aa5befcaf4e4.tar.xz
kernel-qcow2-linux-582a686f52d2e002da64093fe4b9aa5befcaf4e4.zip
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 <phil@nwl.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 491b4c0ca633..6d73b70a4a5d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -88,6 +88,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
*
* @suspend: Called when a device on this bus wants to go to sleep mode.
* @resume: Called to bring a device on this bus out of sleep mode.
+ * @num_vf: Called to find out how many virtual functions a device on this
+ * bus supports.
* @pm: Power management operations of this bus, callback the specific
* device driver's pm-ops.
* @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU
@@ -127,6 +129,8 @@ struct bus_type {
int (*suspend)(struct device *dev, pm_message_t state);
int (*resume)(struct device *dev);
+ int (*num_vf)(struct device *dev);
+
const struct dev_pm_ops *pm;
const struct iommu_ops *iommu_ops;