Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35261
b: refs/heads/master
c: c54f976
h: refs/heads/master
i:
  35259: 9ff6402
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Sep 6, 2006
1 parent 4705ce6 commit 19cdfec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 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: 2f4a66ad49097f0b0207a141aa2115ed352fbf58
refs/heads/master: c54f9765daafe8493dba837b3d70e97432cd876a
29 changes: 15 additions & 14 deletions trunk/drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,17 +818,18 @@ static void skge_rx_clean(struct skge_port *skge)
/* Allocate buffers for receive ring
* For receive: to_clean is next received frame.
*/
static int skge_rx_fill(struct skge_port *skge)
static int skge_rx_fill(struct net_device *dev)
{
struct skge_port *skge = netdev_priv(dev);
struct skge_ring *ring = &skge->rx_ring;
struct skge_element *e;

e = ring->start;
do {
struct sk_buff *skb;

skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
GFP_KERNEL);
skb = __netdev_alloc_skb(dev, skge->rx_buf_size + NET_IP_ALIGN,
GFP_KERNEL);
if (!skb)
return -ENOMEM;

Expand Down Expand Up @@ -2179,7 +2180,7 @@ static int skge_up(struct net_device *dev)
if (err)
goto free_pci_mem;

err = skge_rx_fill(skge);
err = skge_rx_fill(dev);
if (err)
goto free_rx_ring;

Expand Down Expand Up @@ -2585,16 +2586,17 @@ static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
/* Get receive buffer from descriptor.
* Handles copy of small buffers and reallocation failures
*/
static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
struct skge_element *e,
u32 control, u32 status, u16 csum)
static struct sk_buff *skge_rx_get(struct net_device *dev,
struct skge_element *e,
u32 control, u32 status, u16 csum)
{
struct skge_port *skge = netdev_priv(dev);
struct sk_buff *skb;
u16 len = control & BMU_BBC;

if (unlikely(netif_msg_rx_status(skge)))
printk(KERN_DEBUG PFX "%s: rx slot %td status 0x%x len %d\n",
skge->netdev->name, e - skge->rx_ring.start,
dev->name, e - skge->rx_ring.start,
status, len);

if (len > skge->rx_buf_size)
Expand All @@ -2610,7 +2612,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
goto error;

if (len < RX_COPY_THRESHOLD) {
skb = dev_alloc_skb(len + 2);
skb = netdev_alloc_skb(dev, len + 2);
if (!skb)
goto resubmit;

Expand All @@ -2625,7 +2627,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
skge_rx_reuse(e, skge->rx_buf_size);
} else {
struct sk_buff *nskb;
nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
nskb = netdev_alloc_skb(dev, skge->rx_buf_size + NET_IP_ALIGN);
if (!nskb)
goto resubmit;

Expand All @@ -2640,20 +2642,19 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
}

skb_put(skb, len);
skb->dev = skge->netdev;
if (skge->rx_csum) {
skb->csum = csum;
skb->ip_summed = CHECKSUM_HW;
}

skb->protocol = eth_type_trans(skb, skge->netdev);
skb->protocol = eth_type_trans(skb, dev);

return skb;
error:

if (netif_msg_rx_err(skge))
printk(KERN_DEBUG PFX "%s: rx err, slot %td control 0x%x status 0x%x\n",
skge->netdev->name, e - skge->rx_ring.start,
dev->name, e - skge->rx_ring.start,
control, status);

if (skge->hw->chip_id == CHIP_ID_GENESIS) {
Expand Down Expand Up @@ -2723,7 +2724,7 @@ static int skge_poll(struct net_device *dev, int *budget)
if (control & BMU_OWN)
break;

skb = skge_rx_get(skge, e, control, rd->status, rd->csum2);
skb = skge_rx_get(dev, e, control, rd->status, rd->csum2);
if (likely(skb)) {
dev->last_rx = jiffies;
netif_receive_skb(skb);
Expand Down

0 comments on commit 19cdfec

Please sign in to comment.