This interface driver is a helper driver allows other drivers to have a common interface with the Hyper-V PCI frontend driver.
Showing the changes to include/linux (1 of 7 files). Show all
Unified · Split
| @@ -1579,18 +1579,32 @@ hv_pkt_iter_next(struct vmbus_channel *channel, · 1578 unmodified lines | |||
| 1579 | pkt = hv_pkt_iter_next(channel, pkt)) | 1579 | pkt = hv_pkt_iter_next(channel, pkt)) |
| 1580 | 1580 | ||
| 1581 | /* | 1581 | /* |
| 1582 | * Functions for passing data between SR-IOV PF and VF drivers. The VF driver | 1582 | * Interface for passing data between SR-IOV PF and VF drivers. The VF driver |
| 1583 | * sends requests to read and write blocks. Each block must be 128 bytes or | 1583 | * sends requests to read and write blocks. Each block must be 128 bytes or |
| 1584 | * smaller. Optionally, the VF driver can register a callback function which | 1584 | * smaller. Optionally, the VF driver can register a callback function which |
| 1585 | * will be invoked when the host says that one or more of the first 64 block | 1585 | * will be invoked when the host says that one or more of the first 64 block |
| 1586 | * IDs is "invalid" which means that the VF driver should reread them. | 1586 | * IDs is "invalid" which means that the VF driver should reread them. |
| 1587 | */ | 1587 | */ |
| 1588 | #define HV_CONFIG_BLOCK_SIZE_MAX 128 | 1588 | #define HV_CONFIG_BLOCK_SIZE_MAX 128 |
| 1589 | int hv_read_config_block(struct pci_dev *dev, void *buf, unsigned int buf_len, | 1589 | |
| 1590 | unsigned int block_id, unsigned int *bytes_returned); | 1590 | int hyperv_read_cfg_blk(struct pci_dev *dev, void *buf, unsigned int buf_len, |
| 1591 | int hv_write_config_block(struct pci_dev *dev, void *buf, unsigned int len, | 1591 | unsigned int block_id, unsigned int *bytes_returned); |
| 1592 | unsigned int block_id); | 1592 | int hyperv_write_cfg_blk(struct pci_dev *dev, void *buf, unsigned int len, |
| 1593 | int hv_register_block_invalidate(struct pci_dev *dev, void *context, | 1593 | unsigned int block_id); |
| 1594 | void (*block_invalidate)(void *context, | 1594 | int hyperv_reg_block_invalidate(struct pci_dev *dev, void *context, |
| 1595 | u64 block_mask)); | 1595 | void (*block_invalidate)(void *context, |
| 1596 | u64 block_mask)); | ||
| 1597 | |||
| 1598 | struct hyperv_pci_block_ops { | ||
| 1599 | int (*read_block)(struct pci_dev *dev, void *buf, unsigned int buf_len, | ||
| 1600 | unsigned int block_id, unsigned int *bytes_returned); | ||
| 1601 | int (*write_block)(struct pci_dev *dev, void *buf, unsigned int len, | ||
| 1602 | unsigned int block_id); | ||
| 1603 | int (*reg_blk_invalidate)(struct pci_dev *dev, void *context, | ||
| 1604 | void (*block_invalidate)(void *context, | ||
| 1605 | u64 block_mask)); | ||
| 1606 | }; | ||
| 1607 | |||
| 1608 | extern struct hyperv_pci_block_ops hvpci_block_ops; | ||
| 1609 | |||
| 1596 | #endif /* _HYPERV_H */ | 1610 | #endif /* _HYPERV_H */ |