Skip to content

Commit

Permalink
VMCI: dma dg: detect DMA datagram capability
Browse files Browse the repository at this point in the history
Detect the VMCI DMA datagram capability, and if present, ack it
to the device.

Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Link: https://lore.kernel.org/r/20220207102725.2742-4-jhansen@vmware.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jorgen Hansen authored and Greg Kroah-Hartman committed Feb 8, 2022
1 parent e283a0e commit eed2298
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/misc/vmw_vmci/vmci_guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,17 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
}
}

if (mmio_base != NULL) {
if (capabilities & VMCI_CAPS_DMA_DATAGRAM) {
caps_in_use |= VMCI_CAPS_DMA_DATAGRAM;
} else {
dev_err(&pdev->dev,
"Missing capability: VMCI_CAPS_DMA_DATAGRAM\n");
error = -ENXIO;
goto err_free_data_buffer;
}
}

dev_info(&pdev->dev, "Using capabilities 0x%x\n", caps_in_use);

/* Let the host know which capabilities we intend to use. */
Expand Down
1 change: 1 addition & 0 deletions include/linux/vmw_vmci_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define VMCI_CAPS_DATAGRAM BIT(2)
#define VMCI_CAPS_NOTIFICATIONS BIT(3)
#define VMCI_CAPS_PPN64 BIT(4)
#define VMCI_CAPS_DMA_DATAGRAM BIT(5)

/* Interrupt Cause register bits. */
#define VMCI_ICR_DATAGRAM BIT(0)
Expand Down

0 comments on commit eed2298

Please sign in to comment.