#define pr_fmt(fmt) …
#include "fman_tgec.h"
#include "fman.h"
#include "mac.h"
#include <linux/slab.h>
#include <linux/bitrev.h>
#include <linux/io.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
#define TGEC_TX_IPG_LENGTH_MASK …
#define CMD_CFG_EN_TIMESTAMP …
#define CMD_CFG_NO_LEN_CHK …
#define CMD_CFG_PAUSE_IGNORE …
#define CMF_CFG_CRC_FWD …
#define CMD_CFG_PROMIS_EN …
#define CMD_CFG_RX_EN …
#define CMD_CFG_TX_EN …
#define TGEC_IMASK_MDIO_SCAN_EVENT …
#define TGEC_IMASK_MDIO_CMD_CMPL …
#define TGEC_IMASK_REM_FAULT …
#define TGEC_IMASK_LOC_FAULT …
#define TGEC_IMASK_TX_ECC_ER …
#define TGEC_IMASK_TX_FIFO_UNFL …
#define TGEC_IMASK_TX_FIFO_OVFL …
#define TGEC_IMASK_TX_ER …
#define TGEC_IMASK_RX_FIFO_OVFL …
#define TGEC_IMASK_RX_ECC_ER …
#define TGEC_IMASK_RX_JAB_FRM …
#define TGEC_IMASK_RX_OVRSZ_FRM …
#define TGEC_IMASK_RX_RUNT_FRM …
#define TGEC_IMASK_RX_FRAG_FRM …
#define TGEC_IMASK_RX_LEN_ER …
#define TGEC_IMASK_RX_CRC_ER …
#define TGEC_IMASK_RX_ALIGN_ER …
#define TGEC_HASH_MCAST_SHIFT …
#define TGEC_HASH_MCAST_EN …
#define TGEC_HASH_ADR_MSK …
#define DEFAULT_TX_IPG_LENGTH …
#define DEFAULT_MAX_FRAME_LENGTH …
#define DEFAULT_PAUSE_QUANT …
#define TGEC_NUM_OF_PADDRS …
#define GROUP_ADDRESS …
#define TGEC_HASH_TABLE_SIZE …
struct tgec_regs { … };
struct tgec_cfg { … };
struct fman_mac { … };
static void set_mac_address(struct tgec_regs __iomem *regs, const u8 *adr)
{ … }
static void set_dflts(struct tgec_cfg *cfg)
{ … }
static int init(struct tgec_regs __iomem *regs, struct tgec_cfg *cfg,
u32 exception_mask)
{ … }
static int check_init_parameters(struct fman_mac *tgec)
{ … }
static int get_exception_flag(enum fman_mac_exceptions exception)
{ … }
static void tgec_err_exception(void *handle)
{ … }
static void free_init_resources(struct fman_mac *tgec)
{ … }
static int tgec_enable(struct fman_mac *tgec)
{ … }
static void tgec_disable(struct fman_mac *tgec)
{ … }
static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val)
{ … }
static int tgec_set_tx_pause_frames(struct fman_mac *tgec,
u8 __maybe_unused priority, u16 pause_time,
u16 __maybe_unused thresh_time)
{ … }
static int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en)
{ … }
static void tgec_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void tgec_link_up(struct phylink_config *config, struct phy_device *phy,
unsigned int mode, phy_interface_t interface,
int speed, int duplex, bool tx_pause, bool rx_pause)
{ … }
static void tgec_link_down(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{ … }
static const struct phylink_mac_ops tgec_mac_ops = …;
static int tgec_modify_mac_address(struct fman_mac *tgec,
const enet_addr_t *p_enet_addr)
{ … }
static int tgec_add_hash_mac_address(struct fman_mac *tgec,
enet_addr_t *eth_addr)
{ … }
static int tgec_set_allmulti(struct fman_mac *tgec, bool enable)
{ … }
static int tgec_set_tstamp(struct fman_mac *tgec, bool enable)
{ … }
static int tgec_del_hash_mac_address(struct fman_mac *tgec,
enet_addr_t *eth_addr)
{ … }
static int tgec_set_exception(struct fman_mac *tgec,
enum fman_mac_exceptions exception, bool enable)
{ … }
static int tgec_init(struct fman_mac *tgec)
{ … }
static int tgec_free(struct fman_mac *tgec)
{ … }
static struct fman_mac *tgec_config(struct mac_device *mac_dev,
struct fman_mac_params *params)
{ … }
int tgec_initialization(struct mac_device *mac_dev,
struct device_node *mac_node,
struct fman_mac_params *params)
{ … }