]>
Commit | Line | Data |
---|---|---|
32a47e72 YM |
1 | /* QLogic qed NIC Driver |
2 | * Copyright (c) 2015 QLogic Corporation | |
3 | * | |
4 | * This software is available under the terms of the GNU General Public License | |
5 | * (GPL) Version 2, available from the file COPYING in the main directory of | |
6 | * this source tree. | |
7 | */ | |
8 | ||
9 | #ifndef _QED_VF_H | |
10 | #define _QED_VF_H | |
11 | ||
37bff2b9 YM |
12 | enum { |
13 | PFVF_STATUS_WAITING, | |
14 | PFVF_STATUS_SUCCESS, | |
15 | PFVF_STATUS_FAILURE, | |
16 | PFVF_STATUS_NOT_SUPPORTED, | |
17 | PFVF_STATUS_NO_RESOURCE, | |
18 | PFVF_STATUS_FORCED, | |
19 | }; | |
20 | ||
21 | /* vf pf channel tlvs */ | |
22 | /* general tlv header (used for both vf->pf request and pf->vf response) */ | |
23 | struct channel_tlv { | |
24 | u16 type; | |
25 | u16 length; | |
26 | }; | |
27 | ||
28 | /* header of first vf->pf tlv carries the offset used to calculate reponse | |
29 | * buffer address | |
30 | */ | |
31 | struct vfpf_first_tlv { | |
32 | struct channel_tlv tl; | |
33 | u32 padding; | |
34 | u64 reply_address; | |
35 | }; | |
36 | ||
37 | /* header of pf->vf tlvs, carries the status of handling the request */ | |
38 | struct pfvf_tlv { | |
39 | struct channel_tlv tl; | |
40 | u8 status; | |
41 | u8 padding[3]; | |
42 | }; | |
43 | ||
44 | /* response tlv used for most tlvs */ | |
45 | struct pfvf_def_resp_tlv { | |
46 | struct pfvf_tlv hdr; | |
47 | }; | |
48 | ||
49 | /* used to terminate and pad a tlv list */ | |
50 | struct channel_list_end_tlv { | |
51 | struct channel_tlv tl; | |
52 | u8 padding[4]; | |
53 | }; | |
54 | ||
32a47e72 YM |
55 | #define TLV_BUFFER_SIZE 1024 |
56 | struct tlv_buffer_size { | |
57 | u8 tlv_buffer[TLV_BUFFER_SIZE]; | |
58 | }; | |
59 | ||
60 | union vfpf_tlvs { | |
37bff2b9 YM |
61 | struct vfpf_first_tlv first_tlv; |
62 | struct channel_list_end_tlv list_end; | |
32a47e72 YM |
63 | struct tlv_buffer_size tlv_buf_size; |
64 | }; | |
65 | ||
66 | union pfvf_tlvs { | |
37bff2b9 | 67 | struct pfvf_def_resp_tlv default_resp; |
32a47e72 YM |
68 | struct tlv_buffer_size tlv_buf_size; |
69 | }; | |
70 | ||
71 | struct qed_bulletin_content { | |
72 | /* crc of structure to ensure is not in mid-update */ | |
73 | u32 crc; | |
74 | ||
75 | u32 version; | |
76 | ||
77 | /* bitmap indicating which fields hold valid values */ | |
78 | u64 valid_bitmap; | |
79 | }; | |
80 | ||
81 | struct qed_bulletin { | |
82 | dma_addr_t phys; | |
83 | struct qed_bulletin_content *p_virt; | |
84 | u32 size; | |
85 | }; | |
86 | ||
37bff2b9 YM |
87 | enum { |
88 | CHANNEL_TLV_NONE, /* ends tlv sequence */ | |
89 | CHANNEL_TLV_LIST_END, | |
90 | CHANNEL_TLV_MAX | |
91 | }; | |
92 | ||
32a47e72 | 93 | #endif |