diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-04-18 09:31:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-19 02:04:00 -0400 |
commit | 88230fd586b4ccc5ffe6d6c2df8cdc495e89ad83 (patch) | |
tree | 22dfe5a2c0f117ad464971b78db52310034c8e82 /drivers/net/qlge | |
parent | a0d2730c9571aeba793cb5d3009094ee1d8fda35 (diff) |
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>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 34 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 21 |
2 files changed, 8 insertions, 47 deletions
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index 687754da2a9f..78dc40c18c60 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -655,32 +655,6 @@ static int ql_set_pauseparam(struct net_device *netdev, | |||
655 | return status; | 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 | static u32 ql_get_msglevel(struct net_device *ndev) | 658 | static u32 ql_get_msglevel(struct net_device *ndev) |
685 | { | 659 | { |
686 | struct ql_adapter *qdev = netdev_priv(ndev); | 660 | struct ql_adapter *qdev = netdev_priv(ndev); |
@@ -707,14 +681,6 @@ const struct ethtool_ops qlge_ethtool_ops = { | |||
707 | .self_test = ql_self_test, | 681 | .self_test = ql_self_test, |
708 | .get_pauseparam = ql_get_pauseparam, | 682 | .get_pauseparam = ql_get_pauseparam, |
709 | .set_pauseparam = ql_set_pauseparam, | 683 | .set_pauseparam = ql_set_pauseparam, |
710 | .get_rx_csum = ql_get_rx_csum, | ||
711 | .set_rx_csum = ql_set_rx_csum, | ||
712 | .get_tx_csum = ethtool_op_get_tx_csum, | ||
713 | .set_tx_csum = ethtool_op_set_tx_csum, | ||
714 | .get_sg = ethtool_op_get_sg, | ||
715 | .set_sg = ethtool_op_set_sg, | ||
716 | .get_tso = ethtool_op_get_tso, | ||
717 | .set_tso = ql_set_tso, | ||
718 | .get_coalesce = ql_get_coalesce, | 684 | .get_coalesce = ql_get_coalesce, |
719 | .set_coalesce = ql_set_coalesce, | 685 | .set_coalesce = ql_set_coalesce, |
720 | .get_sset_count = ql_get_sset_count, | 686 | .get_sset_count = ql_get_sset_count, |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index f61e717adac4..6c9d124cfc76 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -1571,7 +1571,7 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev, | |||
1571 | skb->protocol = eth_type_trans(skb, ndev); | 1571 | skb->protocol = eth_type_trans(skb, ndev); |
1572 | skb_checksum_none_assert(skb); | 1572 | skb_checksum_none_assert(skb); |
1573 | 1573 | ||
1574 | if (qdev->rx_csum && | 1574 | if ((ndev->features & NETIF_F_RXCSUM) && |
1575 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { | 1575 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { |
1576 | /* TCP frame. */ | 1576 | /* TCP frame. */ |
1577 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { | 1577 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { |
@@ -1684,7 +1684,7 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, | |||
1684 | /* If rx checksum is on, and there are no | 1684 | /* If rx checksum is on, and there are no |
1685 | * csum or frame errors. | 1685 | * csum or frame errors. |
1686 | */ | 1686 | */ |
1687 | if (qdev->rx_csum && | 1687 | if ((ndev->features & NETIF_F_RXCSUM) && |
1688 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { | 1688 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { |
1689 | /* TCP frame. */ | 1689 | /* TCP frame. */ |
1690 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { | 1690 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { |
@@ -2004,7 +2004,7 @@ static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev, | |||
2004 | /* If rx checksum is on, and there are no | 2004 | /* If rx checksum is on, and there are no |
2005 | * csum or frame errors. | 2005 | * csum or frame errors. |
2006 | */ | 2006 | */ |
2007 | if (qdev->rx_csum && | 2007 | if ((ndev->features & NETIF_F_RXCSUM) && |
2008 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { | 2008 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { |
2009 | /* TCP frame. */ | 2009 | /* TCP frame. */ |
2010 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { | 2010 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { |
@@ -4621,7 +4621,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
4621 | /* | 4621 | /* |
4622 | * Set up the operating parameters. | 4622 | * Set up the operating parameters. |
4623 | */ | 4623 | */ |
4624 | qdev->rx_csum = 1; | ||
4625 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4624 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
4626 | INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work); | 4625 | INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work); |
4627 | INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work); | 4626 | INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work); |
@@ -4695,15 +4694,11 @@ static int __devinit qlge_probe(struct pci_dev *pdev, | |||
4695 | 4694 | ||
4696 | qdev = netdev_priv(ndev); | 4695 | qdev = netdev_priv(ndev); |
4697 | SET_NETDEV_DEV(ndev, &pdev->dev); | 4696 | SET_NETDEV_DEV(ndev, &pdev->dev); |
4698 | ndev->features = (0 | 4697 | ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | |
4699 | | NETIF_F_IP_CSUM | 4698 | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN | |
4700 | | NETIF_F_SG | 4699 | NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM; |
4701 | | NETIF_F_TSO | 4700 | ndev->features = ndev->hw_features | |
4702 | | NETIF_F_TSO6 | 4701 | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; |
4703 | | NETIF_F_TSO_ECN | ||
4704 | | NETIF_F_HW_VLAN_TX | ||
4705 | | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER); | ||
4706 | ndev->features |= NETIF_F_GRO; | ||
4707 | 4702 | ||
4708 | if (test_bit(QL_DMA64, &qdev->flags)) | 4703 | if (test_bit(QL_DMA64, &qdev->flags)) |
4709 | ndev->features |= NETIF_F_HIGHDMA; | 4704 | ndev->features |= NETIF_F_HIGHDMA; |