mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Add qualcommax kernel 6.12 support
This commit is contained in:
parent
cb0fb6be18
commit
2ac3cb3c06
55 changed files with 18140 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
|||
From 078b67683613d8f066a2955802b46a4b27eb642e Mon Sep 17 00:00:00 2001
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Tue, 10 Dec 2024 13:24:39 +0200
|
||||
Subject: [PATCH 16/17] nss-dp: disable warnings to support linux-6.12
|
||||
|
||||
Linux 6.12 adds these new warnings which become build errors
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -90,4 +90,5 @@ endif
|
||||
|
||||
ccflags-y += $(NSS_DP_INCLUDE)
|
||||
ccflags-y += -Wall -Werror
|
||||
+ccflags-y += -Wno-missing-prototypes -Wno-missing-declarations
|
||||
ccflags-y += -DEDMA_DEBUG_LEVEL=2
|
|
@ -0,0 +1,74 @@
|
|||
From cdfdb0fd6407bb3a3a3c7bf9602d40928d950641 Mon Sep 17 00:00:00 2001
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Tue, 10 Dec 2024 13:32:04 +0200
|
||||
Subject: [PATCH 17/18] nss-dp: adapt to linux 6.12 API
|
||||
|
||||
Add compatibility with 6.12
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
nss_dp_main.c | 10 ++++------
|
||||
2 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -34,6 +34,10 @@
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 6, 0))
|
||||
#include <net/netdev_rx_queue.h>
|
||||
#endif
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
|
||||
+#include <net/rps.h>
|
||||
+#include <net/hotdata.h>
|
||||
+#endif
|
||||
#if defined(NSS_DP_MAC_POLL_SUPPORT)
|
||||
#include <init/ssdk_init.h>
|
||||
#endif
|
||||
@@ -496,14 +500,22 @@ static int nss_dp_rx_flow_steer(struct n
|
||||
rxflow = &flow_table->flows[hash & flow_table->mask];
|
||||
rxcpu = (uint32_t)rxflow->cpu;
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
|
||||
+ sock_flow_table = rcu_dereference(net_hotdata.rps_sock_flow_table);
|
||||
+#else
|
||||
sock_flow_table = rcu_dereference(rps_sock_flow_table);
|
||||
+#endif
|
||||
if (!sock_flow_table) {
|
||||
netdev_dbg(netdev, "Global RPS flow table not found\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rfscpu = sock_flow_table->ents[hash & sock_flow_table->mask];
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
|
||||
+ rfscpu &= net_hotdata.rps_cpu_mask;
|
||||
+#else
|
||||
rfscpu &= rps_cpu_mask;
|
||||
+#endif
|
||||
|
||||
if (rxcpu == rfscpu)
|
||||
return 0;
|
||||
@@ -998,6 +1010,13 @@ static int nss_dp_remove(struct platform
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0)
|
||||
+static void nss_dp_remove_new(struct platform_device *pdev)
|
||||
+{
|
||||
+ nss_dp_remove(pdev);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static struct of_device_id nss_dp_dt_ids[] = {
|
||||
{ .compatible = "qcom,nss-dp" },
|
||||
{},
|
||||
@@ -1006,7 +1025,11 @@ MODULE_DEVICE_TABLE(of, nss_dp_dt_ids);
|
||||
|
||||
static struct platform_driver nss_dp_drv = {
|
||||
.probe = nss_dp_probe,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0)
|
||||
.remove = nss_dp_remove,
|
||||
+#else
|
||||
+ .remove_new = nss_dp_remove_new,
|
||||
+#endif
|
||||
.driver = {
|
||||
.name = "nss-dp",
|
||||
.owner = THIS_MODULE,
|
|
@ -0,0 +1,155 @@
|
|||
From cdfdb0fd6407bb3a3a3c7bf9602d40928d950641 Mon Sep 17 00:00:00 2001
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Tue, 10 Dec 2024 13:32:04 +0200
|
||||
Subject: [PATCH 18/18] nss-dp: update EEE support for 6.12
|
||||
|
||||
Linux 6.12 changed API for EEE link modes
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
nss_dp_ethtools.c | 8 ++++++--
|
||||
2 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/nss_dp_ethtools.c
|
||||
+++ b/nss_dp_ethtools.c
|
||||
@@ -206,6 +206,7 @@ static int32_t nss_dp_set_pauseparam(str
|
||||
* nss_dp_fal_to_ethtool_linkmode_xlate()
|
||||
* Translate linkmode from FAL type to ethtool type.
|
||||
*/
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0))
|
||||
static inline void nss_dp_fal_to_ethtool_linkmode_xlate(uint32_t *xlate_to, uint32_t *xlate_from)
|
||||
{
|
||||
uint32_t pos;
|
||||
@@ -243,12 +244,26 @@ static inline void nss_dp_fal_to_ethtool
|
||||
*xlate_from &= (~(1 << (pos - 1)));
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+static inline void nss_dp_fal_to_ethtool_linkmode_xlate(unsigned long *to, uint32_t from)
|
||||
+{
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, to, from & FAL_PHY_EEE_10BASE_T);
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, to, from & FAL_PHY_EEE_100BASE_T);
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, to, from & FAL_PHY_EEE_1000BASE_T);
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, to, from & FAL_PHY_EEE_2500BASE_T);
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, to, from & FAL_PHY_EEE_10000BASE_T);
|
||||
+}
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* nss_dp_get_eee()
|
||||
* Get EEE settings.
|
||||
*/
|
||||
-static int32_t nss_dp_get_eee(struct net_device *netdev, struct ethtool_eee *eee)
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0))
|
||||
+static int nss_dp_get_eee(struct net_device *netdev, struct ethtool_eee *eee)
|
||||
+#else
|
||||
+static int nss_dp_get_eee(struct net_device *netdev, struct ethtool_keee *eee)
|
||||
+#endif
|
||||
{
|
||||
struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev);
|
||||
fal_port_eee_cfg_t port_eee_cfg;
|
||||
@@ -266,9 +281,15 @@ static int32_t nss_dp_get_eee(struct net
|
||||
/*
|
||||
* Translate the FAL linkmode types to ethtool linkmode types.
|
||||
*/
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0))
|
||||
nss_dp_fal_to_ethtool_linkmode_xlate(&eee->supported, &port_eee_cfg.capability);
|
||||
nss_dp_fal_to_ethtool_linkmode_xlate(&eee->advertised, &port_eee_cfg.advertisement);
|
||||
nss_dp_fal_to_ethtool_linkmode_xlate(&eee->lp_advertised, &port_eee_cfg.link_partner_advertisement);
|
||||
+#else
|
||||
+ nss_dp_fal_to_ethtool_linkmode_xlate(eee->supported, port_eee_cfg.capability);
|
||||
+ nss_dp_fal_to_ethtool_linkmode_xlate(eee->advertised, port_eee_cfg.advertisement);
|
||||
+ nss_dp_fal_to_ethtool_linkmode_xlate(eee->lp_advertised, port_eee_cfg.link_partner_advertisement);
|
||||
+#endif
|
||||
eee->eee_enabled = port_eee_cfg.enable;
|
||||
eee->eee_active = port_eee_cfg.eee_status;
|
||||
eee->tx_lpi_enabled = port_eee_cfg.lpi_tx_enable;
|
||||
@@ -281,11 +302,15 @@ static int32_t nss_dp_get_eee(struct net
|
||||
* nss_dp_set_eee()
|
||||
* Set EEE settings.
|
||||
*/
|
||||
-static int32_t nss_dp_set_eee(struct net_device *netdev, struct ethtool_eee *eee)
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0))
|
||||
+static int nss_dp_set_eee(struct net_device *netdev, struct ethtool_eee *eee)
|
||||
+#else
|
||||
+static int nss_dp_set_eee(struct net_device *netdev, struct ethtool_keee *eee)
|
||||
+#endif
|
||||
{
|
||||
struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev);
|
||||
fal_port_eee_cfg_t port_eee_cfg, port_eee_cur_cfg;
|
||||
- uint32_t port_id, pos;
|
||||
+ uint32_t port_id;
|
||||
sw_error_t ret;
|
||||
|
||||
memset(&port_eee_cfg, 0, sizeof(fal_port_eee_cfg_t));
|
||||
@@ -306,8 +331,9 @@ static int32_t nss_dp_set_eee(struct net
|
||||
/*
|
||||
* Translate the ethtool speed types to FAL speed types.
|
||||
*/
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0))
|
||||
while (eee->advertised) {
|
||||
- pos = ffs(eee->advertised);
|
||||
+ uint32_t pos = ffs(eee->advertised);
|
||||
switch (1 << (pos - 1)) {
|
||||
case ADVERTISED_10baseT_Full:
|
||||
if (port_eee_cur_cfg.capability & FAL_PHY_EEE_10BASE_T) {
|
||||
@@ -361,6 +387,48 @@ static int32_t nss_dp_set_eee(struct net
|
||||
|
||||
eee->advertised &= (~(1 << (pos - 1)));
|
||||
}
|
||||
+#else
|
||||
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, eee->advertised)) {
|
||||
+ if (port_eee_cur_cfg.capability & FAL_PHY_EEE_10BASE_T) {
|
||||
+ port_eee_cfg.advertisement |= FAL_PHY_EEE_10BASE_T;
|
||||
+ } else {
|
||||
+ netdev_dbg(netdev, "Advertised value 10baseT_Full is not supported\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, eee->advertised)) {
|
||||
+ if (port_eee_cur_cfg.capability & FAL_PHY_EEE_100BASE_T) {
|
||||
+ port_eee_cfg.advertisement |= FAL_PHY_EEE_100BASE_T;
|
||||
+ } else {
|
||||
+ netdev_dbg(netdev, "Advertised value 100baseT_Full is not supported\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, eee->advertised)) {
|
||||
+ if (port_eee_cur_cfg.capability & FAL_PHY_EEE_1000BASE_T) {
|
||||
+ port_eee_cfg.advertisement |= FAL_PHY_EEE_1000BASE_T;
|
||||
+ } else {
|
||||
+ netdev_dbg(netdev, "Advertised value 1000baseT_Full is not supported\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, eee->advertised)) {
|
||||
+ if (port_eee_cur_cfg.capability & FAL_PHY_EEE_2500BASE_T) {
|
||||
+ port_eee_cfg.advertisement |= FAL_PHY_EEE_2500BASE_T;
|
||||
+ } else {
|
||||
+ netdev_dbg(netdev, "Advertised value 2500baseX_Full is not supported\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, eee->advertised)) {
|
||||
+ if (port_eee_cur_cfg.capability & FAL_PHY_EEE_10000BASE_T) {
|
||||
+ port_eee_cfg.advertisement |= FAL_PHY_EEE_10000BASE_T;
|
||||
+ } else {
|
||||
+ netdev_dbg(netdev, "Advertised value 1000baseT_Full is not supported\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
port_eee_cfg.lpi_tx_enable = eee->tx_lpi_enabled;
|
||||
port_eee_cfg.lpi_sleep_timer = eee->tx_lpi_timer;
|
||||
@@ -482,8 +550,10 @@ struct ethtool_ops nss_dp_ethtool_ops =
|
||||
#endif
|
||||
.get_pauseparam = &nss_dp_get_pauseparam,
|
||||
.set_pauseparam = &nss_dp_set_pauseparam,
|
||||
+
|
||||
.get_eee = &nss_dp_get_eee,
|
||||
.set_eee = &nss_dp_set_eee,
|
||||
+
|
||||
.get_priv_flags = nss_dp_get_priv_flags,
|
||||
.set_priv_flags = nss_dp_set_priv_flags,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue