Go to the documentation of this file.
24 #ifndef _VMW_PVSCSI_H_
25 #define _VMW_PVSCSI_H_
27 #include <linux/types.h>
29 #define PVSCSI_DRIVER_VERSION_STRING "1.0.2.0-k"
31 #define PVSCSI_MAX_NUM_SG_ENTRIES_PER_SEGMENT 128
33 #define MASK(n) ((1 << (n)) - 1)
35 #define PCI_VENDOR_ID_VMWARE 0x15AD
36 #define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0
179 #define PVSCSI_SETUP_RINGS_MAX_NUM_PAGES 32
207 #define PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES 16
307 #define PVSCSI_FLAG_CMD_WITH_SG_LIST (1 << 0)
308 #define PVSCSI_FLAG_CMD_OUT_OF_BAND_CDB (1 << 1)
309 #define PVSCSI_FLAG_CMD_DIR_NONE (1 << 2)
310 #define PVSCSI_FLAG_CMD_DIR_TOHOST (1 << 3)
311 #define PVSCSI_FLAG_CMD_DIR_TODEVICE (1 << 4)
400 #define PVSCSI_INTR_CMPL_0 (1 << 0)
401 #define PVSCSI_INTR_CMPL_1 (1 << 1)
402 #define PVSCSI_INTR_CMPL_MASK MASK(2)
404 #define PVSCSI_INTR_MSG_0 (1 << 2)
405 #define PVSCSI_INTR_MSG_1 (1 << 3)
406 #define PVSCSI_INTR_MSG_MASK (MASK(2) << 2)
408 #define PVSCSI_INTR_ALL_SUPPORTED MASK(4)
413 #define PVSCSI_MAX_INTRS 24
418 #define PVSCSI_VECTOR_COMPLETION 0
424 #define PVSCSI_MAX_NUM_PAGES_REQ_RING PVSCSI_SETUP_RINGS_MAX_NUM_PAGES
425 #define PVSCSI_MAX_NUM_PAGES_CMP_RING PVSCSI_SETUP_RINGS_MAX_NUM_PAGES
426 #define PVSCSI_MAX_NUM_PAGES_MSG_RING PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES
428 #define PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE \
429 (PAGE_SIZE / sizeof(struct PVSCSIRingReqDesc))
431 #define PVSCSI_MAX_REQ_QUEUE_DEPTH \
432 (PVSCSI_MAX_NUM_PAGES_REQ_RING * PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE)
434 #define PVSCSI_MEM_SPACE_COMMAND_NUM_PAGES 1
435 #define PVSCSI_MEM_SPACE_INTR_STATUS_NUM_PAGES 1
436 #define PVSCSI_MEM_SPACE_MISC_NUM_PAGES 2
437 #define PVSCSI_MEM_SPACE_KICK_IO_NUM_PAGES 2
438 #define PVSCSI_MEM_SPACE_MSIX_NUM_PAGES 2
449 #define PVSCSI_MEM_SPACE_NUM_PAGES \
450 (PVSCSI_MEM_SPACE_COMMAND_NUM_PAGES + \
451 PVSCSI_MEM_SPACE_INTR_STATUS_NUM_PAGES + \
452 PVSCSI_MEM_SPACE_MISC_NUM_PAGES + \
453 PVSCSI_MEM_SPACE_KICK_IO_NUM_PAGES + \
454 PVSCSI_MEM_SPACE_MSIX_NUM_PAGES)
456 #define PVSCSI_MEM_SPACE_SIZE (PVSCSI_MEM_SPACE_NUM_PAGES * PAGE_SIZE)