Imported Upstream version 16.04
[deb_dpdk.git] / drivers / net / fm10k / base / fm10k_vf.h
1 /*******************************************************************************
2
3 Copyright (c) 2013 - 2015, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9  1. Redistributions of source code must retain the above copyright notice,
10     this list of conditions and the following disclaimer.
11
12  2. Redistributions in binary form must reproduce the above copyright
13     notice, this list of conditions and the following disclaimer in the
14     documentation and/or other materials provided with the distribution.
15
16  3. Neither the name of the Intel Corporation nor the names of its
17     contributors may be used to endorse or promote products derived from
18     this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32 ***************************************************************************/
33
34 #ifndef _FM10K_VF_H_
35 #define _FM10K_VF_H_
36
37 #include "fm10k_type.h"
38 #include "fm10k_common.h"
39
40 enum fm10k_vf_tlv_msg_id {
41         FM10K_VF_MSG_ID_TEST = 0,       /* msg ID reserved for testing */
42         FM10K_VF_MSG_ID_MSIX,
43         FM10K_VF_MSG_ID_MAC_VLAN,
44         FM10K_VF_MSG_ID_LPORT_STATE,
45         FM10K_VF_MSG_ID_1588,
46         FM10K_VF_MSG_ID_MAX,
47 };
48
49 enum fm10k_tlv_mac_vlan_attr_id {
50         FM10K_MAC_VLAN_MSG_VLAN,
51         FM10K_MAC_VLAN_MSG_SET,
52         FM10K_MAC_VLAN_MSG_MAC,
53         FM10K_MAC_VLAN_MSG_DEFAULT_MAC,
54         FM10K_MAC_VLAN_MSG_MULTICAST,
55         FM10K_MAC_VLAN_MSG_ID_MAX
56 };
57
58 enum fm10k_tlv_lport_state_attr_id {
59         FM10K_LPORT_STATE_MSG_DISABLE,
60         FM10K_LPORT_STATE_MSG_XCAST_MODE,
61         FM10K_LPORT_STATE_MSG_READY,
62         FM10K_LPORT_STATE_MSG_MAX
63 };
64
65 enum fm10k_tlv_1588_attr_id {
66         FM10K_1588_MSG_TIMESTAMP = 0, /* deprecated */
67         FM10K_1588_MSG_CLK_OFFSET,
68         FM10K_1588_MSG_MAX
69 };
70
71 #define FM10K_VF_MSG_MSIX_HANDLER(func) \
72          FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_MSIX, NULL, func)
73
74 s32 fm10k_msg_mac_vlan_vf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
75 extern const struct fm10k_tlv_attr fm10k_mac_vlan_msg_attr[];
76 #define FM10K_VF_MSG_MAC_VLAN_HANDLER(func) \
77         FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_MAC_VLAN, \
78                           fm10k_mac_vlan_msg_attr, func)
79
80 s32 fm10k_msg_lport_state_vf(struct fm10k_hw *, u32 **,
81                              struct fm10k_mbx_info *);
82 extern const struct fm10k_tlv_attr fm10k_lport_state_msg_attr[];
83 #define FM10K_VF_MSG_LPORT_STATE_HANDLER(func) \
84         FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_LPORT_STATE, \
85                           fm10k_lport_state_msg_attr, func)
86
87 extern const struct fm10k_tlv_attr fm10k_1588_msg_attr[];
88 #define FM10K_VF_MSG_1588_HANDLER(func) \
89         FM10K_MSG_HANDLER(FM10K_VF_MSG_ID_1588, fm10k_1588_msg_attr, func)
90
91 s32 fm10k_init_ops_vf(struct fm10k_hw *hw);
92 #endif /* _FM10K_VF_H */