@@ -1,386 +0,0 @@
1−--- a/src/wl/sys/wl_cfg80211_hybrid.c 2014-06-26 12:42:08.000000000 +0200
2−+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2015-04-13 13:20:08.140013177 +0200
4− static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
5− struct cfg80211_ibss_params *params);
6− static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev);
7−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
8− static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
9− struct net_device *dev, u8 *mac, struct station_info *sinfo);
11−+static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
12−+ struct net_device *dev, const u8 *mac, struct station_info *sinfo);
14− static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
15− struct net_device *dev, bool enabled, s32 timeout);
16− static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
18− key_endian_to_host(&key);
20− params.key_len = (u8) min_t(u8, DOT11_MAX_KEY_SIZE, key.len);
21−- memcpy(params.key, key.data, params.key_len);
22−+ memcpy((char *)params.key, key.data, params.key_len);
24− if ((err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec)))) {
26−@@ -1421,9 +1426,15 @@
30−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
32− wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
33− u8 *mac, struct station_info *sinfo)
36−+wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
37−+ const u8 *mac, struct station_info *sinfo)
40− struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
42−@@ -1441,7 +1452,11 @@
43− WL_DBG(("Could not get rate (%d)\n", err));
46−+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
47− sinfo->filled |= STATION_INFO_TX_BITRATE;
49−+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
51− sinfo->txrate.legacy = rate * 5;
52− WL_DBG(("Rate %d Mbps\n", (rate / 2)));
54−@@ -1454,7 +1469,11 @@
57− rssi = dtoh32(scb_val.val);
58−+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
59− sinfo->filled |= STATION_INFO_SIGNAL;
61−+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
63− sinfo->signal = rssi;
64− WL_DBG(("RSSI %d dBm\n", rssi));
66−@@ -2010,9 +2029,15 @@
68− notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
69− notify_ielen = le32_to_cpu(bi->ie_length);
70−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
71− cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
72− 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
73− (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
75−+ cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet),
76−+ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
77−+ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
82−@@ -2047,7 +2072,11 @@
84− else if ((event == WLC_E_LINK && ~(flags & WLC_EVENT_MSG_LINK)) ||
85− event == WLC_E_DEAUTH_IND || event == WLC_E_DISASSOC_IND) {
86−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
87−+ cfg80211_disconnected(ndev, 0, NULL, 0, false, GFP_KERNEL);
89− cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
91− clear_bit(WL_STATUS_CONNECTED, &wl->status);
93− wl_init_prof(wl->profile);
94−@@ -2071,7 +2100,26 @@
95− wl_get_assoc_ies(wl);
96− memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
97− wl_update_bss_info(wl);
98−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
100−+ struct wl_bss_info *bi;
101−+ u16 bss_info_channel;
102−+ struct ieee80211_channel *channel;
105−+ bi = (struct wl_bss_info *)(wl->extra_buf + 4);
106−+ bss_info_channel = bi->ctl_ch ? bi->ctl_ch : CHSPEC_CHANNEL(bi->chanspec);
108−+ freq = ieee80211_channel_to_frequency(bss_info_channel,
109−+ (bss_info_channel <= CH_MAX_2G_CHANNEL) ?
110−+ IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
112−+ channel = ieee80211_get_channel(wl_to_wiphy(wl), freq);
113−+ cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
116− cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
118− set_bit(WL_STATUS_CONNECTED, &wl->status);
119− wl->profile->active = true;
121−@@ -2629,7 +2677,15 @@
123− void wl_cfg80211_detach(struct net_device *ndev)
125−- struct wl_cfg80211_priv *wl = ndev_to_wl(ndev);
126−+ struct wl_cfg80211_priv *wl;
127−+ struct wireless_dev *wdev;
129−+ wdev = ndev->ieee80211_ptr;
130−+ if (wdev == NULL) {
131−+ printk(KERN_ERR "[%s()] in ndev=%p: IEEE80211ptr=%p\n", __FUNCTION__, ndev, wdev);
134−+ wl = ndev_to_wl(ndev);
136− wl_deinit_cfg80211_priv(wl);
138−--- a/src/wl/sys/wl_dbg.h 2014-06-26 12:42:08.000000000 +0200
139−+++ b/src/wl/sys/wl_dbg.h 2015-04-13 13:19:52.443345832 +0200
142− #define WL_NONE(args)
144−+#define FORCE_TRACE_LEVEL(fmt, ...) do { printk(KERN_ERR fmt, ## __VA_ARGS__); } while (0) /* ## is GCC specific syntax to remove comma when single arg */
147− #define WL_ERROR(args) WL_PRINT(args)
149−-#define WL_ERROR(args)
150−+#define WL_ERROR(args) FORCE_TRACE_LEVEL args
152− #define WL_TRACE(args)
153− #define WL_APSTA_UPDN(args)
154−--- a/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
155−+++ b/src/wl/sys/wl_linux.c 2015-04-13 13:19:52.443345832 +0200
157− static SIMPLE_DEV_PM_OPS(wl_pm_ops, wl_suspend, wl_resume);
160−-static struct pci_driver wl_pci_driver = {
161−+static struct pci_driver wl_pci_driver __refdata = {
163− .probe = wl_pci_probe,
164− .remove = __devexit_p(wl_remove),
165−@@ -1270,6 +1270,7 @@
166− MFREE(wl->osh, wlif->dev, sizeof(struct net_device));
168− free_netdev(wlif->dev);
173−@@ -1307,7 +1308,12 @@
174− dev->priv = priv_link;
177−+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0))
178− dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
180−+ dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN,
184− WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
185− (wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));
186−@@ -1651,11 +1657,7 @@
190−- if (!capable(CAP_NET_ADMIN)) {
191−- bcmerror = BCME_EPERM;
193−- bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
195−+ bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
199−@@ -2157,8 +2159,8 @@
200− wlif = WL_DEV_IF(dev);
204− if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
209−@@ -2455,8 +2457,10 @@
212− len = sizeof(p80211msg_t) + oskb->len - D11_PHY_HDR_LEN;
213−- if ((skb = dev_alloc_skb(len)) == NULL)
214−+ if ((skb = dev_alloc_skb(len)) == NULL) {
215−+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
220− phdr = (p80211msg_t*)skb->data;
221−@@ -2535,8 +2539,10 @@
222− rtap_len = sizeof(wl_radiotap_ht_brcm_2_t);
224− len = rtap_len + (oskb->len - D11_PHY_HDR_LEN);
225−- if ((skb = dev_alloc_skb(len)) == NULL)
226−+ if ((skb = dev_alloc_skb(len)) == NULL) {
227−+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
233−@@ -2664,8 +2670,10 @@
237−- if ((skb = dev_alloc_skb(len)) == NULL)
238−+ if ((skb = dev_alloc_skb(len)) == NULL) {
239−+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
245−@@ -2990,7 +2998,7 @@
249−-wl_set_monitor(wl_info_t *wl, int val)
250−+wl_set_monitor(wl_info_t *wl, int val) /* public => is called by wlc_hybrid.o_shipped */
252− const char *devname;
254−@@ -3224,42 +3232,75 @@
255− #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
257− wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
259−+ wl_info_t * wl = (wl_info_t *)data;
262−-wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *data)
264−+wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
266−- wl_info_t * wl = (wl_info_t *)data;
269−+ wl_info_t * wl = PDE_DATA(file_inode(filp));
275− #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
281−+ if (*offp > 0) { /* for example, stop: cat /proc/brcm_monitor0 */
282−+ return 0; /* 0 <=> EOF */
287−- WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__));
291−- wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
292−- len = sprintf(buffer, "%d\n", to_user);
295−+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
298−+ if (bcmerror != BCME_OK) {
299−+ WL_ERROR(("%s: GET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
303−+ len = snprintf(tmp, ARRAY_SIZE(tmp), "%d\n", to_user);
304−+ tmp[ARRAY_SIZE(tmp) - 1] = '\0';
305−+ if (len >= ARRAY_SIZE(tmp)) {
306−+ printk(KERN_ERR "%s:%d [%s()] output would be truncated (ret=%d)!", __FILE__, __LINE__, __FUNCTION__, len);
309−+ else if (len < 0) {
310−+ printk(KERN_ERR "%s:%d [%s()] unable to convert value (ret=%d)!", __FILE__, __LINE__, __FUNCTION__, len);
313−+ if (length < len) {
314−+ printk(KERN_ERR "%s:%d [%s()] user buffer is too small (at least=%d ; user=%d)!", __FILE__, __LINE__, __FUNCTION__, len, (int)length);
317−+ if (copy_to_user(buffer, tmp, len) != 0) {
318−+ printk(KERN_ERR "%s:%d [%s()] unable to copy data!", __FILE__, __LINE__, __FUNCTION__);
322−+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
329− #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
331− wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data)
333−+ wl_info_t * wl = (wl_info_t *)data;
336−-wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *data)
338−+wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
340−- wl_info_t * wl = (wl_info_t *)data;
341−+ wl_info_t * wl = PDE_DATA(file_inode(filp));
346−@@ -3270,7 +3311,11 @@
348− if (copy_from_user(&from_user, buff, 1)) {
349− WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
351−+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
358− if (from_user >= 0x30)
359−@@ -3280,10 +3325,15 @@
360− bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
363−- if (bcmerror < 0) {
364−+ if (bcmerror != BCME_OK) {
365− WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
369−+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) && 0 /* no need to update offset because this file should only trigger action... */
376−@@ -3304,8 +3354,8 @@
377− if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
378− WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
380−- if ((wl->proc_entry = proc_create(tmp, 0644, NULL, &wl_fops)) == NULL) {
381−- WL_ERROR(("%s: proc_create %s failed\n", __FUNCTION__, tmp));
382−+ if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
383−+ WL_ERROR(("%s: proc_create_data %s failed\n", __FUNCTION__, tmp));