1 /*******************************************************************************
3 * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 ******************************************************************************/
27 #ifndef _I40E_ADMINQ_H_
28 #define _I40E_ADMINQ_H_
30 #include "i40e_osdep.h"
31 #include "i40e_adminq_cmd.h"
33 #define I40E_ADMINQ_DESC(R, i) \
34 (&(((struct i40e_aq_desc *)((R).desc_buf.va))[i]))
36 #define I40E_ADMINQ_DESC_ALIGNMENT 4096
38 struct i40e_adminq_ring {
39 struct i40e_virt_mem dma_head; /* space for dma structures */
40 struct i40e_dma_mem desc_buf; /* descriptor ring memory */
41 struct i40e_virt_mem cmd_buf; /* command buffer memory */
44 struct i40e_dma_mem *asq_bi;
45 struct i40e_dma_mem *arq_bi;
48 u16 count; /* Number of descriptors */
49 u16 rx_buf_len; /* Admin Receive Queue buffer length */
51 /* used for interrupt processing */
55 /* used for queue tracking */
61 /* ASQ transaction details */
62 struct i40e_asq_cmd_details {
63 void *callback; /* cast from type I40E_ADMINQ_CALLBACK */
71 #define I40E_ADMINQ_DETAILS(R, i) \
72 (&(((struct i40e_asq_cmd_details *)((R).cmd_buf.va))[i]))
74 /* ARQ event information */
75 struct i40e_arq_event_info {
76 struct i40e_aq_desc desc;
81 /* Admin Queue information */
82 struct i40e_adminq_info {
83 struct i40e_adminq_ring arq; /* receive queue */
84 struct i40e_adminq_ring asq; /* send queue */
85 u16 num_arq_entries; /* receive queue depth */
86 u16 num_asq_entries; /* send queue depth */
87 u16 arq_buf_size; /* receive queue buffer size */
88 u16 asq_buf_size; /* send queue buffer size */
89 u16 fw_maj_ver; /* firmware major version */
90 u16 fw_min_ver; /* firmware minor version */
91 u16 api_maj_ver; /* api major version */
92 u16 api_min_ver; /* api minor version */
95 struct mutex asq_mutex; /* Send queue lock */
96 struct mutex arq_mutex; /* Receive queue lock */
98 /* last status values on send and receive queues */
99 enum i40e_admin_queue_err asq_last_status;
100 enum i40e_admin_queue_err arq_last_status;
103 /* general information */
104 #define I40E_AQ_LARGE_BUF 512
105 #define I40E_ASQ_CMD_TIMEOUT 100000 /* usecs */
107 void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
110 #endif /* _I40E_ADMINQ_H_ */