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

« back to all changes in this revision

Viewing changes to drivers/net/bna/bnad_ethtool.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:
237
237
        cmd->phy_address = 0;
238
238
 
239
239
        if (netif_carrier_ok(netdev)) {
240
 
                cmd->speed = SPEED_10000;
 
240
                ethtool_cmd_speed_set(cmd, SPEED_10000);
241
241
                cmd->duplex = DUPLEX_FULL;
242
242
        } else {
243
 
                cmd->speed = -1;
 
243
                ethtool_cmd_speed_set(cmd, -1);
244
244
                cmd->duplex = -1;
245
245
        }
246
246
        cmd->transceiver = XCVR_EXTERNAL;
256
256
        /* 10G full duplex setting supported only */
257
257
        if (cmd->autoneg == AUTONEG_ENABLE)
258
258
                return -EOPNOTSUPP; else {
259
 
                if ((cmd->speed == SPEED_10000) && (cmd->duplex == DUPLEX_FULL))
 
259
                if ((ethtool_cmd_speed(cmd) == SPEED_10000)
 
260
                    && (cmd->duplex == DUPLEX_FULL))
260
261
                        return 0;
261
262
        }
262
263
 
806
807
        return 0;
807
808
}
808
809
 
809
 
static u32
810
 
bnad_get_rx_csum(struct net_device *netdev)
811
 
{
812
 
        u32 rx_csum;
813
 
        struct bnad *bnad = netdev_priv(netdev);
814
 
 
815
 
        rx_csum = bnad->rx_csum;
816
 
        return rx_csum;
817
 
}
818
 
 
819
 
static int
820
 
bnad_set_rx_csum(struct net_device *netdev, u32 rx_csum)
821
 
{
822
 
        struct bnad *bnad = netdev_priv(netdev);
823
 
 
824
 
        mutex_lock(&bnad->conf_mutex);
825
 
        bnad->rx_csum = rx_csum;
826
 
        mutex_unlock(&bnad->conf_mutex);
827
 
        return 0;
828
 
}
829
 
 
830
 
static int
831
 
bnad_set_tx_csum(struct net_device *netdev, u32 tx_csum)
832
 
{
833
 
        struct bnad *bnad = netdev_priv(netdev);
834
 
 
835
 
        mutex_lock(&bnad->conf_mutex);
836
 
        if (tx_csum) {
837
 
                netdev->features |= NETIF_F_IP_CSUM;
838
 
                netdev->features |= NETIF_F_IPV6_CSUM;
839
 
        } else {
840
 
                netdev->features &= ~NETIF_F_IP_CSUM;
841
 
                netdev->features &= ~NETIF_F_IPV6_CSUM;
842
 
        }
843
 
        mutex_unlock(&bnad->conf_mutex);
844
 
        return 0;
845
 
}
846
 
 
847
 
static int
848
 
bnad_set_tso(struct net_device *netdev, u32 tso)
849
 
{
850
 
        struct bnad *bnad = netdev_priv(netdev);
851
 
 
852
 
        mutex_lock(&bnad->conf_mutex);
853
 
        if (tso) {
854
 
                netdev->features |= NETIF_F_TSO;
855
 
                netdev->features |= NETIF_F_TSO6;
856
 
        } else {
857
 
                netdev->features &= ~NETIF_F_TSO;
858
 
                netdev->features &= ~NETIF_F_TSO6;
859
 
        }
860
 
        mutex_unlock(&bnad->conf_mutex);
861
 
        return 0;
862
 
}
863
 
 
864
810
static void
865
811
bnad_get_strings(struct net_device *netdev, u32 stringset, u8 * string)
866
812
{
1256
1202
        .set_ringparam = bnad_set_ringparam,
1257
1203
        .get_pauseparam = bnad_get_pauseparam,
1258
1204
        .set_pauseparam = bnad_set_pauseparam,
1259
 
        .get_rx_csum = bnad_get_rx_csum,
1260
 
        .set_rx_csum = bnad_set_rx_csum,
1261
 
        .get_tx_csum = ethtool_op_get_tx_csum,
1262
 
        .set_tx_csum = bnad_set_tx_csum,
1263
 
        .get_sg = ethtool_op_get_sg,
1264
 
        .set_sg = ethtool_op_set_sg,
1265
 
        .get_tso = ethtool_op_get_tso,
1266
 
        .set_tso = bnad_set_tso,
1267
1205
        .get_strings = bnad_get_strings,
1268
1206
        .get_ethtool_stats = bnad_get_ethtool_stats,
1269
1207
        .get_sset_count = bnad_get_sset_count