Commit 41921071 authored by Jeff Garzik's avatar Jeff Garzik

Merge pobox.com:/garz/repo/netdev-2.6/emac

into pobox.com:/garz/repo/net-drivers-2.6
parents 1cf65f54 8333589e
...@@ -98,7 +98,7 @@ typedef struct emac_regs { ...@@ -98,7 +98,7 @@ typedef struct emac_regs {
#endif /* CONFIG_IBM_EMAC4 */ #endif /* CONFIG_IBM_EMAC4 */
#define EMAC_M1_BASE (EMAC_M1_TX_FIFO_2K | \ #define EMAC_M1_BASE (EMAC_M1_TX_FIFO_2K | \
EMAC_M1_APP | \ EMAC_M1_APP | \
EMAC_M1_TR) EMAC_M1_TR | EMAC_M1_VLE)
/* Transmit Mode Register 0 */ /* Transmit Mode Register 0 */
#define EMAC_TMR0_GNP0 0x80000000 #define EMAC_TMR0_GNP0 0x80000000
......
...@@ -1364,6 +1364,9 @@ static void emac_reset_configure(struct ocp_enet_private *fep) ...@@ -1364,6 +1364,9 @@ static void emac_reset_configure(struct ocp_enet_private *fep)
/* set frame gap */ /* set frame gap */
out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP); out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP);
/* set VLAN Tag Protocol Identifier */
out_be32(&emacp->em0vtpid, 0x8100);
/* Init ring buffers */ /* Init ring buffers */
emac_init_rings(fep->ndev); emac_init_rings(fep->ndev);
} }
...@@ -1700,6 +1703,15 @@ struct mal_commac_ops emac_commac_ops = { ...@@ -1700,6 +1703,15 @@ struct mal_commac_ops emac_commac_ops = {
.rxde = &emac_rxde_dev, .rxde = &emac_rxde_dev,
}; };
#ifdef CONFIG_NET_POLL_CONTROLLER
static int emac_netpoll(struct net_device *ndev)
{
emac_rxeob_dev((void *)ndev, 0);
emac_txeob_dev((void *)ndev, 0);
return 0;
}
#endif
static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal) static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
{ {
int deferred_init = 0; int deferred_init = 0;
...@@ -1882,6 +1894,9 @@ static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal) ...@@ -1882,6 +1894,9 @@ static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
if (emacdata->tah_idx >= 0) if (emacdata->tah_idx >= 0)
ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG; ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG;
#ifdef CONFIG_NET_POLL_CONTROLLER
ndev->poll_controller = emac_netpoll;
#endif
SET_MODULE_OWNER(ndev); SET_MODULE_OWNER(ndev);
......
...@@ -191,17 +191,18 @@ static int genmii_read_link(struct mii_phy *phy) ...@@ -191,17 +191,18 @@ static int genmii_read_link(struct mii_phy *phy)
u16 lpa; u16 lpa;
if (phy->autoneg) { if (phy->autoneg) {
lpa = phy_read(phy, MII_LPA); lpa = phy_read(phy, MII_LPA) & phy_read(phy, MII_ADVERTISE);
if (lpa & (LPA_10FULL | LPA_100FULL))
phy->duplex = DUPLEX_FULL;
else
phy->duplex = DUPLEX_HALF;
if (lpa & (LPA_100FULL | LPA_100HALF))
phy->speed = SPEED_100;
else
phy->speed = SPEED_10; phy->speed = SPEED_10;
phy->duplex = DUPLEX_HALF;
phy->pause = 0; phy->pause = 0;
if (lpa & (LPA_100FULL | LPA_100HALF)) {
phy->speed = SPEED_100;
if (lpa & LPA_100FULL)
phy->duplex = DUPLEX_FULL;
} else if (lpa & LPA_10FULL)
phy->duplex = DUPLEX_FULL;
} }
/* On non-aneg, we assume what we put in BMCR is the speed, /* On non-aneg, we assume what we put in BMCR is the speed,
* though magic-aneg shouldn't prevent this case from occurring * though magic-aneg shouldn't prevent this case from occurring
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment