mac80211: use second center_freq segment only in 80+80
authorJohannes Berg <johannes.berg@intel.com>
Thu, 28 Mar 2013 09:26:17 +0000 (10:26 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Apr 2013 13:29:42 +0000 (15:29 +0200)
The field is otherwise reserved, so we shouldn't read
and reject it, though any sane system will probably
have to set it to 0 anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index cf40fac0aae822201bde9aeb1a1b35c6a578c62d..2a2c453544980944da945bb881d3a056e83cc73f 100644 (file)
@@ -303,12 +303,6 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
                                               channel->band);
        vht_chandef.center_freq2 = 0;
 
-       if (vht_oper->center_freq_seg2_idx)
-               vht_chandef.center_freq2 =
-                       ieee80211_channel_to_frequency(
-                               vht_oper->center_freq_seg2_idx,
-                               channel->band);
-
        switch (vht_oper->chan_width) {
        case IEEE80211_VHT_CHANWIDTH_USE_HT:
                vht_chandef.width = chandef->width;
@@ -321,6 +315,10 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
                break;
        case IEEE80211_VHT_CHANWIDTH_80P80MHZ:
                vht_chandef.width = NL80211_CHAN_WIDTH_80P80;
+               vht_chandef.center_freq2 =
+                       ieee80211_channel_to_frequency(
+                               vht_oper->center_freq_seg2_idx,
+                               channel->band);
                break;
        default:
                if (verbose)