1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (C) 2024 Furong Xu <0x1207@gmail.com> 4 * stmmac FPE(802.3 Qbu) handling 5 */ 6 #ifndef _STMMAC_FPE_H_ 7 #define _STMMAC_FPE_H_ 8 9 #include <linux/types.h> 10 #include <linux/netdevice.h> 11 12 #define STMMAC_FPE_MM_MAX_VERIFY_RETRIES 3 13 #define STMMAC_FPE_MM_MAX_VERIFY_TIME_MS 128 14 15 struct stmmac_priv; 16 17 void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up); 18 bool stmmac_fpe_supported(struct stmmac_priv *priv); 19 void stmmac_fpe_init(struct stmmac_priv *priv); 20 void stmmac_fpe_apply(struct stmmac_priv *priv); 21 void stmmac_fpe_irq_status(struct stmmac_priv *priv); 22 int stmmac_fpe_get_add_frag_size(struct stmmac_priv *priv); 23 void stmmac_fpe_set_add_frag_size(struct stmmac_priv *priv, u32 add_frag_size); 24 25 int dwmac5_fpe_map_preemption_class(struct net_device *ndev, 26 struct netlink_ext_ack *extack, u32 pclass); 27 int dwxgmac3_fpe_map_preemption_class(struct net_device *ndev, 28 struct netlink_ext_ack *extack, u32 pclass); 29 30 extern const struct stmmac_fpe_reg dwmac5_fpe_reg; 31 extern const struct stmmac_fpe_reg dwxgmac3_fpe_reg; 32 33 #endif 34