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_type {
30 QED_FILTER_TYPE_UCAST,
31 QED_FILTER_TYPE_MCAST,
32 QED_FILTER_TYPE_RX_MODE,
36 struct qed_dev_eth_info {
37 struct qed_dev_info common;
42 struct ether_addr port_mac;
43 uint16_t num_vlan_filters;
44 uint32_t num_mac_addrs;
46 /* Legacy VF - this affects the datapath */
50 struct qed_stop_rxq_params {
54 bool eq_completion_only;
57 struct qed_update_vport_params {
59 uint8_t update_vport_active_flg;
60 uint8_t vport_active_flg;
61 uint8_t update_inner_vlan_removal_flg;
62 uint8_t inner_vlan_removal_flg;
63 uint8_t update_tx_switching_flg;
64 uint8_t tx_switching_flg;
65 uint8_t update_accept_any_vlan_flg;
66 uint8_t accept_any_vlan;
67 uint8_t update_rss_flg;
71 struct qed_start_vport_params {
72 bool remove_inner_vlan;
81 struct qed_stop_txq_params {
87 const struct qed_common_ops *common;
89 int (*fill_dev_info)(struct ecore_dev *edev,
90 struct qed_dev_eth_info *info);
92 int (*vport_start)(struct ecore_dev *edev,
93 struct qed_start_vport_params *params);
95 int (*vport_stop)(struct ecore_dev *edev, uint8_t vport_id);
97 int (*vport_update)(struct ecore_dev *edev,
98 struct qed_update_vport_params *params);
100 int (*q_rx_start)(struct ecore_dev *cdev,
102 struct ecore_queue_start_common_params *p_params,
103 uint16_t bd_max_bytes,
104 dma_addr_t bd_chain_phys_addr,
105 dma_addr_t cqe_pbl_addr,
106 uint16_t cqe_pbl_size, void OSAL_IOMEM * *pp_prod);
108 int (*q_rx_stop)(struct ecore_dev *edev,
109 struct qed_stop_rxq_params *params);
111 int (*q_tx_start)(struct ecore_dev *edev,
113 struct ecore_queue_start_common_params *p_params,
115 uint16_t pbl_size, void OSAL_IOMEM * *pp_doorbell);
117 int (*q_tx_stop)(struct ecore_dev *edev,
118 struct qed_stop_txq_params *params);
120 int (*eth_cqe_completion)(struct ecore_dev *edev,
122 struct eth_slow_path_rx_cqe *cqe);
124 int (*fastpath_stop)(struct ecore_dev *edev);
126 void (*fastpath_start)(struct ecore_dev *edev);
128 void (*get_vport_stats)(struct ecore_dev *edev,
129 struct ecore_eth_stats *stats);
134 extern const struct qed_common_ops qed_common_ops_pass;
136 const struct qed_eth_ops *qed_get_eth_ops();
138 int qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev,
139 enum qed_filter_rx_mode_type type);
141 bool qed_update_rss_parm_cmt(struct ecore_dev *edev, uint16_t *p_tbl);
143 #endif /* _QEDE_ETH_IF_H */