162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2008-2010 Cisco Systems, Inc.  All rights reserved.
462306a36Sopenharmony_ci * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifndef _VNIC_RESOURCE_H_
862306a36Sopenharmony_ci#define _VNIC_RESOURCE_H_
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define VNIC_RES_MAGIC		0x766E6963L	/* 'vnic' */
1162306a36Sopenharmony_ci#define VNIC_RES_VERSION	0x00000000L
1262306a36Sopenharmony_ci#define MGMTVNIC_MAGIC		0x544d474dL	/* 'MGMT' */
1362306a36Sopenharmony_ci#define MGMTVNIC_VERSION	0x00000000L
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* The MAC address assigned to the CFG vNIC is fixed. */
1662306a36Sopenharmony_ci#define MGMTVNIC_MAC		{ 0x02, 0x00, 0x54, 0x4d, 0x47, 0x4d }
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/* vNIC resource types */
1962306a36Sopenharmony_cienum vnic_res_type {
2062306a36Sopenharmony_ci	RES_TYPE_EOL,			/* End-of-list */
2162306a36Sopenharmony_ci	RES_TYPE_WQ,			/* Work queues */
2262306a36Sopenharmony_ci	RES_TYPE_RQ,			/* Receive queues */
2362306a36Sopenharmony_ci	RES_TYPE_CQ,			/* Completion queues */
2462306a36Sopenharmony_ci	RES_TYPE_RSVD1,
2562306a36Sopenharmony_ci	RES_TYPE_NIC_CFG,		/* Enet NIC config registers */
2662306a36Sopenharmony_ci	RES_TYPE_RSVD2,
2762306a36Sopenharmony_ci	RES_TYPE_RSVD3,
2862306a36Sopenharmony_ci	RES_TYPE_RSVD4,
2962306a36Sopenharmony_ci	RES_TYPE_RSVD5,
3062306a36Sopenharmony_ci	RES_TYPE_INTR_CTRL,		/* Interrupt ctrl table */
3162306a36Sopenharmony_ci	RES_TYPE_INTR_TABLE,		/* MSI/MSI-X Interrupt table */
3262306a36Sopenharmony_ci	RES_TYPE_INTR_PBA,		/* MSI/MSI-X PBA table */
3362306a36Sopenharmony_ci	RES_TYPE_INTR_PBA_LEGACY,	/* Legacy intr status */
3462306a36Sopenharmony_ci	RES_TYPE_RSVD6,
3562306a36Sopenharmony_ci	RES_TYPE_RSVD7,
3662306a36Sopenharmony_ci	RES_TYPE_DEVCMD,		/* Device command region */
3762306a36Sopenharmony_ci	RES_TYPE_PASS_THRU_PAGE,	/* Pass-thru page */
3862306a36Sopenharmony_ci	RES_TYPE_SUBVNIC,		/* subvnic resource type */
3962306a36Sopenharmony_ci	RES_TYPE_MQ_WQ,			/* MQ Work queues */
4062306a36Sopenharmony_ci	RES_TYPE_MQ_RQ,			/* MQ Receive queues */
4162306a36Sopenharmony_ci	RES_TYPE_MQ_CQ,			/* MQ Completion queues */
4262306a36Sopenharmony_ci	RES_TYPE_DEPRECATED1,		/* Old version of devcmd 2 */
4362306a36Sopenharmony_ci	RES_TYPE_DEPRECATED2,		/* Old version of devcmd 2 */
4462306a36Sopenharmony_ci	RES_TYPE_DEVCMD2,		/* Device control region */
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci	RES_TYPE_MAX,			/* Count of resource types */
4762306a36Sopenharmony_ci};
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cistruct vnic_resource_header {
5062306a36Sopenharmony_ci	u32 magic;
5162306a36Sopenharmony_ci	u32 version;
5262306a36Sopenharmony_ci};
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_cistruct mgmt_barmap_hdr {
5562306a36Sopenharmony_ci	u32 magic;			/* magic number */
5662306a36Sopenharmony_ci	u32 version;			/* header format version */
5762306a36Sopenharmony_ci	u16 lif;			/* loopback lif for mgmt frames */
5862306a36Sopenharmony_ci	u16 pci_slot;			/* installed pci slot */
5962306a36Sopenharmony_ci	char serial[16];		/* card serial number */
6062306a36Sopenharmony_ci};
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_cistruct vnic_resource {
6362306a36Sopenharmony_ci	u8 type;
6462306a36Sopenharmony_ci	u8 bar;
6562306a36Sopenharmony_ci	u8 pad[2];
6662306a36Sopenharmony_ci	u32 bar_offset;
6762306a36Sopenharmony_ci	u32 count;
6862306a36Sopenharmony_ci};
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#endif /* _VNIC_RESOURCE_H_ */
71