net: gianfar: convert to hw_features
Note: I bet that gfar_set_features() don't really need a full reset. 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:
committed by
David S. Miller
parent
c8c64cff2c
commit
8b3afe95e3
@@ -365,7 +365,7 @@ static void gfar_init_mac(struct net_device *ndev)
|
||||
gfar_write(®s->rir0, DEFAULT_RIR0);
|
||||
}
|
||||
|
||||
if (priv->rx_csum_enable)
|
||||
if (ndev->features & NETIF_F_RXCSUM)
|
||||
rctrl |= RCTRL_CHECKSUMMING;
|
||||
|
||||
if (priv->extended_hash) {
|
||||
@@ -463,6 +463,7 @@ static const struct net_device_ops gfar_netdev_ops = {
|
||||
.ndo_start_xmit = gfar_start_xmit,
|
||||
.ndo_stop = gfar_close,
|
||||
.ndo_change_mtu = gfar_change_mtu,
|
||||
.ndo_set_features = gfar_set_features,
|
||||
.ndo_set_multicast_list = gfar_set_multi,
|
||||
.ndo_tx_timeout = gfar_timeout,
|
||||
.ndo_do_ioctl = gfar_ioctl,
|
||||
@@ -513,7 +514,7 @@ void unlock_tx_qs(struct gfar_private *priv)
|
||||
/* Returns 1 if incoming frames use an FCB */
|
||||
static inline int gfar_uses_fcb(struct gfar_private *priv)
|
||||
{
|
||||
return priv->vlgrp || priv->rx_csum_enable ||
|
||||
return priv->vlgrp || (priv->ndev->features & NETIF_F_RXCSUM) ||
|
||||
(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER);
|
||||
}
|
||||
|
||||
@@ -1030,10 +1031,11 @@ static int gfar_probe(struct platform_device *ofdev)
|
||||
netif_napi_add(dev, &priv->gfargrp[i].napi, gfar_poll, GFAR_DEV_WEIGHT);
|
||||
|
||||
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) {
|
||||
priv->rx_csum_enable = 1;
|
||||
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_HIGHDMA;
|
||||
} else
|
||||
priv->rx_csum_enable = 0;
|
||||
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
|
||||
NETIF_F_RXCSUM;
|
||||
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG |
|
||||
NETIF_F_RXCSUM | NETIF_F_HIGHDMA;
|
||||
}
|
||||
|
||||
priv->vlgrp = NULL;
|
||||
|
||||
@@ -2697,7 +2699,7 @@ static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
|
||||
if (priv->padding)
|
||||
skb_pull(skb, priv->padding);
|
||||
|
||||
if (priv->rx_csum_enable)
|
||||
if (dev->features & NETIF_F_RXCSUM)
|
||||
gfar_rx_checksum(skb, fcb);
|
||||
|
||||
/* Tell the skb what kind of packet this is */
|
||||
|
Reference in New Issue
Block a user