summaryrefslogtreecommitdiff
path: root/patches/0094-backport-old-tegra-compile.patch
blob: abd418a593d6852b1a04da4e3f87051f6103a57c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
From 6e3d45d51a72d29e46fc6ffc0fa9722ccd6d7c16 Mon Sep 17 00:00:00 2001
From: Dominik Sliwa <dominik.sliwa@toradex.com>
Date: Fri, 22 Feb 2019 09:22:28 +0100
Subject: [PATCH] backport old tegra compile

---
 drivers/net/wireless/ath/ath10k/mac.c              |  7 +++++++
 drivers/net/wireless/intel/iwlwifi/fw/acpi.h       |  4 ++++
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  4 ++++
 drivers/net/wireless/mediatek/mt76/dma.c           |  4 ++++
 drivers/net/wireless/mediatek/mt76/mac80211.c      |  4 ++++
 drivers/net/wireless/mediatek/mt76/mt76.h          |  4 ++++
 drivers/net/wireless/mediatek/mt76/mt76x0/dma.c    | 10 ++++++++--
 drivers/net/wireless/mediatek/mt76/mt76x0/mac.c    |  5 ++++-
 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c    |  7 +++++--
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.c    |  4 ++++
 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h  |  3 ++-
 drivers/net/wireless/mediatek/mt76/mt76x0/tx.c     |  5 ++++-
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c    | 11 ++++++++---
 drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c |  1 +
 drivers/net/wireless/mediatek/mt76/usb.c           |  5 +++++
 drivers/net/wireless/mediatek/mt7601u/trace.c      |  2 ++
 16 files changed, 71 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3ceca7a..82e3da1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8182,6 +8182,7 @@ struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id)
 #define WRD_METHOD "WRDD"
 #define WRDD_WIFI  (0x07)
 
+#if LINUX_VERSION_IS_GEQ(3,11,0)
 static u32 ath10k_mac_wrdd_get_mcc(struct ath10k *ar, union acpi_object *wrdd)
 {
 	union acpi_object *mcc_pkg;
@@ -8265,6 +8266,12 @@ static int ath10k_mac_get_wrdd_regulatory(struct ath10k *ar, u16 *rd)
 	*rd |= COUNTRY_ERD_FLAG;
 	return 0;
 }
+#else
+static int ath10k_mac_get_wrdd_regulatory(struct ath10k *ar, u16 *rd)
+{
+    return -EOPNOTSUPP;
+}
+#endif
 
 static int ath10k_mac_init_rd(struct ath10k *ar)
 {
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
index 0b3b122..44d36ac 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
@@ -114,6 +114,10 @@ u64 iwl_acpi_get_pwr_limit(struct device *dev);
 
 #else /* CONFIG_ACPI */
 
+#if LINUX_VERSION_IS_LESS(3,11,0)
+typedef char *acpi_string;   /* Null terminated ASCII string */
+#endif
+
 static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method)
 {
 	return ERR_PTR(-ENOENT);
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 74e0e83..3134561 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2823,10 +2823,14 @@ static void mwifiex_pcie_card_reset_work(struct mwifiex_adapter *adapter)
 {
 	struct pcie_service_card *card = adapter->card;
 
+#if LINUX_VERSION_IS_LESS(3,14,0)
+	pci_reset_function(card->dev);
+#else
 	/* We can't afford to wait here; remove() might be waiting on us. If we
 	 * can't grab the device lock, maybe we'll get another chance later.
 	 */
 	pci_try_reset_function(card->dev);
+#endif
 }
 
 static void mwifiex_pcie_work(struct work_struct *work)
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index c51da22..7bc3f5b 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -325,7 +325,11 @@ mt76_dma_rx_fill(struct mt76_dev *dev, struct mt76_queue *q, bool napi)
 	void *(*alloc)(unsigned int fragsz);
 
 	if (napi)
+#if LINUX_VERSION_IS_LESS(3,18,0)
+		alloc = netdev_alloc_frag;
+#else
 		alloc = napi_alloc_frag;
+#endif
 	else
 		alloc = netdev_alloc_frag;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 4517caf..86c9e06 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -92,6 +92,9 @@ static const struct ieee80211_tpt_blink mt76_tpt_blink[] = {
 
 static int mt76_led_init(struct mt76_dev *dev)
 {
+#if LINUX_VERSION_IS_LESS(4,1,0)
+	return 0;
+#else
 	struct device_node *np = dev->dev->of_node;
 	struct ieee80211_hw *hw = dev->hw;
 	int led_pin;
@@ -117,6 +120,7 @@ static int mt76_led_init(struct mt76_dev *dev)
 	}
 
 	return devm_led_classdev_register(dev->dev, &dev->led_cdev);
+#endif
 }
 
 static void mt76_init_stream_cap(struct mt76_dev *dev,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 2eab358..e579d82 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -574,9 +574,13 @@ static inline bool mt76u_check_sg(struct mt76_dev *dev)
 	struct usb_interface *intf = to_usb_interface(dev->dev);
 	struct usb_device *udev = interface_to_usbdev(intf);
 
+#if LINUX_VERSION_IS_LESS(3,14,0)
+	return udev->bus->sg_tablesize > 0 && udev->speed == USB_SPEED_WIRELESS;
+#else
 	return (udev->bus->sg_tablesize > 0 &&
 		(udev->bus->no_sg_constraint ||
 		 udev->speed == USB_SPEED_WIRELESS));
+#endif
 }
 
 int mt76u_vendor_request(struct mt76_dev *dev, u8 req,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/dma.c b/drivers/net/wireless/mediatek/mt76/mt76x0/dma.c
index e2efb43..4877f4d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/dma.c
@@ -104,8 +104,9 @@ static void mt76x0_rx_process_seg(struct mt76x0_dev *dev, u8 *data,
 
 	if (unlikely(FIELD_GET(MT_RXD_INFO_TYPE, fce_info)))
 		dev_err_once(dev->mt76.dev, "Error: RX path seen a non-pkt urb\n");
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_rx(&dev->mt76, rxwi, fce_info);
+#endif
 
 	skb = mt76x0_rx_skb_from_seg(dev, rxwi, data, seg_len, truesize, p);
 	if (!skb)
@@ -154,8 +155,10 @@ mt76x0_rx_process_entry(struct mt76x0_dev *dev, struct mt76x0_dma_buf_rx *e)
 		cnt++;
 	}
 
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	if (cnt > 1)
 		trace_mt76x0_rx_dma_aggr(&dev->mt76, cnt, !!new_p);
+#endif
 
 	if (new_p) {
 		/* we have one extra ref from the allocator */
@@ -235,7 +238,9 @@ static void mt76x0_complete_tx(struct urb *urb)
 		goto out;
 
 	skb = q->e[q->start].skb;
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_tx_dma_done(&dev->mt76, skb);
+#endif
 
 	__skb_queue_tail(&dev->tx_skb_done, skb);
 	tasklet_schedule(&dev->tx_tasklet);
@@ -383,8 +388,9 @@ static int mt76x0_submit_rx_buf(struct mt76x0_dev *dev,
 
 	usb_fill_bulk_urb(e->urb, usb_dev, pipe, buf, MT_RX_URB_SIZE,
 			  mt76x0_complete_rx, dev);
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_submit_urb(&dev->mt76, e->urb);
+#endif
 	ret = usb_submit_urb(e->urb, gfp);
 	if (ret)
 		dev_err(dev->mt76.dev, "Error: submit RX URB failed:%d\n", ret);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c b/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
index 91a84be..4d21651 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
@@ -603,8 +603,9 @@ int mt76x0_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx,
 	cipher = mt76_mac_get_key_info(key, key_data);
 	if (cipher == MT_CIPHER_NONE && key)
 		return -EINVAL;
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_set_key(&dev->mt76, idx);
+#endif
 
 	mt76_wr_copy(dev, MT_WCID_KEY(idx), key_data, sizeof(key_data));
 
@@ -644,7 +645,9 @@ int mt76x0_mac_shared_key_setup(struct mt76x0_dev *dev, u8 vif_idx, u8 key_idx,
 	if (cipher == MT_CIPHER_NONE && key)
 		return -EINVAL;
 
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_set_shared_key(&dev->mt76, vif_idx, key_idx);
+#endif
 
 	mt76_wr_copy(dev, MT_SKEY(vif_idx, key_idx),
 			key_data, sizeof(key_data));
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
index 8affacb..1f563c8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
@@ -55,8 +55,9 @@ static inline void trace_mt76x0_mcu_msg_send_cs(struct mt76_dev *dev,
 
 	for (i = 0; i < skb->len / 4; i++)
 		csum ^= get_unaligned_le32(skb->data + i * 4);
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_mcu_msg_send(dev, skb, csum, need_resp);
+#endif
 }
 
 static struct sk_buff *
@@ -167,9 +168,11 @@ __mt76x0_mcu_msg_send(struct mt76x0_dev *dev, struct sk_buff *skb,
 
 	if (dev->mcu.resp_cmpl.done)
 		dev_err(dev->mt76.dev, "Error: MCU response pre-completed!\n");
-
 	trace_mt76x0_mcu_msg_send_cs(&dev->mt76, skb, wait_resp);
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_submit_urb_sync(&dev->mt76, cmd_pipe, skb->len);
+#endif
+
 
 	ret = usb_bulk_msg(usb_dev, cmd_pipe, skb->data, skb->len, &sent, 500);
 	if (ret) {
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
index 14e8c57..a9727e2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
@@ -52,7 +52,9 @@ mt76x0_rf_csr_wr(struct mt76x0_dev *dev, u32 offset, u8 value)
 		   FIELD_PREP(MT_RF_CSR_CFG_REG_ID, reg) |
 		   MT_RF_CSR_CFG_WR |
 		   MT_RF_CSR_CFG_KICK);
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_rf_write(&dev->mt76, bank, offset, value);
+#endif
 out:
 	mutex_unlock(&dev->reg_atomic_mutex);
 
@@ -96,7 +98,9 @@ mt76x0_rf_csr_rr(struct mt76x0_dev *dev, u32 offset)
 	if (FIELD_GET(MT_RF_CSR_CFG_REG_ID, val) == reg &&
 	    FIELD_GET(MT_RF_CSR_CFG_REG_BANK, val) == bank) {
 		ret = FIELD_GET(MT_RF_CSR_CFG_DATA, val);
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 		trace_mt76x0_rf_read(&dev->mt76, bank, offset, ret);
+#endif
 	}
 out:
 	mutex_unlock(&dev->reg_atomic_mutex);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h b/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
index 8a752a0..3730a33 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
@@ -14,10 +14,10 @@
 
 #if !defined(__MT76X0U_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
 #define __MT76X0U_TRACE_H
-
 #include <linux/tracepoint.h>
 #include "mt76x0.h"
 #include "mac.h"
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM mt76x0
@@ -311,3 +311,4 @@ TRACE_EVENT(mt76x0_set_shared_key,
 #define TRACE_INCLUDE_FILE trace
 
 #include <trace/define_trace.h>
+#endif
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
index 751b49c..21c42cb 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
@@ -176,8 +176,9 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 
 	if (mt76x0_dma_enqueue_tx(dev, skb, wcid, hw_q))
 		return;
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_tx(&dev->mt76, skb, msta, txwi);
+#endif
 }
 
 void mt76x0_tx_stat(struct work_struct *work)
@@ -198,7 +199,9 @@ void mt76x0_tx_stat(struct work_struct *work)
 
 		cleaned++;
 	}
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_tx_status_cleaned(&dev->mt76, cleaned);
+#endif
 
 	spin_lock_irqsave(&dev->tx_lock, flags);
 	if (cleaned)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
index a9a7b6f..014890b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
@@ -83,8 +83,9 @@ int mt76x0_usb_submit_buf(struct mt76x0_dev *dev, int dir, int ep_idx,
 			  complete_fn, context);
 	buf->urb->transfer_dma = buf->dma;
 	buf->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_submit_urb(&dev->mt76, buf->urb);
+#endif
 	ret = usb_submit_urb(buf->urb, gfp);
 	if (ret)
 		dev_err(dev->mt76.dev, "Error: submit URB dir:%d ep:%d failed:%d\n",
@@ -113,9 +114,10 @@ int mt76x0_vendor_request(struct mt76x0_dev *dev, const u8 req,
 		ret = usb_control_msg(usb_dev, pipe, req, req_type,
 				      val, offset, buf, buflen,
 				      MT_VEND_REQ_TOUT_MS);
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 		trace_mt76x0_vend_req(&dev->mt76, pipe, req, req_type, val, offset,
 				  buf, buflen, ret);
-
+#endif
 		if (ret == -ENODEV)
 			set_bit(MT76_REMOVED, &dev->mt76.state);
 		if (ret >= 0 || ret == -ENODEV)
@@ -155,8 +157,9 @@ static u32 mt76x0_rr(struct mt76_dev *dev, u32 offset)
 			ret, offset);
 
 	mutex_unlock(&mdev->usb_ctrl_mtx);
-
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_reg_read(dev, offset, val);
+#endif
 	return val;
 }
 
@@ -191,7 +194,9 @@ static void mt76x0_wr(struct mt76_dev *dev, u32 offset, u32 val)
 	put_unaligned_le32(val, mdev->data);
 	ret = mt76x0_vendor_request(mdev, MT_VEND_MULTI_WRITE, USB_DIR_OUT,
 				    0, offset, mdev->data, MT_VEND_BUF);
+#if LINUX_VERSION_IS_GEQ(3,12,0)
 	trace_mt76x0_reg_write(dev, offset, val);
+#endif
 
 	mutex_unlock(&mdev->usb_ctrl_mtx);
 }
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c
index 1753bcb..89a0037 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c
@@ -17,6 +17,7 @@
 #include <asm/unaligned.h>
 #include "mt76x2.h"
 #include "mt76x2_eeprom.h"
+#include <linux/module.h>
 
 #define EE_FIELD(_name, _value) [MT_EE_##_name] = (_value) | 1
 
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 363bea8..4bde2a3 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -14,6 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <linux/module.h>
 #include "mt76.h"
 #include "usb_trace.h"
 #include "dma.h"
@@ -646,7 +647,11 @@ mt76u_tx_build_sg(struct sk_buff *skb, struct urb *urb)
 	sg_init_marker(urb->sg, nsgs);
 	urb->num_sgs = nsgs;
 
+#if LINUX_VERSION_IS_GEQ(4,1,0)
 	return skb_to_sgvec_nomark(skb, urb->sg, 0, skb->len);
+#else
+	return skb_to_sgvec(skb, urb->sg, 0, skb->len);
+#endif
 }
 
 static int
diff --git a/drivers/net/wireless/mediatek/mt7601u/trace.c b/drivers/net/wireless/mediatek/mt7601u/trace.c
index d48a407..4137d5b 100644
--- a/drivers/net/wireless/mediatek/mt7601u/trace.c
+++ b/drivers/net/wireless/mediatek/mt7601u/trace.c
@@ -12,6 +12,7 @@
  * GNU General Public License for more details.
  */
 
+#if LINUX_VERSION_IS_GEQ(3,10,0)
 #include <linux/module.h>
 #if LINUX_VERSION_IS_LESS(3,4,0)
 #include <linux/interrupt.h>
@@ -22,3 +23,4 @@
 #include "trace.h"
 
 #endif
+#endif
-- 
2.13.6