aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/ksz_common.h
diff options
context:
space:
mode:
authorArun Ramadoss <[email protected]>2022-07-01 15:02:23 +0000
committerDavid S. Miller <[email protected]>2022-07-02 15:34:05 +0000
commit99b16df0cd5236f4cb69d8732b96e436a23a220b (patch)
tree9b2dc7854aa0711d5314ecb0314f2f5e59a32a69 /drivers/net/dsa/microchip/ksz_common.h
parentnet: dsa: microchip: add DSA support for microchip LAN937x (diff)
downloadkernel-99b16df0cd5236f4cb69d8732b96e436a23a220b.tar.gz
kernel-99b16df0cd5236f4cb69d8732b96e436a23a220b.zip
net: dsa: microchip: lan937x: add dsa_tag_protocol
This patch update the ksz_get_tag_protocol to return LAN937x specific tag if the chip id matches one of LAN937x series switch Signed-off-by: Arun Ramadoss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.h')
-rw-r--r--drivers/net/dsa/microchip/ksz_common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 5f69dc872752..bf4f3f3922a5 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -403,6 +403,15 @@ static inline void ksz_regmap_unlock(void *__mtx)
mutex_unlock(mtx);
}
+static inline int is_lan937x(struct ksz_device *dev)
+{
+ return dev->chip_id == LAN9370_CHIP_ID ||
+ dev->chip_id == LAN9371_CHIP_ID ||
+ dev->chip_id == LAN9372_CHIP_ID ||
+ dev->chip_id == LAN9373_CHIP_ID ||
+ dev->chip_id == LAN9374_CHIP_ID;
+}
+
/* STP State Defines */
#define PORT_TX_ENABLE BIT(2)
#define PORT_RX_ENABLE BIT(1)