2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
10 #define _QEDE_ETH_IF_H
15 struct eth_slow_path_rx_cqe
;
17 #define INIT_STRUCT_FIELD(field, value) .field = value
19 #define QED_ETH_INTERFACE_VERSION 609
21 #define QEDE_MAX_MCAST_FILTERS 64
23 enum qed_filter_rx_mode_type
{
24 QED_FILTER_RX_MODE_TYPE_REGULAR
,
25 QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC
,
26 QED_FILTER_RX_MODE_TYPE_PROMISC
,
29 enum qed_filter_xcast_params_type
{
30 QED_FILTER_XCAST_TYPE_ADD
,
31 QED_FILTER_XCAST_TYPE_DEL
,
32 QED_FILTER_XCAST_TYPE_REPLACE
,
35 enum qed_filter_type
{
36 QED_FILTER_TYPE_UCAST
,
37 QED_FILTER_TYPE_MCAST
,
38 QED_FILTER_TYPE_RX_MODE
,
42 struct qed_dev_eth_info
{
43 struct qed_dev_info common
;
48 struct ether_addr port_mac
;
49 uint16_t num_vlan_filters
;
50 uint32_t num_mac_addrs
;
53 struct qed_update_vport_rss_params
{
54 uint16_t rss_ind_table
[128];
59 struct qed_stop_rxq_params
{
63 bool eq_completion_only
;
66 struct qed_update_vport_params
{
68 uint8_t update_vport_active_flg
;
69 uint8_t vport_active_flg
;
70 uint8_t update_inner_vlan_removal_flg
;
71 uint8_t inner_vlan_removal_flg
;
72 uint8_t update_tx_switching_flg
;
73 uint8_t tx_switching_flg
;
74 uint8_t update_accept_any_vlan_flg
;
75 uint8_t accept_any_vlan
;
76 uint8_t update_rss_flg
;
77 struct qed_update_vport_rss_params rss_params
;
81 struct qed_start_vport_params
{
82 bool remove_inner_vlan
;
91 struct qed_stop_txq_params
{
96 struct qed_filter_ucast_params
{
97 enum qed_filter_xcast_params_type type
;
101 unsigned char mac
[ETHER_ADDR_LEN
];
104 struct qed_filter_mcast_params
{
105 enum qed_filter_xcast_params_type type
;
107 unsigned char mac
[QEDE_MAX_MCAST_FILTERS
][ETHER_ADDR_LEN
];
110 union qed_filter_type_params
{
111 enum qed_filter_rx_mode_type accept_flags
;
112 struct qed_filter_ucast_params ucast
;
113 struct qed_filter_mcast_params mcast
;
116 struct qed_filter_params
{
117 enum qed_filter_type type
;
118 union qed_filter_type_params filter
;
122 const struct qed_common_ops
*common
;
124 int (*fill_dev_info
)(struct ecore_dev
*edev
,
125 struct qed_dev_eth_info
*info
);
127 int (*vport_start
)(struct ecore_dev
*edev
,
128 struct qed_start_vport_params
*params
);
130 int (*vport_stop
)(struct ecore_dev
*edev
, uint8_t vport_id
);
132 int (*vport_update
)(struct ecore_dev
*edev
,
133 struct qed_update_vport_params
*params
);
135 int (*q_rx_start
)(struct ecore_dev
*cdev
,
137 struct ecore_queue_start_common_params
*p_params
,
138 uint16_t bd_max_bytes
,
139 dma_addr_t bd_chain_phys_addr
,
140 dma_addr_t cqe_pbl_addr
,
141 uint16_t cqe_pbl_size
, void OSAL_IOMEM
* *pp_prod
);
143 int (*q_rx_stop
)(struct ecore_dev
*edev
,
144 struct qed_stop_rxq_params
*params
);
146 int (*q_tx_start
)(struct ecore_dev
*edev
,
148 struct ecore_queue_start_common_params
*p_params
,
150 uint16_t pbl_size
, void OSAL_IOMEM
* *pp_doorbell
);
152 int (*q_tx_stop
)(struct ecore_dev
*edev
,
153 struct qed_stop_txq_params
*params
);
155 int (*eth_cqe_completion
)(struct ecore_dev
*edev
,
157 struct eth_slow_path_rx_cqe
*cqe
);
159 int (*fastpath_stop
)(struct ecore_dev
*edev
);
161 void (*fastpath_start
)(struct ecore_dev
*edev
);
163 void (*get_vport_stats
)(struct ecore_dev
*edev
,
164 struct ecore_eth_stats
*stats
);
166 int (*filter_config
)(struct ecore_dev
*edev
,
167 struct qed_filter_params
*params
);
172 extern const struct qed_common_ops qed_common_ops_pass
;
174 const struct qed_eth_ops
*qed_get_eth_ops();
176 int qed_configure_filter_rx_mode(struct ecore_dev
*edev
,
177 enum qed_filter_rx_mode_type type
);
179 #endif /* _QEDE_ETH_IF_H */