Commit d0fa047
committed
wifi: mt76: add kernel version compatibility for timer APIs
Add version checks to support both old and new timer APIs across
different kernel versions:
- Use timer_delete_sync() on kernels >= 6.1, fall back to
del_timer_sync() on older kernels. The timer_delete_sync() function
was introduced in kernel 6.1 as a replacement for del_timer_sync().
- Use from_timer() for timer callbacks on kernels >= 4.15, fall back
to container_of() on older kernels. The from_timer() macro was
introduced in kernel 4.15 as part of the timer API modernization.
- Use hrtimer_setup() on kernels >= 4.15, fall back to manual
hrtimer_init() and function assignment on older kernels. The
hrtimer_setup() helper was introduced alongside the timer callback
changes in kernel 4.15.
- Use timer_container_of() on kernels >= 6.16 and container_of() for
older kernels. Since the minimum supported kernel is currently 6.12,
there is no need to add container_of() for older kernels.
Signed-off-by: John Audia <therealgraysky@proton.me>1 parent 3c23252 commit d0fa047
7 files changed
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
1046 | 1050 | | |
1047 | 1051 | | |
1048 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1049 | 1056 | | |
| 1057 | + | |
1050 | 1058 | | |
1051 | 1059 | | |
1052 | 1060 | | |
| |||
1197 | 1205 | | |
1198 | 1206 | | |
1199 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1200 | 1211 | | |
| 1212 | + | |
1201 | 1213 | | |
1202 | 1214 | | |
1203 | 1215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
| 227 | + | |
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
228 | 235 | | |
| 236 | + | |
229 | 237 | | |
230 | 238 | | |
231 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
| 273 | + | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
374 | 377 | | |
| 378 | + | |
375 | 379 | | |
376 | 380 | | |
377 | 381 | | |
| |||
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
405 | 412 | | |
| 413 | + | |
406 | 414 | | |
407 | 415 | | |
408 | 416 | | |
| |||
1494 | 1502 | | |
1495 | 1503 | | |
1496 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1497 | 1508 | | |
| 1509 | + | |
1498 | 1510 | | |
1499 | 1511 | | |
1500 | 1512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
460 | 463 | | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| |||
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
492 | 499 | | |
| 500 | + | |
493 | 501 | | |
494 | 502 | | |
495 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
308 | 311 | | |
| 312 | + | |
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
312 | | - | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
316 | 322 | | |
317 | | - | |
| 323 | + | |
318 | 324 | | |
319 | 325 | | |
320 | 326 | | |
| |||
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
365 | 374 | | |
| 375 | + | |
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
| |||
0 commit comments