#include <linux/etherdevice.h>
#include <linux/mlx4/cmd.h>
#include <linux/module.h>
#include <linux/cache.h>
#include <linux/kernel.h>
#include <uapi/rdma/mlx4-abi.h>
#include "fw.h"
#include "icm.h"
enum { … };
extern void __buggy_use_of_MLX4_GET(void);
extern void __buggy_use_of_MLX4_PUT(void);
static bool enable_qos;
module_param(enable_qos, bool, 0444);
MODULE_PARM_DESC(…) …;
#define MLX4_GET(dest, source, offset) …
#define MLX4_PUT(dest, source, offset) …
static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
{ … }
static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
{ … }
int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
{ … }
int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave)
{ … }
static int mlx4_activate_vst_qinq(struct mlx4_priv *priv, int slave, int port)
{ … }
static int mlx4_handle_vst_qinq(struct mlx4_priv *priv, int slave, int port)
{ … }
int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
struct mlx4_func_cap *func_cap)
{ … }
static void disable_unsupported_roce_caps(void *buf);
int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
{ … }
void mlx4_dev_cap_dump(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
{ … }
int mlx4_QUERY_PORT(struct mlx4_dev *dev, int port, struct mlx4_port_cap *port_cap)
{ … }
#define DEV_CAP_EXT_2_FLAG_PFC_COUNTERS …
#define DEV_CAP_EXT_2_FLAG_VLAN_CONTROL …
#define DEV_CAP_EXT_2_FLAG_80_VFS …
#define DEV_CAP_EXT_2_FLAG_FSM …
int mlx4_QUERY_DEV_CAP_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
static void disable_unsupported_roce_caps(void *buf)
{ … }
int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
int mlx4_get_slave_pkey_gid_tbl_len(struct mlx4_dev *dev, u8 port,
int *gid_tbl_len, int *pkey_tbl_len)
{ … }
EXPORT_SYMBOL(…);
int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt)
{ … }
int mlx4_MAP_FA(struct mlx4_dev *dev, struct mlx4_icm *icm)
{ … }
int mlx4_UNMAP_FA(struct mlx4_dev *dev)
{ … }
int mlx4_RUN_FW(struct mlx4_dev *dev)
{ … }
int mlx4_QUERY_FW(struct mlx4_dev *dev)
{ … }
int mlx4_QUERY_FW_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
static void get_board_id(void *vsd, char *board_id)
{ … }
int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter)
{ … }
int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
{ … }
int mlx4_QUERY_HCA(struct mlx4_dev *dev,
struct mlx4_init_hca_param *param)
{ … }
static int mlx4_hca_core_clock_update(struct mlx4_dev *dev)
{ … }
static int check_qp0_state(struct mlx4_dev *dev, int function, int port)
{ … }
int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
int mlx4_INIT_PORT(struct mlx4_dev *dev, int port)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic)
{ … }
struct mlx4_config_dev { … };
#define MLX4_VXLAN_UDP_DPORT …
#define MLX4_ROCE_V2_UDP_DPORT …
#define MLX4_DISABLE_RX_PORT …
static int mlx4_CONFIG_DEV_set(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev)
{ … }
static int mlx4_CONFIG_DEV_get(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev)
{ … }
static const u8 config_dev_csum_flags[] = …;
int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
struct mlx4_config_dev_params *params)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port)
{ … }
EXPORT_SYMBOL_GPL(…);
#define CONFIG_DISABLE_RX_PORT …
int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis)
{ … }
int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2)
{ … }
int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages)
{ … }
int mlx4_NOP(struct mlx4_dev *dev)
{ … }
int mlx4_query_diag_counters(struct mlx4_dev *dev, u8 op_modifier,
const u32 offset[],
u32 value[], size_t array_len, u8 port)
{ … }
EXPORT_SYMBOL(…);
int mlx4_get_phys_port_id(struct mlx4_dev *dev)
{ … }
#define MLX4_WOL_SETUP_MODE …
int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port)
{ … }
EXPORT_SYMBOL_GPL(…);
enum { … };
void mlx4_opreq_action(struct work_struct *work)
{ … }
static int mlx4_check_smp_firewall_active(struct mlx4_dev *dev,
struct mlx4_cmd_mailbox *mailbox)
{ … }
int mlx4_config_mad_demux(struct mlx4_dev *dev)
{ … }
enum mlx4_access_reg_masks { … };
struct mlx4_access_reg { … } __attribute__((packed));
static int mlx4_ACCESS_REG(struct mlx4_dev *dev, u16 reg_id,
enum mlx4_access_reg_method method,
u16 reg_len, void *reg_data)
{ … }
enum mlx4_reg_id { … };
int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev,
enum mlx4_access_reg_method method,
struct mlx4_ptys_reg *ptys_reg)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_ACCESS_REG_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd)
{ … }
static int mlx4_SET_PORT_phv_bit(struct mlx4_dev *dev, u8 port, u8 phv_bit)
{ … }
int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv)
{ … }
EXPORT_SYMBOL(…);
int set_phv_bit(struct mlx4_dev *dev, u8 port, int new_val)
{ … }
EXPORT_SYMBOL(…);
int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port,
bool *vlan_offload_disabled)
{ … }
EXPORT_SYMBOL(…);
void mlx4_replace_zero_macs(struct mlx4_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);