image.mk: fix emitting profiles for targets that have no subtargets
[openwrt/staging/mkresin.git] / package / kernel / mac80211 / patches / 315-mac80211-fix-ibss-scan-parameters.patch
1 From: Sara Sharon <sara.sharon@intel.com>
2 Date: Mon, 25 Jan 2016 15:46:35 +0200
3 Subject: [PATCH] mac80211: fix ibss scan parameters
4
5 When joining IBSS a full scan should be initiated in order to search
6 for existing cell, unless the fixed_channel parameter was set.
7 A default channel to create the IBSS on if no cell was found is
8 provided as well.
9 However - a scan is initiated only on the default channel provided
10 regardless of whether ifibss->fixed_channel is set or not, with the
11 obvious result of the cell not joining existing IBSS cell that is
12 on another channel.
13
14 Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request")
15 Signed-off-by: Sara Sharon <sara.sharon@intel.com>
16 Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
17 ---
18
19 --- a/net/mac80211/ibss.c
20 +++ b/net/mac80211/ibss.c
21 @@ -7,6 +7,7 @@
22 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
23 * Copyright 2009, Johannes Berg <johannes@sipsolutions.net>
24 * Copyright 2013-2014 Intel Mobile Communications GmbH
25 + * Copyright(c) 2016 Intel Deutschland GmbH
26 *
27 * This program is free software; you can redistribute it and/or modify
28 * it under the terms of the GNU General Public License version 2 as
29 @@ -1483,14 +1484,21 @@ static void ieee80211_sta_find_ibss(stru
30
31 sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
32
33 - num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy,
34 - &ifibss->chandef,
35 - channels,
36 - ARRAY_SIZE(channels));
37 scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef);
38 - ieee80211_request_ibss_scan(sdata, ifibss->ssid,
39 - ifibss->ssid_len, channels, num,
40 - scan_width);
41 +
42 + if (ifibss->fixed_channel) {
43 + num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy,
44 + &ifibss->chandef,
45 + channels,
46 + ARRAY_SIZE(channels));
47 + ieee80211_request_ibss_scan(sdata, ifibss->ssid,
48 + ifibss->ssid_len, channels,
49 + num, scan_width);
50 + } else {
51 + ieee80211_request_ibss_scan(sdata, ifibss->ssid,
52 + ifibss->ssid_len, NULL,
53 + 0, scan_width);
54 + }
55 } else {
56 int interval = IEEE80211_SCAN_INTERVAL;
57