diff options
author | Mengyuan Lou <mengyuanlou@net-swift.com> | 2023-05-30 05:26:28 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-01 09:02:26 +0300 |
commit | 6dbedcffcf543afe1297f86fd6620327482a3a98 (patch) | |
tree | 19cb4d9cac0179fdf3839d946b6db74f317a4eed /drivers/net/ethernet/wangxun/libwx/wx_lib.c | |
parent | f3b03c655f67834cb25174ac6f2b099c9e68c74d (diff) | |
download | linux-6dbedcffcf543afe1297f86fd6620327482a3a98.tar.xz |
net: libwx: Implement xx_set_features ops
Implement wx_set_features function which to support
ndo_set_features.
Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/wangxun/libwx/wx_lib.c')
-rw-r--r-- | drivers/net/ethernet/wangxun/libwx/wx_lib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index 680f1ad36240..3dd328d33fcc 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -2704,4 +2704,24 @@ void wx_get_stats64(struct net_device *netdev, } EXPORT_SYMBOL(wx_get_stats64); +int wx_set_features(struct net_device *netdev, netdev_features_t features) +{ + netdev_features_t changed = netdev->features ^ features; + struct wx *wx = netdev_priv(netdev); + + if (changed & NETIF_F_RXHASH) + wr32m(wx, WX_RDB_RA_CTL, WX_RDB_RA_CTL_RSS_EN, + WX_RDB_RA_CTL_RSS_EN); + else + wr32m(wx, WX_RDB_RA_CTL, WX_RDB_RA_CTL_RSS_EN, 0); + + if (changed & + (NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_STAG_RX)) + wx_set_rx_mode(netdev); + + return 1; +} +EXPORT_SYMBOL(wx_set_features); + MODULE_LICENSE("GPL"); |