enic: move to drivers/net/
[dpdk.git] / drivers / net / enic / base / vnic_resource.h
1 /*
2  * Copyright 2008-2010 Cisco Systems, Inc.  All rights reserved.
3  * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
4  *
5  * Copyright (c) 2014, Cisco Systems, Inc.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
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
18  * distribution.
19  *
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.
32  *
33  */
34 #ident "$Id: vnic_resource.h 196958 2014-11-04 18:23:37Z xuywang $"
35
36 #ifndef _VNIC_RESOURCE_H_
37 #define _VNIC_RESOURCE_H_
38
39 #define VNIC_RES_MAGIC          0x766E6963L     /* 'vnic' */
40 #define VNIC_RES_VERSION        0x00000000L
41 #define MGMTVNIC_MAGIC          0x544d474dL     /* 'MGMT' */
42 #define MGMTVNIC_VERSION        0x00000000L
43
44 /* The MAC address assigned to the CFG vNIC is fixed. */
45 #define MGMTVNIC_MAC            { 0x02, 0x00, 0x54, 0x4d, 0x47, 0x4d }
46
47 /* vNIC resource types */
48 enum vnic_res_type {
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 */
74 };
75
76 struct vnic_resource_header {
77         u32 magic;
78         u32 version;
79 };
80
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 */
87 };
88
89 struct vnic_resource {
90         u8 type;
91         u8 bar;
92         u8 pad[2];
93         u32 bar_offset;
94         u32 count;
95 };
96
97 #endif /* _VNIC_RESOURCE_H_ */