mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-04-27 14:11:53 +02:00
realtek: eth: convert set_features() to regmap
Use regmap_assign_bits() for conversion and much simpler code. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/23067 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
fb874fcef7
commit
4e927d77b4
@ -1272,12 +1272,8 @@ static int rteth_83xx_set_features(struct net_device *dev, netdev_features_t fea
|
||||
{
|
||||
struct rteth_ctrl *ctrl = netdev_priv(dev);
|
||||
|
||||
if ((features ^ dev->features) & NETIF_F_RXCSUM) {
|
||||
if (!(features & NETIF_F_RXCSUM))
|
||||
sw_w32_mask(BIT(3), 0, ctrl->r->mac_l2_port_ctrl);
|
||||
else
|
||||
sw_w32_mask(0, BIT(3), ctrl->r->mac_l2_port_ctrl);
|
||||
}
|
||||
if ((features ^ dev->features) & NETIF_F_RXCSUM)
|
||||
regmap_assign_bits(ctrl->map, ctrl->r->mac_l2_port_ctrl, BIT(3), features & NETIF_F_RXCSUM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1286,12 +1282,8 @@ static int rteth_93xx_set_features(struct net_device *dev, netdev_features_t fea
|
||||
{
|
||||
struct rteth_ctrl *ctrl = netdev_priv(dev);
|
||||
|
||||
if ((features ^ dev->features) & NETIF_F_RXCSUM) {
|
||||
if (!(features & NETIF_F_RXCSUM))
|
||||
sw_w32_mask(BIT(4), 0, ctrl->r->mac_l2_port_ctrl);
|
||||
else
|
||||
sw_w32_mask(0, BIT(4), ctrl->r->mac_l2_port_ctrl);
|
||||
}
|
||||
if ((features ^ dev->features) & NETIF_F_RXCSUM)
|
||||
regmap_assign_bits(ctrl->map, ctrl->r->mac_l2_port_ctrl, BIT(4), features & NETIF_F_RXCSUM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user