From 799b1bad7c00858adc659cd7e27f8a9ecb65c4ae Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 7 Oct 2008 12:04:34 +0200 Subject: [PATCH] --- yaml --- r: 121561 b: refs/heads/master c: d73782fdde76554016abf73b46f843b29f520848 h: refs/heads/master i: 121559: 96a158742eda0f3e6aeb11f3bd3cc6feae4b1614 v: v3 --- [refs] | 2 +- trunk/net/mac80211/cfg.c | 3 +-- trunk/net/mac80211/main.c | 8 +++++++- trunk/net/mac80211/scan.c | 16 +++------------- trunk/net/mac80211/util.c | 5 +---- trunk/net/mac80211/wext.c | 6 +----- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/[refs] b/[refs] index afb29cce1e64..06e6cb0e48eb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3db594380b8452eda4d88b12844077809607caaa +refs/heads/master: d73782fdde76554016abf73b46f843b29f520848 diff --git a/trunk/net/mac80211/cfg.c b/trunk/net/mac80211/cfg.c index 8dc5e46cea68..cf3fd5d60665 100644 --- a/trunk/net/mac80211/cfg.c +++ b/trunk/net/mac80211/cfg.c @@ -394,8 +394,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, */ if (params->interval) { sdata->local->hw.conf.beacon_int = params->interval; - if (ieee80211_hw_config(sdata->local)) - return -EINVAL; + ieee80211_hw_config(sdata->local); /* * We updated some parameter so if below bails out * it's not an error. diff --git a/trunk/net/mac80211/main.c b/trunk/net/mac80211/main.c index ff39d893a113..2ff26d03cd50 100644 --- a/trunk/net/mac80211/main.c +++ b/trunk/net/mac80211/main.c @@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211_local *local) wiphy_name(local->hw.wiphy), chan->center_freq); #endif - if (local->open_count) + if (local->open_count) { 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; } diff --git a/trunk/net/mac80211/scan.c b/trunk/net/mac80211/scan.c index 416bb41099f3..0989b1c062e3 100644 --- a/trunk/net/mac80211/scan.c +++ b/trunk/net/mac80211/scan.c @@ -448,18 +448,12 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) if (local->hw_scanning) { local->hw_scanning = false; - if (ieee80211_hw_config(local)) - printk(KERN_DEBUG "%s: failed to restore operational " - "channel after scan\n", wiphy_name(local->hw.wiphy)); - + ieee80211_hw_config(local); goto done; } local->sw_scanning = false; - if (ieee80211_hw_config(local)) - printk(KERN_DEBUG "%s: failed to restore operational " - "channel after scan\n", wiphy_name(local->hw.wiphy)); - + ieee80211_hw_config(local); netif_tx_lock_bh(local->mdev); netif_addr_lock(local->mdev); @@ -546,12 +540,8 @@ void ieee80211_scan_work(struct work_struct *work) if (!skip) { local->scan_channel = chan; - 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); + if (ieee80211_hw_config(local)) skip = 1; - } } /* advance state machine to next channel/band */ diff --git a/trunk/net/mac80211/util.c b/trunk/net/mac80211/util.c index cee4884b9d06..1b605457017e 100644 --- a/trunk/net/mac80211/util.c +++ b/trunk/net/mac80211/util.c @@ -638,11 +638,8 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz) if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { if (sdata->vif.type == NL80211_IFTYPE_ADHOC && - chan->flags & IEEE80211_CHAN_NO_IBSS) { - printk(KERN_DEBUG "%s: IBSS not allowed on frequency " - "%d MHz\n", sdata->dev->name, chan->center_freq); + chan->flags & IEEE80211_CHAN_NO_IBSS) return ret; - } local->oper_channel = chan; if (local->sw_scanning || local->hw_scanning) diff --git a/trunk/net/mac80211/wext.c b/trunk/net/mac80211/wext.c index 742f811ca416..29c41040c8c9 100644 --- a/trunk/net/mac80211/wext.c +++ b/trunk/net/mac80211/wext.c @@ -689,12 +689,8 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev, ieee80211_led_radio(local, local->hw.conf.radio_enabled); } - if (need_reconfig) { + if (need_reconfig) 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; }