71 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved.4 * Copyright 2007 Nuova Systems, Inc. All rights reserved.5 */6 7#ifndef _VNIC_RESOURCE_H_8#define _VNIC_RESOURCE_H_9 10#define VNIC_RES_MAGIC 0x766E6963L /* 'vnic' */11#define VNIC_RES_VERSION 0x00000000L12#define MGMTVNIC_MAGIC 0x544d474dL /* 'MGMT' */13#define MGMTVNIC_VERSION 0x00000000L14 15/* The MAC address assigned to the CFG vNIC is fixed. */16#define MGMTVNIC_MAC { 0x02, 0x00, 0x54, 0x4d, 0x47, 0x4d }17 18/* vNIC resource types */19enum vnic_res_type {20 RES_TYPE_EOL, /* End-of-list */21 RES_TYPE_WQ, /* Work queues */22 RES_TYPE_RQ, /* Receive queues */23 RES_TYPE_CQ, /* Completion queues */24 RES_TYPE_RSVD1,25 RES_TYPE_NIC_CFG, /* Enet NIC config registers */26 RES_TYPE_RSVD2,27 RES_TYPE_RSVD3,28 RES_TYPE_RSVD4,29 RES_TYPE_RSVD5,30 RES_TYPE_INTR_CTRL, /* Interrupt ctrl table */31 RES_TYPE_INTR_TABLE, /* MSI/MSI-X Interrupt table */32 RES_TYPE_INTR_PBA, /* MSI/MSI-X PBA table */33 RES_TYPE_INTR_PBA_LEGACY, /* Legacy intr status */34 RES_TYPE_RSVD6,35 RES_TYPE_RSVD7,36 RES_TYPE_DEVCMD, /* Device command region */37 RES_TYPE_PASS_THRU_PAGE, /* Pass-thru page */38 RES_TYPE_SUBVNIC, /* subvnic resource type */39 RES_TYPE_MQ_WQ, /* MQ Work queues */40 RES_TYPE_MQ_RQ, /* MQ Receive queues */41 RES_TYPE_MQ_CQ, /* MQ Completion queues */42 RES_TYPE_DEPRECATED1, /* Old version of devcmd 2 */43 RES_TYPE_DEPRECATED2, /* Old version of devcmd 2 */44 RES_TYPE_DEVCMD2, /* Device control region */45 46 RES_TYPE_MAX, /* Count of resource types */47};48 49struct vnic_resource_header {50 u32 magic;51 u32 version;52};53 54struct mgmt_barmap_hdr {55 u32 magic; /* magic number */56 u32 version; /* header format version */57 u16 lif; /* loopback lif for mgmt frames */58 u16 pci_slot; /* installed pci slot */59 char serial[16]; /* card serial number */60};61 62struct vnic_resource {63 u8 type;64 u8 bar;65 u8 pad[2];66 u32 bar_offset;67 u32 count;68};69 70#endif /* _VNIC_RESOURCE_H_ */71