Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188871
b: refs/heads/master
c: ea93fd9
h: refs/heads/master
i:
  188869: 4e56a07
  188867: 749d6ae
  188863: 9449553
v: v3
  • Loading branch information
Yegor Yefremov authored and David S. Miller committed Mar 20, 2010
1 parent 07b9f13 commit 1c7f78e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 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: b894fa2627e28c078740dc7041cd08c7e2c353ab
refs/heads/master: ea93fd9456ad32cd85b2d7914b58c6313cc40c9e
24 changes: 9 additions & 15 deletions trunk/drivers/net/arm/ks8695net.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,17 @@ ks8695_rx_irq(int irq, void *dev_id)
}

/**
* ks8695_rx - Receive packets called by NAPI poll method
* ks8695_rx - Receive packets called by NAPI poll method
* @ksp: Private data for the KS8695 Ethernet
* @budget: The max packets would be receive
* @budget: Number of packets allowed to process
*/

static int ks8695_rx(struct ks8695_priv *ksp, int budget)
{
struct net_device *ndev = ksp->ndev;
struct sk_buff *skb;
int buff_n;
u32 flags;
int pktlen;
int last_rx_processed = -1;
int received = 0;

buff_n = ksp->next_rx_desc_read;
Expand All @@ -471,6 +469,7 @@ static int ks8695_rx(struct ks8695_priv *ksp, int budget)
cpu_to_le32(RDES_OWN)))) {
rmb();
flags = le32_to_cpu(ksp->rx_ring[buff_n].status);

/* Found an SKB which we own, this means we
* received a packet
*/
Expand Down Expand Up @@ -533,23 +532,18 @@ static int ks8695_rx(struct ks8695_priv *ksp, int budget)
ksp->rx_ring[buff_n].status = cpu_to_le32(RDES_OWN);
rx_finished:
received++;
/* And note this as processed so we can start
* from here next time
*/
last_rx_processed = buff_n;
buff_n = (buff_n + 1) & MAX_RX_DESC_MASK;
/*And note which RX descriptor we last did */
if (likely(last_rx_processed != -1))
ksp->next_rx_desc_read =
(last_rx_processed + 1) &
MAX_RX_DESC_MASK;
}

/* And note which RX descriptor we last did */
ksp->next_rx_desc_read = buff_n;

/* And refill the buffers */
ks8695_refill_rxbuffers(ksp);

/* Kick the RX DMA engine, in case it became
* suspended */
/* Kick the RX DMA engine, in case it became suspended */
ks8695_writereg(ksp, KS8695_DRSC, 0);

return received;
}

Expand Down

0 comments on commit 1c7f78e

Please sign in to comment.