1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
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
12 #include <linux/list.h>
13 #include <linux/if_link.h>
14 #include <linux/qed/eth_common.h>
15 #include <linux/qed/qed_if.h>
16 #include <linux/qed/qed_iov_if.h>
18 struct qed_dev_eth_info
{
19 struct qed_dev_info common
;
24 u8 port_mac
[ETH_ALEN
];
28 struct qed_update_vport_rss_params
{
29 u16 rss_ind_table
[128];
34 struct qed_update_vport_params
{
36 u8 update_vport_active_flg
;
38 u8 update_tx_switching_flg
;
40 u8 update_accept_any_vlan_flg
;
43 struct qed_update_vport_rss_params rss_params
;
46 struct qed_start_vport_params
{
47 bool remove_inner_vlan
;
54 struct qed_stop_rxq_params
{
58 bool eq_completion_only
;
61 struct qed_stop_txq_params
{
66 enum qed_filter_rx_mode_type
{
67 QED_FILTER_RX_MODE_TYPE_REGULAR
,
68 QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC
,
69 QED_FILTER_RX_MODE_TYPE_PROMISC
,
72 enum qed_filter_xcast_params_type
{
73 QED_FILTER_XCAST_TYPE_ADD
,
74 QED_FILTER_XCAST_TYPE_DEL
,
75 QED_FILTER_XCAST_TYPE_REPLACE
,
78 struct qed_filter_ucast_params
{
79 enum qed_filter_xcast_params_type type
;
83 unsigned char mac
[ETH_ALEN
];
86 struct qed_filter_mcast_params
{
87 enum qed_filter_xcast_params_type type
;
89 unsigned char mac
[64][ETH_ALEN
];
92 union qed_filter_type_params
{
93 enum qed_filter_rx_mode_type accept_flags
;
94 struct qed_filter_ucast_params ucast
;
95 struct qed_filter_mcast_params mcast
;
98 enum qed_filter_type
{
99 QED_FILTER_TYPE_UCAST
,
100 QED_FILTER_TYPE_MCAST
,
101 QED_FILTER_TYPE_RX_MODE
,
102 QED_MAX_FILTER_TYPES
,
105 struct qed_filter_params
{
106 enum qed_filter_type type
;
107 union qed_filter_type_params filter
;
110 struct qed_queue_start_common_params
{
118 struct qed_tunn_params
{
120 u8 update_vxlan_port
;
122 u8 update_geneve_port
;
125 struct qed_eth_cb_ops
{
126 struct qed_common_cb_ops common
;
127 void (*force_mac
) (void *dev
, u8
*mac
);
131 const struct qed_common_ops
*common
;
132 #ifdef CONFIG_QED_SRIOV
133 const struct qed_iov_hv_ops
*iov
;
136 int (*fill_dev_info
)(struct qed_dev
*cdev
,
137 struct qed_dev_eth_info
*info
);
139 void (*register_ops
)(struct qed_dev
*cdev
,
140 struct qed_eth_cb_ops
*ops
,
143 bool(*check_mac
) (struct qed_dev
*cdev
, u8
*mac
);
145 int (*vport_start
)(struct qed_dev
*cdev
,
146 struct qed_start_vport_params
*params
);
148 int (*vport_stop
)(struct qed_dev
*cdev
,
151 int (*vport_update
)(struct qed_dev
*cdev
,
152 struct qed_update_vport_params
*params
);
154 int (*q_rx_start
)(struct qed_dev
*cdev
,
155 struct qed_queue_start_common_params
*params
,
157 dma_addr_t bd_chain_phys_addr
,
158 dma_addr_t cqe_pbl_addr
,
160 void __iomem
**pp_prod
);
162 int (*q_rx_stop
)(struct qed_dev
*cdev
,
163 struct qed_stop_rxq_params
*params
);
165 int (*q_tx_start
)(struct qed_dev
*cdev
,
166 struct qed_queue_start_common_params
*params
,
169 void __iomem
**pp_doorbell
);
171 int (*q_tx_stop
)(struct qed_dev
*cdev
,
172 struct qed_stop_txq_params
*params
);
174 int (*filter_config
)(struct qed_dev
*cdev
,
175 struct qed_filter_params
*params
);
177 int (*fastpath_stop
)(struct qed_dev
*cdev
);
179 int (*eth_cqe_completion
)(struct qed_dev
*cdev
,
181 struct eth_slow_path_rx_cqe
*cqe
);
183 void (*get_vport_stats
)(struct qed_dev
*cdev
,
184 struct qed_eth_stats
*stats
);
186 int (*tunn_config
)(struct qed_dev
*cdev
,
187 struct qed_tunn_params
*params
);
190 const struct qed_eth_ops
*qed_get_eth_ops(void);
191 void qed_put_eth_ops(void);