Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183993
b: refs/heads/master
c: 633e753
h: refs/heads/master
i:
  183991: 6a14445
v: v3
  • Loading branch information
Rob Herring authored and David S. Miller committed Feb 10, 2010
1 parent ca70eb0 commit 74010fb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 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: 67de792420be2daa1c6fec07ec8552af9ea0bde3
refs/heads/master: 633e7533cec78b99d806248e832fc83e689d2453
57 changes: 29 additions & 28 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,7 @@ static int fec_enet_init(struct net_device *dev, int index)
{
struct fec_enet_private *fep = netdev_priv(dev);
struct bufdesc *cbd_base;
struct bufdesc *bdp;
int i;

/* Allocate memory for buffer descriptors. */
Expand Down Expand Up @@ -1710,6 +1711,34 @@ static int fec_enet_init(struct net_device *dev, int index)
/* Set MII speed to 2.5 MHz */
fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999)
/ 2500000) / 2) & 0x3F) << 1;

/* Initialize the receive buffer descriptors. */
bdp = fep->rx_bd_base;
for (i = 0; i < RX_RING_SIZE; i++) {

/* Initialize the BD for every fragment in the page. */
bdp->cbd_sc = 0;
bdp++;
}

/* Set the last buffer to wrap */
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;

/* ...and the same for transmit */
bdp = fep->tx_bd_base;
for (i = 0; i < TX_RING_SIZE; i++) {

/* Initialize the BD for every fragment in the page. */
bdp->cbd_sc = 0;
bdp->cbd_bufaddr = 0;
bdp++;
}

/* Set the last buffer to wrap */
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;

fec_restart(dev, 0);

/* Queue up command to detect the PHY and initialize the
Expand All @@ -1730,7 +1759,6 @@ static void
fec_restart(struct net_device *dev, int duplex)
{
struct fec_enet_private *fep = netdev_priv(dev);
struct bufdesc *bdp;
int i;

/* Whack a reset. We should wait for this. */
Expand Down Expand Up @@ -1768,33 +1796,6 @@ fec_restart(struct net_device *dev, int duplex)
}
}

/* Initialize the receive buffer descriptors. */
bdp = fep->rx_bd_base;
for (i = 0; i < RX_RING_SIZE; i++) {

/* Initialize the BD for every fragment in the page. */
bdp->cbd_sc = BD_ENET_RX_EMPTY;
bdp++;
}

/* Set the last buffer to wrap */
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;

/* ...and the same for transmit */
bdp = fep->tx_bd_base;
for (i = 0; i < TX_RING_SIZE; i++) {

/* Initialize the BD for every fragment in the page. */
bdp->cbd_sc = 0;
bdp->cbd_bufaddr = 0;
bdp++;
}

/* Set the last buffer to wrap */
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;

/* Enable MII mode */
if (duplex) {
/* MII enable / FD enable */
Expand Down

0 comments on commit 74010fb

Please sign in to comment.