Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203952
b: refs/heads/master
c: 3725b1f
h: refs/heads/master
v: v3
  • Loading branch information
Sriram authored and David S. Miller committed Jul 31, 2010
1 parent 8296ebf commit 611ef09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84da2658a619c2d96fae6741580879cc6d7a4cd1
refs/heads/master: 3725b1fe0b9c7e5ba3c4f6e585cd93a7174c1e07
21 changes: 8 additions & 13 deletions trunk/drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ static int emac_poll(struct napi_struct *napi, int budget)
struct net_device *ndev = priv->ndev;
struct device *emac_dev = &ndev->dev;
u32 status = 0;
u32 num_pkts = 0;
u32 num_tx_pkts = 0, num_rx_pkts = 0;

/* Check interrupt vectors and call packet processing */
status = emac_read(EMAC_MACINVECTOR);
Expand All @@ -2277,27 +2277,19 @@ static int emac_poll(struct napi_struct *napi, int budget)
mask = EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC;

if (status & mask) {
num_pkts = emac_tx_bdproc(priv, EMAC_DEF_TX_CH,
num_tx_pkts = emac_tx_bdproc(priv, EMAC_DEF_TX_CH,
EMAC_DEF_TX_MAX_SERVICE);
} /* TX processing */

if (num_pkts)
return budget;

mask = EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC;

if (priv->version == EMAC_VERSION_2)
mask = EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC;

if (status & mask) {
num_pkts = emac_rx_bdproc(priv, EMAC_DEF_RX_CH, budget);
num_rx_pkts = emac_rx_bdproc(priv, EMAC_DEF_RX_CH, budget);
} /* RX processing */

if (num_pkts < budget) {
napi_complete(napi);
emac_int_enable(priv);
}

mask = EMAC_DM644X_MAC_IN_VECTOR_HOST_INT;
if (priv->version == EMAC_VERSION_2)
mask = EMAC_DM646X_MAC_IN_VECTOR_HOST_INT;
Expand Down Expand Up @@ -2328,9 +2320,12 @@ static int emac_poll(struct napi_struct *napi, int budget)
dev_err(emac_dev, "RX Host error %s on ch=%d\n",
&emac_rxhost_errcodes[cause][0], ch);
}
} /* Host error processing */
} else if (num_rx_pkts < budget) {
napi_complete(napi);
emac_int_enable(priv);
}

return num_pkts;
return num_rx_pkts;
}

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down

0 comments on commit 611ef09

Please sign in to comment.