mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-17 01:06:36 +00:00
There are significant changes between NSS version 11.4.0.5 and 12.1 (12.0.5), that it doesn't really make sense to use it with older firmware (i.e. using mesh releated features). This change will explicitly link building the proper driver and client packages when FW 12.1 or 11.4 is selected, while also backporting patches from 12.4.
75 lines
2.7 KiB
Diff
75 lines
2.7 KiB
Diff
From 2a3b9f4659542e529f4e1a535c33dfde7e272707 Mon Sep 17 00:00:00 2001
|
|
From: Ansuel Smith <ansuelsmth@gmail.com>
|
|
Date: Tue, 5 Apr 2022 18:10:57 +0200
|
|
Subject: [PATCH 2/4] nss-drv: add support for kernel 5.15
|
|
|
|
- Fix coredump panic notifier include change.
|
|
- Fix skb ZEROCOPY flag.
|
|
- Add skb reuse support for 5.15 kernel version.
|
|
|
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
|
---
|
|
nss_core.c | 5 +++--
|
|
nss_coredump.c | 4 ++++
|
|
nss_hal/nss_hal.c | 1 +
|
|
3 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
--- a/nss_core.c
|
|
+++ b/nss_core.c
|
|
@@ -53,7 +53,9 @@
|
|
(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))) || \
|
|
(((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)))) || \
|
|
(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))) || \
|
|
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))))))
|
|
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))) || \
|
|
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))) || \
|
|
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))))))
|
|
#error "Check skb recycle code in this file to match Linux version"
|
|
#endif
|
|
|
|
@@ -2578,7 +2580,7 @@ static inline bool nss_core_skb_can_reus
|
|
if (unlikely(irqs_disabled()))
|
|
return false;
|
|
|
|
- if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY))
|
|
+ if (unlikely(skb_shinfo(nbuf)->flags & SKBFL_ZEROCOPY_ENABLE))
|
|
return false;
|
|
|
|
if (unlikely(skb_is_nonlinear(nbuf)))
|
|
--- a/nss_coredump.c
|
|
+++ b/nss_coredump.c
|
|
@@ -23,7 +23,11 @@
|
|
#include "nss_hal.h"
|
|
#include "nss_log.h"
|
|
#include <linux/kernel.h>
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
|
|
#include <linux/notifier.h> /* for panic_notifier_list */
|
|
+#else
|
|
+#include <linux/panic_notifier.h>
|
|
+#endif
|
|
#include <linux/jiffies.h> /* for time */
|
|
#include "nss_tx_rx_common.h"
|
|
|
|
--- a/nss_hal/nss_hal.c
|
|
+++ b/nss_hal/nss_hal.c
|
|
@@ -24,6 +24,7 @@
|
|
#include <linux/firmware.h>
|
|
#include <linux/of.h>
|
|
#include <linux/irq.h>
|
|
+#include <linux/ethtool.h>
|
|
|
|
#include "nss_hal.h"
|
|
#include "nss_arch.h"
|
|
@@ -57,9 +58,9 @@ int nss_hal_firmware_load(struct nss_ctx
|
|
int rc;
|
|
|
|
if (nss_ctx->id == 0) {
|
|
- rc = request_firmware(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
|
|
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
|
|
} else if (nss_ctx->id == 1) {
|
|
- rc = request_firmware(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
|
|
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
|
|
} else {
|
|
nss_warning("%px: Invalid nss dev: %d\n", nss_ctx, nss_ctx->id);
|
|
return -EINVAL;
|