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

/*
 * Copyright (c) 2007 Mellanox Technologies. 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/errno.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/export.h>

#include <linux/mlx4/cmd.h>

#include "mlx4.h"
#include "mlx4_stats.h"

#define MLX4_MAC_VALID

#define MLX4_VLAN_VALID
#define MLX4_VLAN_MASK

#define MLX4_STATS_TRAFFIC_COUNTERS_MASK
#define MLX4_STATS_TRAFFIC_DROPS_MASK
#define MLX4_STATS_ERROR_COUNTERS_MASK
#define MLX4_STATS_PORT_COUNTERS_MASK

#define MLX4_FLAG2_V_IGNORE_FCS_MASK
#define MLX4_FLAG2_V_USER_MTU_MASK
#define MLX4_FLAG2_V_USER_MAC_MASK
#define MLX4_FLAG_V_MTU_MASK
#define MLX4_FLAG_V_PPRX_MASK
#define MLX4_FLAG_V_PPTX_MASK
#define MLX4_IGNORE_FCS_MASK
#define MLX4_TC_MAX_NUMBER

void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table)
{}

void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table)
{}

void mlx4_init_roce_gid_table(struct mlx4_dev *dev,
			      struct mlx4_roce_gid_table *table)
{}

static int validate_index(struct mlx4_dev *dev,
			  struct mlx4_mac_table *table, int index)
{}

static int find_index(struct mlx4_dev *dev,
		      struct mlx4_mac_table *table, u64 mac)
{}

static int mlx4_set_port_mac_table(struct mlx4_dev *dev, u8 port,
				   __be64 *entries)
{}

int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx)
{}
EXPORT_SYMBOL_GPL();

static bool mlx4_need_mf_bond(struct mlx4_dev *dev)
{}

int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac)
{}
EXPORT_SYMBOL_GPL();

int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac)
{}
EXPORT_SYMBOL_GPL();

int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port)
{}
EXPORT_SYMBOL_GPL();

void __mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
{}
EXPORT_SYMBOL_GPL();

void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
{}
EXPORT_SYMBOL_GPL();

int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac)
{}
EXPORT_SYMBOL_GPL();

static int mlx4_set_port_vlan_table(struct mlx4_dev *dev, u8 port,
				    __be32 *entries)
{}

int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx)
{}
EXPORT_SYMBOL_GPL();

int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan,
				int *index)
{}

int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
{}
EXPORT_SYMBOL_GPL();

void __mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan)
{}

void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan)
{}
EXPORT_SYMBOL_GPL();

int mlx4_bond_mac_table(struct mlx4_dev *dev)
{}

int mlx4_unbond_mac_table(struct mlx4_dev *dev)
{}

int mlx4_bond_vlan_table(struct mlx4_dev *dev)
{}

int mlx4_unbond_vlan_table(struct mlx4_dev *dev)
{}

int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps)
{}
static struct mlx4_roce_gid_entry zgid_entry;

int mlx4_get_slave_num_gids(struct mlx4_dev *dev, int slave, int port)
{}

int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port)
{}
EXPORT_SYMBOL_GPL();

static int mlx4_reset_roce_port_gids(struct mlx4_dev *dev, int slave,
				     int port, struct mlx4_cmd_mailbox *mailbox)
{}


void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave)
{}

static void
mlx4_en_set_port_mtu(struct mlx4_dev *dev, int slave, int port,
		     struct mlx4_set_port_general_context *gen_context)
{}

static void
mlx4_en_set_port_user_mtu(struct mlx4_dev *dev, int slave, int port,
			  struct mlx4_set_port_general_context *gen_context)
{}

static void
mlx4_en_set_port_global_pause(struct mlx4_dev *dev, int slave,
			      struct mlx4_set_port_general_context *gen_context)
{}

static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
				u8 op_mod, struct mlx4_cmd_mailbox *inbox)
{}

int mlx4_SET_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)
{}

/* bit locations for set port command with zero op modifier */
enum {};

int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
{}

#define SET_PORT_ROCE_2_FLAGS
#define MLX4_SET_PORT_ROCE_V1_V2
int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
			  u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx)
{}
EXPORT_SYMBOL();

int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
			   u8 promisc)
{}
EXPORT_SYMBOL();

int mlx4_SET_PORT_user_mtu(struct mlx4_dev *dev, u8 port, u16 user_mtu)
{}
EXPORT_SYMBOL();

int mlx4_SET_PORT_user_mac(struct mlx4_dev *dev, u8 port, u8 *user_mac)
{}
EXPORT_SYMBOL();

int mlx4_SET_PORT_fcs_check(struct mlx4_dev *dev, u8 port, u8 ignore_fcs_value)
{}
EXPORT_SYMBOL();

enum {};

struct mlx4_set_port_vxlan_context {};

int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable)
{}
EXPORT_SYMBOL();

int mlx4_SET_PORT_BEACON(struct mlx4_dev *dev, u8 port, u16 time)
{}
EXPORT_SYMBOL();

int mlx4_SET_MCAST_FLTR_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_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port,
			u64 mac, u64 clear, u8 mode)
{}
EXPORT_SYMBOL();

int mlx4_SET_VLAN_FLTR_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_DUMP_ETH_STATS_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_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid,
				 int *slave_id)
{}
EXPORT_SYMBOL();

int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id,
				 u8 *gid)
{}
EXPORT_SYMBOL();

/* Cable Module Info */
#define MODULE_INFO_MAX_READ

#define I2C_ADDR_LOW
#define I2C_ADDR_HIGH
#define I2C_PAGE_SIZE
#define I2C_HIGH_PAGE_SIZE

/* Module Info Data */
struct mlx4_cable_info {};

enum cable_info_err {};

#define MAD_STATUS_2_CABLE_ERR(mad_status)

static inline const char *cable_info_mad_err_str(u16 mad_status)
{}

static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id)
{}

static void mlx4_sfp_eeprom_params_set(u8 *i2c_addr, u8 *page_num, u16 *offset)
{}

static void mlx4_qsfp_eeprom_params_set(u8 *i2c_addr, u8 *page_num, u16 *offset)
{}

/**
 * mlx4_get_module_info - Read cable module eeprom data
 * @dev: mlx4_dev.
 * @port: port number.
 * @offset: byte offset in eeprom to start reading data from.
 * @size: num of bytes to read.
 * @data: output buffer to put the requested data into.
 *
 * Reads cable module eeprom data, puts the outcome data into
 * data pointer parameter.
 * Returns num of read bytes on success or a negative error
 * code.
 */
int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
			 u16 offset, u16 size, u8 *data)
{}
EXPORT_SYMBOL();

int mlx4_max_tc(struct mlx4_dev *dev)
{}
EXPORT_SYMBOL();