Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_scsi_ini.h
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2013,2014 Emulex
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License version 2
7  * as published by the Free Software Foundation. The full GNU General
8  * Public License can be found at <http://www.gnu.org/licenses/>.
9  *
10  * Written by: Chris Moore (chris.moore@emulex.com)
11  *
12  * Emulex
13  * 3333 Susan Street
14  * Costa Mesa, CA 92626
15  */
16 
17 
18 /**
19  * @file
20  * OCS SCSI Open-iSCSI include file
21  */
22 #if !defined(__OCS_SCSI_INI_H__)
23 #define __OCS_SCSI_INI_H__
24 
25 #define OCS_INCLUDE_OPEN_ISCSI
26 
27 #include <scsi/scsi_host.h>
28 #include <scsi/scsi_netlink.h>
29 #include <scsi/scsi_transport_iscsi.h>
30 #include "ocs_scsi.h"
31 #include "ocs_ini_template.h"
32 
33 #define OCS_NL_VENDOR_ID (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_EMULEX)
34 #define OCS_DEFAULT_SG_SEG_CNT 64 /* sg element count per scsi cmnd */
35 #define OCS_CMD_PER_LUN 32 /* max outstanding cmds per lun */
36 #define OCS_BHS_ALLOC_SIZE 128
37 
38 
39 typedef struct ocs_conn_s ocs_conn_t;
40 
41 typedef enum {
47 
48 
49 typedef struct {
50  //ocs_t *ocs;
51  struct iscsi_endpoint *openiscsi_ep;
52  ocs_cxn_t *cxn;
53  ocs_conn_t *ocs_conn;
54 } ocs_ep_t;
55 
56 struct ocs_conn_s {
58  struct iscsi_conn *conn;
59  ocs_session_t *ocs_sess;
60 };
61 
62 typedef struct ocs_io_task_s {
64  ocs_io_t *io;
65  struct scsi_cmnd *scsi_cmnd;
66  struct iscsi_task *task;
67  uint32_t original_itt;
69 
70 typedef struct ocs_rport_data_s {
72 
73 typedef struct {
75 
76 typedef struct {
78 
79 /* Note: The ocs_scsi_ini_t is stored in the ocs structure.
80  The ocs structure we work with is the one we get
81  when we call ocs_get_instance(), which is created by the
82  driver we're hooking in to (ocs_iscsi_ramd). Because of
83  that, the definition here of ocs_scsi_ini_t must be the
84  same as the one for ocs_iscsi_ramd. */
85 typedef struct ocs_scsi_ini_s {
86  struct Scsi_Host *shost;
87  ocs_scsi_ini_template_t ini_template;
89 
90 typedef struct {
91  struct scsi_cmnd *scsi_cmd;
92  void (*done) (struct scsi_cmnd *);
94  int32_t (*unassisted_cb)(ocs_io_t *io, uint32_t expCmdSN, uint32_t maxCmdSN, uint8_t response);
96 
97 /**
98  * @brief initiator private node structure
99  */
100 typedef struct {
103 
104 typedef struct {
105  ocs_t *ocs;
106  struct iscsi_iface *iface;
108 
109 #endif // __OCS_SCSI_INI_H__
struct iscsi_iface * iface
Definition: ocs_scsi_ini.h:106
struct iscsi_task * task
Definition: ocs_scsi_ini.h:66
struct iscsi_conn * conn
Definition: ocs_scsi_ini.h:58
struct iscsi_endpoint * openiscsi_ep
Definition: ocs_scsi_ini.h:51
struct Scsi_Host * shost
Definition: ocs_scsi_ini.h:86
ocs_cxn_t * cxn
Definition: ocs_scsi_ini.h:52
ocs_ep_t * ocs_ep
Definition: ocs_scsi_ini.h:57
ocs_conn_t * ocs_conn
Definition: ocs_scsi_ini.h:53
ocs_io_task_state_e task_state
Definition: ocs_scsi_ini.h:63
struct scsi_cmnd * scsi_cmnd
Definition: ocs_scsi_ini.h:65
ocs_session_t * ocs_sess
Definition: ocs_scsi_ini.h:59
ocs_io_task_t * io_task
Definition: ocs_scsi_ini.h:93
uint32_t original_itt
Definition: ocs_scsi_ini.h:67
ocs_scsi_ini_template_t ini_template
Definition: ocs_scsi_ini.h:87
ocs_io_t * io
Definition: ocs_scsi_ini.h:64
ocs_io_task_state_e
Definition: ocs_scsi_ini.h:41
initiator private node structure
Definition: ocs_scsi_ini.h:100
struct scsi_cmnd * scsi_cmd
Definition: ocs_scsi_ini.h:91