#ifndef __BCM_SF2_H
#define __BCM_SF2_H
#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/types.h>
#include <linux/bitops.h>
#include <linux/if_vlan.h>
#include <linux/reset.h>
#include <net/dsa.h>
#include "bcm_sf2_regs.h"
#include "b53/b53_priv.h"
struct bcm_sf2_hw_params { … };
#define BCM_SF2_REGS_NAME …
#define BCM_SF2_REGS_NUM …
struct bcm_sf2_port_status { … };
struct bcm_sf2_cfp_priv { … };
struct bcm_sf2_priv { … };
static inline struct bcm_sf2_priv *bcm_sf2_to_priv(struct dsa_switch *ds)
{ … }
static inline u32 bcm_sf2_mangle_addr(struct bcm_sf2_priv *priv, u32 off)
{ … }
#define SF2_IO_MACRO(name) … \
#define SF2_IO64_MACRO(name) …
#define SWITCH_INTR_L2(which) … \
static inline u32 core_readl(struct bcm_sf2_priv *priv, u32 off)
{ … }
static inline void core_writel(struct bcm_sf2_priv *priv, u32 val, u32 off)
{ … }
static inline u32 reg_readl(struct bcm_sf2_priv *priv, u16 off)
{ … }
static inline void reg_writel(struct bcm_sf2_priv *priv, u32 val, u16 off)
{ … }
SF2_IO64_MACRO(core);
SF2_IO_MACRO(intrl2_0);
SF2_IO_MACRO(intrl2_1);
SF2_IO_MACRO(fcb);
SF2_IO_MACRO(acb);
SWITCH_INTR_L2(0);
SWITCH_INTR_L2(1);
static inline u32 reg_led_readl(struct bcm_sf2_priv *priv, u16 off, u16 reg)
{ … }
static inline void reg_led_writel(struct bcm_sf2_priv *priv, u32 val, u16 off, u16 reg)
{ … }
int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port,
struct ethtool_rxnfc *nfc, u32 *rule_locs);
int bcm_sf2_set_rxnfc(struct dsa_switch *ds, int port,
struct ethtool_rxnfc *nfc);
int bcm_sf2_cfp_rst(struct bcm_sf2_priv *priv);
void bcm_sf2_cfp_exit(struct dsa_switch *ds);
int bcm_sf2_cfp_resume(struct dsa_switch *ds);
void bcm_sf2_cfp_get_strings(struct dsa_switch *ds, int port,
u32 stringset, uint8_t *data);
void bcm_sf2_cfp_get_ethtool_stats(struct dsa_switch *ds, int port,
uint64_t *data);
int bcm_sf2_cfp_get_sset_count(struct dsa_switch *ds, int port, int sset);
#endif