linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / net / sungem_phy.c
index 278c7cb..d3ddb41 100644 (file)
@@ -19,6 +19,7 @@
  *    of darwin, still need to reverse engineer that
  */
 
+#include <linux/config.h>
 
 #include <linux/module.h>
 
@@ -38,7 +39,7 @@
 #include "sungem_phy.h"
 
 /* Link modes of the BCM5400 PHY */
-static const int phy_BCM5400_link_table[8][3] = {
+static int phy_BCM5400_link_table[8][3] = {
        { 0, 0, 0 },    /* No link */
        { 0, 0, 0 },    /* 10BT Half Duplex */
        { 1, 0, 0 },    /* 10BT Full Duplex */
@@ -274,7 +275,7 @@ static int bcm5411_init(struct mii_phy* phy)
        return 0;
 }
 
-static int generic_suspend(struct mii_phy* phy)
+static int bcm5411_suspend(struct mii_phy* phy)
 {
        phy_write(phy, MII_BMCR, BMCR_PDOWN);
 
@@ -328,30 +329,6 @@ static int bcm5421_init(struct mii_phy* phy)
        return 0;
 }
 
-static int bcm5421_enable_fiber(struct mii_phy* phy)
-{
-       /* enable fiber mode */
-       phy_write(phy, MII_NCONFIG, 0x9020);
-       /* LEDs active in both modes, autosense prio = fiber */
-       phy_write(phy, MII_NCONFIG, 0x945f);
-
-       /* switch off fibre autoneg */
-       phy_write(phy, MII_NCONFIG, 0xfc01);
-       phy_write(phy, 0x0b, 0x0004);
-
-       return 0;
-}
-
-static int bcm5461_enable_fiber(struct mii_phy* phy)
-{
-       phy_write(phy, MII_NCONFIG, 0xfc0c);
-       phy_write(phy, MII_BMCR, 0x4140);
-       phy_write(phy, MII_NCONFIG, 0xfc0b);
-       phy_write(phy, MII_BMCR, 0x0140);
-
-       return 0;
-}
-
 static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise)
 {
        u16 ctl, adv;
@@ -761,7 +738,7 @@ static struct mii_phy_def bcm5401_phy_def = {
 /* Broadcom BCM 5411 */
 static struct mii_phy_ops bcm5411_phy_ops = {
        .init           = bcm5411_init,
-       .suspend        = generic_suspend,
+       .suspend        = bcm5411_suspend,
        .setup_aneg     = bcm54xx_setup_aneg,
        .setup_forced   = bcm54xx_setup_forced,
        .poll_link      = genmii_poll_link,
@@ -780,12 +757,11 @@ static struct mii_phy_def bcm5411_phy_def = {
 /* Broadcom BCM 5421 */
 static struct mii_phy_ops bcm5421_phy_ops = {
        .init           = bcm5421_init,
-       .suspend        = generic_suspend,
+       .suspend        = bcm5411_suspend,
        .setup_aneg     = bcm54xx_setup_aneg,
        .setup_forced   = bcm54xx_setup_forced,
        .poll_link      = genmii_poll_link,
        .read_link      = bcm54xx_read_link,
-       .enable_fiber   = bcm5421_enable_fiber,
 };
 
 static struct mii_phy_def bcm5421_phy_def = {
@@ -800,7 +776,7 @@ static struct mii_phy_def bcm5421_phy_def = {
 /* Broadcom BCM 5421 built-in K2 */
 static struct mii_phy_ops bcm5421k2_phy_ops = {
        .init           = bcm5421_init,
-       .suspend        = generic_suspend,
+       .suspend        = bcm5411_suspend,
        .setup_aneg     = bcm54xx_setup_aneg,
        .setup_forced   = bcm54xx_setup_forced,
        .poll_link      = genmii_poll_link,
@@ -816,29 +792,10 @@ static struct mii_phy_def bcm5421k2_phy_def = {
        .ops            = &bcm5421k2_phy_ops
 };
 
-static struct mii_phy_ops bcm5461_phy_ops = {
-       .init           = bcm5421_init,
-       .suspend        = generic_suspend,
-       .setup_aneg     = bcm54xx_setup_aneg,
-       .setup_forced   = bcm54xx_setup_forced,
-       .poll_link      = genmii_poll_link,
-       .read_link      = bcm54xx_read_link,
-       .enable_fiber   = bcm5461_enable_fiber,
-};
-
-static struct mii_phy_def bcm5461_phy_def = {
-       .phy_id         = 0x002060c0,
-       .phy_id_mask    = 0xfffffff0,
-       .name           = "BCM5461",
-       .features       = MII_GBIT_FEATURES,
-       .magic_aneg     = 1,
-       .ops            = &bcm5461_phy_ops
-};
-
 /* Broadcom BCM 5462 built-in Vesta */
 static struct mii_phy_ops bcm5462V_phy_ops = {
        .init           = bcm5421_init,
-       .suspend        = generic_suspend,
+       .suspend        = bcm5411_suspend,
        .setup_aneg     = bcm54xx_setup_aneg,
        .setup_forced   = bcm54xx_setup_forced,
        .poll_link      = genmii_poll_link,
@@ -859,7 +816,6 @@ static struct mii_phy_def bcm5462V_phy_def = {
  * would be useful here) --BenH.
  */
 static struct mii_phy_ops marvell_phy_ops = {
-       .suspend        = generic_suspend,
        .setup_aneg     = marvell_setup_aneg,
        .setup_forced   = marvell_setup_forced,
        .poll_link      = genmii_poll_link,
@@ -900,7 +856,6 @@ static struct mii_phy_def* mii_phy_table[] = {
        &bcm5411_phy_def,
        &bcm5421_phy_def,
        &bcm5421k2_phy_def,
-       &bcm5461_phy_def,
        &bcm5462V_phy_def,
        &marvell_phy_def,
        &genmii_phy_def,