Skip to content

Commit 6dbedcf

Browse files
Mengyuan Loukuba-moo
authored andcommitted
net: libwx: Implement xx_set_features ops
Implement wx_set_features function which to support ndo_set_features. Signed-off-by: Mengyuan Lou <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f3b03c6 commit 6dbedcf

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

drivers/net/ethernet/wangxun/libwx/wx_lib.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,4 +2704,24 @@ void wx_get_stats64(struct net_device *netdev,
27042704
}
27052705
EXPORT_SYMBOL(wx_get_stats64);
27062706

2707+
int wx_set_features(struct net_device *netdev, netdev_features_t features)
2708+
{
2709+
netdev_features_t changed = netdev->features ^ features;
2710+
struct wx *wx = netdev_priv(netdev);
2711+
2712+
if (changed & NETIF_F_RXHASH)
2713+
wr32m(wx, WX_RDB_RA_CTL, WX_RDB_RA_CTL_RSS_EN,
2714+
WX_RDB_RA_CTL_RSS_EN);
2715+
else
2716+
wr32m(wx, WX_RDB_RA_CTL, WX_RDB_RA_CTL_RSS_EN, 0);
2717+
2718+
if (changed &
2719+
(NETIF_F_HW_VLAN_CTAG_RX |
2720+
NETIF_F_HW_VLAN_STAG_RX))
2721+
wx_set_rx_mode(netdev);
2722+
2723+
return 1;
2724+
}
2725+
EXPORT_SYMBOL(wx_set_features);
2726+
27072727
MODULE_LICENSE("GPL");

drivers/net/ethernet/wangxun/libwx/wx_lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ void wx_free_resources(struct wx *wx);
2828
int wx_setup_resources(struct wx *wx);
2929
void wx_get_stats64(struct net_device *netdev,
3030
struct rtnl_link_stats64 *stats);
31+
int wx_set_features(struct net_device *netdev, netdev_features_t features);
3132

3233
#endif /* _NGBE_LIB_H_ */

drivers/net/ethernet/wangxun/libwx/wx_type.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
#define WX_RDB_PL_CFG_L2HDR BIT(3)
112112
#define WX_RDB_PL_CFG_TUN_TUNHDR BIT(4)
113113
#define WX_RDB_PL_CFG_TUN_OUTL2HDR BIT(5)
114+
#define WX_RDB_RA_CTL 0x194F4
115+
#define WX_RDB_RA_CTL_RSS_EN BIT(2) /* RSS Enable */
114116

115117
/******************************* PSR Registers *******************************/
116118
/* psr control */

0 commit comments

Comments
 (0)