aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2011-01-16 23:37:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-21 15:34:17 -0500
commit59eb21a6504731fc16db4cf9463065dd61093e08 (patch)
tree4a3732d451c85a5949c6d6294db51a56530677d8 /net/mac80211
parent60f2d1d506195803fa6e1dcf3972637b740fdd60 (diff)
cfg80211: Extend channel to frequency mapping for 802.11j
Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping channel numbers in the 2GHz and 5GHz band we can't map from channel to frequency without knowing the band. This is no problem as in most contexts we know the band. In places where we don't know the band (and WEXT compatibility) we assume the 2GHz band for channels below 14. This patch does not implement all channel to frequency mappings defined in 802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz channels as well as 802.11y channels have been omitted. The following drivers have been updated to reflect the API changes: iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx. The drivers have been compile-tested only. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: Brian Prodoehl <bprodoehl@gmail.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ibss.c3
-rw-r--r--net/mac80211/mesh.c2
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/mac80211/scan.c3
4 files changed, 10 insertions, 6 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 53c7077ffd4f..775fb63471c4 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -270,7 +270,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
270 enum ieee80211_band band = rx_status->band; 270 enum ieee80211_band band = rx_status->band;
271 271
272 if (elems->ds_params && elems->ds_params_len == 1) 272 if (elems->ds_params && elems->ds_params_len == 1)
273 freq = ieee80211_channel_to_frequency(elems->ds_params[0]); 273 freq = ieee80211_channel_to_frequency(elems->ds_params[0],
274 band);
274 else 275 else
275 freq = rx_status->freq; 276 freq = rx_status->freq;
276 277
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 2563fd1ea998..2a57cc02c618 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -574,7 +574,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
574 &elems); 574 &elems);
575 575
576 if (elems.ds_params && elems.ds_params_len == 1) 576 if (elems.ds_params && elems.ds_params_len == 1)
577 freq = ieee80211_channel_to_frequency(elems.ds_params[0]); 577 freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
578 else 578 else
579 freq = rx_status->freq; 579 freq = rx_status->freq;
580 580
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index eecbb1fcd2ab..32210695b8b6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -176,7 +176,7 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
176 176
177 /* check that channel matches the right operating channel */ 177 /* check that channel matches the right operating channel */
178 if (local->hw.conf.channel->center_freq != 178 if (local->hw.conf.channel->center_freq !=
179 ieee80211_channel_to_frequency(hti->control_chan)) 179 ieee80211_channel_to_frequency(hti->control_chan, sband->band))
180 enable_ht = false; 180 enable_ht = false;
181 181
182 if (enable_ht) { 182 if (enable_ht) {
@@ -429,7 +429,8 @@ void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
429 container_of((void *)bss, struct cfg80211_bss, priv); 429 container_of((void *)bss, struct cfg80211_bss, priv);
430 struct ieee80211_channel *new_ch; 430 struct ieee80211_channel *new_ch;
431 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 431 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
432 int new_freq = ieee80211_channel_to_frequency(sw_elem->new_ch_num); 432 int new_freq = ieee80211_channel_to_frequency(sw_elem->new_ch_num,
433 cbss->channel->band);
433 434
434 ASSERT_MGD_MTX(ifmgd); 435 ASSERT_MGD_MTX(ifmgd);
435 436
@@ -1519,7 +1520,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1519 } 1520 }
1520 1521
1521 if (elems->ds_params && elems->ds_params_len == 1) 1522 if (elems->ds_params && elems->ds_params_len == 1)
1522 freq = ieee80211_channel_to_frequency(elems->ds_params[0]); 1523 freq = ieee80211_channel_to_frequency(elems->ds_params[0],
1524 rx_status->band);
1523 else 1525 else
1524 freq = rx_status->freq; 1526 freq = rx_status->freq;
1525 1527
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index fb274db77e3c..1ef73be76b25 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -196,7 +196,8 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
196 ieee802_11_parse_elems(elements, skb->len - baselen, &elems); 196 ieee802_11_parse_elems(elements, skb->len - baselen, &elems);
197 197
198 if (elems.ds_params && elems.ds_params_len == 1) 198 if (elems.ds_params && elems.ds_params_len == 1)
199 freq = ieee80211_channel_to_frequency(elems.ds_params[0]); 199 freq = ieee80211_channel_to_frequency(elems.ds_params[0],
200 rx_status->band);
200 else 201 else
201 freq = rx_status->freq; 202 freq = rx_status->freq;
202 203