#define pr_fmt(fmt) …
#include "fman_dtsec.h"
#include "fman.h"
#include "mac.h"
#include <linux/slab.h>
#include <linux/bitrev.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/phy.h>
#include <linux/crc32.h>
#include <linux/of_mdio.h>
#include <linux/mii.h>
#include <linux/netdevice.h>
#define MII_TBICON …
#define TBICON_SOFT_RESET …
#define TBICON_DISABLE_RX_DIS …
#define TBICON_DISABLE_TX_DIS …
#define TBICON_AN_SENSE …
#define TBICON_CLK_SELECT …
#define TBICON_MI_MODE …
#define DTSEC_IMASK_BREN …
#define DTSEC_IMASK_RXCEN …
#define DTSEC_IMASK_MSROEN …
#define DTSEC_IMASK_GTSCEN …
#define DTSEC_IMASK_BTEN …
#define DTSEC_IMASK_TXCEN …
#define DTSEC_IMASK_TXEEN …
#define DTSEC_IMASK_LCEN …
#define DTSEC_IMASK_CRLEN …
#define DTSEC_IMASK_XFUNEN …
#define DTSEC_IMASK_ABRTEN …
#define DTSEC_IMASK_IFERREN …
#define DTSEC_IMASK_MAGEN …
#define DTSEC_IMASK_MMRDEN …
#define DTSEC_IMASK_MMWREN …
#define DTSEC_IMASK_GRSCEN …
#define DTSEC_IMASK_TDPEEN …
#define DTSEC_IMASK_RDPEEN …
#define DTSEC_EVENTS_MASK …
#define TMR_PEMASK_TSREEN …
#define TMR_PEVENT_TSRE …
#define MAC_GROUP_ADDRESS …
#define DEFAULT_HALFDUP_RETRANSMIT …
#define DEFAULT_HALFDUP_COLL_WINDOW …
#define DEFAULT_TX_PAUSE_TIME …
#define DEFAULT_RX_PREPEND …
#define DEFAULT_PREAMBLE_LEN …
#define DEFAULT_TX_PAUSE_TIME_EXTD …
#define DEFAULT_NON_BACK_TO_BACK_IPG1 …
#define DEFAULT_NON_BACK_TO_BACK_IPG2 …
#define DEFAULT_MIN_IFG_ENFORCEMENT …
#define DEFAULT_BACK_TO_BACK_IPG …
#define DEFAULT_MAXIMUM_FRAME …
#define DTSEC_ID2_INT_REDUCED_OFF …
#define DTSEC_ECNTRL_GMIIM …
#define DTSEC_ECNTRL_TBIM …
#define DTSEC_ECNTRL_RPM …
#define DTSEC_ECNTRL_R100M …
#define DTSEC_ECNTRL_RMM …
#define DTSEC_ECNTRL_SGMIIM …
#define DTSEC_ECNTRL_QSGMIIM …
#define TCTRL_TTSE …
#define TCTRL_GTS …
#define RCTRL_PAL_MASK …
#define RCTRL_PAL_SHIFT …
#define RCTRL_GHTX …
#define RCTRL_RTSE …
#define RCTRL_GRS …
#define RCTRL_MPROM …
#define RCTRL_RSF …
#define RCTRL_UPROM …
#define MACCFG1_SOFT_RESET …
#define MACCFG1_RX_FLOW …
#define MACCFG1_TX_FLOW …
#define MACCFG1_TX_EN …
#define MACCFG1_RX_EN …
#define MACCFG2_NIBBLE_MODE …
#define MACCFG2_BYTE_MODE …
#define MACCFG2_PAD_CRC_EN …
#define MACCFG2_FULL_DUPLEX …
#define MACCFG2_PREAMBLE_LENGTH_MASK …
#define MACCFG2_PREAMBLE_LENGTH_SHIFT …
#define IPGIFG_NON_BACK_TO_BACK_IPG_1_SHIFT …
#define IPGIFG_NON_BACK_TO_BACK_IPG_2_SHIFT …
#define IPGIFG_MIN_IFG_ENFORCEMENT_SHIFT …
#define IPGIFG_NON_BACK_TO_BACK_IPG_1 …
#define IPGIFG_NON_BACK_TO_BACK_IPG_2 …
#define IPGIFG_MIN_IFG_ENFORCEMENT …
#define IPGIFG_BACK_TO_BACK_IPG …
#define HAFDUP_EXCESS_DEFER …
#define HAFDUP_COLLISION_WINDOW …
#define HAFDUP_RETRANSMISSION_MAX_SHIFT …
#define HAFDUP_RETRANSMISSION_MAX …
#define NUM_OF_HASH_REGS …
#define PTV_PTE_MASK …
#define PTV_PT_MASK …
#define PTV_PTE_SHIFT …
#define MAX_PACKET_ALIGNMENT …
#define MAX_INTER_PACKET_GAP …
#define MAX_RETRANSMISSION …
#define MAX_COLLISION_WINDOW …
#define DTSEC_HASH_TABLE_SIZE …
#define EXTENDED_HASH_TABLE_SIZE …
struct dtsec_regs { … };
struct dtsec_cfg { … };
struct fman_mac { … };
static void set_dflts(struct dtsec_cfg *cfg)
{ … }
static void set_mac_address(struct dtsec_regs __iomem *regs, const u8 *adr)
{ … }
static int init(struct dtsec_regs __iomem *regs, struct dtsec_cfg *cfg,
phy_interface_t iface, u16 iface_speed, u64 addr,
u32 exception_mask, u8 tbi_addr)
{ … }
static void set_bucket(struct dtsec_regs __iomem *regs, int bucket,
bool enable)
{ … }
static int check_init_parameters(struct fman_mac *dtsec)
{ … }
static int get_exception_flag(enum fman_mac_exceptions exception)
{ … }
static u16 dtsec_get_max_frame_length(struct fman_mac *dtsec)
{ … }
static void dtsec_isr(void *handle)
{ … }
static void dtsec_1588_isr(void *handle)
{ … }
static void free_init_resources(struct fman_mac *dtsec)
{ … }
static struct fman_mac *pcs_to_dtsec(struct phylink_pcs *pcs)
{ … }
static void dtsec_pcs_get_state(struct phylink_pcs *pcs,
struct phylink_link_state *state)
{ … }
static int dtsec_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
{ … }
static void dtsec_pcs_an_restart(struct phylink_pcs *pcs)
{ … }
static const struct phylink_pcs_ops dtsec_pcs_ops = …;
static void graceful_start(struct fman_mac *dtsec)
{ … }
static void graceful_stop(struct fman_mac *dtsec)
{ … }
static int dtsec_enable(struct fman_mac *dtsec)
{ … }
static void dtsec_disable(struct fman_mac *dtsec)
{ … }
static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,
u8 __maybe_unused priority,
u16 pause_time,
u16 __maybe_unused thresh_time)
{ … }
static int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en)
{ … }
static struct phylink_pcs *dtsec_select_pcs(struct phylink_config *config,
phy_interface_t iface)
{ … }
static void dtsec_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void dtsec_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 dtsec_link_down(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{ … }
static const struct phylink_mac_ops dtsec_mac_ops = …;
static int dtsec_modify_mac_address(struct fman_mac *dtsec,
const enet_addr_t *enet_addr)
{ … }
static int dtsec_add_hash_mac_address(struct fman_mac *dtsec,
enet_addr_t *eth_addr)
{ … }
static int dtsec_set_allmulti(struct fman_mac *dtsec, bool enable)
{ … }
static int dtsec_set_tstamp(struct fman_mac *dtsec, bool enable)
{ … }
static int dtsec_del_hash_mac_address(struct fman_mac *dtsec,
enet_addr_t *eth_addr)
{ … }
static int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val)
{ … }
static int dtsec_set_exception(struct fman_mac *dtsec,
enum fman_mac_exceptions exception, bool enable)
{ … }
static int dtsec_init(struct fman_mac *dtsec)
{ … }
static int dtsec_free(struct fman_mac *dtsec)
{ … }
static struct fman_mac *dtsec_config(struct mac_device *mac_dev,
struct fman_mac_params *params)
{ … }
int dtsec_initialization(struct mac_device *mac_dev,
struct device_node *mac_node,
struct fman_mac_params *params)
{ … }