blob: 728491fdb9d20fdb594bc774321c134b2c283cf4 [file] [log] [blame]
Ariel Elior1ab44342013-01-01 05:22:23 +00001/* 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 Eliorbe1f1ffa2013-01-01 05:22:24 +000021/* Common definitions for all HVs */
22struct 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
31struct 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 Elior1ab44342013-01-01 05:22:23 +000036/* HW VF-PF channel definitions
37 * A.K.A VF-PF mailbox
38 */
39#define TLV_BUFFER_SIZE 1024
40
Ariel Eliorbe1f1ffa2013-01-01 05:22:24 +000041enum {
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) */
51struct 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 */
59struct 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 */
65struct 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 */
72struct channel_list_end_tlv {
73 struct channel_tlv tl;
74 u8 padding[4];
75};
76
77/* Acquire */
78struct 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 */
94struct 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 Elior1ab44342013-01-01 05:22:23 +0000128struct tlv_buffer_size {
129 u8 tlv_buffer[TLV_BUFFER_SIZE];
130};
131
132union vfpf_tlvs {
Ariel Eliorbe1f1ffa2013-01-01 05:22:24 +0000133 struct vfpf_first_tlv first_tlv;
134 struct vfpf_acquire_tlv acquire;
135 struct channel_list_end_tlv list_end;
Ariel Elior1ab44342013-01-01 05:22:23 +0000136 struct tlv_buffer_size tlv_buf_size;
137};
138
139union pfvf_tlvs {
Ariel Eliorbe1f1ffa2013-01-01 05:22:24 +0000140 struct pfvf_acquire_resp_tlv acquire_resp;
141 struct channel_list_end_tlv list_end;
Ariel Elior1ab44342013-01-01 05:22:23 +0000142 struct tlv_buffer_size tlv_buf_size;
143};
Ariel Eliorbe1f1ffa2013-01-01 05:22:24 +0000144
145#define MAX_TLVS_IN_LIST 50
146
147enum channel_tlvs {
148 CHANNEL_TLV_NONE,
149 CHANNEL_TLV_ACQUIRE,
150 CHANNEL_TLV_LIST_END,
151 CHANNEL_TLV_MAX
152};
153
Ariel Elior1ab44342013-01-01 05:22:23 +0000154#endif /* VF_PF_IF_H */