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>
This commit is contained in:
Michał Mirosław 2011-04-18 13:31:21 +00:00 committed by David S. Miller
parent a0d2730c95
commit 88230fd586
2 changed files with 8 additions and 47 deletions

View File

@ -655,32 +655,6 @@ static int ql_set_pauseparam(struct net_device *netdev,
return status; return status;
} }
static u32 ql_get_rx_csum(struct net_device *netdev)
{
struct ql_adapter *qdev = netdev_priv(netdev);
return qdev->rx_csum;
}
static int ql_set_rx_csum(struct net_device *netdev, uint32_t data)
{
struct ql_adapter *qdev = netdev_priv(netdev);
qdev->rx_csum = data;
return 0;
}
static int ql_set_tso(struct net_device *ndev, uint32_t data)
{
if (data) {
ndev->features |= NETIF_F_TSO;
ndev->features |= NETIF_F_TSO6;
} else {
ndev->features &= ~NETIF_F_TSO;
ndev->features &= ~NETIF_F_TSO6;
}
return 0;
}
static u32 ql_get_msglevel(struct net_device *ndev) static u32 ql_get_msglevel(struct net_device *ndev)
{ {
struct ql_adapter *qdev = netdev_priv(ndev); struct ql_adapter *qdev = netdev_priv(ndev);
@ -707,14 +681,6 @@ const struct ethtool_ops qlge_ethtool_ops = {
.self_test = ql_self_test, .self_test = ql_self_test,
.get_pauseparam = ql_get_pauseparam, .get_pauseparam = ql_get_pauseparam,
.set_pauseparam = ql_set_pauseparam, .set_pauseparam = ql_set_pauseparam,
.get_rx_csum = ql_get_rx_csum,
.set_rx_csum = ql_set_rx_csum,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_csum,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg,
.get_tso = ethtool_op_get_tso,
.set_tso = ql_set_tso,
.get_coalesce = ql_get_coalesce, .get_coalesce = ql_get_coalesce,
.set_coalesce = ql_set_coalesce, .set_coalesce = ql_set_coalesce,
.get_sset_count = ql_get_sset_count, .get_sset_count = ql_get_sset_count,

View File

@ -1571,7 +1571,7 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
skb->protocol = eth_type_trans(skb, ndev); skb->protocol = eth_type_trans(skb, ndev);
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
if (qdev->rx_csum && if ((ndev->features & NETIF_F_RXCSUM) &&
!(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) {
/* TCP frame. */ /* TCP frame. */
if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { 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,
/* If rx checksum is on, and there are no /* If rx checksum is on, and there are no
* csum or frame errors. * csum or frame errors.
*/ */
if (qdev->rx_csum && if ((ndev->features & NETIF_F_RXCSUM) &&
!(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) {
/* TCP frame. */ /* TCP frame. */
if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { 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,
/* If rx checksum is on, and there are no /* If rx checksum is on, and there are no
* csum or frame errors. * csum or frame errors.
*/ */
if (qdev->rx_csum && if ((ndev->features & NETIF_F_RXCSUM) &&
!(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) {
/* TCP frame. */ /* TCP frame. */
if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) {
@ -4621,7 +4621,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
/* /*
* Set up the operating parameters. * Set up the operating parameters.
*/ */
qdev->rx_csum = 1;
qdev->workqueue = create_singlethread_workqueue(ndev->name); qdev->workqueue = create_singlethread_workqueue(ndev->name);
INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work); INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work);
INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work); INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work);
@ -4695,15 +4694,11 @@ static int __devinit qlge_probe(struct pci_dev *pdev,
qdev = netdev_priv(ndev); qdev = netdev_priv(ndev);
SET_NETDEV_DEV(ndev, &pdev->dev); SET_NETDEV_DEV(ndev, &pdev->dev);
ndev->features = (0 ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
| NETIF_F_IP_CSUM NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN |
| NETIF_F_SG NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM;
| NETIF_F_TSO ndev->features = ndev->hw_features |
| NETIF_F_TSO6 NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
| NETIF_F_TSO_ECN
| NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER);
ndev->features |= NETIF_F_GRO;
if (test_bit(QL_DMA64, &qdev->flags)) if (test_bit(QL_DMA64, &qdev->flags))
ndev->features |= NETIF_F_HIGHDMA; ndev->features |= NETIF_F_HIGHDMA;