Skip to content

Commit 53db798

Browse files
Merge branch 'openwrt:main' into wax206
2 parents 8fca74f + 010c08c commit 53db798

56 files changed

Lines changed: 2191 additions & 401 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package/boot/uboot-rockchip/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ define U-Boot/rk3576/Default
275275
TPL:=rk3576_ddr_lp4_2112MHz_lp5_2736MHz_v1.09.bin
276276
endef
277277

278+
define U-Boot/generic-rk3576
279+
$(U-Boot/rk3576/Default)
280+
NAME:=Generic RK3576
281+
BUILD_DEVICES:= \
282+
friendlyarm_nanopi-r76s
283+
endef
284+
278285
define U-Boot/rock-4d-rk3576
279286
$(U-Boot/rk3576/Default)
280287
NAME:=ROCK 4D
@@ -392,6 +399,7 @@ UBOOT_TARGETS := \
392399
radxa-e25-rk3568 \
393400
rock-3a-rk3568 \
394401
rock-3b-rk3568 \
402+
generic-rk3576 \
395403
rock-4d-rk3576 \
396404
generic-rk3588 \
397405
nanopc-t6-rk3588 \

package/devel/strace/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
99
include $(INCLUDE_DIR)/kernel.mk
1010

1111
PKG_NAME:=strace
12-
PKG_VERSION:=6.15
12+
PKG_VERSION:=6.17
1313
PKG_RELEASE:=1
1414

1515
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
1616
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
17-
PKG_HASH:=8552dfab08abc22a0f2048c98fd9541fd4d71b6882507952780dab7c7c512f51
17+
PKG_HASH:=0a7c7bedc7efc076f3242a0310af2ae63c292a36dd4236f079e88a93e98cb9c0
1818

1919
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
2020
PKG_LICENSE:=LGPL-2.1-or-later

package/firmware/ipq-wifi/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
66

77
PKG_SOURCE_PROTO:=git
88
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
9-
PKG_SOURCE_DATE:=2025-10-09
10-
PKG_SOURCE_VERSION:=20e5a5a3265679c7367f2857214c3691bd75bea0
11-
PKG_MIRROR_HASH:=697ae289bbcff6d1c077c3086ce9bcca670728cfbc7da5b52ae1bcad838d0225
9+
PKG_SOURCE_DATE:=2025-10-17
10+
PKG_SOURCE_VERSION:=a1529e183333e38bdc95dc8d9317b7af2bec0dcd
11+
PKG_MIRROR_HASH:=30ce8f808424602cba556e106cb16080ef29d6d45a9d9018e04664598460eb2f
1212
PKG_FLAGS:=nonshared
1313

1414
include $(INCLUDE_DIR)/package.mk
@@ -78,6 +78,7 @@ ALLWIFIBOARDS:= \
7878
tplink_eap623od-hd-v1 \
7979
tplink_eap625-outdoor-hd-v1 \
8080
tplink_eap660hd-v1 \
81+
tplink_archer-c59-v1 \
8182
tplink_archer-c6-v2 \
8283
tplink_archer-c60-v1 \
8384
wallys_dr40x9 \
@@ -250,6 +251,7 @@ $(eval $(call generate-ipq-wifi-package,tplink_eap620hd-v1,TP-Link EAP620 HD v1)
250251
$(eval $(call generate-ipq-wifi-package,tplink_eap623od-hd-v1,TP-Link EAP623-Outdoor HD v1))
251252
$(eval $(call generate-ipq-wifi-package,tplink_eap625-outdoor-hd-v1,TP-Link EAP625-Outdoor HD v1))
252253
$(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1))
254+
$(eval $(call generate-ipq-wifi-package,tplink_archer-c59-v1,TP-Link Archer C59 V1))
253255
$(eval $(call generate-ipq-wifi-package,tplink_archer-c6-v2,TP-Link Archer C6 V2))
254256
$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v1,TP-Link Archer C60 V1))
255257
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))

package/firmware/linux-firmware/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=linux-firmware
11-
PKG_VERSION:=20250917
11+
PKG_VERSION:=20251011
1212
PKG_RELEASE:=1
1313

1414
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
1515
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16-
PKG_HASH:=120575b756915a11e736f599316a756b6a29a76d6135ad86208868b21c58fb75
16+
PKG_HASH:=b6c9a9c112b88417d985b87d6521b677fa2fa0d5d7ee5219c76dc8ca66945ad3
1717

1818
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
1919

package/kernel/lantiq/ltq-ptm/patches/100-fix-compilation-warning-debugfs.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/ifxmips_ptm_adsl.c
22
+++ b/ifxmips_ptm_adsl.c
3-
@@ -175,9 +175,11 @@ static INLINE void mailbox_signal(unsign
3+
@@ -178,9 +178,11 @@ static INLINE void mailbox_signal(unsign
44
*/
55
static INLINE void proc_file_create(void);
66
static INLINE void proc_file_delete(void);
@@ -12,15 +12,15 @@
1212
#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
1313
static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
1414
#endif
15-
@@ -896,6 +898,7 @@ static INLINE void proc_file_delete(void
15+
@@ -936,6 +938,7 @@ static INLINE void proc_file_delete(void
1616
remove_proc_entry("driver/ifx_ptm", NULL);
1717
}
1818

1919
+#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
2020
static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data)
2121
{
2222
int len = 0;
23-
@@ -970,8 +973,9 @@ static int proc_write_wanmib(struct file
23+
@@ -1010,8 +1013,9 @@ static int proc_write_wanmib(struct file
2424

2525
return count;
2626
}

package/kernel/lantiq/ltq-ptm/patches/101-fix-more-compilation-warning-debugfs.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/ifxmips_ptm_adsl.c
22
+++ b/ifxmips_ptm_adsl.c
3-
@@ -180,7 +180,7 @@ static int proc_read_version(char *, cha
3+
@@ -183,7 +183,7 @@ static int proc_read_version(char *, cha
44
static int proc_read_wanmib(char *, char **, off_t, int, int *, void *);
55
static int proc_write_wanmib(struct file *, const char *, unsigned long, void *);
66
#endif
@@ -9,7 +9,7 @@
99
static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
1010
#endif
1111
#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
12-
@@ -191,8 +191,8 @@ static int proc_write_wanmib(struct file
12+
@@ -194,8 +194,8 @@ static int proc_write_wanmib(struct file
1313
/*
1414
* Proc Help Functions
1515
*/
@@ -19,7 +19,7 @@
1919
static INLINE int strincmp(const char *, const char *, int);
2020
#endif
2121
static INLINE int ifx_ptm_version(char *);
22-
@@ -1166,8 +1166,6 @@ static int proc_write_dbg(struct file *f
22+
@@ -1206,8 +1206,6 @@ static int proc_write_dbg(struct file *f
2323
return count;
2424
}
2525

@@ -28,7 +28,7 @@
2828
static INLINE int stricmp(const char *p1, const char *p2)
2929
{
3030
int c1, c2;
31-
@@ -1185,7 +1183,6 @@ static INLINE int stricmp(const char *p1
31+
@@ -1225,7 +1223,6 @@ static INLINE int stricmp(const char *p1
3232
return *p1 - *p2;
3333
}
3434

package/kernel/lantiq/ltq-ptm/patches/102-fix-missing-prototypes-warning.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
1515

1616
--- a/ifxmips_ptm_vdsl.c
1717
+++ b/ifxmips_ptm_vdsl.c
18-
@@ -61,7 +61,7 @@ static void *g_xdata_addr = NULL;
18+
@@ -62,7 +62,7 @@ static void *g_xdata_addr = NULL;
1919

2020
#define ENABLE_TMP_DBG 0
2121

package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
2222
#include <linux/platform_device.h>
2323
+#include <linux/mod_devicetable.h>
2424
#include <linux/of_device.h>
25+
#include <linux/of_net.h>
2526

26-
#include "ifxmips_ptm_vdsl.h"

package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c

Lines changed: 68 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#include <linux/platform_device.h>
4848
#include <linux/of_device.h>
4949
#include <linux/of_net.h>
50+
#include <linux/uaccess.h>
51+
#include <linux/capability.h>
5052
#include <asm/io.h>
5153

5254
/*
@@ -472,56 +474,85 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat
472474
{
473475
int ndev;
474476

477+
if (!capable(CAP_NET_ADMIN))
478+
return -EPERM;
479+
475480
for ( ndev = 0; ndev < ARRAY_SIZE(g_net_dev) && g_net_dev[ndev] != dev; ndev++ );
476481
ASSERT(ndev >= 0 && ndev < ARRAY_SIZE(g_net_dev), "ndev = %d (wrong value)", ndev);
477482

478483
switch ( cmd )
479484
{
480485
case IFX_PTM_MIB_CW_GET:
481-
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
482-
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
483-
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
484-
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = 0;
485-
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = 0;
486-
break;
487-
case IFX_PTM_MIB_FRAME_GET:
488-
((PTM_FRAME_MIB_T *)data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
489-
((PTM_FRAME_MIB_T *)data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
490-
((PTM_FRAME_MIB_T *)data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
491-
((PTM_FRAME_MIB_T *)data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
492-
break;
493-
case IFX_PTM_CFG_GET:
494-
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
495-
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
496-
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
497-
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
498-
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
499-
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
500-
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
501-
break;
502-
case IFX_PTM_CFG_SET:
503-
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent ? 1 : 0;
504-
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 1 : 0;
505-
if ( ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 32) )
506486
{
507-
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1;
508-
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->RxTcCrcLen;
487+
PTM_CW_IF_ENTRY_T tmp = {0};
488+
489+
tmp.ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
490+
tmp.ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
491+
tmp.ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
492+
tmp.ifTxNoIdleCodewords = 0;
493+
tmp.ifTxIdleCodewords = 0;
494+
495+
if (copy_to_user(data, &tmp, sizeof(tmp)))
496+
return -EFAULT;
509497
}
510-
else
498+
break;
499+
case IFX_PTM_MIB_FRAME_GET:
511500
{
512-
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0;
513-
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0;
501+
PTM_FRAME_MIB_T tmp = {0};
502+
503+
tmp.RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
504+
tmp.TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
505+
tmp.RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
506+
tmp.TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
507+
if (copy_to_user(data, &tmp, sizeof(tmp)))
508+
return -EFAULT;
514509
}
515-
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 1 : 0;
516-
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 32) )
510+
break;
511+
case IFX_PTM_CFG_GET:
517512
{
518-
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1;
519-
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->TxTcCrcLen;
513+
IFX_PTM_CFG_T tmp = {0};
514+
515+
tmp.RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
516+
tmp.RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
517+
tmp.RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
518+
tmp.RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
519+
tmp.TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
520+
tmp.TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
521+
tmp.TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
522+
if (copy_to_user(data, &tmp, sizeof(tmp)))
523+
return -EFAULT;
520524
}
521-
else
525+
break;
526+
case IFX_PTM_CFG_SET:
522527
{
523-
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 0;
524-
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = 0;
528+
IFX_PTM_CFG_T cfg = {0};
529+
530+
if (copy_from_user(&cfg, data, sizeof(cfg)))
531+
return -EFAULT;
532+
533+
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = cfg.RxEthCrcPresent ? 1 : 0;
534+
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = cfg.RxEthCrcCheck ? 1 : 0;
535+
if ( cfg.RxTcCrcCheck && (cfg.RxTcCrcLen == 16 || cfg.RxTcCrcLen == 32) )
536+
{
537+
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1;
538+
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = cfg.RxTcCrcLen;
539+
}
540+
else
541+
{
542+
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0;
543+
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0;
544+
}
545+
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = cfg.TxEthCrcGen ? 1 : 0;
546+
if ( cfg.TxTcCrcGen && (cfg.TxTcCrcLen == 16 || cfg.TxTcCrcLen == 32) )
547+
{
548+
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1;
549+
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = cfg.TxTcCrcLen;
550+
}
551+
else
552+
{
553+
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 0;
554+
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = 0;
555+
}
525556
}
526557
break;
527558
default:

package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,24 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat
390390
{
391391
ASSERT(dev == g_net_dev[0], "incorrect device");
392392

393+
if (!capable(CAP_NET_ADMIN))
394+
return -EPERM;
395+
393396
switch ( cmd )
394397
{
395398
case IFX_PTM_MIB_CW_GET:
396-
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
397-
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
398-
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
399-
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
400-
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
399+
{
400+
PTM_CW_IF_ENTRY_T tmp = {0};
401+
402+
tmp.ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
403+
tmp.ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
404+
tmp.ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
405+
tmp.ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
406+
tmp.ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
407+
408+
if (copy_to_user(data, &tmp, sizeof(tmp)))
409+
return -EFAULT;
410+
}
401411
break;
402412
case IFX_PTM_MIB_FRAME_GET:
403413
{
@@ -410,38 +420,50 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *dat
410420
for ( i = 0; i < 8; i++ )
411421
tmp.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu;
412422

413-
*((PTM_FRAME_MIB_T *)data) = tmp;
423+
if (copy_to_user(data, &tmp, sizeof(tmp)))
424+
return -EFAULT;
414425
}
415426
break;
416427
case IFX_PTM_CFG_GET:
417-
// use bear channel 0 preemption gamma interface settings
418-
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = 1;
419-
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
420-
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;;
421-
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
422-
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
423-
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
424-
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
428+
{
429+
IFX_PTM_CFG_T tmp = {0};
430+
431+
// use bear channel 0 preemption gamma interface settings
432+
tmp.RxEthCrcPresent = 1;
433+
tmp.RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
434+
tmp.RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;
435+
tmp.RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
436+
tmp.TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
437+
tmp.TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
438+
tmp.TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
439+
440+
if (copy_to_user(data, &tmp, sizeof(tmp)))
441+
return -EFAULT;
442+
}
425443
break;
426444
case IFX_PTM_CFG_SET:
427445
{
446+
IFX_PTM_CFG_T cfg;
428447
int i;
429448

449+
if (copy_from_user(&cfg, data, sizeof(cfg)))
450+
return -EFAULT;
451+
430452
for ( i = 0; i < 4; i++ ) {
431-
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 0 : 1;
453+
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = cfg.RxEthCrcCheck ? 0 : 1;
432454

433-
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck ? 0 : 1;
455+
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = cfg.RxTcCrcCheck ? 0 : 1;
434456

435-
switch ( ((IFX_PTM_CFG_T *)data)->RxTcCrcLen ) {
457+
switch ( cfg.RxTcCrcLen ) {
436458
case 16: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 1; break;
437459
case 32: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 2; break;
438460
default: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 0;
439461
}
440462

441-
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 0 : 1;
463+
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = cfg.TxEthCrcGen ? 0 : 1;
442464

443-
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen ) {
444-
switch ( ((IFX_PTM_CFG_T *)data)->TxTcCrcLen ) {
465+
if ( cfg.TxTcCrcGen ) {
466+
switch ( cfg.TxTcCrcLen ) {
445467
case 16: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 1; break;
446468
case 32: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 2; break;
447469
default: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 0;

0 commit comments

Comments
 (0)