~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/qed/storage_common.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2 /* QLogic qed NIC Driver
  3  * Copyright (c) 2015-2017  QLogic Corporation
  4  * Copyright (c) 2019-2020 Marvell International Ltd.
  5  */
  6 
  7 #ifndef __STORAGE_COMMON__
  8 #define __STORAGE_COMMON__
  9 
 10 /*********************/
 11 /* SCSI CONSTANTS */
 12 /*********************/
 13 
 14 #define SCSI_MAX_NUM_OF_CMDQS           (NUM_OF_GLOBAL_QUEUES / 2)
 15 #define BDQ_NUM_RESOURCES               (4)
 16 
 17 #define BDQ_ID_RQ                       (0)
 18 #define BDQ_ID_IMM_DATA                 (1)
 19 #define BDQ_ID_TQ                       (2)
 20 #define BDQ_NUM_IDS                     (3)
 21 
 22 #define SCSI_NUM_SGES_SLOW_SGL_THR      8
 23 
 24 #define BDQ_MAX_EXTERNAL_RING_SIZE      BIT(15)
 25 
 26 /* SCSI op codes */
 27 #define SCSI_OPCODE_COMPARE_AND_WRITE   (0x89)
 28 #define SCSI_OPCODE_READ_10             (0x28)
 29 #define SCSI_OPCODE_WRITE_6             (0x0A)
 30 #define SCSI_OPCODE_WRITE_10            (0x2A)
 31 #define SCSI_OPCODE_WRITE_12            (0xAA)
 32 #define SCSI_OPCODE_WRITE_16            (0x8A)
 33 #define SCSI_OPCODE_WRITE_AND_VERIFY_10 (0x2E)
 34 #define SCSI_OPCODE_WRITE_AND_VERIFY_12 (0xAE)
 35 #define SCSI_OPCODE_WRITE_AND_VERIFY_16 (0x8E)
 36 
 37 /* iSCSI Drv opaque */
 38 struct iscsi_drv_opaque {
 39         __le16 reserved_zero[3];
 40         __le16 opaque;
 41 };
 42 
 43 /* Scsi 2B/8B opaque union */
 44 union scsi_opaque {
 45         struct regpair fcoe_opaque;
 46         struct iscsi_drv_opaque iscsi_opaque;
 47 };
 48 
 49 /* SCSI buffer descriptor */
 50 struct scsi_bd {
 51         struct regpair address;
 52         union scsi_opaque opaque;
 53 };
 54 
 55 /* Scsi Drv BDQ struct */
 56 struct scsi_bdq_ram_drv_data {
 57         __le16 external_producer;
 58         __le16 reserved0[3];
 59 };
 60 
 61 /* SCSI SGE entry */
 62 struct scsi_sge {
 63         struct regpair sge_addr;
 64         __le32 sge_len;
 65         __le32 reserved;
 66 };
 67 
 68 /* Cached SGEs section */
 69 struct scsi_cached_sges {
 70         struct scsi_sge sge[4];
 71 };
 72 
 73 /* Scsi Drv CMDQ struct */
 74 struct scsi_drv_cmdq {
 75         __le16 cmdq_cons;
 76         __le16 reserved0;
 77         __le32 reserved1;
 78 };
 79 
 80 /* Common SCSI init params passed by driver to FW in function init ramrod */
 81 struct scsi_init_func_params {
 82         __le16 num_tasks;
 83         u8 log_page_size;
 84         u8 log_page_size_conn;
 85         u8 debug_mode;
 86         u8 reserved2[11];
 87 };
 88 
 89 /* SCSI RQ/CQ/CMDQ firmware function init parameters */
 90 struct scsi_init_func_queues {
 91         struct regpair glbl_q_params_addr;
 92         __le16 rq_buffer_size;
 93         __le16 cq_num_entries;
 94         __le16 cmdq_num_entries;
 95         u8 bdq_resource_id;
 96         u8 q_validity;
 97 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_MASK                     0x1
 98 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_SHIFT                    0
 99 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_MASK               0x1
100 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_SHIFT              1
101 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_MASK                    0x1
102 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_SHIFT                   2
103 #define SCSI_INIT_FUNC_QUEUES_TQ_VALID_MASK                     0x1
104 #define SCSI_INIT_FUNC_QUEUES_TQ_VALID_SHIFT                    3
105 #define SCSI_INIT_FUNC_QUEUES_SOC_EN_MASK                       0x1
106 #define SCSI_INIT_FUNC_QUEUES_SOC_EN_SHIFT                      4
107 #define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_MASK        0x7
108 #define SCSI_INIT_FUNC_QUEUES_SOC_NUM_OF_BLOCKS_LOG_SHIFT       5
109         __le16 cq_cmdq_sb_num_arr[SCSI_MAX_NUM_OF_CMDQS];
110         u8 num_queues;
111         u8 queue_relative_offset;
112         u8 cq_sb_pi;
113         u8 cmdq_sb_pi;
114         u8 bdq_pbl_num_entries[BDQ_NUM_IDS];
115         u8 reserved1;
116         struct regpair bdq_pbl_base_address[BDQ_NUM_IDS];
117         __le16 bdq_xoff_threshold[BDQ_NUM_IDS];
118         __le16 cmdq_xoff_threshold;
119         __le16 bdq_xon_threshold[BDQ_NUM_IDS];
120         __le16 cmdq_xon_threshold;
121 };
122 
123 /* Scsi Drv BDQ Data struct (2 BDQ IDs: 0 - RQ, 1 - Immediate Data) */
124 struct scsi_ram_per_bdq_resource_drv_data {
125         struct scsi_bdq_ram_drv_data drv_data_per_bdq_id[BDQ_NUM_IDS];
126 };
127 
128 /* SCSI SGL types */
129 enum scsi_sgl_mode {
130         SCSI_TX_SLOW_SGL,
131         SCSI_FAST_SGL,
132         MAX_SCSI_SGL_MODE
133 };
134 
135 /* SCSI SGL parameters */
136 struct scsi_sgl_params {
137         struct regpair sgl_addr;
138         __le32 sgl_total_length;
139         __le32 sge_offset;
140         __le16 sgl_num_sges;
141         u8 sgl_index;
142         u8 reserved;
143 };
144 
145 /* SCSI terminate connection params */
146 struct scsi_terminate_extra_params {
147         __le16 unsolicited_cq_count;
148         __le16 cmdq_count;
149         u8 reserved[4];
150 };
151 
152 /* SCSI Task Queue Element */
153 struct scsi_tqe {
154         __le16 itid;
155 };
156 
157 #endif /* __STORAGE_COMMON__ */
158 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php