linux/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2014-2015 Hisilicon Limited.
 */

#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_mdio.h>
#include <linux/phy.h>
#include <linux/platform_device.h>

#include "hns_dsaf_main.h"
#include "hns_dsaf_misc.h"
#include "hns_dsaf_rcb.h"

#define MAC_EN_FLAG_V

static const u16 mac_phy_to_speed[] =;

static const enum mac_mode g_mac_mode_100[] =;

static const enum mac_mode g_mac_mode_1000[] =;

static enum mac_mode hns_get_enet_interface(const struct hns_mac_cb *mac_cb)
{}

static u32 hns_mac_link_anti_shake(struct mac_driver *mac_ctrl_drv)
{}

void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status)
{}

int hns_mac_get_port_info(struct hns_mac_cb *mac_cb,
			  u8 *auto_neg, u16 *speed, u8 *duplex)
{}

/**
 *hns_mac_need_adjust_link - check is need change mac speed and duplex register
 *@mac_cb: mac device
 *@speed: phy device speed
 *@duplex:phy device duplex
 *
 */
bool hns_mac_need_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex)
{}

void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex)
{}

/**
 *hns_mac_get_inner_port_num - get mac table inner port number
 *@mac_cb: mac device
 *@vmid: vm id
 *@port_num:port number
 *
 */
int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb, u8 vmid, u8 *port_num)
{}

/**
 *hns_mac_change_vf_addr - change vf mac address
 *@mac_cb: mac device
 *@vmid: vmid
 *@addr:mac address
 */
int hns_mac_change_vf_addr(struct hns_mac_cb *mac_cb,
			   u32 vmid, const char *addr)
{}

int hns_mac_add_uc_addr(struct hns_mac_cb *mac_cb, u8 vf_id,
			const unsigned char *addr)
{}

int hns_mac_rm_uc_addr(struct hns_mac_cb *mac_cb, u8 vf_id,
		       const unsigned char *addr)
{}

int hns_mac_set_multi(struct hns_mac_cb *mac_cb,
		      u32 port_num, char *addr, bool enable)
{}

int hns_mac_clr_multicast(struct hns_mac_cb *mac_cb, int vfn)
{}

static void hns_mac_param_get(struct mac_params *param,
			      struct hns_mac_cb *mac_cb)
{}

/**
 * hns_mac_port_config_bc_en - set broadcast rx&tx enable
 * @mac_cb: mac device
 * @port_num: queue number
 * @vlan_id: vlan id`
 * @enable: enable
 * return 0 - success , negative --fail
 */
static int hns_mac_port_config_bc_en(struct hns_mac_cb *mac_cb,
				     u32 port_num, u16 vlan_id, bool enable)
{}

/**
 * hns_mac_vm_config_bc_en - set broadcast rx&tx enable
 * @mac_cb: mac device
 * @vmid: vm id
 * @enable: enable
 * return 0 - success , negative --fail
 */
int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vmid, bool enable)
{}

int hns_mac_wait_fifo_clean(struct hns_mac_cb *mac_cb)
{}

void hns_mac_reset(struct hns_mac_cb *mac_cb)
{}

int hns_mac_set_mtu(struct hns_mac_cb *mac_cb, u32 new_mtu, u32 buf_size)
{}

void hns_mac_start(struct hns_mac_cb *mac_cb)
{}

void hns_mac_stop(struct hns_mac_cb *mac_cb)
{}

/**
 * hns_mac_get_autoneg - get auto autonegotiation
 * @mac_cb: mac control block
 * @auto_neg: output pointer to autoneg result
 * return 0 - success , negative --fail
 */
void hns_mac_get_autoneg(struct hns_mac_cb *mac_cb, u32 *auto_neg)
{}

/**
 * hns_mac_get_pauseparam - set rx & tx pause parameter
 * @mac_cb: mac control block
 * @rx_en: rx enable status
 * @tx_en: tx enable status
 * return 0 - success , negative --fail
 */
void hns_mac_get_pauseparam(struct hns_mac_cb *mac_cb, u32 *rx_en, u32 *tx_en)
{}

/**
 * hns_mac_set_autoneg - set auto autonegotiation
 * @mac_cb: mac control block
 * @enable: enable or not
 * return 0 - success , negative --fail
 */
int hns_mac_set_autoneg(struct hns_mac_cb *mac_cb, u8 enable)
{}

/**
 * hns_mac_set_pauseparam - set rx & tx pause parameter
 * @mac_cb: mac control block
 * @rx_en: rx enable or not
 * @tx_en: tx enable or not
 * return 0 - success , negative --fail
 */
int hns_mac_set_pauseparam(struct hns_mac_cb *mac_cb, u32 rx_en, u32 tx_en)
{}

/**
 * hns_mac_init_ex - mac init
 * @mac_cb: mac control block
 * return 0 - success , negative --fail
 */
static int hns_mac_init_ex(struct hns_mac_cb *mac_cb)
{}

static int
hns_mac_phy_parse_addr(struct device *dev, struct fwnode_handle *fwnode)
{}

static int
hns_mac_register_phydev(struct mii_bus *mdio, struct hns_mac_cb *mac_cb,
			u32 addr)
{}

static int hns_mac_register_phy(struct hns_mac_cb *mac_cb)
{}

static void hns_mac_remove_phydev(struct hns_mac_cb *mac_cb)
{}

#define MAC_MEDIA_TYPE_MAX_LEN

static const struct {} media_type_defs[] =;

/**
 *hns_mac_get_info  - get mac information from device node
 *@mac_cb: mac device
 * return: 0 --success, negative --fail
 */
static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
{}

/**
 * hns_mac_get_mode - get mac mode
 * @phy_if: phy interface
 * return 0 - gmac, 1 - xgmac , negative --fail
 */
static int hns_mac_get_mode(phy_interface_t phy_if)
{}

static u8 __iomem *
hns_mac_get_vaddr(struct dsaf_device *dsaf_dev,
		  struct hns_mac_cb *mac_cb, u32 mac_mode_idx)
{}

/**
 * hns_mac_get_cfg - get mac cfg from dtb or acpi table
 * @dsaf_dev: dsa fabric device struct pointer
 * @mac_cb: mac control block
 * return 0 - success , negative --fail
 */
static int
hns_mac_get_cfg(struct dsaf_device *dsaf_dev, struct hns_mac_cb *mac_cb)
{}

static int hns_mac_get_max_port_num(struct dsaf_device *dsaf_dev)
{}

void hns_mac_enable(struct hns_mac_cb *mac_cb, enum mac_commom_mode mode)
{}

void hns_mac_disable(struct hns_mac_cb *mac_cb, enum mac_commom_mode mode)
{}

/**
 * hns_mac_init - init mac
 * @dsaf_dev: dsa fabric device struct pointer
 * return 0 - success , negative --fail
 */
int hns_mac_init(struct dsaf_device *dsaf_dev)
{}

void hns_mac_uninit(struct dsaf_device *dsaf_dev)
{}

int hns_mac_config_mac_loopback(struct hns_mac_cb *mac_cb,
				enum hnae_loop loop, int en)
{}

void hns_mac_update_stats(struct hns_mac_cb *mac_cb)
{}

void hns_mac_get_stats(struct hns_mac_cb *mac_cb, u64 *data)
{}

void hns_mac_get_strings(struct hns_mac_cb *mac_cb,
			 int stringset, u8 *data)
{}

int hns_mac_get_sset_count(struct hns_mac_cb *mac_cb, int stringset)
{}

void hns_mac_set_promisc(struct hns_mac_cb *mac_cb, u8 en)
{}

int hns_mac_get_regs_count(struct hns_mac_cb *mac_cb)
{}

void hns_mac_get_regs(struct hns_mac_cb *mac_cb, void *data)
{}

void hns_set_led_opt(struct hns_mac_cb *mac_cb)
{}

int hns_cpld_led_set_id(struct hns_mac_cb *mac_cb,
			enum hnae_led_state status)
{}