Commit 9f3b2416 authored by Zhu Yi's avatar Zhu Yi Committed by John W. Linville

[PATCH] ipw2100: Fix `iwpriv set_power` error

iwpriv <iface> set_power [0~6] can be used for ipw2100. '0' indicates
off and '6' indicates auto. 1~5 are the actual power levels.
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 90869b24
...@@ -7868,10 +7868,10 @@ static int ipw2100_wx_set_powermode(struct net_device *dev, ...@@ -7868,10 +7868,10 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
goto done; goto done;
} }
if ((mode < 1) || (mode > POWER_MODES)) if ((mode < 0) || (mode > POWER_MODES))
mode = IPW_POWER_AUTO; mode = IPW_POWER_AUTO;
if (priv->power_mode != mode) if (IPW_POWER_LEVEL(priv->power_mode) != mode)
err = ipw2100_set_power_mode(priv, mode); err = ipw2100_set_power_mode(priv, mode);
done: done:
mutex_unlock(&priv->action_mutex); mutex_unlock(&priv->action_mutex);
...@@ -7902,7 +7902,7 @@ static int ipw2100_wx_get_powermode(struct net_device *dev, ...@@ -7902,7 +7902,7 @@ static int ipw2100_wx_get_powermode(struct net_device *dev,
break; break;
case IPW_POWER_AUTO: case IPW_POWER_AUTO:
snprintf(extra, MAX_POWER_STRING, snprintf(extra, MAX_POWER_STRING,
"Power save level: %d (Auto)", 0); "Power save level: %d (Auto)", level);
break; break;
default: default:
timeout = timeout_duration[level - 1] / 1000; timeout = timeout_duration[level - 1] / 1000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment