1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
9 #ifndef __STORAGE_COMMON__
10 #define __STORAGE_COMMON__
12 #define NUM_OF_CMDQS_CQS (NUM_OF_GLOBAL_QUEUES / 2)
13 #define BDQ_NUM_RESOURCES (4)
16 #define BDQ_ID_IMM_DATA (1)
17 #define BDQ_NUM_IDS (2)
19 #define BDQ_MAX_EXTERNAL_RING_SIZE (1 << 15)
22 struct regpair address;
23 struct regpair opaque;
26 struct scsi_bdq_ram_drv_data {
27 __le16 external_producer;
31 struct scsi_drv_cmdq {
37 struct scsi_init_func_params {
44 struct scsi_init_func_queues {
45 struct regpair glbl_q_params_addr;
46 __le16 rq_buffer_size;
47 __le16 cq_num_entries;
48 __le16 cmdq_num_entries;
51 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_MASK 0x1
52 #define SCSI_INIT_FUNC_QUEUES_RQ_VALID_SHIFT 0
53 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_MASK 0x1
54 #define SCSI_INIT_FUNC_QUEUES_IMM_DATA_VALID_SHIFT 1
55 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_MASK 0x1
56 #define SCSI_INIT_FUNC_QUEUES_CMD_VALID_SHIFT 2
57 #define SCSI_INIT_FUNC_QUEUES_RESERVED_VALID_MASK 0x1F
58 #define SCSI_INIT_FUNC_QUEUES_RESERVED_VALID_SHIFT 3
60 u8 queue_relative_offset;
63 __le16 cq_cmdq_sb_num_arr[NUM_OF_CMDQS_CQS];
65 u8 bdq_pbl_num_entries[BDQ_NUM_IDS];
66 struct regpair bdq_pbl_base_address[BDQ_NUM_IDS];
67 __le16 bdq_xoff_threshold[BDQ_NUM_IDS];
68 __le16 bdq_xon_threshold[BDQ_NUM_IDS];
69 __le16 cmdq_xoff_threshold;
70 __le16 cmdq_xon_threshold;
74 struct scsi_ram_per_bdq_resource_drv_data {
75 struct scsi_bdq_ram_drv_data drv_data_per_bdq_id[BDQ_NUM_IDS];
79 struct regpair sge_addr;
85 struct scsi_terminate_extra_params {
86 __le16 unsolicited_cq_count;
91 #endif /* __STORAGE_COMMON__ */