Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_ramd.c File Reference
#include "ocs.h"
#include "ocs_ramd.h"
#include "ocs_ramdisc.h"
#include "scsi_cmds.h"
#include "ocs_mgmt.h"

Go to the source code of this file.

Detailed Description

Implement the SCSI RAMD target-server.

Definition in file ocs_ramd.c.

Data Structures

struct  ocs_ramd_status_t
 A structure that contains the status and extended status fields. More...
 
struct  ocs_port_rdisc_t
 
struct  scsi_cmd_table_t
 A structure used to map a handler function to a SCSI sommand. More...
 
struct  fixed_sense_data_t
 Defines the standard sense response bits per the SCSI SPC specification. More...
 
struct  read_capacity10_param_data_t
 A structure used to create the READ CAPACITY (10) parameter data. More...
 
struct  read_capacity16_param_data_t
 A structure used to create READ CAPACITY (16) parameter data. More...
 
struct  scsi_std_inquiry_t
 A structure used to create the standard inquiry data. More...
 
struct  scsi_extdif_inquiry_t
 Vendor specific inquiry data for External DIF. More...
 
struct  scsi_supported_pages_vpd_page_t
 A structure used to create the inquiry page 00 data. More...
 
struct  scsi_unit_serial_number_vpd_page_t
 A structure used to create the inquiry page 80 data. More...
 
struct  scsi_device_identification_vpd_page_t
 A structure used to create the inquiry page 83 data. More...
 
struct  scsi_device_identification_vpd_desc_t
 A structure used to create the device ID data for inquiry page 83. More...
 
struct  scsi_device_designator_t
 The Designator used by inquiry page 83. This is an EUI-64 based 12-byte identifier. More...
 
struct  scsi_extended_inquiry_data_vpd_page_t
 A structure used to create the inquiry page 86 data. More...
 
struct  scsi_block_limits_vpd_page_t
 A structure used to create the inquiry page B0 data. More...
 
struct  scsi_block_device_characteristics_vpd_page_t
 A structure used to create the inquiry page B1 data. More...
 

Macros

#define INVALID_APP_TAG   0xffffffff
 
#define RAMD_APP_TAG   0x0
 
#define IOFMT   "[%04x][i:%0*x t:%0*x h:%04x][c:%02x]"
 
#define IOFMT_ITT_SIZE(ocs)   ((ocs->ocs_xport == OCS_XPORT_FC) ? 4 : 8)
 
#define IOFMT_ARGS(io)   io->instance_index, IOFMT_ITT_SIZE(io->ocs), io->init_task_tag, IOFMT_ITT_SIZE(io->ocs), io->tgt_task_tag, io->hw_tag, io->tgt_io.cdb[0]
 
#define io_sm_trace()
 
#define tmfio_sm_trace()
 
#define io_printf(io, fmt,...)
 
#define OCS_RAMD_MIN_SIZE   (1024*1024)
 
#define ENABLE_CMD_TRACE   0
 
#define ENABLE_API_TRACE   0
 
#define ENABLE_BUFFER_DUMP   0
 
#define trace(io, enable_flag, fmt,...)
 
#define cmd_trace(io, fmt,...)   trace(io, ENABLE_CMD_TRACE, fmt, ##__VA_ARGS__)
 
#define api_trace(...)
 
#define container_of(p, stype, field)   ((stype *)(((uint8_t *)(p)) - offsetof(stype, field)))
 
#define ACTIVE_IO_COUNT(ocs)   ocs_atomic_read(&ocs->xport->io_active_count)
 
#define DATA_DIR_NONE   0x00
 
#define DATA_DIR_READ   0x01
 
#define DATA_DIR_WRITE   0x02
 
#define DATA_DIR_RDWR   0x03
 
#define INQ_VPD_SUPPORTED_PAGE_00   0x00
 
#define INQ_VPD_UNIT_SERIAL_NO_PAGE_80   0x80
 
#define INQ_VPD_DEVICE_ID_PAGE_83   0x83
 
#define INQ_VPD_EXT_INQ_DATA_PAGE_86   0x86
 
#define INQ_VPD_BLOCKS_LIMIT_PAGE_B0   0xB0
 
#define INQ_VPD_BLOCK_DEV_CHARS_PAGE_B1   0xB1
 

Enumerations

enum  ocs_ramd_state_t {
  __OCS_RAMD_IO_INIT = 0, __OCS_RAMD_IO_INIT_ERR_INJECTION, __OCS_RAMD_IO_WAIT_FIRST_BURST, __OCS_RAMD_IO_WAIT_DATAPHASE_COMPL,
  __OCS_RAMD_IO_WAIT_AND_VALIDATE_DATAPHASE, __OCS_RAMD_IO_WAIT_AND_COMPLETE_WRITESAME_DATAPHASE, __OCS_RAMD_IO_WAIT_RESP_COMPL, __OCS_RAMD_IO_ABORTING,
  __OCS_RAMD_IO_ABORTING_WAIT_IO_CMPL, __OCS_RAMD_IO_ABORTING_WAIT_ABORT_CMPL, __OCS_RAMD_TMF_WAIT_RESP_CMPL, __OCS_RAMD_ABTS_WAIT_IO_ABORT_RESP,
  __OCS_RAMD_WAIT_ABTS_ACC_CMPL, __OCS_RAMD_IO_WAIT_FIRST_BURST_SEND_RESP
}
 

Functions

static void * __ocs_ramd_io_init (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Initial IO state. More...
 
static void * __ocs_ramd_io_init_err_injection (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Initial IO state with error injection enabled. More...
 
static void * __ocs_ramd_io_wait_first_burst (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Waiting for first burst data. More...
 
static void * __ocs_ramd_io_common (const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Common IO event handler. More...
 
static void * __ocs_ramd_io_wait_dataphase_compl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait for the data phase to complete. More...
 
static void * __ocs_ramd_io_wait_and_validate_dataphase (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait for the data phase to complete, then validate the received data. More...
 
static void * __ocs_ramd_io_wait_and_complete_writesame_dataphase (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait for the data phase to complete following a WRITE SAME command. More...
 
static void * __ocs_ramd_io_wait_resp_compl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait for the response to complete. More...
 
static void * __ocs_ramd_io_aborting (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Aborting IO. More...
 
static void * __ocs_ramd_io_aborting_wait_io_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Aborting IO. More...
 
static void * __ocs_ramd_io_aborting_wait_abort_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Aborting IO. More...
 
static void * __ocs_ramd_tmf_wait_resp_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait for the TMF response to complete. More...
 
static void * __ocs_ramd_abts_wait_io_abort_resp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: ABTS: Wait for the IO to be aborted, and send response. More...
 
static void * __ocs_ramd_wait_abts_acc_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: ABTS: Wait for the BA_ACC to complete. More...
 
static void * __ocs_ramd_io_wait_first_burst_send_resp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 State: Wait on first burst then send response. More...
 
static int32_t ocs_ramd_data_phase_start (ocs_io_t *io)
 Common code to start a SCSI data phase once the IO has been set up. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write6 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (6) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write12 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (12) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE (32) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE LONG (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE LONG (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI WRITE SAME (32) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read6 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (6) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read12 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (12) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read32 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ (32) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ LONG (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ LONG (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_inquiry (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI INQUIRY command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_test_unit_ready (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI TEST UNIT READY command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_reserve_release (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI RESERVE or RELEASE command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity10 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ CAPACITY (10) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity16 (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI READ CAPACITY (16) command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_report_luns (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI REPORT LUNS command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_format_unit (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI FORMAT UNIT command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_mode_select (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI MODE SELECT command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_request_sense (ocs_io_t *io, uint8_t cdb[])
 Process the SCSI REQUEST SENSE command. More...
 
static int32_t ocs_ramd_abort_node_tasks (ocs_node_t *node, ocs_io_t *myio)
 Abort all tasks associated with a node. More...
 
static int32_t ocs_ramd_abort_node_tasks_lun (ocs_node_t *node, uint32_t lun, ocs_io_t *myio)
 Abort tasks associated with a given node and LUN. More...
 
static uint32_t scsi_validate_format_unit (ocs_io_t *io)
 Validate a FORMAT UNIT parameter list. More...
 
static int32_t scsi_format_unit_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Command data phase callback for the FORMAT UNIT command. More...
 
static uint32_t scsi_validate_mode_select (ocs_io_t *io)
 Validate a MODE SELECT parameter list. More...
 
static int32_t scsi_mode_select_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Command data phase callback for the MODE SELECT command. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_complete_write_same (ocs_io_t *io)
 Command completion for the SCSI WRITE SAME command. More...
 
static void ocs_scsi_ramd_free (ocs_t *ocs, ocs_ramdisc_t ***rdisc, uint32_t *rdisc_count)
 Free the memory associate with a ramdisc. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t rdprotect, uint32_t app_tag, uint32_t ref_tag)
 Common code used for all SCSI READ commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t wrprotect, uint32_t app_tag, uint32_t ref_tag)
 Common code for all SCSI WRITE commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same_common (ocs_io_t *io, uint64_t lba, uint32_t block_count, uint8_t wrprotect, uint8_t pbdata, uint8_t lbdata, uint32_t app_tag, uint32_t ref_tag)
 Common code for all SCSI WRITE SAME commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long_common (ocs_io_t *io, uint64_t lba, uint16_t xfer_len, uint8_t cor_dis, uint8_t wr_uncor, uint8_t pblock)
 Common code for all SCSI WRITE LONG commands. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long_common (ocs_io_t *io, uint64_t lba, uint16_t xfer_len, uint8_t pblock, uint8_t corrct)
 Common code used for all SCSI READ commands. More...
 
static int32_t ocs_ramd_io_error (ocs_io_t *io, ocs_scsi_io_status_e scsi_status)
 
static int32_t ocs_ramd_abort_tgt_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Command abort callback. More...
 
static int32_t ocs_mgmt_read_block (ocs_t *ocs, char *, void *, uint32_t, void *, uint32_t)
 
void ocs_mgmt_ramd_list (ocs_textbuf_t *textbuf, void *object)
 
void ocs_mgmt_ramd_get_all (ocs_textbuf_t *textbuf, void *object)
 
int ocs_mgmt_ramd_get (ocs_textbuf_t *textbuf, char *parent, char *name, void *object)
 
int ocs_mgmt_ramd_exec (char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *object)
 
static void ocs_ignore_abort_evt (ocs_sm_event_t evt, const char *func, ocs_io_t *io, ocs_io_t *tmfio)
 Ignore abort event. More...
 
int32_t ocs_scsi_tgt_driver_init (void)
 Driver-wide initialization for the target-server. More...
 
int32_t ocs_scsi_tgt_driver_exit (void)
 Driver-wide clean-up for the target-server. More...
 
uint32_t ocs_scsi_tgt_io_state (ocs_io_t *io)
 Set SCST IO state. More...
 
int32_t ocs_scsi_tgt_io_init (ocs_io_t *io)
 Initialize SCSI IO. More...
 
int32_t ocs_scsi_tgt_io_exit (ocs_io_t *io)
 Un-initialize SCSI IO. More...
 
ocs_ramdisc_t * ocs_ramd_lookup (ocs_io_t *io, uint32_t lun)
 Given an IO and a LUN number, return the ramdisc to which the IO is directed. More...
 
ocs_ramdisc_t * ocs_ramd_lookup_by_tgt (ocs_t *ocs, uint32_t tgt, uint32_t lun)
 Given an TGT number and a LUN number, return the corresponding ramdisc. More...
 
static int32_t ocs_scsi_ramd_create (ocs_t *ocs, ocs_ramdisc_t ***rdisc, uint32_t *rdisc_count)
 Create a RAMD (target) based on the property parameter values. More...
 
int32_t ocs_scsi_tgt_new_device (ocs_t *ocs)
 Initializes any target fields on the ocs structure. More...
 
int32_t ocs_scsi_tgt_del_device (ocs_t *ocs)
 Tears down the target members of the ocs structure. More...
 
int32_t ocs_scsi_tgt_new_domain (ocs_domain_t *domain)
 Accept a new domain notification. More...
 
void ocs_scsi_tgt_del_domain (ocs_domain_t *domain)
 Accept a domain lost notification. More...
 
int32_t ocs_scsi_tgt_new_sport (ocs_sport_t *sport)
 Accept a new SLI Port notification. More...
 
void ocs_scsi_tgt_del_sport (ocs_sport_t *sport)
 Accept a SLI Port gone notification. More...
 
int32_t ocs_scsi_validate_initiator (ocs_node_t *node)
 Validate a new initiator. More...
 
int32_t ocs_scsi_new_initiator (ocs_node_t *node)
 Receive notification of a new SCSI initiator node. More...
 
int32_t ocs_scsi_del_initiator (ocs_node_t *node, ocs_scsi_del_initiator_reason_e reason)
 Delete a SCSI initiator node. More...
 
static void ocs_ramd_io_free (ocs_io_t *io)
 Perform ramd IO free. More...
 
int32_t _ocs_scsi_recv_cmd (ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags)
 Receive an FCP SCSI command. More...
 
int32_t ocs_scsi_recv_cmd_first_burst (ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags, ocs_dma_t first_burst_buffers[], uint32_t first_burst_bytes)
 Receive an FCP SCSI command with the first burst data. More...
 
int32_t ocs_scsi_get_block_vaddr (ocs_io_t *io, uint64_t blocknumber, ocs_scsi_vaddr_len_t addrlen[], uint32_t max_addrlen, void **dif_vaddr)
 Return address of data and DIF data given a block in the target. More...
 
int32_t ocs_scsi_recv_cmd_common (ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags, uint8_t has_first_burst, ocs_dma_t first_burst_buffers[], uint32_t first_burst_bytes)
 Common code used by ocs_scsi_recv_cmd() and ocs_scsi_recv_cmd_first_burst(). More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_call_cmd_handler (ocs_io_t *io)
 Function to call the command handler for a CDB. More...
 
static int32_t ocs_ramd_tgt_abort_rsp_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Abort response callback. More...
 
static void ocs_ramd_abort_cleanup (ocs_io_t *io)
 State: Cleanup aborted IO. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_good_status (ocs_io_t *io)
 Send a good SCSI status. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_check_cond (ocs_io_t *io, uint8_t sense_key, uint8_t asc, uint8_t ascq)
 Send a SCSI check condition. More...
 
ocs_ramd_hndlr_rtn_e ocs_ramd_task_set_full_or_busy (ocs_io_t *io)
 Send a SCSI task set full or busy status. More...
 
int32_t ocs_scsi_recv_tmf (ocs_io_t *tmfio, uint32_t lun, ocs_scsi_tmf_cmd_e cmd, ocs_io_t *io_to_abort, uint32_t flags)
 Receive a TMF command IO. More...
 
int32_t _scsi_io_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Response phase callback. More...
 
int32_t _scsi_dataphase_cb (ocs_io_t *io, ocs_scsi_io_status_e scsi_status, uint32_t flags, void *arg)
 Command data phase callback. More...
 
static int32_t ocs_ramd_first_burst_local (ocs_io_t *io, uint32_t bytes_left)
 Process first burst data into the IO DMA memory. More...
 
static int32_t ocs_ramd_first_burst_no_dif (ocs_io_t *io, ocs_ramdisc_t *ramdisc)
 Process the first burst data without any DIF information. More...
 
static void ocs_ramd_set_dif_prot_type_fields (ocs_t *ocs, ocs_ramdisc_t *ramdisc, ocs_scsi_dif_info_t *dif_info)
 Set the Disable App and reference fields based on the protection type. More...
 
static int32_t ocs_ramd_first_burst_with_dif (ocs_io_t *io, ocs_ramdisc_t *ramdisc, uint32_t data_blk_size)
 Process the first burst data by adding/verifying/stripping DIF information. More...
 
static ocs_ramd_hndlr_rtn_e ocs_ramd_init_write_dif (ocs_io_t *io, ocs_scsi_dif_info_t *dif_info, uint8_t wrprotect, uint32_t app_tag, uint32_t ref_tag)
 
void ocs_scsi_tgt_ddump (ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
 
static void post_one_ua (ocs_node_t *node, uint32_t lun, uint8_t asc, uint8_t ascq)
 Post a Unit Attention condition to a node/LUN (I_T nexus). More...
 
void ocs_ramd_post_ua (ocs_t *ocs, ocs_ramdisc_t *ramdisc, uint8_t asc, uint8_t ascq, ocs_node_t *except_node)
 Post a Unit Attention condition to a ramdisc. More...
 
int32_t ocs_ramd_get_ua (ocs_t *ocs, ocs_node_t *node, uint32_t lun, uint8_t *asc, uint8_t *ascq)
 Get a pending Unit Attention, if any. More...
 
void ocs_ramd_clear_ua (ocs_t *ocs, ocs_node_t *node, uint32_t lun, uint8_t asc, uint8_t ascq)
 Clear a Unit Attention condition. More...
 
int32_t ocs_port_rdisc_init (ocs_t *ocs)
 Initialize per port ramdisc structure. More...
 
void ocs_port_rdisc_free (ocs_t *ocs)
 Free per port ramdisc structure. More...
 
int32_t ocs_port_rdisc_find (ocs_t *ocs, uint32_t tgt_id, ocs_ramdisc_t ***rdisc, uint32_t *rdisc_count)
 Find a per port ramdisc instance. More...
 
int32_t ocs_port_rdisc_save (ocs_t *ocs, uint32_t tgt_id, ocs_ramdisc_t **rdisc, uint32_t rdisc_count)
 Save a per port ramdisc. More...
 

Variables

static ocs_lock_t ramd_lock
 
static ocs_ramdisc_t ** ocs_ramd = NULL
 
static uint32_t ocs_ramd_count = 0
 
static int ramd_ref_cnt = 0
 
static const char * ocs_ramd_state_names []
 
static scsi_cmd_table_t * scsi_cmd_lookup [256]
 
static scsi_cmd_table_t scsi_cmd_table []
 
static scsi_cmd_table_t scsi_cmd_table_svc_in_action16 []
 
static scsi_cmd_table_t scsi_cmd_table_svc_out_action16 []
 
static scsi_cmd_table_t scsi_cmd_table_variable_len_cdb []
 
ocs_mgmt_functions_t ramd_mgmt_functions
 
uint8_t supportedVPDPageList []
 

Macro Details

#define ACTIVE_IO_COUNT (   ocs)    ocs_atomic_read(&ocs->xport->io_active_count)

Definition at line 135 of file ocs_ramd.c.

#define api_trace (   ...)
Value:
do { \
ocs_log_debug(NULL, "%s:\n", __func__); \
} while(0)
#define ENABLE_API_TRACE
Definition: ocs_ramd.c:105

Definition at line 122 of file ocs_ramd.c.

#define cmd_trace (   io,
  fmt,
  ... 
)    trace(io, ENABLE_CMD_TRACE, fmt, ##__VA_ARGS__)

Definition at line 120 of file ocs_ramd.c.

#define container_of (   p,
  stype,
  field 
)    ((stype *)(((uint8_t *)(p)) - offsetof(stype, field)))

Definition at line 129 of file ocs_ramd.c.

#define DATA_DIR_NONE   0x00

Definition at line 252 of file ocs_ramd.c.

#define DATA_DIR_RDWR   0x03

Definition at line 255 of file ocs_ramd.c.

#define DATA_DIR_READ   0x01

Definition at line 253 of file ocs_ramd.c.

#define DATA_DIR_WRITE   0x02

Definition at line 254 of file ocs_ramd.c.

#define ENABLE_API_TRACE   0

Definition at line 105 of file ocs_ramd.c.

#define ENABLE_BUFFER_DUMP   0

Definition at line 106 of file ocs_ramd.c.

#define ENABLE_CMD_TRACE   0

Definition at line 104 of file ocs_ramd.c.

#define INQ_VPD_BLOCK_DEV_CHARS_PAGE_B1   0xB1

Definition at line 5456 of file ocs_ramd.c.

#define INQ_VPD_BLOCKS_LIMIT_PAGE_B0   0xB0

Definition at line 5455 of file ocs_ramd.c.

#define INQ_VPD_DEVICE_ID_PAGE_83   0x83

Definition at line 5453 of file ocs_ramd.c.

#define INQ_VPD_EXT_INQ_DATA_PAGE_86   0x86

Definition at line 5454 of file ocs_ramd.c.

#define INQ_VPD_SUPPORTED_PAGE_00   0x00

Definition at line 5451 of file ocs_ramd.c.

#define INQ_VPD_UNIT_SERIAL_NO_PAGE_80   0x80

Definition at line 5452 of file ocs_ramd.c.

#define INVALID_APP_TAG   0xffffffff

Definition at line 72 of file ocs_ramd.c.

#define io_printf (   io,
  fmt,
  ... 
)
Value:
do { \
ocs_log_debug(io->ocs, "[%s]" IOFMT " %-20s " fmt, \
(io->node ? io->node->display_name : ""), \
IOFMT_ARGS(io), __func__, ##__VA_ARGS__); \
} while (0)
#define IOFMT_ARGS(io)
Definition: ocs_ramd.c:77
const char const char * fmt
Definition: ocs_ddump.h:54
#define IOFMT
Definition: ocs_ramd.c:75

Definition at line 95 of file ocs_ramd.c.

#define io_sm_trace ( )
Value:
do { \
if (OCS_LOG_ENABLE_SCSI_TGT_TRACE(io->node->ocs)) \
ocs_log_info(io->ocs, "[%s]" IOFMT " (IO) %-20s %-20s\n", \
(io->node ? io->node->display_name : ""), \
IOFMT_ARGS(io), __func__, ocs_sm_event_name(evt)); \
} while (0)
#define OCS_LOG_ENABLE_SCSI_TGT_TRACE(ocs)
Definition: ocs_debug.h:72
const char * ocs_sm_event_name(ocs_sm_event_t evt)
Definition: ocs_sm.c:93
#define IOFMT_ARGS(io)
Definition: ocs_ramd.c:77
#define IOFMT
Definition: ocs_ramd.c:75

Definition at line 79 of file ocs_ramd.c.

#define IOFMT   "[%04x][i:%0*x t:%0*x h:%04x][c:%02x]"

Definition at line 75 of file ocs_ramd.c.

#define IOFMT_ARGS (   io)    io->instance_index, IOFMT_ITT_SIZE(io->ocs), io->init_task_tag, IOFMT_ITT_SIZE(io->ocs), io->tgt_task_tag, io->hw_tag, io->tgt_io.cdb[0]

Definition at line 77 of file ocs_ramd.c.

#define IOFMT_ITT_SIZE (   ocs)    ((ocs->ocs_xport == OCS_XPORT_FC) ? 4 : 8)

Definition at line 76 of file ocs_ramd.c.

#define OCS_RAMD_MIN_SIZE   (1024*1024)

Definition at line 102 of file ocs_ramd.c.

#define RAMD_APP_TAG   0x0

Definition at line 73 of file ocs_ramd.c.

#define tmfio_sm_trace ( )
Value:
do { \
if (OCS_LOG_ENABLE_SCSI_TGT_TRACE(tmfio->ocs)) \
ocs_log_info(tmfio->ocs, "[%s]" IOFMT " (TMF) %-20s %-20s\n", \
(tmfio->node ? tmfio->node->display_name : ""), \
IOFMT_ARGS(tmfio), __func__, ocs_sm_event_name(evt)); \
} while (0)
#define OCS_LOG_ENABLE_SCSI_TGT_TRACE(ocs)
Definition: ocs_debug.h:72
const char * ocs_sm_event_name(ocs_sm_event_t evt)
Definition: ocs_sm.c:93
#define IOFMT_ARGS(io)
Definition: ocs_ramd.c:77
#define IOFMT
Definition: ocs_ramd.c:75

Definition at line 87 of file ocs_ramd.c.

#define trace (   io,
  enable_flag,
  fmt,
  ... 
)
Value:
do { \
if (enable_flag) { \
if (io) { \
ocs_log_debug(NULL, "[%s]" IOFMT " %s: " fmt, io->node->display_name, \
IOFMT_ARGS(io), __func__, ##__VA_ARGS__); \
} else { \
ocs_log_debug(NULL, "%s: " fmt, __func__, ##__VA_ARGS__); \
} \
} \
} while(0)
#define IOFMT_ARGS(io)
Definition: ocs_ramd.c:77
const char const char * fmt
Definition: ocs_ddump.h:54
#define IOFMT
Definition: ocs_ramd.c:75

Definition at line 108 of file ocs_ramd.c.

Enumeration Details

Enumerator
__OCS_RAMD_IO_INIT 
__OCS_RAMD_IO_INIT_ERR_INJECTION 
__OCS_RAMD_IO_WAIT_FIRST_BURST 
__OCS_RAMD_IO_WAIT_DATAPHASE_COMPL 
__OCS_RAMD_IO_WAIT_AND_VALIDATE_DATAPHASE 
__OCS_RAMD_IO_WAIT_AND_COMPLETE_WRITESAME_DATAPHASE 
__OCS_RAMD_IO_WAIT_RESP_COMPL 
__OCS_RAMD_IO_ABORTING 
__OCS_RAMD_IO_ABORTING_WAIT_IO_CMPL 
__OCS_RAMD_IO_ABORTING_WAIT_ABORT_CMPL 
__OCS_RAMD_TMF_WAIT_RESP_CMPL 
__OCS_RAMD_ABTS_WAIT_IO_ABORT_RESP 
__OCS_RAMD_WAIT_ABTS_ACC_CMPL 
__OCS_RAMD_IO_WAIT_FIRST_BURST_SEND_RESP 

Definition at line 138 of file ocs_ramd.c.

Function Details

static void * __ocs_ramd_io_aborting ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)
static

State: Aborting IO.

Description
IO abort has been started. Wait for IO or abort to complete.
Parameters
ctxRemote node sm context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 2282 of file ocs_ramd.c.

static void * __ocs_ramd_io_aborting_wait_abort_cmpl ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)
static

State: Aborting IO.

Description
IO abort has been started and IO has completed. Wait for the abort to complete and then free IO.
Parameters
ctxRemote node sm context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 2363 of file ocs_ramd.c.

static void * __ocs_ramd_io_aborting_wait_io_cmpl ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)
static

State: Aborting IO.

Description
IO abort has been started and Abort has completed. Wait for the IO to complete and then free IO.
Parameters
ctxRemote node sm context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 2409 of file ocs_ramd.c.

int32_t _scsi_dataphase_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)

Command data phase callback.

Description
This function is called when the SCSI command data phase has completed.
Parameters
ioPointer to the IO structure.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 2875 of file ocs_ramd.c.

int32_t _scsi_io_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)

Response phase callback.

Description
This function is called when the response phase for an IO completes.
Parameters
ioPointer to the IO structure.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 2846 of file ocs_ramd.c.

static void ocs_ignore_abort_evt ( ocs_sm_event_t  evt,
const char *  func,
ocs_io_t *  io,
ocs_io_t *  tmfio 
)
static

Ignore abort event.

Parameters
evtAbort event to be ignored.
funcThe calling function name.
ioPointer to the IO context that received the abort event.
tmfioPointer to the TMF IO context (if ABTS).
Returns
None.

Definition at line 333 of file ocs_ramd.c.

int ocs_mgmt_ramd_exec ( char *  parent,
char *  action,
void *  arg_in,
uint32_t  arg_in_length,
void *  arg_out,
uint32_t  arg_out_length,
void *  object 
)

Definition at line 7054 of file ocs_ramd.c.

int ocs_mgmt_ramd_get ( ocs_textbuf_t *  textbuf,
char *  parent,
char *  name,
void *  object 
)

Definition at line 6988 of file ocs_ramd.c.

void ocs_mgmt_ramd_get_all ( ocs_textbuf_t *  textbuf,
void *  object 
)

Definition at line 7032 of file ocs_ramd.c.

void ocs_mgmt_ramd_list ( ocs_textbuf_t *  textbuf,
void *  object 
)

Definition at line 6973 of file ocs_ramd.c.

static int32_t ocs_mgmt_read_block ( ocs_t *  ocs,
char *  name,
void *  arg_in,
uint32_t  arg_in_length,
void *  arg_out,
uint32_t  arg_out_length 
)
static

Definition at line 7081 of file ocs_ramd.c.

int32_t ocs_port_rdisc_find ( ocs_t *  ocs,
uint32_t  tgt_id,
ocs_ramdisc_t ***  rdisc,
uint32_t *  rdisc_count 
)

Find a per port ramdisc instance.

Description
A per port ramdisc instance is searched for given its target id (tgt_id), if found, the rdisc/rdisc_count arguments are updated with the persisted ramdisc information.
Parameters
ocsPointer to OCS structure.
tgt_idTarget id.
rdiscPointer to ramdiscs.
rdisc_countCount of ramdiscs.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 7188 of file ocs_ramd.c.

void ocs_port_rdisc_free ( ocs_t *  ocs)

Free per port ramdisc structure.

Description
The per port ramdisc persistence data structure is freed along with the ramdisc objects
Parameters
ocsPointer to OCS instance.
Returns
None.

Definition at line 7158 of file ocs_ramd.c.

int32_t ocs_port_rdisc_init ( ocs_t *  ocs)

Initialize per port ramdisc structure.

Description
The per port ramdisc persistence data structure is initialized.
Parameters
ocspointer to OCS instance
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 7140 of file ocs_ramd.c.

int32_t ocs_port_rdisc_save ( ocs_t *  ocs,
uint32_t  tgt_id,
ocs_ramdisc_t **  rdisc,
uint32_t  rdisc_count 
)

Save a per port ramdisc.

Description
The ramdisc instance given by rdisc/rdisc_count is saved in the per port ramdisc persist structure.
Parameters
ocsPointer to OCS structure.
tgt_idTarget id for this ramdisc.
rdiscPointer to ramdiscs.
rdisc_countCount of ramdiscs.
Returns
Returns 0 for success, or a negative error code value on failure.

Definition at line 7220 of file ocs_ramd.c.

static void ocs_ramd_abort_cleanup ( ocs_io_t *  io)
static

State: Cleanup aborted IO.

Description
Cleanup IO that has been aborted.
Parameters
ioAborted IO.
Returns
None.

Definition at line 2334 of file ocs_ramd.c.

static int32_t ocs_ramd_abort_tgt_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)
static

Command abort callback.

Description
This function is called with a command abort request to the base driver SCSI API completes.
Parameters
ioPointer to the IO context.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1814 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_call_cmd_handler ( ocs_io_t *  io)
static

Function to call the command handler for a CDB.

Description
After a command and its first burst data is received, this function is called to call the actual command handler function.
Parameters
ioPointer to the SCSI IO object.
Returns
The command handler status.

Definition at line 1531 of file ocs_ramd.c.

static ocs_ramd_hndlr_rtn_e ocs_ramd_init_write_dif ( ocs_io_t *  io,
ocs_scsi_dif_info_t *  dif_info,
uint8_t  wrprotect,
uint32_t  app_tag,
uint32_t  ref_tag 
)
static

Definition at line 3829 of file ocs_ramd.c.

static int32_t ocs_ramd_io_error ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status 
)
static

Definition at line 1823 of file ocs_ramd.c.

static void ocs_ramd_io_free ( ocs_io_t *  io)
static

Perform ramd IO free.

Description
Frees an ocs_ramd-managed IO object.
Parameters
ioPointer to the IO context.
Returns
None.

Definition at line 1150 of file ocs_ramd.c.

ocs_ramdisc_t* ocs_ramd_lookup ( ocs_io_t *  io,
uint32_t  lun 
)

Given an IO and a LUN number, return the ramdisc to which the IO is directed.

Description
From the IO, get the ocs, then the target private area for the ocs. Check if a global RAMD (one RAMD for all SLI Ports) is used. If so, then find the RAMD in the target private area. If not, then go from IO to node to SLI Port to find the SLI Port's list of ramdiscs.
Parameters
ioPointer to the IO context.
lunLUN for the command.
Returns
Returns a pointer to the ramdisc, or NULL if lun is not valid.

Definition at line 471 of file ocs_ramd.c.

ocs_ramdisc_t* ocs_ramd_lookup_by_tgt ( ocs_t *  ocs,
uint32_t  tgt,
uint32_t  lun 
)

Given an TGT number and a LUN number, return the corresponding ramdisc.

Description
This function is used by the mgmt interface to access ramdisc data out-of-band rather than through a SCSI IO. The TGT number is assumed to correspond to a sport on the first domain. TGT 0 is domain[1]/sport[1], TGT 1 is domain[1]/sport[2], etc.

If the global RAMD is being used then the TGT number must be 0. In this case the ramdisc for LUN n is at ocs->tgt_ocs.rdisc[n].

If per-port RAMD is being used then the TGT number is used to find the correct sport, then LUN n is at sport->tgt_sport.rdisc[n].

Parameters
ocsPointer to the ocs.
tgtTGT number, 0..n.
lunLUN number, 0..n.
Returns
Returns a pointer to a ramdisc structure on success, or NULL on failure.

Definition at line 519 of file ocs_ramd.c.

static int32_t ocs_ramd_tgt_abort_rsp_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)
static

Abort response callback.

Description
When an IO abort operation has completed, this callback is invoked.
Parameters
ioPointer to the context.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 2258 of file ocs_ramd.c.

int32_t ocs_scsi_get_block_vaddr ( ocs_io_t *  io,
uint64_t  blocknumber,
ocs_scsi_vaddr_len_t  addrlen[],
uint32_t  max_addrlen,
void **  dif_vaddr 
)

Return address of data and DIF data given a block in the target.

Description
The virtual addresses of the data block and DIF block are returned for a given lba in the target.
Parameters
ioPointer to the IO context.
blocknumberThe SCSI logical block address.
addrlenArray of address length pairs.
max_addrlenMaximum number of addrlen pairs to return.
dif_vaddrPointer to location to store virtual address of DIF block.
Returns
Returns number of addrlen pairs returned, or a negative value for error.

Definition at line 1269 of file ocs_ramd.c.

static int32_t ocs_scsi_ramd_create ( ocs_t *  ocs,
ocs_ramdisc_t ***  rdisc,
uint32_t *  rdisc_count 
)
static

Create a RAMD (target) based on the property parameter values.

Parameters
ocsPointer to the ocs.
rdiscPointer to the ramdisc to allocate.
rdisc_countPointer to the number of ramdiscs (LUNs) allocated.
Returns
Returns 0 on success, or a negative error code value on failure.

In case we need to allocate multiple ramdiscs in huge sizes, this entire loop might take more than '21' secs to execute. As a result, 'rcu_sched' can detect a stall and send an NMI. To avoid such scenarios, yield the CPU.

Definition at line 553 of file ocs_ramd.c.

static void ocs_scsi_ramd_free ( ocs_t *  ocs,
ocs_ramdisc_t ***  rdisc,
uint32_t *  rdisc_count 
)
static

Free the memory associate with a ramdisc.

Parameters
ocsPointer to the ocs.
rdiscPointer to the ramdisc to allocate.
rdisc_countPointer to the number of ramdiscs (LUNs) allocated.

Definition at line 719 of file ocs_ramd.c.

int32_t ocs_scsi_recv_cmd_common ( ocs_io_t *  io,
uint32_t  lun,
uint8_t *  cdb,
uint32_t  cdb_len,
uint32_t  flags,
uint8_t  has_first_burst,
ocs_dma_t  first_burst_buffers[],
uint32_t  first_burst_bytes 
)

Common code used by ocs_scsi_recv_cmd() and ocs_scsi_recv_cmd_first_burst().

Description
Receive a new FCP SCSI command from the base driver, possibly with the first burst data.
Parameters
ioPointer to the IO context.
lunLUN for this IO.
cdbPointer to the SCSI CDB.
cdb_lenLength of the CDB, in bytes.
flagsCommand flags.
has_first_burstTRUE if the command has first burst data.
first_burst_buffersFirst burst buffer.
first_burst_bytesThe number of bytes received in the first burst.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1302 of file ocs_ramd.c.

void ocs_scsi_tgt_ddump ( ocs_textbuf_t *  textbuf,
ocs_scsi_ddump_type_e  type,
void *  obj 
)

Definition at line 6580 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_io_exit ( ocs_io_t *  io)

Un-initialize SCSI IO.

Description
Un-initialize target server private data in a SCSI io object.
Parameters
ioPointer to SCSI IO object.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 450 of file ocs_ramd.c.

int32_t ocs_scsi_tgt_io_init ( ocs_io_t *  io)

Initialize SCSI IO.

Description
Initialize SCSI IO, this function is called once per IO during IO pool allocation so that the target server may initialize any of its own private data.
Parameters
ioPointer to SCSI IO object.
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 433 of file ocs_ramd.c.

uint32_t ocs_scsi_tgt_io_state ( ocs_io_t *  io)

Set SCST IO state.

Parameters
iopointer to SCSI IO object
stateto be set
Returns
TGT iostate

Definition at line 415 of file ocs_ramd.c.

static int32_t scsi_format_unit_cb ( ocs_io_t *  io,
ocs_scsi_io_status_e  scsi_status,
uint32_t  flags,
void *  arg 
)
static

Command data phase callback for the FORMAT UNIT command.

Description
This function is called with the SCSI command data phase has completed following a FORMAT UNIT command.
Parameters
ioPointer to the IO structure.
scsi_statusCompletion status.
flagsFlags.
argApplication-specified argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 5115 of file ocs_ramd.c.

Variable Details

ocs_ramdisc_t** ocs_ramd = NULL
static

Definition at line 60 of file ocs_ramd.c.

uint32_t ocs_ramd_count = 0
static

Definition at line 61 of file ocs_ramd.c.

const char* ocs_ramd_state_names[]
static
Initial value:
= {
"__ocs_ramd_io_init",
"__ocs_ramd_io_init_err_injection",
"__ocs_ramd_io_wait_first_burst",
"__ocs_ramd_io_wait_dataphase_compl",
"__ocs_ramd_io_wait_and_validate_dataphase",
"__ocs_ramd_io_wait_and_complete_writesame_dataphase",
"__ocs_ramd_io_wait_resp_compl",
"__ocs_ramd_io_aborting",
"__ocs_ramd_io_aborting_wait_io_cmpl",
"__ocs_ramd_io_aborting_wait_abort_cmpl",
"__ocs_ramd_tmf_wait_resp_cmpl",
"__ocs_ramd_abts_wait_io_abort_resp",
"__ocs_ramd_wait_abts_acc_cmpl",
"__ocs_ramd_io_wait_first_burst_send_resp"
}

Definition at line 155 of file ocs_ramd.c.

ocs_lock_t ramd_lock
static

Definition at line 59 of file ocs_ramd.c.

ocs_mgmt_functions_t ramd_mgmt_functions
Initial value:
= {
.get_list_handler = ocs_mgmt_ramd_list,
.get_handler = ocs_mgmt_ramd_get,
.get_all_handler = ocs_mgmt_ramd_get_all,
.exec_handler = ocs_mgmt_ramd_exec,
}
void ocs_mgmt_ramd_list(ocs_textbuf_t *textbuf, void *object)
Definition: ocs_ramd.c:6973
void ocs_mgmt_ramd_get_all(ocs_textbuf_t *textbuf, void *object)
Definition: ocs_ramd.c:7032
int ocs_mgmt_ramd_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *object)
Definition: ocs_ramd.c:6988
int ocs_mgmt_ramd_exec(char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *object)
Definition: ocs_ramd.c:7054

Definition at line 314 of file ocs_ramd.c.

int ramd_ref_cnt = 0
static

Definition at line 62 of file ocs_ramd.c.

scsi_cmd_table_t* scsi_cmd_lookup[256]
static

Definition at line 256 of file ocs_ramd.c.

scsi_cmd_table_t scsi_cmd_table[]
static

Definition at line 258 of file ocs_ramd.c.

scsi_cmd_table_t scsi_cmd_table_svc_in_action16[]
static
Initial value:
= {
}
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_capacity16(ocs_io_t *io, uint8_t cdb[])
Process the SCSI READ CAPACITY (16) command.
Definition: ocs_ramd.c:5367
#define DATA_DIR_READ
Definition: ocs_ramd.c:253
#define SCSI_SVC_ACTION16_READ_LONG
Definition: scsi_cmds.h:162
static ocs_ramd_hndlr_rtn_e ocs_ramd_read_long16(ocs_io_t *io, uint8_t cdb[])
Process the SCSI READ LONG (16) command.
Definition: ocs_ramd.c:4618
#define SCSI_SVC_ACTION16_READ_CAPACITY
Definition: scsi_cmds.h:161

Definition at line 292 of file ocs_ramd.c.

scsi_cmd_table_t scsi_cmd_table_svc_out_action16[]
static
Initial value:
= {
}
#define DATA_DIR_WRITE
Definition: ocs_ramd.c:254
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_long16(ocs_io_t *io, uint8_t cdb[])
Process the SCSI WRITE LONG (16) command.
Definition: ocs_ramd.c:3291
#define SCSI_SVC_ACTION16_WRITE_LONG
Definition: scsi_cmds.h:167

Definition at line 297 of file ocs_ramd.c.

scsi_cmd_table_t scsi_cmd_table_variable_len_cdb[]
static
Initial value:
= {
}
#define DATA_DIR_WRITE
Definition: ocs_ramd.c:254
#define SCSI_VAR_CMD_SVC_ACT_WRITE_SAME32
Definition: scsi_cmds.h:158
static ocs_ramd_hndlr_rtn_e ocs_ramd_write32(ocs_io_t *io, uint8_t cdb[])
Process the SCSI WRITE (32) command.
Definition: ocs_ramd.c:3162
#define SCSI_VAR_CMD_SVC_ACT_WRITE32
Definition: scsi_cmds.h:156
#define DATA_DIR_READ
Definition: ocs_ramd.c:253
#define SCSI_VAR_CMD_SVC_ACT_WRITE_VERIFY32
Definition: scsi_cmds.h:157
static ocs_ramd_hndlr_rtn_e ocs_ramd_write_same32(ocs_io_t *io, uint8_t cdb[])
Process the SCSI WRITE SAME (32) command.
Definition: ocs_ramd.c:3443
#define SCSI_VAR_CMD_SVC_ACT_READ32
Definition: scsi_cmds.h:154
static ocs_ramd_hndlr_rtn_e ocs_ramd_read32(ocs_io_t *io, uint8_t cdb[])
Process the SCSI READ (32) command.
Definition: ocs_ramd.c:4506

Definition at line 301 of file ocs_ramd.c.

uint8_t supportedVPDPageList[]
Initial value:
= {
}
#define INQ_VPD_BLOCKS_LIMIT_PAGE_B0
Definition: ocs_ramd.c:5455
#define INQ_VPD_BLOCK_DEV_CHARS_PAGE_B1
Definition: ocs_ramd.c:5456
#define INQ_VPD_UNIT_SERIAL_NO_PAGE_80
Definition: ocs_ramd.c:5452
#define INQ_VPD_SUPPORTED_PAGE_00
Definition: ocs_ramd.c:5451
#define INQ_VPD_DEVICE_ID_PAGE_83
Definition: ocs_ramd.c:5453
#define INQ_VPD_EXT_INQ_DATA_PAGE_86
Definition: ocs_ramd.c:5454

VPD pages supported by the ramd driver Adding a new VPD page must be inserted in correct numerical oreder.

Definition at line 5463 of file ocs_ramd.c.