Re: [PATCHv2 3/4] ethtool: Use the full 32 bit speed range inethtool's set_settings

From: Stephen Hemminger
Date: Wed Apr 27 2011 - 18:23:19 EST


On Wed, 27 Apr 2011 11:34:48 -0700
David Decotigny <decot@xxxxxxxxxx> wrote:

> diff --git a/drivers/net/skge.c b/drivers/net/skge.c
> index 176d784..b0fa999 100644
> --- a/drivers/net/skge.c
> +++ b/drivers/net/skge.c
> @@ -322,7 +322,7 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
> } else {
> u32 setting;
>
> - switch (ecmd->speed) {
> + switch (ethtool_cmd_speed(ecmd)) {
> case SPEED_1000:
> if (ecmd->duplex == DUPLEX_FULL)
> setting = SUPPORTED_1000baseT_Full;
> @@ -355,7 +355,7 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
> if ((setting & supported) == 0)
> return -EINVAL;
>
> - skge->speed = ecmd->speed;
> + skge->speed = ethtool_cmd_speed(ecmd);
> skge->duplex = ecmd->duplex;
> }
>
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index c8d0451..40afe07 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -3453,7 +3453,7 @@ static int sky2_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
> } else {
> u32 setting;
>
> - switch (ecmd->speed) {
> + switch (ethtool_cmd_speed(ecmd)) {
> case SPEED_1000:
> if (ecmd->duplex == DUPLEX_FULL)
> setting = SUPPORTED_1000baseT_Full;
> @@ -3486,7 +3486,7 @@ static int sky2_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
> if ((setting & supported) == 0)
> return -EINVAL;
>
> - sky2->speed = ecmd->speed;
> + sky2->speed = ethtool_cmd_speed(ecmd);
> sky2->duplex = ecmd->duplex;
> sky2->flags &= ~SKY2_FLAG_AUTO_SPEED;
> }

These two are trivial, thanks for doing it.

Acked-by: Stephen Hemminger <shemminger@xxxxxxxxxx>


--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/