| 1 | /* |
| 2 | * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. |
| 3 | * Copyright 2007 Nuova Systems, Inc. All rights reserved. |
| 4 | * |
| 5 | * LICENSE_BEGIN |
| 6 | * |
| 7 | * This software is available to you under a choice of one of two |
| 8 | * licenses. You may choose to be licensed under the terms of the GNU |
| 9 | * General Public License (GPL) Version 2, available from the file |
| 10 | * COPYING in the main directory of this source tree, or the |
| 11 | * BSD license below: |
| 12 | * |
| 13 | * Redistribution and use in source and binary forms, with or |
| 14 | * without modification, are permitted provided that the following |
| 15 | * conditions are met: |
| 16 | * |
| 17 | * - Redistributions of source code must retain the above |
| 18 | * copyright notice, this list of conditions and the following |
| 19 | * disclaimer. |
| 20 | * |
| 21 | * - Redistributions in binary form must reproduce the above |
| 22 | * copyright notice, this list of conditions and the following |
| 23 | * disclaimer in the documentation and/or other materials |
| 24 | * provided with the distribution. |
| 25 | * |
| 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 29 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 30 | * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 31 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 32 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 33 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 34 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 36 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 37 | * POSSIBILITY OF SUCH DAMAGE. |
| 38 | * |
| 39 | * LICENSE_END |
| 40 | * |
| 41 | * |
| 42 | */ |
| 43 | |
| 44 | #ifndef _VNIC_RESOURCE_H_ |
| 45 | #define _VNIC_RESOURCE_H_cxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:45:9`! |
| 46 | |
| 47 | #define VNIC_RES_MAGICcxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:47:9`! 0x766E6963L /* 'vnic' */ |
| 48 | #define VNIC_RES_VERSIONcxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:48:9`! 0x00000000L |
| 49 | #define MGMTVNIC_MAGICcxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:49:9`! 0x544d474dL /* 'MGMT' */ |
| 50 | #define MGMTVNIC_VERSIONcxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:50:9`! 0x00000000L |
| 51 | |
| 52 | /* The MAC address assigned to the CFG vNIC is fixed. */ |
| 53 | #define MGMTVNIC_MACcxx . . $ `prov/usnic/src/usnic_direct/vnic_resource.h:53:9`! { 0x02, 0x00, 0x54, 0x4d, 0x47, 0x4d } |
| 54 | |
| 55 | /* vNIC resource types */ |
| 56 | enum vnic_res_typecxx . . $ vnic_res_type# { |
| 57 | RES_TYPE_EOLcxx . . $ RES_TYPE_EOL., /* End-of-list */ |
| 58 | RES_TYPE_WQcxx . . $ RES_TYPE_WQ., /* Work queues */ |
| 59 | RES_TYPE_RQcxx . . $ RES_TYPE_RQ., /* Receive queues */ |
| 60 | RES_TYPE_CQcxx . . $ RES_TYPE_CQ., /* Completion queues */ |
| 61 | RES_TYPE_MEMcxx . . $ RES_TYPE_MEM., /* Window to dev memory */ |
| 62 | RES_TYPE_NIC_CFGcxx . . $ RES_TYPE_NIC_CFG., /* Enet NIC config registers */ |
| 63 | RES_TYPE_RSS_KEYcxx . . $ RES_TYPE_RSS_KEY., /* Enet RSS secret key */ |
| 64 | RES_TYPE_RSS_CPUcxx . . $ RES_TYPE_RSS_CPU., /* Enet RSS indirection table */ |
| 65 | RES_TYPE_TX_STATScxx . . $ RES_TYPE_TX_STATS., /* Netblock Tx statistic regs */ |
| 66 | RES_TYPE_RX_STATScxx . . $ RES_TYPE_RX_STATS., /* Netblock Rx statistic regs */ |
| 67 | RES_TYPE_INTR_CTRLcxx . . $ RES_TYPE_INTR_CTRL., /* Interrupt ctrl table */ |
| 68 | RES_TYPE_INTR_TABLEcxx . . $ RES_TYPE_INTR_TABLE., /* MSI/MSI-X Interrupt table */ |
| 69 | RES_TYPE_INTR_PBAcxx . . $ RES_TYPE_INTR_PBA., /* MSI/MSI-X PBA table */ |
| 70 | RES_TYPE_INTR_PBA_LEGACYcxx . . $ RES_TYPE_INTR_PBA_LEGACY., /* Legacy intr status */ |
| 71 | RES_TYPE_DEBUGcxx . . $ RES_TYPE_DEBUG., /* Debug-only info */ |
| 72 | RES_TYPE_DEVcxx . . $ RES_TYPE_DEV., /* Device-specific region */ |
| 73 | RES_TYPE_DEVCMDcxx . . $ RES_TYPE_DEVCMD., /* Device command region */ |
| 74 | RES_TYPE_PASS_THRU_PAGEcxx . . $ RES_TYPE_PASS_THRU_PAGE., /* Pass-thru page */ |
| 75 | RES_TYPE_SUBVNICcxx . . $ RES_TYPE_SUBVNIC., /* subvnic resource type */ |
| 76 | RES_TYPE_MQ_WQcxx . . $ RES_TYPE_MQ_WQ., /* MQ Work queues */ |
| 77 | RES_TYPE_MQ_RQcxx . . $ RES_TYPE_MQ_RQ., /* MQ Receive queues */ |
| 78 | RES_TYPE_MQ_CQcxx . . $ RES_TYPE_MQ_CQ., /* MQ Completion queues */ |
| 79 | RES_TYPE_DEPRECATED1cxx . . $ RES_TYPE_DEPRECATED1., /* Old version of devcmd 2 */ |
| 80 | RES_TYPE_DEPRECATED2cxx . . $ RES_TYPE_DEPRECATED2., /* Old version of devcmd 2 */ |
| 81 | RES_TYPE_DEVCMD2cxx . . $ RES_TYPE_DEVCMD2., /* Device control region */ |
| 82 | RES_TYPE_RDMA_WQcxx . . $ RES_TYPE_RDMA_WQ., /* RDMA WQ */ |
| 83 | RES_TYPE_RDMA_RQcxx . . $ RES_TYPE_RDMA_RQ., /* RDMA RQ */ |
| 84 | RES_TYPE_RDMA_CQcxx . . $ RES_TYPE_RDMA_CQ., /* RDMA CQ */ |
| 85 | RES_TYPE_RDMA_RKEY_TABLEcxx . . $ RES_TYPE_RDMA_RKEY_TABLE., /* RDMA RKEY table */ |
| 86 | RES_TYPE_RDMA_RQ_HEADER_TABLEcxx . . $ RES_TYPE_RDMA_RQ_HEADER_TABLE., /* RDMA RQ Header Table */ |
| 87 | RES_TYPE_RDMA_RQ_TABLEcxx . . $ RES_TYPE_RDMA_RQ_TABLE., /* RDMA RQ Table */ |
| 88 | RES_TYPE_RDMA_RD_RESP_HEADER_TABLEcxx . . $ RES_TYPE_RDMA_RD_RESP_HEADER_TABLE., /* RDMA Read Response Header Table */ |
| 89 | RES_TYPE_RDMA_RD_RESP_TABLEcxx . . $ RES_TYPE_RDMA_RD_RESP_TABLE., /* RDMA Read Response Table */ |
| 90 | RES_TYPE_RDMA_QP_STATS_TABLEcxx . . $ RES_TYPE_RDMA_QP_STATS_TABLE., /* RDMA per QP stats table */ |
| 91 | RES_TYPE_WQ_MREGScxx . . $ RES_TYPE_WQ_MREGS., /* XXX snic proto only */ |
| 92 | RES_TYPE_GRPMBR_INTRcxx . . $ RES_TYPE_GRPMBR_INTR., /* Group member interrupt control */ |
| 93 | RES_TYPE_DPKTcxx . . $ RES_TYPE_DPKT., /* Direct Packet memory region */ |
| 94 | |
| 95 | RES_TYPE_MAXcxx . . $ RES_TYPE_MAX., /* Count of resource types */ |
| 96 | }; |
| 97 | |
| 98 | struct vnic_resource_headercxx . . $ vnic_resource_header# { |
| 99 | u32cxx . . $ u32# magiccxx . . $ vnic_resource_header#magic.; |
| 100 | u32cxx . . $ u32# versioncxx . . $ vnic_resource_header#version.; |
| 101 | }; |
| 102 | |
| 103 | struct mgmt_barmap_hdrcxx . . $ mgmt_barmap_hdr# { |
| 104 | u32cxx . . $ u32# magiccxx . . $ mgmt_barmap_hdr#magic.; /* magic number */ |
| 105 | u32cxx . . $ u32# versioncxx . . $ mgmt_barmap_hdr#version.; /* header format version */ |
| 106 | u16cxx . . $ u16# lifcxx . . $ mgmt_barmap_hdr#lif.; /* loopback lif for mgmt frames */ |
| 107 | u16cxx . . $ u16# pci_slotcxx . . $ mgmt_barmap_hdr#pci_slot.; /* installed pci slot */ |
| 108 | char serialcxx . . $ mgmt_barmap_hdr#serial.[16]; /* card serial number */ |
| 109 | }; |
| 110 | |
| 111 | struct vnic_resourcecxx . . $ vnic_resource# { |
| 112 | u8cxx . . $ u8# typecxx . . $ vnic_resource#type.; |
| 113 | u8cxx . . $ u8# barcxx . . $ vnic_resource#bar.; |
| 114 | u8cxx . . $ u8# padcxx . . $ vnic_resource#pad.[2]; |
| 115 | u32cxx . . $ u32# bar_offsetcxx . . $ vnic_resource#bar_offset.; |
| 116 | u32cxx . . $ u32# countcxx . . $ vnic_resource#count.; |
| 117 | }; |
| 118 | |
| 119 | #endif /* _VNIC_RESOURCE_H_ */ |