New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / net / ixgbe / base / ixgbe_vf.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2001-2018
3  */
4
5 #ifndef _IXGBE_VF_H_
6 #define _IXGBE_VF_H_
7
8 #include "ixgbe_type.h"
9
10 #define IXGBE_VF_IRQ_CLEAR_MASK 7
11 #define IXGBE_VF_MAX_TX_QUEUES  8
12 #define IXGBE_VF_MAX_RX_QUEUES  8
13
14 /* DCB define */
15 #define IXGBE_VF_MAX_TRAFFIC_CLASS      8
16
17 #define IXGBE_VFCTRL            0x00000
18 #define IXGBE_VFSTATUS          0x00008
19 #define IXGBE_VFLINKS           0x00010
20 #define IXGBE_VFFRTIMER         0x00048
21 #define IXGBE_VFRXMEMWRAP       0x03190
22 #define IXGBE_VTEICR            0x00100
23 #define IXGBE_VTEICS            0x00104
24 #define IXGBE_VTEIMS            0x00108
25 #define IXGBE_VTEIMC            0x0010C
26 #define IXGBE_VTEIAC            0x00110
27 #define IXGBE_VTEIAM            0x00114
28 #define IXGBE_VTEITR(x)         (0x00820 + (4 * (x)))
29 #define IXGBE_VTIVAR(x)         (0x00120 + (4 * (x)))
30 #define IXGBE_VTIVAR_MISC       0x00140
31 #define IXGBE_VTRSCINT(x)       (0x00180 + (4 * (x)))
32 /* define IXGBE_VFPBACL  still says TBD in EAS */
33 #define IXGBE_VFRDBAL(x)        (0x01000 + (0x40 * (x)))
34 #define IXGBE_VFRDBAH(x)        (0x01004 + (0x40 * (x)))
35 #define IXGBE_VFRDLEN(x)        (0x01008 + (0x40 * (x)))
36 #define IXGBE_VFRDH(x)          (0x01010 + (0x40 * (x)))
37 #define IXGBE_VFRDT(x)          (0x01018 + (0x40 * (x)))
38 #define IXGBE_VFRXDCTL(x)       (0x01028 + (0x40 * (x)))
39 #define IXGBE_VFSRRCTL(x)       (0x01014 + (0x40 * (x)))
40 #define IXGBE_VFRSCCTL(x)       (0x0102C + (0x40 * (x)))
41 #define IXGBE_VFPSRTYPE         0x00300
42 #define IXGBE_VFTDBAL(x)        (0x02000 + (0x40 * (x)))
43 #define IXGBE_VFTDBAH(x)        (0x02004 + (0x40 * (x)))
44 #define IXGBE_VFTDLEN(x)        (0x02008 + (0x40 * (x)))
45 #define IXGBE_VFTDH(x)          (0x02010 + (0x40 * (x)))
46 #define IXGBE_VFTDT(x)          (0x02018 + (0x40 * (x)))
47 #define IXGBE_VFTXDCTL(x)       (0x02028 + (0x40 * (x)))
48 #define IXGBE_VFTDWBAL(x)       (0x02038 + (0x40 * (x)))
49 #define IXGBE_VFTDWBAH(x)       (0x0203C + (0x40 * (x)))
50 #define IXGBE_VFDCA_RXCTRL(x)   (0x0100C + (0x40 * (x)))
51 #define IXGBE_VFDCA_TXCTRL(x)   (0x0200c + (0x40 * (x)))
52 #define IXGBE_VFGPRC            0x0101C
53 #define IXGBE_VFGPTC            0x0201C
54 #define IXGBE_VFGORC_LSB        0x01020
55 #define IXGBE_VFGORC_MSB        0x01024
56 #define IXGBE_VFGOTC_LSB        0x02020
57 #define IXGBE_VFGOTC_MSB        0x02024
58 #define IXGBE_VFMPRC            0x01034
59 #define IXGBE_VFMRQC            0x3000
60 #define IXGBE_VFRSSRK(x)        (0x3100 + ((x) * 4))
61 #define IXGBE_VFRETA(x) (0x3200 + ((x) * 4))
62
63
64 struct ixgbevf_hw_stats {
65         u64 base_vfgprc;
66         u64 base_vfgptc;
67         u64 base_vfgorc;
68         u64 base_vfgotc;
69         u64 base_vfmprc;
70
71         u64 last_vfgprc;
72         u64 last_vfgptc;
73         u64 last_vfgorc;
74         u64 last_vfgotc;
75         u64 last_vfmprc;
76
77         u64 vfgprc;
78         u64 vfgptc;
79         u64 vfgorc;
80         u64 vfgotc;
81         u64 vfmprc;
82
83         u64 saved_reset_vfgprc;
84         u64 saved_reset_vfgptc;
85         u64 saved_reset_vfgorc;
86         u64 saved_reset_vfgotc;
87         u64 saved_reset_vfmprc;
88 };
89
90 s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw);
91 s32 ixgbe_init_hw_vf(struct ixgbe_hw *hw);
92 s32 ixgbe_start_hw_vf(struct ixgbe_hw *hw);
93 s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw);
94 s32 ixgbe_stop_adapter_vf(struct ixgbe_hw *hw);
95 u32 ixgbe_get_num_of_tx_queues_vf(struct ixgbe_hw *hw);
96 u32 ixgbe_get_num_of_rx_queues_vf(struct ixgbe_hw *hw);
97 s32 ixgbe_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr);
98 s32 ixgbe_setup_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed speed,
99                             bool autoneg_wait_to_complete);
100 s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
101                             bool *link_up, bool autoneg_wait_to_complete);
102 s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
103                      u32 enable_addr);
104 s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr);
105 s32 ixgbe_update_mc_addr_list_vf(struct ixgbe_hw *hw, u8 *mc_addr_list,
106                                  u32 mc_addr_count, ixgbe_mc_addr_itr,
107                                  bool clear);
108 s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode);
109 s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
110                       bool vlan_on, bool vlvf_bypass);
111 s32 ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size);
112 int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api);
113 int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
114                        unsigned int *default_tc);
115
116 #endif /* __IXGBE_VF_H__ */