From 05dd11abffe27c2fd8f618e79036be026f71b20c Mon Sep 17 00:00:00 2001
From: Alberto Milone <alberto.milone@canonical.com>
Date: Mon, 12 May 2014 17:32:44 +0200
Subject: [PATCH 1/1] Add support for Linux 3.15

Make sure to pass the channel to cfg80211_ibss_joined().

This should fix LP: #1307744
---
 src/wl/sys/wl_cfg80211_hybrid.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/x86-64/src/wl/sys/wl_cfg80211_hybrid.c b/x86-64/src/wl/sys/wl_cfg80211_hybrid.c
index 3a5e46b..6384e58 100644
--- a/x86-64/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/x86-64/src/wl/sys/wl_cfg80211_hybrid.c
@@ -1841,7 +1841,26 @@ wl_notify_connect_status(struct wl_cfg80211_priv *wl, struct net_device *ndev,
 			wl_get_assoc_ies(wl);
 			memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
 			wl_update_bss_info(wl);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+			{
+				struct wl_bss_info *bi;
+				u16 bss_info_channel;
+				struct ieee80211_channel *channel;
+				u32 freq;
+
+				bi = (struct wl_bss_info *)(wl->extra_buf + 4);
+				bss_info_channel = bi->ctl_ch ? bi->ctl_ch : CHSPEC_CHANNEL(bi->chanspec);
+
+				freq = ieee80211_channel_to_frequency(bss_info_channel,
+					(bss_info_channel <= CH_MAX_2G_CHANNEL) ?
+					IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
+
+				channel = ieee80211_get_channel(wl_to_wiphy(wl), freq);
+				cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
+			}
+#else
 			cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
+#endif
 			set_bit(WL_STATUS_CONNECTED, &wl->status);
 			wl->profile->active = true;
 		}
-- 
1.9.1
