smartmontools SVN Rev 5617
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Macros | Typedefs | Functions | Variables
megaraid.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __attribute__
 
union  ptr_t
 
struct  uioctl_t
 
struct  megasas_sge32
 
struct  megasas_sge64
 
union  megasas_sgl
 
struct  megasas_header
 
struct  megasas_pthru_frame
 
struct  megasas_dcmd_frame
 
struct  megasas_iocpacket
 
struct  megasas_pd_address
 
struct  megasas_pd_list
 

Macros

#define u8   uint8_t
 
#define u16   uint16_t
 
#define u32   uint32_t
 
#define u64   uint64_t
 
#define MEGAIOC_MAGIC   'm'
 
#define MEGAIOCCMD   _IOWR(MEGAIOC_MAGIC, 0, struct uioctl_t)
 
#define MKADAP(adapno)   (MEGAIOC_MAGIC << 8 | adapno)
 
#define MEGAIOC_QNADAP   'm'
 
#define MEGAIOC_QDRVRVER   'e'
 
#define MEGAIOC_QADAPINFO   'g'
 
#define MEGA_MBOXCMD_PASSTHRU   0x03
 
#define MAX_REQ_SENSE_LEN   0x20
 
#define MAX_CDB_LEN   10
 
#define MEGASAS_MAGIC   'M'
 
#define MEGASAS_IOC_FIRMWARE   _IOWR(MEGASAS_MAGIC, 1, struct megasas_iocpacket)
 
#define MFI_CMD_PD_SCSI_IO   0x04
 
#define MFI_CMD_DCMD   0x05
 
#define MFI_FRAME_SGL64   0x02
 
#define MFI_STAT_OK   0x00
 
#define MFI_DCMD_PD_GET_LIST   0x02010000
 
#define MFI_MBOX_SIZE   12
 
#define MAX_IOCTL_SGE   16
 
#define MFI_FRAME_DIR_NONE   0x0000
 
#define MFI_FRAME_DIR_WRITE   0x0008
 
#define MFI_FRAME_DIR_READ   0x0010
 
#define MFI_FRAME_DIR_BOTH   0x0018
 
#define MAX_SYS_PDS   240
 

Typedefs

typedef char assert_sizeof_ptr_t[sizeof(ptr_t)==8 ? 1 :-1]
 

Functions

int megaraid_io_interface (int device, int target, struct scsi_cmnd_io *, int)
 
struct {
   uint8_t   opcode
 
   uint8_t   subopcode
 
   uint16_t   adapno
 
   ptr_t   buffer
 
   uint32_t   length
 
__attribute__ ((packed)) fcs
 

Variables

uint8_t opcode
 
uint8_t subopcode
 
uint16_t adapno
 
ptr_t buffer
 
uint32_t length
 
uint8_t fca [16]
 
uint32_t inlen
 
uint32_t outlen
 
megacmd_t mbox
 
mega_passthru pthru
 
ptr_t data
 
u32 phys_addr
 
struct megasas_sge32 sge32 [1]
 
struct megasas_sge64 sge64 [1]
 
u8 cmd
 
u8 sense_len
 
u8 cmd_status
 
u8 scsi_status
 
u8 target_id
 
u8 lun
 
u8 cdb_len
 
u8 sge_count
 
u32 context
 
u32 pad_0
 
u16 flags
 
u16 timeout
 
u32 data_xferlen
 
u32 data_xfer_len
 
u32 sense_buf_phys_addr_lo
 
u32 sense_buf_phys_addr_hi
 
u8 cdb [16]
 
union megasas_sgl sgl
 
u8 reserved_0
 
u8 reserved_1 [4]
 
u16 host_no
 
u16 __pad1
 
u32 sgl_off
 
u32 sense_off
 
union {
   u8   raw [128]
 
   struct megasas_header   hdr
 
   struct megasas_pthru_frame   pthru
 
   struct megasas_dcmd_frame   dcmd
 
frame
 
u16 device_id
 
u16 encl_device_id
 
u8 encl_index
 
u8 slot_number
 
u8 scsi_dev_type
 
u8 connect_port_bitmap
 
u64 sas_addr [2]
 
u32 size
 
u32 count
 
struct megasas_pd_address addr [MAX_SYS_PDS]
 

Macro Definition Documentation

◆ MAX_CDB_LEN

#define MAX_CDB_LEN   10

Definition at line 39 of file megaraid.h.

◆ MAX_IOCTL_SGE

#define MAX_IOCTL_SGE   16

Definition at line 128 of file megaraid.h.

◆ MAX_REQ_SENSE_LEN

#define MAX_REQ_SENSE_LEN   0x20

Definition at line 38 of file megaraid.h.

◆ MAX_SYS_PDS

#define MAX_SYS_PDS   240

Definition at line 134 of file megaraid.h.

◆ MEGA_MBOXCMD_PASSTHRU

#define MEGA_MBOXCMD_PASSTHRU   0x03

Definition at line 36 of file megaraid.h.

◆ MEGAIOC_MAGIC

#define MEGAIOC_MAGIC   'm'

Definition at line 27 of file megaraid.h.

◆ MEGAIOC_QADAPINFO

#define MEGAIOC_QADAPINFO   'g'

Definition at line 34 of file megaraid.h.

◆ MEGAIOC_QDRVRVER

#define MEGAIOC_QDRVRVER   'e'

Definition at line 33 of file megaraid.h.

◆ MEGAIOC_QNADAP

#define MEGAIOC_QNADAP   'm'

Definition at line 32 of file megaraid.h.

◆ MEGAIOCCMD

#define MEGAIOCCMD   _IOWR(MEGAIOC_MAGIC, 0, struct uioctl_t)

Definition at line 28 of file megaraid.h.

◆ MEGASAS_IOC_FIRMWARE

#define MEGASAS_IOC_FIRMWARE   _IOWR(MEGASAS_MAGIC, 1, struct megasas_iocpacket)

Definition at line 117 of file megaraid.h.

◆ MEGASAS_MAGIC

#define MEGASAS_MAGIC   'M'

Definition at line 116 of file megaraid.h.

◆ MFI_CMD_DCMD

#define MFI_CMD_DCMD   0x05

Definition at line 120 of file megaraid.h.

◆ MFI_CMD_PD_SCSI_IO

#define MFI_CMD_PD_SCSI_IO   0x04

Definition at line 119 of file megaraid.h.

◆ MFI_DCMD_PD_GET_LIST

#define MFI_DCMD_PD_GET_LIST   0x02010000

Definition at line 123 of file megaraid.h.

◆ MFI_FRAME_DIR_BOTH

#define MFI_FRAME_DIR_BOTH   0x0018

Definition at line 132 of file megaraid.h.

◆ MFI_FRAME_DIR_NONE

#define MFI_FRAME_DIR_NONE   0x0000

Definition at line 129 of file megaraid.h.

◆ MFI_FRAME_DIR_READ

#define MFI_FRAME_DIR_READ   0x0010

Definition at line 131 of file megaraid.h.

◆ MFI_FRAME_DIR_WRITE

#define MFI_FRAME_DIR_WRITE   0x0008

Definition at line 130 of file megaraid.h.

◆ MFI_FRAME_SGL64

#define MFI_FRAME_SGL64   0x02

Definition at line 121 of file megaraid.h.

◆ MFI_MBOX_SIZE

#define MFI_MBOX_SIZE   12

Definition at line 127 of file megaraid.h.

◆ MFI_STAT_OK

#define MFI_STAT_OK   0x00

Definition at line 122 of file megaraid.h.

◆ MKADAP

#define MKADAP (   adapno)    (MEGAIOC_MAGIC << 8 | adapno)

Definition at line 31 of file megaraid.h.

◆ u16

#define u16   uint16_t

Definition at line 16 of file megaraid.h.

◆ u32

#define u32   uint32_t

Definition at line 17 of file megaraid.h.

◆ u64

#define u64   uint64_t

Definition at line 18 of file megaraid.h.

◆ u8

#define u8   uint8_t

Definition at line 15 of file megaraid.h.

Typedef Documentation

◆ assert_sizeof_ptr_t

typedef char assert_sizeof_ptr_t[sizeof(ptr_t)==8 ? 1 :-1]

Definition at line 88 of file megaraid.h.

Function Documentation

◆ __attribute__()

struct megasas_pd_list __attribute__ ( (packed)  )

◆ megaraid_io_interface()

int megaraid_io_interface ( int  device,
int  target,
struct scsi_cmnd_io ,
int   
)

Variable Documentation

◆ __pad1

u16 __pad1

Definition at line 1 of file megaraid.h.

◆ adapno

uint16_t adapno

Definition at line 2 of file megaraid.h.

◆ addr

Definition at line 2 of file megaraid.h.

◆ b

u8 b[12]

Definition at line 17 of file megaraid.h.

◆ buffer

ptr_t buffer

Definition at line 3 of file megaraid.h.

◆ cdb

u8 cdb[16]

Definition at line 21 of file megaraid.h.

◆ cdb_len

u8 cdb_len

Definition at line 8 of file megaraid.h.

◆ cmd

u8 cmd

Definition at line 1 of file megaraid.h.

◆ cmd_status

u8 cmd_status

Definition at line 3 of file megaraid.h.

◆ connect_port_bitmap

u8 connect_port_bitmap

Definition at line 5 of file megaraid.h.

◆ context

u32 context

Definition at line 11 of file megaraid.h.

◆ count

u32 count

Definition at line 1 of file megaraid.h.

◆ data

ptr_t data

Definition at line 15 of file megaraid.h.

◆ data_xfer_len

u32 data_xfer_len

Definition at line 16 of file megaraid.h.

◆ data_xferlen

u32 data_xferlen

Definition at line 16 of file megaraid.h.

◆ dcmd

struct megasas_dcmd_frame dcmd

Definition at line 10 of file megaraid.h.

◆ device_id

u16 device_id

Definition at line 0 of file megaraid.h.

◆ encl_device_id

u16 encl_device_id

Definition at line 1 of file megaraid.h.

◆ encl_index

u8 encl_index

Definition at line 2 of file megaraid.h.

◆ fca

uint8_t fca

Definition at line 0 of file megaraid.h.

◆ flags

uint16_t flags

Definition at line 14 of file megaraid.h.

◆ 

union { ... } frame

◆ hdr

struct megasas_header hdr

Definition at line 8 of file megaraid.h.

◆ host_no

u16 host_no

Definition at line 0 of file megaraid.h.

◆ inlen

uint32_t inlen

Definition at line 0 of file megaraid.h.

◆ length

u32 length

Definition at line 4 of file megaraid.h.

◆ lun

u8 lun

Definition at line 7 of file megaraid.h.

◆ 

union { ... } mbox

Definition at line 13 of file megaraid.h.

◆ opcode

u32 opcode

Definition at line 0 of file megaraid.h.

◆ outlen

uint32_t outlen

Definition at line 1 of file megaraid.h.

◆ pad_0

u32 pad_0

Definition at line 12 of file megaraid.h.

◆ phys_addr

u64 phys_addr

Definition at line 1 of file megaraid.h.

◆ pthru

struct megasas_pthru_frame pthru

Definition at line 14 of file megaraid.h.

◆ raw

u8 raw[128]

Definition at line 7 of file megaraid.h.

◆ reserved_0

u8 reserved_0

Definition at line 2 of file megaraid.h.

◆ reserved_1

u8 reserved_1[4]

Definition at line 4 of file megaraid.h.

◆ s

u16 s[6]

Definition at line 18 of file megaraid.h.

◆ sas_addr

u64 sas_addr[2]

Definition at line 6 of file megaraid.h.

◆ scsi_dev_type

u8 scsi_dev_type

Definition at line 4 of file megaraid.h.

◆ scsi_status

u8 scsi_status

Definition at line 4 of file megaraid.h.

◆ sense_buf_phys_addr_hi

u32 sense_buf_phys_addr_hi

Definition at line 19 of file megaraid.h.

◆ sense_buf_phys_addr_lo

u32 sense_buf_phys_addr_lo

Definition at line 18 of file megaraid.h.

◆ sense_len

u32 sense_len

Definition at line 2 of file megaraid.h.

◆ sense_off

u32 sense_off

Definition at line 4 of file megaraid.h.

◆ sge32

struct megasas_sge32 sge32[1]

Definition at line 1 of file megaraid.h.

◆ sge64

struct megasas_sge64 sge64[1]

Definition at line 2 of file megaraid.h.

◆ sge_count

u32 sge_count

Definition at line 9 of file megaraid.h.

◆ sgl

struct iovec sgl

Definition at line 22 of file megaraid.h.

◆ sgl_off

u32 sgl_off

Definition at line 2 of file megaraid.h.

◆ size

u32 size

Definition at line 0 of file megaraid.h.

◆ slot_number

u8 slot_number

Definition at line 3 of file megaraid.h.

◆ subopcode

uint8_t subopcode

Definition at line 1 of file megaraid.h.

◆ target_id

u8 target_id

Definition at line 6 of file megaraid.h.

◆ timeout

u16 timeout

Definition at line 15 of file megaraid.h.

◆ w

u32 w[3]

Definition at line 19 of file megaraid.h.