Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ibm_newemac: convert to hw_features

Side effect: allow toggling of TX offloads.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michał Mirosław and committed by
David S. Miller
5e4011e2 131ae329

+4 -13
+4 -13
drivers/net/ibm_newemac/core.c
··· 2053 2053 mutex_unlock(&dev->link_lock); 2054 2054 } 2055 2055 2056 - static u32 emac_ethtool_get_rx_csum(struct net_device *ndev) 2057 - { 2058 - struct emac_instance *dev = netdev_priv(ndev); 2059 - 2060 - return dev->tah_dev != NULL; 2061 - } 2062 - 2063 2056 static int emac_get_regs_len(struct emac_instance *dev) 2064 2057 { 2065 2058 if (emac_has_feature(dev, EMAC_FTR_EMAC4)) ··· 2196 2203 .get_ringparam = emac_ethtool_get_ringparam, 2197 2204 .get_pauseparam = emac_ethtool_get_pauseparam, 2198 2205 2199 - .get_rx_csum = emac_ethtool_get_rx_csum, 2200 - 2201 2206 .get_strings = emac_ethtool_get_strings, 2202 2207 .get_sset_count = emac_ethtool_get_sset_count, 2203 2208 .get_ethtool_stats = emac_ethtool_get_ethtool_stats, 2204 2209 2205 2210 .get_link = ethtool_op_get_link, 2206 - .get_tx_csum = ethtool_op_get_tx_csum, 2207 - .get_sg = ethtool_op_get_sg, 2208 2211 }; 2209 2212 2210 2213 static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) ··· 2848 2859 if (err != 0) 2849 2860 goto err_detach_tah; 2850 2861 2851 - if (dev->tah_dev) 2852 - ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; 2862 + if (dev->tah_dev) { 2863 + ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG; 2864 + ndev->features |= ndev->hw_features | NETIF_F_RXCSUM; 2865 + } 2853 2866 ndev->watchdog_timeo = 5 * HZ; 2854 2867 if (emac_phy_supports_gige(dev->phy_mode)) { 2855 2868 ndev->netdev_ops = &emac_gige_netdev_ops;