2018-07-14 01:34:27 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2018-05-23 20:56:55 +00:00
|
|
|
* Copyright (c) 2016 - 2018 Cavium Inc.
|
2016-04-27 14:18:37 +00:00
|
|
|
* All rights reserved.
|
2018-05-23 20:56:55 +00:00
|
|
|
* www.cavium.com
|
2016-04-27 14:18:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _QEDE_IF_H
|
|
|
|
#define _QEDE_IF_H
|
|
|
|
|
|
|
|
#include "qede_ethdev.h"
|
|
|
|
|
|
|
|
/* forward */
|
|
|
|
struct ecore_dev;
|
|
|
|
struct qed_sb_info;
|
|
|
|
struct qed_pf_params;
|
|
|
|
enum ecore_int_mode;
|
|
|
|
|
|
|
|
struct qed_dev_info {
|
|
|
|
uint8_t num_hwfns;
|
2019-05-21 16:13:05 +00:00
|
|
|
uint8_t hw_mac[RTE_ETHER_ADDR_LEN];
|
2016-04-27 14:18:37 +00:00
|
|
|
bool is_mf_default;
|
|
|
|
|
|
|
|
/* FW version */
|
|
|
|
uint16_t fw_major;
|
|
|
|
uint16_t fw_minor;
|
|
|
|
uint16_t fw_rev;
|
|
|
|
uint16_t fw_eng;
|
|
|
|
|
|
|
|
/* MFW version */
|
|
|
|
uint32_t mfw_rev;
|
2017-03-29 20:36:21 +00:00
|
|
|
#define QED_MFW_VERSION_0_MASK 0x000000FF
|
|
|
|
#define QED_MFW_VERSION_0_OFFSET 0
|
|
|
|
#define QED_MFW_VERSION_1_MASK 0x0000FF00
|
|
|
|
#define QED_MFW_VERSION_1_OFFSET 8
|
|
|
|
#define QED_MFW_VERSION_2_MASK 0x00FF0000
|
|
|
|
#define QED_MFW_VERSION_2_OFFSET 16
|
|
|
|
#define QED_MFW_VERSION_3_MASK 0xFF000000
|
|
|
|
#define QED_MFW_VERSION_3_OFFSET 24
|
2016-04-27 14:18:37 +00:00
|
|
|
|
|
|
|
uint32_t flash_size;
|
2017-09-19 01:51:40 +00:00
|
|
|
bool b_arfs_capable;
|
2017-09-19 01:51:32 +00:00
|
|
|
bool b_inter_pf_switch;
|
2016-04-27 14:18:37 +00:00
|
|
|
bool tx_switching;
|
2017-03-29 20:36:12 +00:00
|
|
|
u16 mtu;
|
2017-03-29 20:36:30 +00:00
|
|
|
|
2017-09-19 01:29:52 +00:00
|
|
|
bool smart_an;
|
|
|
|
|
2020-04-25 06:13:47 +00:00
|
|
|
/* MBI version */
|
|
|
|
uint32_t mbi_version;
|
|
|
|
#define QED_MBI_VERSION_0_MASK 0x000000FF
|
|
|
|
#define QED_MBI_VERSION_0_OFFSET 0
|
|
|
|
#define QED_MBI_VERSION_1_MASK 0x0000FF00
|
|
|
|
#define QED_MBI_VERSION_1_OFFSET 8
|
|
|
|
#define QED_MBI_VERSION_2_MASK 0x00FF0000
|
|
|
|
#define QED_MBI_VERSION_2_OFFSET 16
|
|
|
|
|
2017-03-29 20:36:30 +00:00
|
|
|
/* Out param for qede */
|
|
|
|
bool vxlan_enable;
|
|
|
|
bool gre_enable;
|
|
|
|
bool geneve_enable;
|
2017-09-19 01:29:45 +00:00
|
|
|
|
|
|
|
enum ecore_dev_type dev_type;
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
2017-06-07 07:42:19 +00:00
|
|
|
struct qed_dev_eth_info {
|
|
|
|
struct qed_dev_info common;
|
|
|
|
|
|
|
|
uint8_t num_queues;
|
|
|
|
uint8_t num_tc;
|
|
|
|
|
2019-05-21 16:13:03 +00:00
|
|
|
struct rte_ether_addr port_mac;
|
2017-06-07 07:42:19 +00:00
|
|
|
uint16_t num_vlan_filters;
|
|
|
|
uint32_t num_mac_filters;
|
|
|
|
|
|
|
|
/* Legacy VF - this affects the datapath */
|
|
|
|
bool is_legacy;
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
2017-06-07 07:42:19 +00:00
|
|
|
#define INIT_STRUCT_FIELD(field, value) .field = value
|
|
|
|
|
|
|
|
struct qed_eth_ops {
|
|
|
|
const struct qed_common_ops *common;
|
|
|
|
int (*fill_dev_info)(struct ecore_dev *edev,
|
|
|
|
struct qed_dev_eth_info *info);
|
2020-09-25 11:55:05 +00:00
|
|
|
void (*sriov_configure)(struct ecore_dev *edev, int num_vfs);
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct qed_link_params {
|
|
|
|
bool link_up;
|
|
|
|
|
|
|
|
#define QED_LINK_OVERRIDE_SPEED_AUTONEG (1 << 0)
|
|
|
|
#define QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS (1 << 1)
|
|
|
|
#define QED_LINK_OVERRIDE_SPEED_FORCED_SPEED (1 << 2)
|
|
|
|
#define QED_LINK_OVERRIDE_PAUSE_CONFIG (1 << 3)
|
2017-09-19 01:29:55 +00:00
|
|
|
#define QED_LINK_OVERRIDE_EEE_CONFIG (1 << 5)
|
2016-04-27 14:18:37 +00:00
|
|
|
uint32_t override_flags;
|
|
|
|
bool autoneg;
|
|
|
|
uint32_t adv_speeds;
|
|
|
|
uint32_t forced_speed;
|
|
|
|
#define QED_LINK_PAUSE_AUTONEG_ENABLE (1 << 0)
|
|
|
|
#define QED_LINK_PAUSE_RX_ENABLE (1 << 1)
|
|
|
|
#define QED_LINK_PAUSE_TX_ENABLE (1 << 2)
|
|
|
|
uint32_t pause_config;
|
2017-09-19 01:29:55 +00:00
|
|
|
struct ecore_link_eee_params eee;
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct qed_link_output {
|
|
|
|
bool link_up;
|
|
|
|
uint32_t supported_caps; /* In SUPPORTED defs */
|
|
|
|
uint32_t advertised_caps; /* In ADVERTISED defs */
|
|
|
|
uint32_t lp_caps; /* In ADVERTISED defs */
|
|
|
|
uint32_t speed; /* In Mb/s */
|
2016-11-11 17:41:36 +00:00
|
|
|
uint32_t adv_speed; /* Speed mask */
|
2016-04-27 14:18:37 +00:00
|
|
|
uint8_t duplex; /* In DUPLEX defs */
|
2017-09-29 07:17:24 +00:00
|
|
|
uint16_t port; /* In PORT defs */
|
2016-04-27 14:18:37 +00:00
|
|
|
bool autoneg;
|
|
|
|
uint32_t pause_config;
|
2017-09-19 01:29:55 +00:00
|
|
|
|
|
|
|
/* EEE - capability & param */
|
|
|
|
bool eee_supported;
|
|
|
|
bool eee_active;
|
|
|
|
u8 sup_caps;
|
|
|
|
struct ecore_link_eee_params eee;
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct qed_slowpath_params {
|
|
|
|
uint32_t int_mode;
|
|
|
|
uint8_t drv_major;
|
|
|
|
uint8_t drv_minor;
|
|
|
|
uint8_t drv_rev;
|
|
|
|
uint8_t drv_eng;
|
2016-10-19 04:11:41 +00:00
|
|
|
uint8_t name[NAME_SIZE];
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct qed_common_cb_ops {
|
|
|
|
void (*link_update)(void *dev, struct qed_link_output *link);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct qed_common_ops {
|
|
|
|
int (*probe)(struct ecore_dev *edev,
|
|
|
|
struct rte_pci_device *pci_dev,
|
|
|
|
uint32_t dp_module, uint8_t dp_level, bool is_vf);
|
2017-03-29 20:36:23 +00:00
|
|
|
void (*set_name)(struct ecore_dev *edev, char name[]);
|
2017-01-05 07:03:57 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
(*chain_alloc)(struct ecore_dev *edev,
|
|
|
|
enum ecore_chain_use_mode
|
|
|
|
intended_use,
|
|
|
|
enum ecore_chain_mode mode,
|
|
|
|
enum ecore_chain_cnt_type cnt_type,
|
|
|
|
uint32_t num_elems,
|
|
|
|
osal_size_t elem_size,
|
|
|
|
struct ecore_chain *p_chain,
|
|
|
|
struct ecore_chain_ext_pbl *ext_pbl);
|
2016-04-27 14:18:37 +00:00
|
|
|
|
|
|
|
void (*chain_free)(struct ecore_dev *edev,
|
|
|
|
struct ecore_chain *p_chain);
|
|
|
|
|
|
|
|
void (*get_link)(struct ecore_dev *edev,
|
|
|
|
struct qed_link_output *if_link);
|
|
|
|
int (*set_link)(struct ecore_dev *edev,
|
|
|
|
struct qed_link_params *params);
|
|
|
|
|
|
|
|
int (*drain)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
void (*remove)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*slowpath_stop)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
void (*update_pf_params)(struct ecore_dev *edev,
|
|
|
|
struct ecore_pf_params *params);
|
|
|
|
|
|
|
|
int (*slowpath_start)(struct ecore_dev *edev,
|
|
|
|
struct qed_slowpath_params *params);
|
|
|
|
|
|
|
|
int (*set_fp_int)(struct ecore_dev *edev, uint16_t cnt);
|
|
|
|
|
|
|
|
uint32_t (*sb_init)(struct ecore_dev *edev,
|
|
|
|
struct ecore_sb_info *sb_info,
|
|
|
|
void *sb_virt_addr,
|
|
|
|
dma_addr_t sb_phy_addr,
|
2017-06-07 07:42:19 +00:00
|
|
|
uint16_t sb_id);
|
2016-04-27 14:18:37 +00:00
|
|
|
|
2017-04-25 07:28:46 +00:00
|
|
|
int (*get_sb_info)(struct ecore_dev *edev,
|
|
|
|
struct ecore_sb_info *sb, u16 qid,
|
|
|
|
struct ecore_sb_info_dbg *sb_dbg);
|
|
|
|
|
2016-04-27 14:18:37 +00:00
|
|
|
bool (*can_link_change)(struct ecore_dev *edev);
|
2017-03-29 20:36:02 +00:00
|
|
|
|
2016-04-27 14:18:37 +00:00
|
|
|
void (*update_msglvl)(struct ecore_dev *edev,
|
|
|
|
uint32_t dp_module, uint8_t dp_level);
|
2017-03-29 20:36:02 +00:00
|
|
|
|
|
|
|
int (*send_drv_state)(struct ecore_dev *edev, bool active);
|
2020-07-08 22:50:53 +00:00
|
|
|
|
|
|
|
/* ############### DEBUG *************************/
|
|
|
|
|
|
|
|
int (*dbg_grc)(struct ecore_dev *edev,
|
|
|
|
void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
int (*dbg_grc_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_idle_chk)(struct ecore_dev *edev,
|
|
|
|
void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
int (*dbg_idle_chk_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_reg_fifo)(struct ecore_dev *edev,
|
|
|
|
void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
int (*dbg_reg_fifo_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_mcp_trace)(struct ecore_dev *edev,
|
|
|
|
void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
int (*dbg_mcp_trace_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_protection_override)(struct ecore_dev *edev, void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
int (*dbg_protection_override_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_igu_fifo_size)(struct ecore_dev *edev);
|
|
|
|
int (*dbg_igu_fifo)(struct ecore_dev *edev, void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
|
|
|
|
int (*dbg_fw_asserts)(struct ecore_dev *edev, void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
|
|
|
|
int (*dbg_fw_asserts_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
int (*dbg_ilt)(struct ecore_dev *edev, void *buffer,
|
|
|
|
u32 *num_dumped_bytes);
|
|
|
|
|
|
|
|
int (*dbg_ilt_size)(struct ecore_dev *edev);
|
|
|
|
|
|
|
|
u8 (*dbg_get_debug_engine)(struct ecore_dev *edev);
|
|
|
|
void (*dbg_set_debug_engine)(struct ecore_dev *edev,
|
|
|
|
int engine_number);
|
|
|
|
|
2016-04-27 14:18:37 +00:00
|
|
|
};
|
|
|
|
|
2017-06-07 07:42:19 +00:00
|
|
|
/* Externs */
|
|
|
|
|
|
|
|
const struct qed_eth_ops *qed_get_eth_ops(void);
|
|
|
|
|
2016-04-27 14:18:37 +00:00
|
|
|
#endif /* _QEDE_IF_H */
|