2 * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
5 * Copyright (c) 2014, Cisco Systems, Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
34 #ident "$Id: vnic_resource.h 196958 2014-11-04 18:23:37Z xuywang $"
36 #ifndef _VNIC_RESOURCE_H_
37 #define _VNIC_RESOURCE_H_
39 #define VNIC_RES_MAGIC 0x766E6963L /* 'vnic' */
40 #define VNIC_RES_VERSION 0x00000000L
41 #define MGMTVNIC_MAGIC 0x544d474dL /* 'MGMT' */
42 #define MGMTVNIC_VERSION 0x00000000L
44 /* The MAC address assigned to the CFG vNIC is fixed. */
45 #define MGMTVNIC_MAC { 0x02, 0x00, 0x54, 0x4d, 0x47, 0x4d }
47 /* vNIC resource types */
49 RES_TYPE_EOL, /* End-of-list */
50 RES_TYPE_WQ, /* Work queues */
51 RES_TYPE_RQ, /* Receive queues */
52 RES_TYPE_CQ, /* Completion queues */
53 RES_TYPE_MEM, /* Window to dev memory */
54 RES_TYPE_NIC_CFG, /* Enet NIC config registers */
55 RES_TYPE_RSS_KEY, /* Enet RSS secret key */
56 RES_TYPE_RSS_CPU, /* Enet RSS indirection table */
57 RES_TYPE_TX_STATS, /* Netblock Tx statistic regs */
58 RES_TYPE_RX_STATS, /* Netblock Rx statistic regs */
59 RES_TYPE_INTR_CTRL, /* Interrupt ctrl table */
60 RES_TYPE_INTR_TABLE, /* MSI/MSI-X Interrupt table */
61 RES_TYPE_INTR_PBA, /* MSI/MSI-X PBA table */
62 RES_TYPE_INTR_PBA_LEGACY, /* Legacy intr status */
63 RES_TYPE_DEBUG, /* Debug-only info */
64 RES_TYPE_DEV, /* Device-specific region */
65 RES_TYPE_DEVCMD, /* Device command region */
66 RES_TYPE_PASS_THRU_PAGE, /* Pass-thru page */
67 RES_TYPE_SUBVNIC, /* subvnic resource type */
68 RES_TYPE_MQ_WQ, /* MQ Work queues */
69 RES_TYPE_MQ_RQ, /* MQ Receive queues */
70 RES_TYPE_MQ_CQ, /* MQ Completion queues */
71 RES_TYPE_DEPRECATED1, /* Old version of devcmd 2 */
72 RES_TYPE_DEVCMD2, /* Device control region */
73 RES_TYPE_MAX, /* Count of resource types */
76 struct vnic_resource_header {
81 struct mgmt_barmap_hdr {
82 u32 magic; /* magic number */
83 u32 version; /* header format version */
84 u16 lif; /* loopback lif for mgmt frames */
85 u16 pci_slot; /* installed pci slot */
86 char serial[16]; /* card serial number */
89 struct vnic_resource {
97 #endif /* _VNIC_RESOURCE_H_ */