cpqfcTSioctl.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. // for user apps, make sure data size types are defined
  2. // with 
  3. #define CCPQFCTS_IOC_MAGIC 'Z'
  4. typedef struct 
  5. {
  6.   __u8 bus;
  7.   __u8 dev_fn;
  8.   __u32 board_id;
  9. } cpqfc_pci_info_struct;
  10. typedef __u32 DriverVer_type;
  11. /*
  12. typedef union
  13. {
  14.   struct  // Peripheral Unit Device
  15.   { 
  16.     __u8 Bus:6;
  17.     __u8 Mode:2;  // b00
  18.     __u8 Dev;
  19.   } PeripDev;
  20.   struct  // Volume Set Address
  21.   { 
  22.     __u8 DevMSB:6;
  23.     __u8 Mode:2;  // b01
  24.     __u8 DevLSB;
  25.   } LogDev;
  26.   struct  // Logical Unit Device (SCSI-3, SCC-2 defined)
  27.   { 
  28.     __u8 Targ:6;
  29.     __u8 Mode:2;  // b10
  30.     __u8 Dev:5;
  31.     __u8 Bus:3;
  32.   } LogUnit;
  33. } SCSI3Addr_struct;
  34. typedef struct
  35. {
  36.   SCSI3Addr_struct FCP_Nexus;
  37.   __u8 cdb[16];
  38. } PassThru_Command_struct;
  39. */
  40. /* this is nearly duplicated in idashare.h */
  41. typedef struct {
  42.   int lc;     /* Controller number */
  43.   int node; /* Node (box) number */
  44.   int ld; /* Logical Drive on this box, if required */
  45.   __u32 nexus;          /* SCSI Nexus */
  46.   void *argp; /* Argument pointer */
  47. } VENDOR_IOCTL_REQ;
  48. typedef struct {
  49.   char cdb[16]; /* SCSI CDB for the pass-through */
  50.   ushort bus; /* Target bus on the box */
  51.   ushort pdrive; /* Physical drive on the box */
  52.   int len;              /* Length of the data area of the CDB */
  53.   int sense_len; /* Length of the sense data */
  54.   char sense_data[40];  /* Sense data */
  55.   void *bufp; /* Data area for the CDB */
  56.   char rw_flag; /* Read CDB or Write CDB */
  57. } cpqfc_passthru_t;
  58. /*
  59. ** Defines for the IOCTLS.
  60. */
  61. #define VENDOR_READ_OPCODE 0x26
  62. #define VENDOR_WRITE_OPCODE 0x27
  63. #define CPQFCTS_GETPCIINFO _IOR( CCPQFCTS_IOC_MAGIC, 1, cpqfc_pci_info_struct)
  64. #define CPQFCTS_GETDRIVVER _IOR( CCPQFCTS_IOC_MAGIC, 9, DriverVer_type)
  65. #define CPQFCTS_SCSI_PASSTHRU _IOWR( CCPQFCTS_IOC_MAGIC,11, VENDOR_IOCTL_REQ)
  66. /* We would rather have equivalent generic, low-level driver agnostic 
  67. ioctls that do what CPQFC_IOCTL_FC_TARGET_ADDRESS and 
  68. CPQFC_IOCTL_FC_TDR 0x5388 do, but currently, we do not have them, 
  69. consequently applications would have to know they are talking to cpqfc. */
  70.    
  71. /* Used to get Fibre Channel WWN and port_id from device */
  72. // #define CPQFC_IOCTL_FC_TARGET_ADDRESS 0x5387
  73. #define CPQFC_IOCTL_FC_TARGET_ADDRESS 
  74. _IOR( CCPQFCTS_IOC_MAGIC, 13, Scsi_FCTargAddress)
  75. /* Used to invoke Target Defice Reset for Fibre Channel */
  76. // #define CPQFC_IOCTL_FC_TDR 0x5388
  77. #define CPQFC_IOCTL_FC_TDR _IO( CCPQFCTS_IOC_MAGIC, 15)