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

net: qlge: convert to hw_features

Another simple conversion.

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
88230fd5 a0d2730c

+8 -47
-34
drivers/net/qlge/qlge_ethtool.c
··· 655 655 return status; 656 656 } 657 657 658 - static u32 ql_get_rx_csum(struct net_device *netdev) 659 - { 660 - struct ql_adapter *qdev = netdev_priv(netdev); 661 - return qdev->rx_csum; 662 - } 663 - 664 - static int ql_set_rx_csum(struct net_device *netdev, uint32_t data) 665 - { 666 - struct ql_adapter *qdev = netdev_priv(netdev); 667 - qdev->rx_csum = data; 668 - return 0; 669 - } 670 - 671 - static int ql_set_tso(struct net_device *ndev, uint32_t data) 672 - { 673 - 674 - if (data) { 675 - ndev->features |= NETIF_F_TSO; 676 - ndev->features |= NETIF_F_TSO6; 677 - } else { 678 - ndev->features &= ~NETIF_F_TSO; 679 - ndev->features &= ~NETIF_F_TSO6; 680 - } 681 - return 0; 682 - } 683 - 684 658 static u32 ql_get_msglevel(struct net_device *ndev) 685 659 { 686 660 struct ql_adapter *qdev = netdev_priv(ndev); ··· 681 707 .self_test = ql_self_test, 682 708 .get_pauseparam = ql_get_pauseparam, 683 709 .set_pauseparam = ql_set_pauseparam, 684 - .get_rx_csum = ql_get_rx_csum, 685 - .set_rx_csum = ql_set_rx_csum, 686 - .get_tx_csum = ethtool_op_get_tx_csum, 687 - .set_tx_csum = ethtool_op_set_tx_csum, 688 - .get_sg = ethtool_op_get_sg, 689 - .set_sg = ethtool_op_set_sg, 690 - .get_tso = ethtool_op_get_tso, 691 - .set_tso = ql_set_tso, 692 710 .get_coalesce = ql_get_coalesce, 693 711 .set_coalesce = ql_set_coalesce, 694 712 .get_sset_count = ql_get_sset_count,
+8 -13
drivers/net/qlge/qlge_main.c
··· 1571 1571 skb->protocol = eth_type_trans(skb, ndev); 1572 1572 skb_checksum_none_assert(skb); 1573 1573 1574 - if (qdev->rx_csum && 1574 + if ((ndev->features & NETIF_F_RXCSUM) && 1575 1575 !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { 1576 1576 /* TCP frame. */ 1577 1577 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { ··· 1684 1684 /* If rx checksum is on, and there are no 1685 1685 * csum or frame errors. 1686 1686 */ 1687 - if (qdev->rx_csum && 1687 + if ((ndev->features & NETIF_F_RXCSUM) && 1688 1688 !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { 1689 1689 /* TCP frame. */ 1690 1690 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { ··· 2004 2004 /* If rx checksum is on, and there are no 2005 2005 * csum or frame errors. 2006 2006 */ 2007 - if (qdev->rx_csum && 2007 + if ((ndev->features & NETIF_F_RXCSUM) && 2008 2008 !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { 2009 2009 /* TCP frame. */ 2010 2010 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { ··· 4621 4621 /* 4622 4622 * Set up the operating parameters. 4623 4623 */ 4624 - qdev->rx_csum = 1; 4625 4624 qdev->workqueue = create_singlethread_workqueue(ndev->name); 4626 4625 INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work); 4627 4626 INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work); ··· 4694 4695 4695 4696 qdev = netdev_priv(ndev); 4696 4697 SET_NETDEV_DEV(ndev, &pdev->dev); 4697 - ndev->features = (0 4698 - | NETIF_F_IP_CSUM 4699 - | NETIF_F_SG 4700 - | NETIF_F_TSO 4701 - | NETIF_F_TSO6 4702 - | NETIF_F_TSO_ECN 4703 - | NETIF_F_HW_VLAN_TX 4704 - | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER); 4705 - ndev->features |= NETIF_F_GRO; 4698 + ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | 4699 + NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN | 4700 + NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM; 4701 + ndev->features = ndev->hw_features | 4702 + NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; 4706 4703 4707 4704 if (test_bit(QL_DMA64, &qdev->flags)) 4708 4705 ndev->features |= NETIF_F_HIGHDMA;