~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/sfc/mcdi_phy.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
2
 * Driver for Solarflare Solarstorm network controllers and boards
3
 
 * Copyright 2009 Solarflare Communications Inc.
 
3
 * Copyright 2009-2010 Solarflare Communications Inc.
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify it
6
6
 * under the terms of the GNU General Public License version 2 as published
449
449
        struct efx_mcdi_phy_data *phy_cfg = efx->phy_data;
450
450
        u32 rmtadv;
451
451
 
452
 
        /* The link partner capabilities are only relevent if the
 
452
        /* The link partner capabilities are only relevant if the
453
453
         * link supports flow control autonegotiation */
454
454
        if (~phy_cfg->supported_cap & (1 << MC_CMD_PHY_CAP_AN_LBN))
455
455
                return;
513
513
        ecmd->supported =
514
514
                mcdi_to_ethtool_cap(phy_cfg->media, phy_cfg->supported_cap);
515
515
        ecmd->advertising = efx->link_advertising;
516
 
        ecmd->speed = efx->link_state.speed;
 
516
        ethtool_cmd_speed_set(ecmd, efx->link_state.speed);
517
517
        ecmd->duplex = efx->link_state.fd;
518
518
        ecmd->port = mcdi_to_ethtool_media(phy_cfg->media);
519
519
        ecmd->phy_address = phy_cfg->port;
545
545
                caps = (ethtool_to_mcdi_cap(ecmd->advertising) |
546
546
                         1 << MC_CMD_PHY_CAP_AN_LBN);
547
547
        } else if (ecmd->duplex) {
548
 
                switch (ecmd->speed) {
 
548
                switch (ethtool_cmd_speed(ecmd)) {
549
549
                case 10:    caps = 1 << MC_CMD_PHY_CAP_10FDX_LBN;    break;
550
550
                case 100:   caps = 1 << MC_CMD_PHY_CAP_100FDX_LBN;   break;
551
551
                case 1000:  caps = 1 << MC_CMD_PHY_CAP_1000FDX_LBN;  break;
553
553
                default:    return -EINVAL;
554
554
                }
555
555
        } else {
556
 
                switch (ecmd->speed) {
 
556
                switch (ethtool_cmd_speed(ecmd)) {
557
557
                case 10:    caps = 1 << MC_CMD_PHY_CAP_10HDX_LBN;    break;
558
558
                case 100:   caps = 1 << MC_CMD_PHY_CAP_100HDX_LBN;   break;
559
559
                case 1000:  caps = 1 << MC_CMD_PHY_CAP_1000HDX_LBN;  break;
739
739
        return NULL;
740
740
}
741
741
 
742
 
struct efx_phy_operations efx_mcdi_phy_ops = {
 
742
const struct efx_phy_operations efx_mcdi_phy_ops = {
743
743
        .probe          = efx_mcdi_phy_probe,
744
744
        .init           = efx_port_dummy_op_int,
745
745
        .reconfigure    = efx_mcdi_phy_reconfigure,