xref: /linux/drivers/net/ethernet/ti/am65-cpsw-switchdev.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1*86e8b070SVignesh Raghavendra /* SPDX-License-Identifier: GPL-2.0 */
2*86e8b070SVignesh Raghavendra /* Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/
3*86e8b070SVignesh Raghavendra  */
4*86e8b070SVignesh Raghavendra 
5*86e8b070SVignesh Raghavendra #ifndef DRIVERS_NET_ETHERNET_TI_AM65_CPSW_SWITCHDEV_H_
6*86e8b070SVignesh Raghavendra #define DRIVERS_NET_ETHERNET_TI_AM65_CPSW_SWITCHDEV_H_
7*86e8b070SVignesh Raghavendra 
8*86e8b070SVignesh Raghavendra #include <linux/skbuff.h>
9*86e8b070SVignesh Raghavendra 
10*86e8b070SVignesh Raghavendra #if IS_ENABLED(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV)
am65_cpsw_nuss_set_offload_fwd_mark(struct sk_buff * skb,bool val)11*86e8b070SVignesh Raghavendra static inline void am65_cpsw_nuss_set_offload_fwd_mark(struct sk_buff *skb, bool val)
12*86e8b070SVignesh Raghavendra {
13*86e8b070SVignesh Raghavendra 	skb->offload_fwd_mark = val;
14*86e8b070SVignesh Raghavendra }
15*86e8b070SVignesh Raghavendra 
16*86e8b070SVignesh Raghavendra int am65_cpsw_switchdev_register_notifiers(struct am65_cpsw_common *cpsw);
17*86e8b070SVignesh Raghavendra void am65_cpsw_switchdev_unregister_notifiers(struct am65_cpsw_common *cpsw);
18*86e8b070SVignesh Raghavendra #else
am65_cpsw_switchdev_register_notifiers(struct am65_cpsw_common * cpsw)19*86e8b070SVignesh Raghavendra static inline int am65_cpsw_switchdev_register_notifiers(struct am65_cpsw_common *cpsw)
20*86e8b070SVignesh Raghavendra {
21*86e8b070SVignesh Raghavendra 	return -EOPNOTSUPP;
22*86e8b070SVignesh Raghavendra }
23*86e8b070SVignesh Raghavendra 
am65_cpsw_switchdev_unregister_notifiers(struct am65_cpsw_common * cpsw)24*86e8b070SVignesh Raghavendra static inline void am65_cpsw_switchdev_unregister_notifiers(struct am65_cpsw_common *cpsw)
25*86e8b070SVignesh Raghavendra {
26*86e8b070SVignesh Raghavendra }
27*86e8b070SVignesh Raghavendra 
am65_cpsw_nuss_set_offload_fwd_mark(struct sk_buff * skb,bool val)28*86e8b070SVignesh Raghavendra static inline void am65_cpsw_nuss_set_offload_fwd_mark(struct sk_buff *skb, bool val)
29*86e8b070SVignesh Raghavendra {
30*86e8b070SVignesh Raghavendra }
31*86e8b070SVignesh Raghavendra 
32*86e8b070SVignesh Raghavendra #endif
33*86e8b070SVignesh Raghavendra 
34*86e8b070SVignesh Raghavendra #endif /* DRIVERS_NET_ETHERNET_TI_AM65_CPSW_SWITCHDEV_H_ */
35