Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299532
b: refs/heads/master
c: 3c5e979
h: refs/heads/master
v: v3
  • Loading branch information
Will Deacon authored and David S. Miller committed Apr 13, 2012
1 parent 030a11e commit be625ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 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: 51c61a2838c33dab7b6659b9a3e008bb1b40bc9b
refs/heads/master: 3c5e979bd037888dd7d722da22da4b43659af485
14 changes: 5 additions & 9 deletions trunk/drivers/net/ethernet/smsc/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)

/* Quickly dumps bad packets */
static void
smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
{
unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;

if (likely(pktwords >= 4)) {
unsigned int timeout = 500;
unsigned int val;
Expand Down Expand Up @@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
continue;
}

skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
skb = netdev_alloc_skb(dev, pktwords << 2);
if (unlikely(!skb)) {
SMSC_WARN(pdata, rx_err,
"Unable to allocate skb for rx packet");
Expand All @@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
break;
}

skb->data = skb->head;
skb_reset_tail_pointer(skb);
pdata->ops->rx_readfifo(pdata,
(unsigned int *)skb->data, pktwords);

/* Align IP on 16B boundary */
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, pktlength - 4);
pdata->ops->rx_readfifo(pdata,
(unsigned int *)skb->head, pktwords);
skb->protocol = eth_type_trans(skb, dev);
skb_checksum_none_assert(skb);
netif_receive_skb(skb);
Expand Down Expand Up @@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev)
smsc911x_reg_write(pdata, FIFO_INT, temp);

/* set RX Data offset to 2 bytes for alignment */
smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));

/* enable NAPI polling before enabling RX interrupts */
napi_enable(&pdata->napi);
Expand Down

0 comments on commit be625ab

Please sign in to comment.