Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132538
b: refs/heads/master
c: 6914563
h: refs/heads/master
v: v3
  • Loading branch information
Kyle McMartin authored and David S. Miller committed Mar 19, 2009
1 parent fb127ab commit 601dcf3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 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: 4783256ef92f5aecd6d54693b16386f2a0021c2a
refs/heads/master: 69145635d4db0a0382885b14634aa5b721f3aa1a
45 changes: 29 additions & 16 deletions trunk/drivers/net/tulip/tulip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ const char tulip_media_cap[32] =

static void tulip_tx_timeout(struct net_device *dev);
static void tulip_init_ring(struct net_device *dev);
static void tulip_free_ring(struct net_device *dev);
static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int tulip_open(struct net_device *dev);
static int tulip_close(struct net_device *dev);
Expand Down Expand Up @@ -502,16 +503,21 @@ tulip_open(struct net_device *dev)
{
int retval;

if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
return retval;

tulip_init_ring (dev);

retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
if (retval)
goto free_ring;

tulip_up (dev);

netif_start_queue (dev);

return 0;

free_ring:
tulip_free_ring (dev);
return retval;
}


Expand Down Expand Up @@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev)
tulip_set_power_state (tp, 0, 1);
}


static int tulip_close (struct net_device *dev)
static void tulip_free_ring (struct net_device *dev)
{
struct tulip_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->base_addr;
int i;

netif_stop_queue (dev);

tulip_down (dev);

if (tulip_debug > 1)
printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, ioread32 (ioaddr + CSR5));

free_irq (dev->irq, dev);

/* Free all the skbuffs in the Rx queue. */
for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = tp->rx_buffers[i].skb;
Expand All @@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev)
dev_kfree_skb (skb);
}
}

for (i = 0; i < TX_RING_SIZE; i++) {
struct sk_buff *skb = tp->tx_buffers[i].skb;

Expand All @@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev)
tp->tx_buffers[i].skb = NULL;
tp->tx_buffers[i].mapping = 0;
}
}

static int tulip_close (struct net_device *dev)
{
struct tulip_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->base_addr;

netif_stop_queue (dev);

tulip_down (dev);

if (tulip_debug > 1)
printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, ioread32 (ioaddr + CSR5));

free_irq (dev->irq, dev);

tulip_free_ring (dev);

return 0;
}
Expand Down

0 comments on commit 601dcf3

Please sign in to comment.