summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-31 13:48:50 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-17 14:35:24 +0100
commit3793558b231361dc545e9e0e345b21cd9660e738 (patch)
tree3a0f2cd66a6adc0f5eb12725842861fb1c58fc59
parentc44615ae10c0df303b484f580d3c2cd0d1c5f8aa (diff)
net: fec: move receive checksum flags into new flags member
The receive checksum flag is only changed upon ethtool configuration, so move it into the flags member. In any case, this is checked alongside the BUFDESC_EX flag. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/net/ethernet/freescale/fec.h2
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c11
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 34302a2bb5a1..6f576a3cc204 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -260,7 +260,6 @@ union bufdesc_u {
#define BD_ENET_RX_PTP ((ushort)0x0400)
#define BD_ENET_RX_ICE 0x00000020
#define BD_ENET_RX_PCR 0x00000010
-#define FLAG_RX_CSUM_ENABLED (BD_ENET_RX_ICE | BD_ENET_RX_PCR)
#define FLAG_RX_CSUM_ERROR (BD_ENET_RX_ICE | BD_ENET_RX_PCR)
/* The FEC buffer descriptors track the ring buffers. The rx_bd_base and
@@ -335,7 +334,6 @@ struct fec_enet_private {
unsigned short pause_mode;
struct napi_struct napi;
- int csum_flags;
struct work_struct tx_timeout_work;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 5ed94160f9ed..7f99cc6bd868 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -259,6 +259,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
/* flags */
#define FEC_FLAG_BUFDESC_EX BIT(0)
+#define FEC_FLAG_RX_CSUM BIT(1)
#define TSO_HEADER_SIZE 128
/* Max number of allowed TCP segments for software TSO */
@@ -914,7 +915,7 @@ fec_restart(struct net_device *ndev)
#if !defined(CONFIG_M5272)
/* set RX checksum */
val = readl(fep->hwp + FEC_RACC);
- if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
+ if (fep->flags & FEC_FLAG_RX_CSUM)
val |= FEC_RACC_OPTIONS;
else
val &= ~FEC_RACC_OPTIONS;
@@ -1329,7 +1330,7 @@ fec_enet_rx(struct net_device *ndev, int budget)
skb_hwtstamps(skb));
if (fep->flags & FEC_FLAG_BUFDESC_EX &&
- (fep->csum_flags & FLAG_RX_CSUM_ENABLED)) {
+ fep->flags & FEC_FLAG_RX_CSUM) {
if (!(bdp->ebd.cbd_esc & FLAG_RX_CSUM_ERROR)) {
/* don't check it */
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -2528,9 +2529,9 @@ static int fec_set_features(struct net_device *netdev,
/* Receive checksum has been changed */
if (changed & NETIF_F_RXCSUM) {
if (features & NETIF_F_RXCSUM)
- fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
+ fep->flags |= FEC_FLAG_RX_CSUM;
else
- fep->csum_flags &= ~FLAG_RX_CSUM_ENABLED;
+ fep->flags &= ~FEC_FLAG_RX_CSUM;
}
/* Set the appropriate minimum transmit ring free threshold */
@@ -2653,7 +2654,7 @@ static int fec_enet_init(struct net_device *ndev)
/* enable hw accelerator */
ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
| NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO);
- fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
+ fep->flags |= FEC_FLAG_RX_CSUM;
}
if (ndev->features & NETIF_F_SG) {