summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c
diff options
context:
space:
mode:
authorBadreddine ZAGROUBA2010-10-01 17:25:08 +0200
committerBadreddine ZAGROUBA2010-10-04 16:07:13 +0200
commit34e7a20f8e0615ebfdf9727b0c1512310c64fdef (patch)
tree50ef636963f82204a9abf346c88e1b37362218b9 /cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c
parenta25e3a1f26fb95916a761e03a1a4901e45591aae (diff)
cleo/linux/eth: Split ETH and PHY drivers, closes #1860
- ETH driver : cleaning & /proc entry modification to be completely independent from PHY driver - IP175 PHY driver : add connection autodetection mechnaism and 100M/Full static setting for PHY5 Please enter the commit message for your changes.
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c b/cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c
index af3f1f2a9f..be4c3387f5 100644
--- a/cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/net/phy/icplus.c
@@ -40,6 +40,8 @@ static int ip175c_config_init(struct phy_device *phydev)
int err, i;
static int full_reset_performed = 0;
+ printk("ICPlus IP175C : Driver Initialization - PHY addr = %d\n", phydev->addr);
+
if (full_reset_performed == 0) {
/* master reset */
@@ -92,17 +94,41 @@ static int ip175c_config_init(struct phy_device *phydev)
static int ip175c_read_status(struct phy_device *phydev)
{
+ int i, status;
+
if (phydev->addr == 4) /* WAN port */
genphy_read_status(phydev);
- else
- /* Don't need to read status for switch ports */
- phydev->irq = PHY_IGNORE_INTERRUPT;
+
+ if (phydev->addr == 5) /* MAC 5 */
+ {
+ /* Read all links status */
+ phydev->link = 0;
+ for (i = 0; i < 5; i++) {
+ /* Do a fake read */
+ status = phydev->bus->read(phydev->bus, i, MII_BMSR);
+ if (status < 0)
+ return status;
+ /* Read link and autonegotiation status */
+ status = phydev->bus->read(phydev->bus, i, MII_BMSR);
+ if (status < 0)
+ return status;
+ if ((status & BMSR_LSTATUS) != 0)
+ phydev->link = 1;
+ }
+ }
return 0;
}
static int ip175c_config_aneg(struct phy_device *phydev)
{
+ if (phydev->addr == 5) /* MAC 5 */
+ {
+ phydev->autoneg = AUTONEG_DISABLE;
+ phydev->speed = SPEED_100;
+ phydev->duplex = DUPLEX_FULL;
+ genphy_config_aneg(phydev);
+ }
if (phydev->addr == 4) /* WAN port */
genphy_config_aneg(phydev);