Changeset cbfece7 in mainline for uspace/app/nic/nic.c


Ignore:
Timestamp:
2014-07-21T22:10:18Z (10 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f1fa64
Parents:
96e368a (diff), 54a1ca7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
  • Merged mainline changes
  • Refactored rtl8169 driver to work with recent driver framework changes
  • Fixed speed selection in rtl8169 (disables autonegotiation first)
  • Added support for restarting autonegotiation
  • Added new switch to 'nic' utility which restarts autonegotiation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nic/nic.c

    r96e368a rcbfece7  
    6060        printf("\taddr <mac_address> - set MAC address\n");
    6161        printf("\tspeed <10|100|1000> - set NIC speed\n");
    62         printf("\tduplex <half|full> - set duplex mode\n");
     62        printf("\tduplex <half|full|simplex> - set duplex mode\n");
     63        printf("\tauto - enable autonegotiation\n");
    6364}
    6465
     
    206207        }
    207208
    208         printf("[Service Name]\n");
     209        printf("[Index]: [Service Name]\n");
    209210        for (i = 0; i < count; i++) {
    210211                rc = loc_service_get_name(nics[i], &svc_name);
     
    320321
    321322        return nic_set_operation_mode(sess, oldspeed, duplex, oldrole);
     323}
     324
     325static int nic_set_autoneg(int i)
     326{
     327        async_sess_t *sess;
     328        int rc;
     329
     330        sess = get_nic_by_index(i);
     331        if (sess == NULL) {
     332                printf("Specified NIC doesn't exist or cannot connect to it.\n");
     333                return EINVAL;
     334        }
     335
     336        rc = nic_autoneg_restart(sess);
     337        if (rc != EOK) {
     338                printf("Error restarting NIC autonegotiation.\n");
     339                return EIO;
     340        }
     341
     342        return EOK;
    322343}
    323344
     
    376397                        return nic_set_duplex(index, argv[3]);
    377398
     399                if (!str_cmp(argv[2], "auto"))
     400                        return nic_set_autoneg(index);
     401
    378402        } else {
    379403                printf(NAME ": Invalid argument.\n");
Note: See TracChangeset for help on using the changeset viewer.