0001
0002
0003
0004 #ifndef _ICE_CONTROLQ_H_
0005 #define _ICE_CONTROLQ_H_
0006
0007 #include "ice_adminq_cmd.h"
0008
0009
0010 #define ICE_AQ_MAX_BUF_LEN 4096
0011 #define ICE_MBXQ_MAX_BUF_LEN 4096
0012 #define ICE_SBQ_MAX_BUF_LEN 512
0013
0014 #define ICE_CTL_Q_DESC(R, i) \
0015 (&(((struct ice_aq_desc *)((R).desc_buf.va))[i]))
0016
0017 #define ICE_CTL_Q_DESC_UNUSED(R) \
0018 ((u16)((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
0019 (R)->next_to_clean - (R)->next_to_use - 1))
0020
0021
0022
0023
0024 #define EXP_FW_API_VER_BRANCH 0x00
0025 #define EXP_FW_API_VER_MAJOR 0x01
0026 #define EXP_FW_API_VER_MINOR 0x05
0027
0028
0029 enum ice_ctl_q {
0030 ICE_CTL_Q_UNKNOWN = 0,
0031 ICE_CTL_Q_ADMIN,
0032 ICE_CTL_Q_MAILBOX,
0033 ICE_CTL_Q_SB,
0034 };
0035
0036
0037 #define ICE_CTL_Q_SQ_CMD_TIMEOUT 10000
0038 #define ICE_CTL_Q_SQ_CMD_USEC 100
0039 #define ICE_CTL_Q_ADMIN_INIT_TIMEOUT 10
0040 #define ICE_CTL_Q_ADMIN_INIT_MSEC 100
0041
0042 struct ice_ctl_q_ring {
0043 void *dma_head;
0044 struct ice_dma_mem desc_buf;
0045 void *cmd_buf;
0046
0047 union {
0048 struct ice_dma_mem *sq_bi;
0049 struct ice_dma_mem *rq_bi;
0050 } r;
0051
0052 u16 count;
0053
0054
0055 u16 next_to_use;
0056 u16 next_to_clean;
0057
0058
0059 u32 head;
0060 u32 tail;
0061 u32 len;
0062 u32 bah;
0063 u32 bal;
0064 u32 len_mask;
0065 u32 len_ena_mask;
0066 u32 len_crit_mask;
0067 u32 head_mask;
0068 };
0069
0070
0071 struct ice_sq_cd {
0072 struct ice_aq_desc *wb_desc;
0073 };
0074
0075 #define ICE_CTL_Q_DETAILS(R, i) (&(((struct ice_sq_cd *)((R).cmd_buf))[i]))
0076
0077
0078 struct ice_rq_event_info {
0079 struct ice_aq_desc desc;
0080 u16 msg_len;
0081 u16 buf_len;
0082 u8 *msg_buf;
0083 };
0084
0085
0086 struct ice_ctl_q_info {
0087 enum ice_ctl_q qtype;
0088 struct ice_ctl_q_ring rq;
0089 struct ice_ctl_q_ring sq;
0090 u32 sq_cmd_timeout;
0091 u16 num_rq_entries;
0092 u16 num_sq_entries;
0093 u16 rq_buf_size;
0094 u16 sq_buf_size;
0095 enum ice_aq_err sq_last_status;
0096 struct mutex sq_lock;
0097 struct mutex rq_lock;
0098 };
0099
0100 #endif