Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 1 | /* bnx2x_vfpf.h: Broadcom Everest network driver. |
| 2 | * |
| 3 | * Copyright (c) 2011-2012 Broadcom Corporation |
| 4 | * |
| 5 | * Unless you and Broadcom execute a separate written software license |
| 6 | * agreement governing use of this software, this software is licensed to you |
| 7 | * under the terms of the GNU General Public License version 2, available |
| 8 | * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"). |
| 9 | * |
| 10 | * Notwithstanding the above, under no circumstances may you combine this |
| 11 | * software in any way with any other Broadcom software provided under a |
| 12 | * license other than the GPL, without Broadcom's express prior written |
| 13 | * consent. |
| 14 | * |
| 15 | * Maintained by: Eilon Greenstein <eilong@broadcom.com> |
| 16 | * Written by: Ariel Elior <ariele@broadcom.com> |
| 17 | */ |
| 18 | #ifndef VF_PF_IF_H |
| 19 | #define VF_PF_IF_H |
| 20 | |
Ariel Elior | be1f1ffa | 2013-01-01 05:22:24 +0000 | [diff] [blame^] | 21 | /* Common definitions for all HVs */ |
| 22 | struct vf_pf_resc_request { |
| 23 | u8 num_rxqs; |
| 24 | u8 num_txqs; |
| 25 | u8 num_sbs; |
| 26 | u8 num_mac_filters; |
| 27 | u8 num_vlan_filters; |
| 28 | u8 num_mc_filters; /* No limit so superfluous */ |
| 29 | }; |
| 30 | |
| 31 | struct hw_sb_info { |
| 32 | u8 hw_sb_id; /* aka absolute igu id, used to ack the sb */ |
| 33 | u8 sb_qid; /* used to update DHC for sb */ |
| 34 | }; |
| 35 | |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 36 | /* HW VF-PF channel definitions |
| 37 | * A.K.A VF-PF mailbox |
| 38 | */ |
| 39 | #define TLV_BUFFER_SIZE 1024 |
| 40 | |
Ariel Elior | be1f1ffa | 2013-01-01 05:22:24 +0000 | [diff] [blame^] | 41 | enum { |
| 42 | PFVF_STATUS_WAITING = 0, |
| 43 | PFVF_STATUS_SUCCESS, |
| 44 | PFVF_STATUS_FAILURE, |
| 45 | PFVF_STATUS_NOT_SUPPORTED, |
| 46 | PFVF_STATUS_NO_RESOURCE |
| 47 | }; |
| 48 | |
| 49 | /* vf pf channel tlvs */ |
| 50 | /* general tlv header (used for both vf->pf request and pf->vf response) */ |
| 51 | struct channel_tlv { |
| 52 | u16 type; |
| 53 | u16 length; |
| 54 | }; |
| 55 | |
| 56 | /* header of first vf->pf tlv carries the offset used to calculate response |
| 57 | * buffer address |
| 58 | */ |
| 59 | struct vfpf_first_tlv { |
| 60 | struct channel_tlv tl; |
| 61 | u32 resp_msg_offset; |
| 62 | }; |
| 63 | |
| 64 | /* header of pf->vf tlvs, carries the status of handling the request */ |
| 65 | struct pfvf_tlv { |
| 66 | struct channel_tlv tl; |
| 67 | u8 status; |
| 68 | u8 padding[3]; |
| 69 | }; |
| 70 | |
| 71 | /* used to terminate and pad a tlv list */ |
| 72 | struct channel_list_end_tlv { |
| 73 | struct channel_tlv tl; |
| 74 | u8 padding[4]; |
| 75 | }; |
| 76 | |
| 77 | /* Acquire */ |
| 78 | struct vfpf_acquire_tlv { |
| 79 | struct vfpf_first_tlv first_tlv; |
| 80 | |
| 81 | struct vf_pf_vfdev_info { |
| 82 | /* the following fields are for debug purposes */ |
| 83 | u8 vf_id; /* ME register value */ |
| 84 | u8 vf_os; /* e.g. Linux, W2K8 */ |
| 85 | u8 padding[2]; |
| 86 | } vfdev_info; |
| 87 | |
| 88 | struct vf_pf_resc_request resc_request; |
| 89 | |
| 90 | aligned_u64 bulletin_addr; |
| 91 | }; |
| 92 | |
| 93 | /* acquire response tlv - carries the allocated resources */ |
| 94 | struct pfvf_acquire_resp_tlv { |
| 95 | struct pfvf_tlv hdr; |
| 96 | struct pf_vf_pfdev_info { |
| 97 | u32 chip_num; |
| 98 | u32 pf_cap; |
| 99 | #define PFVF_CAP_RSS 0x00000001 |
| 100 | #define PFVF_CAP_DHC 0x00000002 |
| 101 | #define PFVF_CAP_TPA 0x00000004 |
| 102 | char fw_ver[32]; |
| 103 | u16 db_size; |
| 104 | u8 indices_per_sb; |
| 105 | u8 padding; |
| 106 | } pfdev_info; |
| 107 | struct pf_vf_resc { |
| 108 | /* in case of status NO_RESOURCE in message hdr, pf will fill |
| 109 | * this struct with suggested amount of resources for next |
| 110 | * acquire request |
| 111 | */ |
| 112 | #define PFVF_MAX_QUEUES_PER_VF 16 |
| 113 | #define PFVF_MAX_SBS_PER_VF 16 |
| 114 | struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF]; |
| 115 | u8 hw_qid[PFVF_MAX_QUEUES_PER_VF]; |
| 116 | u8 num_rxqs; |
| 117 | u8 num_txqs; |
| 118 | u8 num_sbs; |
| 119 | u8 num_mac_filters; |
| 120 | u8 num_vlan_filters; |
| 121 | u8 num_mc_filters; |
| 122 | u8 permanent_mac_addr[ETH_ALEN]; |
| 123 | u8 current_mac_addr[ETH_ALEN]; |
| 124 | u8 padding[2]; |
| 125 | } resc; |
| 126 | }; |
| 127 | |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 128 | struct tlv_buffer_size { |
| 129 | u8 tlv_buffer[TLV_BUFFER_SIZE]; |
| 130 | }; |
| 131 | |
| 132 | union vfpf_tlvs { |
Ariel Elior | be1f1ffa | 2013-01-01 05:22:24 +0000 | [diff] [blame^] | 133 | struct vfpf_first_tlv first_tlv; |
| 134 | struct vfpf_acquire_tlv acquire; |
| 135 | struct channel_list_end_tlv list_end; |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 136 | struct tlv_buffer_size tlv_buf_size; |
| 137 | }; |
| 138 | |
| 139 | union pfvf_tlvs { |
Ariel Elior | be1f1ffa | 2013-01-01 05:22:24 +0000 | [diff] [blame^] | 140 | struct pfvf_acquire_resp_tlv acquire_resp; |
| 141 | struct channel_list_end_tlv list_end; |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 142 | struct tlv_buffer_size tlv_buf_size; |
| 143 | }; |
Ariel Elior | be1f1ffa | 2013-01-01 05:22:24 +0000 | [diff] [blame^] | 144 | |
| 145 | #define MAX_TLVS_IN_LIST 50 |
| 146 | |
| 147 | enum channel_tlvs { |
| 148 | CHANNEL_TLV_NONE, |
| 149 | CHANNEL_TLV_ACQUIRE, |
| 150 | CHANNEL_TLV_LIST_END, |
| 151 | CHANNEL_TLV_MAX |
| 152 | }; |
| 153 | |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 154 | #endif /* VF_PF_IF_H */ |