Commit fe19176e authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

iwmc3200wifi: Dont set the UMAC power limit when interface is down

When we're down, we shouldnt try to set the UMAC power limit. We just return 0
instead, and cfg80211 toggles the soft rfkill state.
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 902b6667
...@@ -678,6 +678,9 @@ static int iwm_cfg80211_set_txpower(struct wiphy *wiphy, ...@@ -678,6 +678,9 @@ static int iwm_cfg80211_set_txpower(struct wiphy *wiphy,
case TX_POWER_AUTOMATIC: case TX_POWER_AUTOMATIC:
return 0; return 0;
case TX_POWER_FIXED: case TX_POWER_FIXED:
if (!test_bit(IWM_STATUS_READY, &iwm->status))
return 0;
ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
CFG_TX_PWR_LIMIT_USR, dbm * 2); CFG_TX_PWR_LIMIT_USR, dbm * 2);
if (ret < 0) if (ret < 0)
...@@ -685,6 +688,7 @@ static int iwm_cfg80211_set_txpower(struct wiphy *wiphy, ...@@ -685,6 +688,7 @@ static int iwm_cfg80211_set_txpower(struct wiphy *wiphy,
return iwm_tx_power_trigger(iwm); return iwm_tx_power_trigger(iwm);
default: default:
IWM_ERR(iwm, "Unsupported power type: %d\n", type);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
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