+
+ /* Wait for link status to get updated */
+ if (!link->link_status)
+ sleep(1);
+
+ /* Configure link only if link is UP*/
+ if (link->link_status) {
+ if (eth_conf->link_speeds == ETH_LINK_SPEED_AUTONEG) {
+ /* Start autoneg only if link is not in autoneg mode */
+ if (!link->link_autoneg)
+ dpaa_restart_link_autoneg(__fif->node_name);
+ } else if (eth_conf->link_speeds & ETH_LINK_SPEED_FIXED) {
+ switch (eth_conf->link_speeds & ~ETH_LINK_SPEED_FIXED) {
+ case ETH_LINK_SPEED_10M_HD:
+ speed = ETH_SPEED_NUM_10M;
+ duplex = ETH_LINK_HALF_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_10M:
+ speed = ETH_SPEED_NUM_10M;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_100M_HD:
+ speed = ETH_SPEED_NUM_100M;
+ duplex = ETH_LINK_HALF_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_100M:
+ speed = ETH_SPEED_NUM_100M;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_1G:
+ speed = ETH_SPEED_NUM_1G;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_2_5G:
+ speed = ETH_SPEED_NUM_2_5G;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ case ETH_LINK_SPEED_10G:
+ speed = ETH_SPEED_NUM_10G;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ default:
+ speed = ETH_SPEED_NUM_NONE;
+ duplex = ETH_LINK_FULL_DUPLEX;
+ break;
+ }
+ /* Set link speed */
+ dpaa_update_link_speed(__fif->node_name, speed, duplex);
+ } else {
+ /* Manual autoneg - custom advertisement speed. */
+ printf("Custom Advertisement speeds not supported\n");
+ }
+ }
+