18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2014 Cisco Systems, Inc.  All rights reserved.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This program is free software; you may redistribute it and/or modify
58c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by
68c2ecf20Sopenharmony_ci * the Free Software Foundation; version 2 of the License.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
98c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
108c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
118c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
128c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
148c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
158c2ecf20Sopenharmony_ci * SOFTWARE.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#ifndef _VNIC_RESOURCE_H_
198c2ecf20Sopenharmony_ci#define _VNIC_RESOURCE_H_
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define VNIC_RES_MAGIC		0x766E6963L	/* 'vnic' */
228c2ecf20Sopenharmony_ci#define VNIC_RES_VERSION	0x00000000L
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/* vNIC resource types */
258c2ecf20Sopenharmony_cienum vnic_res_type {
268c2ecf20Sopenharmony_ci	RES_TYPE_EOL,			/* End-of-list */
278c2ecf20Sopenharmony_ci	RES_TYPE_WQ,			/* Work queues */
288c2ecf20Sopenharmony_ci	RES_TYPE_RQ,			/* Receive queues */
298c2ecf20Sopenharmony_ci	RES_TYPE_CQ,			/* Completion queues */
308c2ecf20Sopenharmony_ci	RES_TYPE_RSVD1,
318c2ecf20Sopenharmony_ci	RES_TYPE_NIC_CFG,		/* Enet NIC config registers */
328c2ecf20Sopenharmony_ci	RES_TYPE_RSVD2,
338c2ecf20Sopenharmony_ci	RES_TYPE_RSVD3,
348c2ecf20Sopenharmony_ci	RES_TYPE_RSVD4,
358c2ecf20Sopenharmony_ci	RES_TYPE_RSVD5,
368c2ecf20Sopenharmony_ci	RES_TYPE_INTR_CTRL,		/* Interrupt ctrl table */
378c2ecf20Sopenharmony_ci	RES_TYPE_INTR_TABLE,		/* MSI/MSI-X Interrupt table */
388c2ecf20Sopenharmony_ci	RES_TYPE_INTR_PBA,		/* MSI/MSI-X PBA table */
398c2ecf20Sopenharmony_ci	RES_TYPE_INTR_PBA_LEGACY,	/* Legacy intr status */
408c2ecf20Sopenharmony_ci	RES_TYPE_RSVD6,
418c2ecf20Sopenharmony_ci	RES_TYPE_RSVD7,
428c2ecf20Sopenharmony_ci	RES_TYPE_DEVCMD,		/* Device command region */
438c2ecf20Sopenharmony_ci	RES_TYPE_PASS_THRU_PAGE,	/* Pass-thru page */
448c2ecf20Sopenharmony_ci	RES_TYPE_SUBVNIC,		/* subvnic resource type */
458c2ecf20Sopenharmony_ci	RES_TYPE_MQ_WQ,			/* MQ Work queues */
468c2ecf20Sopenharmony_ci	RES_TYPE_MQ_RQ,			/* MQ Receive queues */
478c2ecf20Sopenharmony_ci	RES_TYPE_MQ_CQ,			/* MQ Completion queues */
488c2ecf20Sopenharmony_ci	RES_TYPE_DEPRECATED1,		/* Old version of devcmd 2 */
498c2ecf20Sopenharmony_ci	RES_TYPE_DEPRECATED2,		/* Old version of devcmd 2 */
508c2ecf20Sopenharmony_ci	RES_TYPE_DEVCMD2,		/* Device control region */
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci	RES_TYPE_MAX,			/* Count of resource types */
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_cistruct vnic_resource_header {
568c2ecf20Sopenharmony_ci	u32 magic;
578c2ecf20Sopenharmony_ci	u32 version;
588c2ecf20Sopenharmony_ci};
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistruct vnic_resource {
618c2ecf20Sopenharmony_ci	u8 type;
628c2ecf20Sopenharmony_ci	u8 bar;
638c2ecf20Sopenharmony_ci	u8 pad[2];
648c2ecf20Sopenharmony_ci	u32 bar_offset;
658c2ecf20Sopenharmony_ci	u32 count;
668c2ecf20Sopenharmony_ci};
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#endif /* _VNIC_RESOURCE_H_ */
69