aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/qed/storage_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/qed/storage_common.h')
-rw-r--r--include/linux/qed/storage_common.h91
1 files changed, 69 insertions, 22 deletions
diff --git a/include/linux/qed/storage_common.h b/include/linux/qed/storage_common.h
index 08df82a096b6..505c0b48a761 100644
--- a/include/linux/qed/storage_common.h
+++ b/include/linux/qed/storage_common.h
@@ -33,43 +33,77 @@
33#ifndef __STORAGE_COMMON__ 33#ifndef __STORAGE_COMMON__
34#define __STORAGE_COMMON__ 34#define __STORAGE_COMMON__
35 35
36#define NUM_OF_CMDQS_CQS (NUM_OF_GLOBAL_QUEUES / 2) 36/*********************/
37#define BDQ_NUM_RESOURCES (4) 37/* SCSI CONSTANTS */
38 38/*********************/
39#define BDQ_ID_RQ (0) 39
40#define BDQ_ID_IMM_DATA (1) 40#define SCSI_MAX_NUM_OF_CMDQS (NUM_OF_GLOBAL_QUEUES / 2)
41#define BDQ_NUM_IDS (2) 41#define BDQ_NUM_RESOURCES (4)
42 42
43#define SCSI_NUM_SGES_SLOW_SGL_THR 8 43#define BDQ_ID_RQ (0)
44#define BDQ_ID_IMM_DATA (1)
45#define BDQ_ID_TQ (2)
46#define BDQ_NUM_IDS (3)
47
48#define SCSI_NUM_SGES_SLOW_SGL_THR 8
49
50#define BDQ_MAX_EXTERNAL_RING_SIZE BIT(15)
51
52/* SCSI op codes */
53#define SCSI_OPCODE_COMPARE_AND_WRITE (0x89)
54#define SCSI_OPCODE_READ_10 (0x28)
55#define SCSI_OPCODE_WRITE_6 (0x0A)
56#define SCSI_OPCODE_WRITE_10 (0x2A)
57#define SCSI_OPCODE_WRITE_12 (0xAA)
58#define SCSI_OPCODE_WRITE_16 (0x8A)
59#define SCSI_OPCODE_WRITE_AND_VERIFY_10 (0x2E)
60#define SCSI_OPCODE_WRITE_AND_VERIFY_12 (0xAE)
61#define SCSI_OPCODE_WRITE_AND_VERIFY_16 (0x8E)
62
63/* iSCSI Drv opaque */
64struct iscsi_drv_opaque {
65 __le16 reserved_zero[3];
66 __le16 opaque;
67};
44 68
45#define BDQ_MAX_EXTERNAL_RING_SIZE (1 << 15) 69/* Scsi 2B/8B opaque union */
70union scsi_opaque {
71 struct regpair fcoe_opaque;
72 struct iscsi_drv_opaque iscsi_opaque;
73};
46 74
75/* SCSI buffer descriptor */
47struct scsi_bd { 76struct scsi_bd {
48 struct regpair address; 77 struct regpair address;
49 struct regpair opaque; 78 union scsi_opaque opaque;
50}; 79};
51 80
81/* Scsi Drv BDQ struct */
52struct scsi_bdq_ram_drv_data { 82struct scsi_bdq_ram_drv_data {
53 __le16 external_producer; 83 __le16 external_producer;
54 __le16 reserved0[3]; 84 __le16 reserved0[3];
55}; 85};
56 86
87/* SCSI SGE entry */
57struct scsi_sge { 88struct scsi_sge {
58 struct regpair sge_addr; 89 struct regpair sge_addr;
59 __le32 sge_len; 90 __le32 sge_len;
60 __le32 reserved; 91 __le32 reserved;
61}; 92};
62 93
94/* Cached SGEs section */
63struct scsi_cached_sges { 95struct scsi_cached_sges {
64 struct scsi_sge sge[4]; 96 struct scsi_sge sge[4];
65}; 97};
66 98
99/* Scsi Drv CMDQ struct */
67struct scsi_drv_cmdq { 100struct scsi_drv_cmdq {
68 __le16 cmdq_cons; 101 __le16 cmdq_cons;
69 __le16 reserved0; 102 __le16 reserved0;
70 __le32 reserved1; 103 __le32 reserved1;
71}; 104};
72 105
106/* Common SCSI init params passed by driver to FW in function init ramrod */
73struct scsi_init_func_params { 107struct scsi_init_func_params {
74 __le16 num_tasks; 108 __le16 num_tasks;
75 u8 log_page_size; 109 u8 log_page_size;
@@ -77,6 +111,7 @@ struct scsi_init_func_params {
77 u8 reserved2[12]; 111 u8 reserved2[12];
78}; 112};
79 113
114/* SCSI RQ/CQ/CMDQ firmware function init parameters */
80struct scsi_init_func_queues { 115struct scsi_init_func_queues {
81 struct regpair glbl_q_params_addr; 116 struct regpair glbl_q_params_addr;
82 __le16 rq_buffer_size; 117 __le16 rq_buffer_size;
@@ -84,39 +119,45 @@ struct scsi_init_func_queues {
84 __le16 cmdq_num_entries; 119 __le16 cmdq_num_entries;
85 u8 bdq_resource_id; 120 u8 bdq_resource_id;
86 u8 q_validity; 121 u8 q_validity;
87#define SCSI_INIT_FUNC_QUEUES_RQ_VALID_MASK 0x1 122#define SCSI_INIT_FUNC_QUEUES_RQ_VALID_MASK 0x1
88#define SCSI_INIT_FUNC_QUEUES_RQ_VALID_SHIFT 0 123#define SCSI_INIT_FUNC_QUEUES_RQ_VALID_SHIFT 0
89#define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_MASK 0x1 124#define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_MASK 0x1
90#define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_SHIFT 1 125#define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_SHIFT 1
91#define SCSI_INIT_FUNC_QUEUES_CMD_VALID_MASK 0x1 126#define SCSI_INIT_FUNC_QUEUES_CMD_VALID_MASK 0x1
92#define SCSI_INIT_FUNC_QUEUES_CMD_VALID_SHIFT 2 127#define SCSI_INIT_FUNC_QUEUES_CMD_VALID_SHIFT 2
93#define SCSI_INIT_FUNC_QUEUES_RESERVED_VALID_MASK 0x1F 128#define SCSI_INIT_FUNC_QUEUES_TQ_VALID_MASK 0x1
94#define SCSI_INIT_FUNC_QUEUES_RESERVED_VALID_SHIFT 3 129#define SCSI_INIT_FUNC_QUEUES_TQ_VALID_SHIFT 3
130#define SCSI_INIT_FUNC_QUEUES_SOC_EN_MASK 0x1
131#define SCSI_INIT_FUNC_QUEUES_SOC_EN_SHIFT 4
132#define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_MASK 0x7
133#define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_SHIFT 5
134 __le16 cq_cmdq_sb_num_arr[SCSI_MAX_NUM_OF_CMDQS];
95 u8 num_queues; 135 u8 num_queues;
96 u8 queue_relative_offset; 136 u8 queue_relative_offset;
97 u8 cq_sb_pi; 137 u8 cq_sb_pi;
98 u8 cmdq_sb_pi; 138 u8 cmdq_sb_pi;
99 __le16 cq_cmdq_sb_num_arr[NUM_OF_CMDQS_CQS];
100 __le16 reserved0;
101 u8 bdq_pbl_num_entries[BDQ_NUM_IDS]; 139 u8 bdq_pbl_num_entries[BDQ_NUM_IDS];
140 u8 reserved1;
102 struct regpair bdq_pbl_base_address[BDQ_NUM_IDS]; 141 struct regpair bdq_pbl_base_address[BDQ_NUM_IDS];
103 __le16 bdq_xoff_threshold[BDQ_NUM_IDS]; 142 __le16 bdq_xoff_threshold[BDQ_NUM_IDS];
104 __le16 bdq_xon_threshold[BDQ_NUM_IDS];
105 __le16 cmdq_xoff_threshold; 143 __le16 cmdq_xoff_threshold;
144 __le16 bdq_xon_threshold[BDQ_NUM_IDS];
106 __le16 cmdq_xon_threshold; 145 __le16 cmdq_xon_threshold;
107 __le32 reserved1;
108}; 146};
109 147
148/* Scsi Drv BDQ Data struct (2 BDQ IDs: 0 - RQ, 1 - Immediate Data) */
110struct scsi_ram_per_bdq_resource_drv_data { 149struct scsi_ram_per_bdq_resource_drv_data {
111 struct scsi_bdq_ram_drv_data drv_data_per_bdq_id[BDQ_NUM_IDS]; 150 struct scsi_bdq_ram_drv_data drv_data_per_bdq_id[BDQ_NUM_IDS];
112}; 151};
113 152
153/* SCSI SGL types */
114enum scsi_sgl_mode { 154enum scsi_sgl_mode {
115 SCSI_TX_SLOW_SGL, 155 SCSI_TX_SLOW_SGL,
116 SCSI_FAST_SGL, 156 SCSI_FAST_SGL,
117 MAX_SCSI_SGL_MODE 157 MAX_SCSI_SGL_MODE
118}; 158};
119 159
160/* SCSI SGL parameters */
120struct scsi_sgl_params { 161struct scsi_sgl_params {
121 struct regpair sgl_addr; 162 struct regpair sgl_addr;
122 __le32 sgl_total_length; 163 __le32 sgl_total_length;
@@ -126,10 +167,16 @@ struct scsi_sgl_params {
126 u8 reserved; 167 u8 reserved;
127}; 168};
128 169
170/* SCSI terminate connection params */
129struct scsi_terminate_extra_params { 171struct scsi_terminate_extra_params {
130 __le16 unsolicited_cq_count; 172 __le16 unsolicited_cq_count;
131 __le16 cmdq_count; 173 __le16 cmdq_count;
132 u8 reserved[4]; 174 u8 reserved[4];
133}; 175};
134 176
177/* SCSI Task Queue Element */
178struct scsi_tqe {
179 __le16 itid;
180};
181
135#endif /* __STORAGE_COMMON__ */ 182#endif /* __STORAGE_COMMON__ */