2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
12 #include "qede_ethdev.h"
22 uint8_t hw_mac[ETHER_ADDR_LEN];
33 #define QED_MFW_VERSION_0_MASK 0x000000FF
34 #define QED_MFW_VERSION_0_OFFSET 0
35 #define QED_MFW_VERSION_1_MASK 0x0000FF00
36 #define QED_MFW_VERSION_1_OFFSET 8
37 #define QED_MFW_VERSION_2_MASK 0x00FF0000
38 #define QED_MFW_VERSION_2_OFFSET 16
39 #define QED_MFW_VERSION_3_MASK 0xFF000000
40 #define QED_MFW_VERSION_3_OFFSET 24
47 /* Out param for qede */
52 enum ecore_dev_type dev_type;
55 struct qed_dev_eth_info {
56 struct qed_dev_info common;
61 struct ether_addr port_mac;
62 uint16_t num_vlan_filters;
63 uint32_t num_mac_filters;
65 /* Legacy VF - this affects the datapath */
69 #define INIT_STRUCT_FIELD(field, value) .field = value
72 const struct qed_common_ops *common;
73 int (*fill_dev_info)(struct ecore_dev *edev,
74 struct qed_dev_eth_info *info);
77 struct qed_link_params {
80 #define QED_LINK_OVERRIDE_SPEED_AUTONEG (1 << 0)
81 #define QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS (1 << 1)
82 #define QED_LINK_OVERRIDE_SPEED_FORCED_SPEED (1 << 2)
83 #define QED_LINK_OVERRIDE_PAUSE_CONFIG (1 << 3)
84 uint32_t override_flags;
87 uint32_t forced_speed;
88 #define QED_LINK_PAUSE_AUTONEG_ENABLE (1 << 0)
89 #define QED_LINK_PAUSE_RX_ENABLE (1 << 1)
90 #define QED_LINK_PAUSE_TX_ENABLE (1 << 2)
91 uint32_t pause_config;
94 struct qed_link_output {
96 uint32_t supported_caps; /* In SUPPORTED defs */
97 uint32_t advertised_caps; /* In ADVERTISED defs */
98 uint32_t lp_caps; /* In ADVERTISED defs */
99 uint32_t speed; /* In Mb/s */
100 uint32_t adv_speed; /* Speed mask */
101 uint8_t duplex; /* In DUPLEX defs */
102 uint8_t port; /* In PORT defs */
104 uint32_t pause_config;
107 struct qed_slowpath_params {
113 uint8_t name[NAME_SIZE];
116 struct qed_common_cb_ops {
117 void (*link_update)(void *dev, struct qed_link_output *link);
120 struct qed_common_ops {
121 int (*probe)(struct ecore_dev *edev,
122 struct rte_pci_device *pci_dev,
123 uint32_t dp_module, uint8_t dp_level, bool is_vf);
124 void (*set_name)(struct ecore_dev *edev, char name[]);
126 (*chain_alloc)(struct ecore_dev *edev,
127 enum ecore_chain_use_mode
129 enum ecore_chain_mode mode,
130 enum ecore_chain_cnt_type cnt_type,
132 osal_size_t elem_size,
133 struct ecore_chain *p_chain,
134 struct ecore_chain_ext_pbl *ext_pbl);
136 void (*chain_free)(struct ecore_dev *edev,
137 struct ecore_chain *p_chain);
139 void (*get_link)(struct ecore_dev *edev,
140 struct qed_link_output *if_link);
141 int (*set_link)(struct ecore_dev *edev,
142 struct qed_link_params *params);
144 int (*drain)(struct ecore_dev *edev);
146 void (*remove)(struct ecore_dev *edev);
148 int (*slowpath_stop)(struct ecore_dev *edev);
150 void (*update_pf_params)(struct ecore_dev *edev,
151 struct ecore_pf_params *params);
153 int (*slowpath_start)(struct ecore_dev *edev,
154 struct qed_slowpath_params *params);
156 int (*set_fp_int)(struct ecore_dev *edev, uint16_t cnt);
158 uint32_t (*sb_init)(struct ecore_dev *edev,
159 struct ecore_sb_info *sb_info,
161 dma_addr_t sb_phy_addr,
164 int (*get_sb_info)(struct ecore_dev *edev,
165 struct ecore_sb_info *sb, u16 qid,
166 struct ecore_sb_info_dbg *sb_dbg);
168 bool (*can_link_change)(struct ecore_dev *edev);
170 void (*update_msglvl)(struct ecore_dev *edev,
171 uint32_t dp_module, uint8_t dp_level);
173 int (*send_drv_state)(struct ecore_dev *edev, bool active);
178 const struct qed_eth_ops *qed_get_eth_ops(void);
180 #endif /* _QEDE_IF_H */