Commit f5f11907 authored by Luiz Angelo Daros de Luca's avatar Luiz Angelo Daros de Luca Committed by David S. Miller

net: dsa: realtek: rename realtek_smi to realtek_priv

In preparation to adding other interfaces, the private data structure
was renamed to priv. Also, realtek_smi_variant and realtek_smi_ops
were renamed to realtek_variant and realtek_ops as those structs are
not SMI specific.
Signed-off-by: default avatarLuiz Angelo Daros de Luca <luizluca@gmail.com>
Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 319a70a5
This diff is collapsed.
......@@ -13,7 +13,7 @@
#include <linux/gpio/consumer.h>
#include <net/dsa.h>
struct realtek_smi_ops;
struct realtek_ops;
struct dentry;
struct inode;
struct file;
......@@ -43,7 +43,7 @@ struct rtl8366_vlan_4k {
u8 fid;
};
struct realtek_smi {
struct realtek_priv {
struct device *dev;
struct gpio_desc *reset;
struct gpio_desc *mdc;
......@@ -65,7 +65,7 @@ struct realtek_smi {
unsigned int num_mib_counters;
struct rtl8366_mib_counter *mib_counters;
const struct realtek_smi_ops *ops;
const struct realtek_ops *ops;
int vlan_enabled;
int vlan4k_enabled;
......@@ -75,40 +75,40 @@ struct realtek_smi {
};
/*
* struct realtek_smi_ops - vtable for the per-SMI-chiptype operations
* struct realtek_ops - vtable for the per-SMI-chiptype operations
* @detect: detects the chiptype
*/
struct realtek_smi_ops {
int (*detect)(struct realtek_smi *smi);
int (*reset_chip)(struct realtek_smi *smi);
int (*setup)(struct realtek_smi *smi);
void (*cleanup)(struct realtek_smi *smi);
int (*get_mib_counter)(struct realtek_smi *smi,
struct realtek_ops {
int (*detect)(struct realtek_priv *priv);
int (*reset_chip)(struct realtek_priv *priv);
int (*setup)(struct realtek_priv *priv);
void (*cleanup)(struct realtek_priv *priv);
int (*get_mib_counter)(struct realtek_priv *priv,
int port,
struct rtl8366_mib_counter *mib,
u64 *mibvalue);
int (*get_vlan_mc)(struct realtek_smi *smi, u32 index,
int (*get_vlan_mc)(struct realtek_priv *priv, u32 index,
struct rtl8366_vlan_mc *vlanmc);
int (*set_vlan_mc)(struct realtek_smi *smi, u32 index,
int (*set_vlan_mc)(struct realtek_priv *priv, u32 index,
const struct rtl8366_vlan_mc *vlanmc);
int (*get_vlan_4k)(struct realtek_smi *smi, u32 vid,
int (*get_vlan_4k)(struct realtek_priv *priv, u32 vid,
struct rtl8366_vlan_4k *vlan4k);
int (*set_vlan_4k)(struct realtek_smi *smi,
int (*set_vlan_4k)(struct realtek_priv *priv,
const struct rtl8366_vlan_4k *vlan4k);
int (*get_mc_index)(struct realtek_smi *smi, int port, int *val);
int (*set_mc_index)(struct realtek_smi *smi, int port, int index);
bool (*is_vlan_valid)(struct realtek_smi *smi, unsigned int vlan);
int (*enable_vlan)(struct realtek_smi *smi, bool enable);
int (*enable_vlan4k)(struct realtek_smi *smi, bool enable);
int (*enable_port)(struct realtek_smi *smi, int port, bool enable);
int (*phy_read)(struct realtek_smi *smi, int phy, int regnum);
int (*phy_write)(struct realtek_smi *smi, int phy, int regnum,
int (*get_mc_index)(struct realtek_priv *priv, int port, int *val);
int (*set_mc_index)(struct realtek_priv *priv, int port, int index);
bool (*is_vlan_valid)(struct realtek_priv *priv, unsigned int vlan);
int (*enable_vlan)(struct realtek_priv *priv, bool enable);
int (*enable_vlan4k)(struct realtek_priv *priv, bool enable);
int (*enable_port)(struct realtek_priv *priv, int port, bool enable);
int (*phy_read)(struct realtek_priv *priv, int phy, int regnum);
int (*phy_write)(struct realtek_priv *priv, int phy, int regnum,
u16 val);
};
struct realtek_smi_variant {
struct realtek_variant {
const struct dsa_switch_ops *ds_ops;
const struct realtek_smi_ops *ops;
const struct realtek_ops *ops;
unsigned int clk_delay;
u8 cmd_read;
u8 cmd_write;
......@@ -116,19 +116,19 @@ struct realtek_smi_variant {
};
/* SMI core calls */
int realtek_smi_write_reg_noack(struct realtek_smi *smi, u32 addr,
int realtek_smi_write_reg_noack(struct realtek_priv *priv, u32 addr,
u32 data);
int realtek_smi_setup_mdio(struct realtek_smi *smi);
int realtek_smi_setup_mdio(struct realtek_priv *priv);
/* RTL8366 library helpers */
int rtl8366_mc_is_used(struct realtek_smi *smi, int mc_index, int *used);
int rtl8366_set_vlan(struct realtek_smi *smi, int vid, u32 member,
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_smi *smi, unsigned int port,
int rtl8366_set_pvid(struct realtek_priv *priv, unsigned int port,
unsigned int vid);
int rtl8366_enable_vlan4k(struct realtek_smi *smi, bool enable);
int rtl8366_enable_vlan(struct realtek_smi *smi, bool enable);
int rtl8366_reset_vlan(struct realtek_smi *smi);
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);
......@@ -139,7 +139,7 @@ void rtl8366_get_strings(struct dsa_switch *ds, int port, u32 stringset,
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_smi_variant rtl8366rb_variant;
extern const struct realtek_smi_variant rtl8365mb_variant;
extern const struct realtek_variant rtl8366rb_variant;
extern const struct realtek_variant rtl8365mb_variant;
#endif /* _REALTEK_SMI_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment