Example #1
0
int phy_reset(struct net_device *dev)
{
#ifdef ARMULATING
    return 0;
#else // ARMULATING
    gmac_priv_t* priv = (gmac_priv_t*)netdev_priv(dev);
    int complete = 0;
    unsigned long end;

    // Start the reset operation
    start_phy_reset(priv);

    // Total time to wait for reset to complete
    end = jiffies + MS_TO_JIFFIES(PHY_TRANSFER_TIMEOUT_MS);

    // Should apparently wait at least 50mS before reading back from PHY; this
    // could just be a nasty feature of the SMC91x MAC/PHY and not apply to us
    msleep(50);

    // Read back the status until it indicates reset, or we timeout
    while (!(complete = is_phy_reset_complete(priv)) && time_before(jiffies, end)) {
        msleep(1);
    }

    return !complete;
#endif // ARMULATING
}
Example #2
0
int phy_reset(struct net_device *dev)
{
    gmac_priv_t* priv = (gmac_priv_t*)netdev_priv(dev);
    int complete = 0;
    unsigned long end;

    // Start the reset operation
    start_phy_reset(priv);

    // Total time to wait for reset to complete
    end = jiffies + MS_TO_JIFFIES(PHY_TRANSFER_TIMEOUT_MS);

    // Read back the status until it indicates reset, or we timeout
    while (!(complete = is_phy_reset_complete(priv)) && time_before(jiffies, end)) {
        msleep(1);
    }

    /* if (complete) { */
    /*     	post_phy_reset_action(dev); */
    /* } */

    return !complete;
}