linux/drivers/net/dsa/realtek/realtek.h

/* SPDX-License-Identifier: GPL-2.0+ */
/* Realtek SMI interface driver defines
 *
 * Copyright (C) 2017 Linus Walleij <[email protected]>
 * Copyright (C) 2009-2010 Gabor Juhos <[email protected]>
 */

#ifndef _REALTEK_H
#define _REALTEK_H

#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <net/dsa.h>
#include <linux/reset.h>

#define REALTEK_HW_STOP_DELAY
#define REALTEK_HW_START_DELAY

struct phylink_mac_ops;
struct realtek_ops;
struct dentry;
struct inode;
struct file;

struct rtl8366_mib_counter {};

/*
 * struct rtl8366_vlan_mc - Virtual LAN member configuration
 */
struct rtl8366_vlan_mc {};

struct rtl8366_vlan_4k {};

struct realtek_priv {};

/*
 * struct realtek_ops - vtable for the per-SMI-chiptype operations
 * @detect: detects the chiptype
 */
struct realtek_ops {};

struct realtek_variant {};

/* RTL8366 library helpers */
int rtl8366_mc_is_used(struct realtek_priv *priv, int mc_index, int *used);
int rtl8366_set_vlan(struct realtek_priv *priv, int vid, u32 member,
		     u32 untag, u32 fid);
int rtl8366_set_pvid(struct realtek_priv *priv, unsigned int port,
		     unsigned int vid);
int rtl8366_enable_vlan4k(struct realtek_priv *priv, bool enable);
int rtl8366_enable_vlan(struct realtek_priv *priv, bool enable);
int rtl8366_reset_vlan(struct realtek_priv *priv);
int rtl8366_vlan_add(struct dsa_switch *ds, int port,
		     const struct switchdev_obj_port_vlan *vlan,
		     struct netlink_ext_ack *extack);
int rtl8366_vlan_del(struct dsa_switch *ds, int port,
		     const struct switchdev_obj_port_vlan *vlan);
void rtl8366_get_strings(struct dsa_switch *ds, int port, u32 stringset,
			 uint8_t *data);
int rtl8366_get_sset_count(struct dsa_switch *ds, int port, int sset);
void rtl8366_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data);

extern const struct realtek_variant rtl8366rb_variant;
extern const struct realtek_variant rtl8365mb_variant;

#endif /*  _REALTEK_H */