Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202896
b: refs/heads/master
c: c527f81
h: refs/heads/master
v: v3
  • Loading branch information
Jonas Bonn authored and David S. Miller committed Jun 11, 2010
1 parent efbe555 commit 94a08e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 14599f1e341ee219abdd15f4eee5872d6f2d29f1
refs/heads/master: c527f81475aaa18123eebe3d72a40a25d8e244af
14 changes: 7 additions & 7 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,20 +658,13 @@ static int ethoc_mdio_probe(struct net_device *dev)
static int ethoc_open(struct net_device *dev)
{
struct ethoc *priv = netdev_priv(dev);
unsigned int min_tx = 2;
unsigned int num_bd;
int ret;

ret = request_irq(dev->irq, ethoc_interrupt, IRQF_SHARED,
dev->name, dev);
if (ret)
return ret;

/* calculate the number of TX/RX buffers, maximum 128 supported */
num_bd = min_t(unsigned int,
128, (dev->mem_end - dev->mem_start + 1) / ETHOC_BUFSIZ);
priv->num_tx = max(min_tx, num_bd / 4);
priv->num_rx = num_bd - priv->num_tx;
ethoc_write(priv, TX_BD_NUM, priv->num_tx);

ethoc_init_ring(priv);
Expand Down Expand Up @@ -884,6 +877,7 @@ static int ethoc_probe(struct platform_device *pdev)
struct resource *mem = NULL;
struct ethoc *priv = NULL;
unsigned int phy;
int num_bd;
int ret = 0;

/* allocate networking device */
Expand Down Expand Up @@ -978,6 +972,12 @@ static int ethoc_probe(struct platform_device *pdev)
priv->dma_alloc = buffer_size;
}

/* calculate the number of TX/RX buffers, maximum 128 supported */
num_bd = min_t(unsigned int,
128, (netdev->mem_end - netdev->mem_start + 1) / ETHOC_BUFSIZ);
priv->num_tx = max(2, num_bd / 4);
priv->num_rx = num_bd - priv->num_tx;

/* Allow the platform setup code to pass in a MAC address. */
if (pdev->dev.platform_data) {
struct ethoc_platform_data *pdata =
Expand Down

0 comments on commit 94a08e8

Please sign in to comment.