#include <linux/fsl/enetc_mdio.h>
#include <soc/mscc/ocelot_qsys.h>
#include <soc/mscc/ocelot_vcap.h>
#include <soc/mscc/ocelot_ana.h>
#include <soc/mscc/ocelot_dev.h>
#include <soc/mscc/ocelot_ptp.h>
#include <soc/mscc/ocelot_sys.h>
#include <net/tc_act/tc_gate.h>
#include <soc/mscc/ocelot.h>
#include <linux/dsa/ocelot.h>
#include <linux/pcs-lynx.h>
#include <net/pkt_sched.h>
#include <linux/iopoll.h>
#include <linux/mdio.h>
#include <linux/of.h>
#include <linux/pci.h>
#include <linux/time.h>
#include "felix.h"
#define VSC9959_NUM_PORTS …
#define VSC9959_TAS_GCL_ENTRY_MAX …
#define VSC9959_TAS_MIN_GATE_LEN_NS …
#define VSC9959_VCAP_POLICER_BASE …
#define VSC9959_VCAP_POLICER_MAX …
#define VSC9959_SWITCH_PCI_BAR …
#define VSC9959_IMDIO_PCI_BAR …
#define VSC9959_PORT_MODE_SERDES …
static const u32 vsc9959_port_modes[VSC9959_NUM_PORTS] = …;
static const u32 vsc9959_ana_regmap[] = …;
static const u32 vsc9959_qs_regmap[] = …;
static const u32 vsc9959_vcap_regmap[] = …;
static const u32 vsc9959_qsys_regmap[] = …;
static const u32 vsc9959_rew_regmap[] = …;
static const u32 vsc9959_sys_regmap[] = …;
static const u32 vsc9959_ptp_regmap[] = …;
static const u32 vsc9959_gcb_regmap[] = …;
static const u32 vsc9959_dev_gmii_regmap[] = …;
static const u32 *vsc9959_regmap[TARGET_MAX] = …;
static const struct resource vsc9959_resources[] = …;
static const char * const vsc9959_resource_names[TARGET_MAX] = …;
static const struct resource vsc9959_imdio_res = …;
static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = …;
static const struct vcap_field vsc9959_vcap_es0_keys[] = …;
static const struct vcap_field vsc9959_vcap_es0_actions[] = …;
static const struct vcap_field vsc9959_vcap_is1_keys[] = …;
static const struct vcap_field vsc9959_vcap_is1_actions[] = …;
static struct vcap_field vsc9959_vcap_is2_keys[] = …;
static struct vcap_field vsc9959_vcap_is2_actions[] = …;
static struct vcap_props vsc9959_vcap_props[] = …;
static const struct ptp_clock_info vsc9959_ptp_caps = …;
#define VSC9959_INIT_TIMEOUT …
#define VSC9959_GCB_RST_SLEEP …
#define VSC9959_SYS_RAMINIT_SLEEP …
static int vsc9959_gcb_soft_rst_status(struct ocelot *ocelot)
{ … }
static int vsc9959_sys_ram_init_status(struct ocelot *ocelot)
{ … }
static int vsc9959_reset(struct ocelot *ocelot)
{ … }
static u16 vsc9959_wm_enc(u16 value)
{ … }
static u16 vsc9959_wm_dec(u16 wm)
{ … }
static void vsc9959_wm_stat(u32 val, u32 *inuse, u32 *maxuse)
{ … }
static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
{ … }
static void vsc9959_mdio_bus_free(struct ocelot *ocelot)
{ … }
static u64 vsc9959_tas_remaining_gate_len_ps(u64 gate_len_ns)
{ … }
static void vsc9959_tas_min_gate_lengths(struct tc_taprio_qopt_offload *taprio,
u64 min_gate_len[OCELOT_NUM_TC])
{ … }
static void vsc9959_port_qmaxsdu_set(struct ocelot *ocelot, int port, int tc,
u32 max_sdu)
{ … }
static u32 vsc9959_port_qmaxsdu_get(struct ocelot *ocelot, int port, int tc)
{ … }
static u32 vsc9959_tas_tc_max_sdu(struct tc_taprio_qopt_offload *taprio, int tc)
{ … }
static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)
{ … }
static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
u32 speed)
{ … }
static void vsc9959_new_base_time(struct ocelot *ocelot, ktime_t base_time,
u64 cycle_time,
struct timespec64 *new_base_ts)
{ … }
static u32 vsc9959_tas_read_cfg_status(struct ocelot *ocelot)
{ … }
static void vsc9959_tas_gcl_set(struct ocelot *ocelot, const u32 gcl_ix,
struct tc_taprio_sched_entry *entry)
{ … }
static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
struct tc_taprio_qopt_offload *taprio)
{ … }
static void vsc9959_tas_clock_adjust(struct ocelot *ocelot)
{ … }
static int vsc9959_qos_port_cbs_set(struct dsa_switch *ds, int port,
struct tc_cbs_qopt_offload *cbs_qopt)
{ … }
static int vsc9959_qos_query_caps(struct tc_query_caps_base *base)
{ … }
static int vsc9959_qos_port_mqprio(struct ocelot *ocelot, int port,
struct tc_mqprio_qopt_offload *mqprio)
{ … }
static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
enum tc_setup_type type,
void *type_data)
{ … }
#define VSC9959_PSFP_SFID_MAX …
#define VSC9959_PSFP_GATE_ID_MAX …
#define VSC9959_PSFP_POLICER_BASE …
#define VSC9959_PSFP_POLICER_MAX …
#define VSC9959_PSFP_GATE_LIST_NUM …
#define VSC9959_PSFP_GATE_CYCLETIME_MIN …
struct felix_stream { … };
struct felix_stream_filter_counters { … };
struct felix_stream_filter { … };
struct felix_stream_gate { … };
struct felix_stream_gate_entry { … };
static int vsc9959_stream_identify(struct flow_cls_offload *f,
struct felix_stream *stream)
{ … }
static int vsc9959_mact_stream_set(struct ocelot *ocelot,
struct felix_stream *stream,
struct netlink_ext_ack *extack)
{ … }
static struct felix_stream *
vsc9959_stream_table_lookup(struct list_head *stream_list,
struct felix_stream *stream)
{ … }
static int vsc9959_stream_table_add(struct ocelot *ocelot,
struct list_head *stream_list,
struct felix_stream *stream,
struct netlink_ext_ack *extack)
{ … }
static struct felix_stream *
vsc9959_stream_table_get(struct list_head *stream_list, unsigned long id)
{ … }
static void vsc9959_stream_table_del(struct ocelot *ocelot,
struct felix_stream *stream)
{ … }
static u32 vsc9959_sfi_access_status(struct ocelot *ocelot)
{ … }
static int vsc9959_psfp_sfi_set(struct ocelot *ocelot,
struct felix_stream_filter *sfi)
{ … }
static int vsc9959_psfp_sfidmask_set(struct ocelot *ocelot, u32 sfid, int ports)
{ … }
static int vsc9959_psfp_sfi_list_add(struct ocelot *ocelot,
struct felix_stream_filter *sfi,
struct list_head *pos)
{ … }
static int vsc9959_psfp_sfi_table_add(struct ocelot *ocelot,
struct felix_stream_filter *sfi)
{ … }
static int vsc9959_psfp_sfi_table_add2(struct ocelot *ocelot,
struct felix_stream_filter *sfi,
struct felix_stream_filter *sfi2)
{ … }
static struct felix_stream_filter *
vsc9959_psfp_sfi_table_get(struct list_head *sfi_list, u32 index)
{ … }
static void vsc9959_psfp_sfi_table_del(struct ocelot *ocelot, u32 index)
{ … }
static void vsc9959_psfp_parse_gate(const struct flow_action_entry *entry,
struct felix_stream_gate *sgi)
{ … }
static u32 vsc9959_sgi_cfg_status(struct ocelot *ocelot)
{ … }
static int vsc9959_psfp_sgi_set(struct ocelot *ocelot,
struct felix_stream_gate *sgi)
{ … }
static int vsc9959_psfp_sgi_table_add(struct ocelot *ocelot,
struct felix_stream_gate *sgi)
{ … }
static void vsc9959_psfp_sgi_table_del(struct ocelot *ocelot,
u32 index)
{ … }
static int vsc9959_psfp_filter_add(struct ocelot *ocelot, int port,
struct flow_cls_offload *f)
{ … }
static int vsc9959_psfp_filter_del(struct ocelot *ocelot,
struct flow_cls_offload *f)
{ … }
static void vsc9959_update_sfid_stats(struct ocelot *ocelot,
struct felix_stream_filter *sfi)
{ … }
static void vsc9959_update_stats(struct ocelot *ocelot)
{ … }
static int vsc9959_psfp_stats_get(struct ocelot *ocelot,
struct flow_cls_offload *f,
struct flow_stats *stats)
{ … }
static void vsc9959_psfp_init(struct ocelot *ocelot)
{ … }
static void vsc9959_cut_through_fwd(struct ocelot *ocelot)
{ … }
static irqreturn_t vsc9959_irq_handler(int irq, void *data)
{ … }
static int vsc9959_request_irq(struct ocelot *ocelot)
{ … }
static const struct ocelot_ops vsc9959_ops = …;
static const struct felix_info felix_info_vsc9959 = …;
static int felix_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static void felix_pci_remove(struct pci_dev *pdev)
{ … }
static void felix_pci_shutdown(struct pci_dev *pdev)
{ … }
static struct pci_device_id felix_ids[] = …;
MODULE_DEVICE_TABLE(pci, felix_ids);
static struct pci_driver felix_vsc9959_pci_driver = …;
module_pci_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;