Merge tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyper...
[sfrench/cifs-2.6.git] / include / linux / hyperv.h
index a3aa9e9ef6f23d6c491b169b8f6a4fc445ebbe7f..b4a017093b697e615b6850860f9d58a8ed65193c 100644 (file)
@@ -1592,4 +1592,33 @@ hv_pkt_iter_next(struct vmbus_channel *channel,
        for (pkt = hv_pkt_iter_first(channel); pkt; \
            pkt = hv_pkt_iter_next(channel, pkt))
 
+/*
+ * Interface for passing data between SR-IOV PF and VF drivers. The VF driver
+ * sends requests to read and write blocks. Each block must be 128 bytes or
+ * smaller. Optionally, the VF driver can register a callback function which
+ * will be invoked when the host says that one or more of the first 64 block
+ * IDs is "invalid" which means that the VF driver should reread them.
+ */
+#define HV_CONFIG_BLOCK_SIZE_MAX 128
+
+int hyperv_read_cfg_blk(struct pci_dev *dev, void *buf, unsigned int buf_len,
+                       unsigned int block_id, unsigned int *bytes_returned);
+int hyperv_write_cfg_blk(struct pci_dev *dev, void *buf, unsigned int len,
+                        unsigned int block_id);
+int hyperv_reg_block_invalidate(struct pci_dev *dev, void *context,
+                               void (*block_invalidate)(void *context,
+                                                        u64 block_mask));
+
+struct hyperv_pci_block_ops {
+       int (*read_block)(struct pci_dev *dev, void *buf, unsigned int buf_len,
+                         unsigned int block_id, unsigned int *bytes_returned);
+       int (*write_block)(struct pci_dev *dev, void *buf, unsigned int len,
+                          unsigned int block_id);
+       int (*reg_blk_invalidate)(struct pci_dev *dev, void *context,
+                                 void (*block_invalidate)(void *context,
+                                                          u64 block_mask));
+};
+
+extern struct hyperv_pci_block_ops hvpci_block_ops;
+
 #endif /* _HYPERV_H */