mac80211: clean up ieee80211_hw_config errors
Warn when ieee80211_hw_config returns an error, it shouldn't happen; remove a number of printks that would happen in such a case and one printk that is user-triggerable. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
3db594380b
commit
d73782fdde
@@ -394,8 +394,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
|
|||||||
*/
|
*/
|
||||||
if (params->interval) {
|
if (params->interval) {
|
||||||
sdata->local->hw.conf.beacon_int = params->interval;
|
sdata->local->hw.conf.beacon_int = params->interval;
|
||||||
if (ieee80211_hw_config(sdata->local))
|
ieee80211_hw_config(sdata->local);
|
||||||
return -EINVAL;
|
|
||||||
/*
|
/*
|
||||||
* We updated some parameter so if below bails out
|
* We updated some parameter so if below bails out
|
||||||
* it's not an error.
|
* it's not an error.
|
||||||
|
@@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211_local *local)
|
|||||||
wiphy_name(local->hw.wiphy), chan->center_freq);
|
wiphy_name(local->hw.wiphy), chan->center_freq);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (local->open_count)
|
if (local->open_count) {
|
||||||
ret = local->ops->config(local_to_hw(local), &local->hw.conf);
|
ret = local->ops->config(local_to_hw(local), &local->hw.conf);
|
||||||
|
/*
|
||||||
|
* HW reconfiguration should never fail, the driver has told
|
||||||
|
* us what it can support so it should live up to that promise.
|
||||||
|
*/
|
||||||
|
WARN_ON(ret);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -448,18 +448,12 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
|
|||||||
|
|
||||||
if (local->hw_scanning) {
|
if (local->hw_scanning) {
|
||||||
local->hw_scanning = false;
|
local->hw_scanning = false;
|
||||||
if (ieee80211_hw_config(local))
|
ieee80211_hw_config(local);
|
||||||
printk(KERN_DEBUG "%s: failed to restore operational "
|
|
||||||
"channel after scan\n", wiphy_name(local->hw.wiphy));
|
|
||||||
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
local->sw_scanning = false;
|
local->sw_scanning = false;
|
||||||
if (ieee80211_hw_config(local))
|
ieee80211_hw_config(local);
|
||||||
printk(KERN_DEBUG "%s: failed to restore operational "
|
|
||||||
"channel after scan\n", wiphy_name(local->hw.wiphy));
|
|
||||||
|
|
||||||
|
|
||||||
netif_tx_lock_bh(local->mdev);
|
netif_tx_lock_bh(local->mdev);
|
||||||
netif_addr_lock(local->mdev);
|
netif_addr_lock(local->mdev);
|
||||||
@@ -546,12 +540,8 @@ void ieee80211_scan_work(struct work_struct *work)
|
|||||||
|
|
||||||
if (!skip) {
|
if (!skip) {
|
||||||
local->scan_channel = chan;
|
local->scan_channel = chan;
|
||||||
if (ieee80211_hw_config(local)) {
|
if (ieee80211_hw_config(local))
|
||||||
printk(KERN_DEBUG "%s: failed to set freq to "
|
|
||||||
"%d MHz for scan\n", wiphy_name(local->hw.wiphy),
|
|
||||||
chan->center_freq);
|
|
||||||
skip = 1;
|
skip = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* advance state machine to next channel/band */
|
/* advance state machine to next channel/band */
|
||||||
|
@@ -638,11 +638,8 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz)
|
|||||||
|
|
||||||
if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
|
if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
|
||||||
if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
|
if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
|
||||||
chan->flags & IEEE80211_CHAN_NO_IBSS) {
|
chan->flags & IEEE80211_CHAN_NO_IBSS)
|
||||||
printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
|
|
||||||
"%d MHz\n", sdata->dev->name, chan->center_freq);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
local->oper_channel = chan;
|
local->oper_channel = chan;
|
||||||
|
|
||||||
if (local->sw_scanning || local->hw_scanning)
|
if (local->sw_scanning || local->hw_scanning)
|
||||||
|
@@ -689,12 +689,8 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
|
|||||||
ieee80211_led_radio(local, local->hw.conf.radio_enabled);
|
ieee80211_led_radio(local, local->hw.conf.radio_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_reconfig) {
|
if (need_reconfig)
|
||||||
ieee80211_hw_config(local);
|
ieee80211_hw_config(local);
|
||||||
/* The return value of hw_config is not of big interest here,
|
|
||||||
* as it doesn't say that it failed because of _this_ config
|
|
||||||
* change or something else. Ignore it. */
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user