Skip to content

Commit

Permalink
net: dsa: ksz: Rename NET_DSA_TAG_KSZ to _KSZ9477
Browse files Browse the repository at this point in the history
Rename the tag Kconfig option and related macros in preparation for
addition of new KSZ family switches with different tag formats.

Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tristram Ha authored and David S. Miller committed Dec 16, 2018
1 parent 036b9e7 commit 39d6b96
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/net/dsa/microchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config NET_DSA_MICROCHIP_KSZ_COMMON
menuconfig NET_DSA_MICROCHIP_KSZ9477
tristate "Microchip KSZ9477 series switch support"
depends on NET_DSA
select NET_DSA_TAG_KSZ
select NET_DSA_TAG_KSZ9477
select NET_DSA_MICROCHIP_KSZ_COMMON
help
This driver adds support for Microchip KSZ9477 switch chips.
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/microchip/ksz9477.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static int ksz9477_reset_switch(struct ksz_device *dev)
static enum dsa_tag_protocol ksz9477_get_tag_protocol(struct dsa_switch *ds,
int port)
{
return DSA_TAG_PROTO_KSZ;
return DSA_TAG_PROTO_KSZ9477;
}

static int ksz9477_phy_read16(struct dsa_switch *ds, int addr, int reg)
Expand Down
2 changes: 1 addition & 1 deletion include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum dsa_tag_protocol {
DSA_TAG_PROTO_DSA,
DSA_TAG_PROTO_EDSA,
DSA_TAG_PROTO_GSWIP,
DSA_TAG_PROTO_KSZ,
DSA_TAG_PROTO_KSZ9477,
DSA_TAG_PROTO_LAN9303,
DSA_TAG_PROTO_MTK,
DSA_TAG_PROTO_QCA,
Expand Down
4 changes: 4 additions & 0 deletions net/dsa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ config NET_DSA_TAG_GSWIP
config NET_DSA_TAG_KSZ
bool

config NET_DSA_TAG_KSZ9477
bool
select NET_DSA_TAG_KSZ

config NET_DSA_TAG_LAN9303
bool

Expand Down
8 changes: 4 additions & 4 deletions net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const struct dsa_device_ops *dsa_device_ops[DSA_TAG_LAST] = {
#ifdef CONFIG_NET_DSA_TAG_GSWIP
[DSA_TAG_PROTO_GSWIP] = &gswip_netdev_ops,
#endif
#ifdef CONFIG_NET_DSA_TAG_KSZ
[DSA_TAG_PROTO_KSZ] = &ksz_netdev_ops,
#ifdef CONFIG_NET_DSA_TAG_KSZ9477
[DSA_TAG_PROTO_KSZ9477] = &ksz9477_netdev_ops,
#endif
#ifdef CONFIG_NET_DSA_TAG_LAN9303
[DSA_TAG_PROTO_LAN9303] = &lan9303_netdev_ops,
Expand Down Expand Up @@ -91,8 +91,8 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops)
#ifdef CONFIG_NET_DSA_TAG_GSWIP
[DSA_TAG_PROTO_GSWIP] = "gswip",
#endif
#ifdef CONFIG_NET_DSA_TAG_KSZ
[DSA_TAG_PROTO_KSZ] = "ksz",
#ifdef CONFIG_NET_DSA_TAG_KSZ9477
[DSA_TAG_PROTO_KSZ9477] = "ksz9477",
#endif
#ifdef CONFIG_NET_DSA_TAG_LAN9303
[DSA_TAG_PROTO_LAN9303] = "lan9303",
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/dsa_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ extern const struct dsa_device_ops edsa_netdev_ops;
extern const struct dsa_device_ops gswip_netdev_ops;

/* tag_ksz.c */
extern const struct dsa_device_ops ksz_netdev_ops;
extern const struct dsa_device_ops ksz9477_netdev_ops;

/* tag_lan9303.c */
extern const struct dsa_device_ops lan9303_netdev_ops;
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/tag_ksz.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev,
return skb;
}

const struct dsa_device_ops ksz_netdev_ops = {
const struct dsa_device_ops ksz9477_netdev_ops = {
.xmit = ksz_xmit,
.rcv = ksz_rcv,
.overhead = KSZ_INGRESS_TAG_LEN,
Expand Down

0 comments on commit 39d6b96

Please sign in to comment.