/* * Copyright (c) 2015 Emulex. All rights reserved. EMULEX CONFIDENTIAL. * Unpublished work. Copying, access, use or distribution requires an * applicable license approved by Emulex. */ // TODO: We should reference this information from the driver directory, not copy it here. #define ELX_PT_IOCTL_CMD_BASE 0x9a #define IOCTL_CMD_ELX_PT_GET_INFO _IOR(ELX_PT_IOCTL_CMD_BASE, 1, elx_pt_ioctl_info_t) #define IOCTL_CMD_ELX_PT_DMA_ALLOC _IOWR(ELX_PT_IOCTL_CMD_BASE, 2, elx_pt_ioctl_dma_alloc_t) #define IOCTL_CMD_ELX_PT_DMA_FREE _IOWR(ELX_PT_IOCTL_CMD_BASE, 3, elx_pt_ioctl_dma_free_t) #define IOCTL_CMD_ELX_PT_DMA_SYNC _IOWR(ELX_PT_IOCTL_CMD_BASE, 4, elx_pt_ioctl_dma_sync_t) #define IOCTL_CMD_ELX_PT_MBOX _IOWR(ELX_PT_IOCTL_CMD_BASE, 5, elx_pt_ioctl_mbox_t) #define IOCTL_CMD_ELX_PT_MBOX_FC _IOWR(ELX_PT_IOCTL_CMD_BASE, 6, elx_pt_ioctl_mbox_fc_t) #define IOCTL_CMD_ELX_PT_ECD_HELPER _IOWR(ELX_PT_IOCTL_CMD_BASE, 7, elx_pt_ioctl_ecd_helper_t) typedef struct { uint32_t instance; uint32_t vendor; uint32_t device; uint32_t sli_intf; uint32_t asic_id; char bus_addr[80]; } elx_pt_ioctl_info_t; typedef struct { uint32_t req_size; uintptr_t paddr; uint32_t tag; } elx_pt_ioctl_dma_alloc_t; typedef struct { uint32_t tag; } elx_pt_ioctl_dma_free_t; enum { ELX_PT_DMASYNC_PREWRITE=1, ELX_PT_DMASYNC_POSTREAD, }; typedef struct { uint32_t flags; uintptr_t paddr; uint32_t size; } elx_pt_ioctl_dma_sync_t; typedef struct { uint32_t *words; uint32_t num_words; } elx_pt_ioctl_mbox_t; typedef struct { uint32_t *words; uint32_t num_words; } elx_pt_ioctl_mbox_fc_t; typedef enum { ELX_PT_ECD_HELPER_CFG_READ8, ELX_PT_ECD_HELPER_CFG_READ16, ELX_PT_ECD_HELPER_CFG_READ32, ELX_PT_ECD_HELPER_CFG_WRITE8, ELX_PT_ECD_HELPER_CFG_WRITE16, ELX_PT_ECD_HELPER_CFG_WRITE32, ELX_PT_ECD_HELPER_BAR_READ8, ELX_PT_ECD_HELPER_BAR_READ16, ELX_PT_ECD_HELPER_BAR_READ32, ELX_PT_ECD_HELPER_BAR_WRITE8, ELX_PT_ECD_HELPER_BAR_WRITE16, ELX_PT_ECD_HELPER_BAR_WRITE32, } elx_pt_ecd_helper_cmd_t; typedef struct { elx_pt_ecd_helper_cmd_t cmd; /*<< coredump helper function command */ uint32_t bar; /*<< BAR value to use */ uint32_t offset; /*<< offset value to use */ uint32_t data; /*<< 32 bit data value to write or return read data in */ int status; /*<< status of helper function request */ } elx_pt_ioctl_ecd_helper_t;