linux/drivers/net/ethernet/mellanox/mlx4/fw.c

/*
 * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
 * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved.
 * Copyright (c) 2005, 2006, 2007 Cisco Systems, Inc.  All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#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)
{}

/* for IB-type ports only in SRIOV mode. Checks that both proxy QP0
 * and real QP0 are active, so that the paravirtualized QP0 is ready
 * to operate */
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)
{}

/* Conversion between the HW values and the actual functionality.
 * The value represented by the array index,
 * and the functionality determined by the flags.
 */
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)
{}

/* Access Reg commands */
enum mlx4_access_reg_masks {};

struct mlx4_access_reg {} __attribute__((packed));

/**
 * mlx4_ACCESS_REG - Generic access reg command.
 * @dev: mlx4_dev.
 * @reg_id: register ID to access.
 * @method: Access method Read/Write.
 * @reg_len: register length to Read/Write in bytes.
 * @reg_data: reg_data pointer to Read/Write From/To.
 *
 * Access ConnectX registers FW command.
 * Returns 0 on success and copies outbox mlx4_access_reg data
 * field into reg_data or a negative error code.
 */
static int mlx4_ACCESS_REG(struct mlx4_dev *dev, u16 reg_id,
			   enum mlx4_access_reg_method method,
			   u16 reg_len, void *reg_data)
{}

/* ConnectX registers IDs */
enum mlx4_reg_id {};

/**
 * mlx4_ACCESS_PTYS_REG - Access PTYs (Port Type and Speed)
 * register
 * @dev: mlx4_dev.
 * @method: Access method Read/Write.
 * @ptys_reg: PTYS register data pointer.
 *
 * Access ConnectX PTYS register, to Read/Write Port Type/Speed
 * configuration
 * Returns 0 on success or a negative error code.
 */
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();