]> git.baikalelectronics.ru Git - kernel.git/commit
net: systemport: Refactor bcm_sysport_set_features()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 27 Sep 2018 22:36:10 +0000 (15:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 06:11:52 +0000 (23:11 -0700)
commitf9e9ca5878ceff7d247eedb1ab8e197928dc77f9
treece5574f19176cd476c3f870d17a65ab8bcabc548
parent5397d338bea7e0b2f47509be16ffd0061d4df52d
net: systemport: Refactor bcm_sysport_set_features()

In preparation for unconditionally enabling TX and RX checksum offloads,
refactor bcm_sysport_set_features() a bit such that
__netdev_update_features() during register_netdev() can make sure that
features are correctly programmed during network device registration.

Since we can now be called during register_netdev() with clocks gated,
we need to temporarily turn them on/off in order to have a successful
register programming.

We also move the CRC forward setting read into
bcm_sysport_set_features() since priv->crc_fwd matters while turning on
RX checksum offload, that way we are guaranteed they are in sync in case
we ever add support for NETIF_F_RXFCS at some point in the future.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c