commit | 7cd7e5e04318fdcb7bd397f0aab5dedef42329c8 | [log] [tgz] |
---|---|---|
author | developer <developer@mediatek.com> | Thu Nov 17 13:57:32 2022 +0800 |
committer | developer <developer@mediatek.com> | Thu Nov 24 13:14:59 2022 +0800 |
tree | 18db1f8a870e1ebf2d6c81235e46d0921e69e7b6 | |
parent | 84d1e834668b0105f2d804e3d0642ca7d797fc7f [diff] |
[][Kernel][mt7988][eth][Add Ethernet API to adjust PSE OQ drop] [Description] Add Ethernet API to dynamically adjust PSE output port drop configurations. It's exported for WiFi driver to fine-tune hw path drop policy according to scenario. [Release-log] N/A Change-Id: I2c63951d80d22b04346c9f3948bb8bb0033de1b6 Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6794384
diff --git a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 5d20651..0e34957 100755 --- a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3068,6 +3068,15 @@ } } +void mtk_set_pse_drop(u32 config) +{ + struct mtk_eth *eth = g_eth; + + if (eth) + mtk_w32(eth, config, PSE_PPE0_DROP); +} +EXPORT_SYMBOL(mtk_set_pse_drop); + static int mtk_open(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev);
diff --git a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 1a11af6..00eec80 100755 --- a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1601,6 +1601,7 @@ }; /* the struct describing the SoC. these are declared in the soc_xyz.c files */ +extern struct mtk_eth *g_eth; extern const struct of_device_id of_mtk_match[]; extern u32 mtk_hwlro_stats_ebl;