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>
17 struct qed_dev_eth_info
{
18 struct qed_dev_info common
;
23 u8 port_mac
[ETH_ALEN
];
27 struct qed_update_vport_rss_params
{
28 u16 rss_ind_table
[128];
32 struct qed_update_vport_params
{
34 u8 update_vport_active_flg
;
36 u8 update_accept_any_vlan_flg
;
39 struct qed_update_vport_rss_params rss_params
;
42 struct qed_start_vport_params
{
43 bool remove_inner_vlan
;
50 struct qed_stop_rxq_params
{
54 bool eq_completion_only
;
57 struct qed_stop_txq_params
{
62 enum qed_filter_rx_mode_type
{
63 QED_FILTER_RX_MODE_TYPE_REGULAR
,
64 QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC
,
65 QED_FILTER_RX_MODE_TYPE_PROMISC
,
68 enum qed_filter_xcast_params_type
{
69 QED_FILTER_XCAST_TYPE_ADD
,
70 QED_FILTER_XCAST_TYPE_DEL
,
71 QED_FILTER_XCAST_TYPE_REPLACE
,
74 struct qed_filter_ucast_params
{
75 enum qed_filter_xcast_params_type type
;
79 unsigned char mac
[ETH_ALEN
];
82 struct qed_filter_mcast_params
{
83 enum qed_filter_xcast_params_type type
;
85 unsigned char mac
[64][ETH_ALEN
];
88 union qed_filter_type_params
{
89 enum qed_filter_rx_mode_type accept_flags
;
90 struct qed_filter_ucast_params ucast
;
91 struct qed_filter_mcast_params mcast
;
94 enum qed_filter_type
{
95 QED_FILTER_TYPE_UCAST
,
96 QED_FILTER_TYPE_MCAST
,
97 QED_FILTER_TYPE_RX_MODE
,
101 struct qed_filter_params
{
102 enum qed_filter_type type
;
103 union qed_filter_type_params filter
;
106 struct qed_queue_start_common_params
{
114 struct qed_eth_cb_ops
{
115 struct qed_common_cb_ops common
;
119 const struct qed_common_ops
*common
;
121 int (*fill_dev_info
)(struct qed_dev
*cdev
,
122 struct qed_dev_eth_info
*info
);
124 void (*register_ops
)(struct qed_dev
*cdev
,
125 struct qed_eth_cb_ops
*ops
,
128 int (*vport_start
)(struct qed_dev
*cdev
,
129 struct qed_start_vport_params
*params
);
131 int (*vport_stop
)(struct qed_dev
*cdev
,
134 int (*vport_update
)(struct qed_dev
*cdev
,
135 struct qed_update_vport_params
*params
);
137 int (*q_rx_start
)(struct qed_dev
*cdev
,
138 struct qed_queue_start_common_params
*params
,
140 dma_addr_t bd_chain_phys_addr
,
141 dma_addr_t cqe_pbl_addr
,
143 void __iomem
**pp_prod
);
145 int (*q_rx_stop
)(struct qed_dev
*cdev
,
146 struct qed_stop_rxq_params
*params
);
148 int (*q_tx_start
)(struct qed_dev
*cdev
,
149 struct qed_queue_start_common_params
*params
,
152 void __iomem
**pp_doorbell
);
154 int (*q_tx_stop
)(struct qed_dev
*cdev
,
155 struct qed_stop_txq_params
*params
);
157 int (*filter_config
)(struct qed_dev
*cdev
,
158 struct qed_filter_params
*params
);
160 int (*fastpath_stop
)(struct qed_dev
*cdev
);
162 int (*eth_cqe_completion
)(struct qed_dev
*cdev
,
164 struct eth_slow_path_rx_cqe
*cqe
);
166 void (*get_vport_stats
)(struct qed_dev
*cdev
,
167 struct qed_eth_stats
*stats
);
170 const struct qed_eth_ops
*qed_get_eth_ops(u32 version
);
171 void qed_put_eth_ops(void);