1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-24 15:04:16 +00:00
openmptcprouter/6.1/package/kernel/lantiq/vrx518_tc/patches/301-fix-kernel-6.1-compile.patch
Ycarus (Yannick Chabanois) fb024bdfd3 Test for RUTX 6.1 compilation
2023-06-29 13:20:32 +02:00

336 lines
10 KiB
Diff

--- a/dcdp/ptm_tc.c 2023-05-22 11:06:09.177510131 +0200
+++ b/dcdp/ptm_tc.c 2023-05-22 11:37:23.765131033 +0200
@@ -659,7 +659,11 @@
memcpy(ptm_tc->outq_map, def_outq_map, sizeof(def_outq_map));
SET_NETDEV_DEV(ptm_tc->dev, tc_priv->ep_dev[id].dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0)
+ netif_napi_add(ptm_tc->dev, &ptm_tc->napi_rx, tc_priv->tc_ops.napi_rx);
+#else
netif_napi_add(ptm_tc->dev, &ptm_tc->napi_rx, tc_priv->tc_ops.napi_rx, NAPI_POLL_WEIGHT);
+#endif
netif_tx_napi_add(ptm_tc->dev, &ptm_tc->napi_tx, tc_priv->tc_ops.napi_tx, NAPI_POLL_WEIGHT);
err = register_netdev(ptm_tc->dev);
@@ -3125,7 +3129,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct ptm_ep_priv *)PDE_DATA(file_inode(file));
+ priv = (struct ptm_ep_priv *)pde_data(file_inode(file));
len = count < sizeof(str) ? count : sizeof(str) - 1;
rlen = len - copy_from_user(str, buf, len);
@@ -3335,7 +3339,7 @@
local_buf[len] = 0;
num = vrx_split_buffer(local_buf, param_list, ARRAY_SIZE(param_list));
- priv = (struct ptm_ep_priv *)PDE_DATA(file_inode(file));
+ priv = (struct ptm_ep_priv *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("%s: Invalid private data\n", __func__);
return -EINVAL;
--- a/dcdp/inc/ptm_tc.h 2023-05-22 11:24:47.982177396 +0200
+++ b/dcdp/inc/ptm_tc.h 2023-05-22 11:25:34.313376656 +0200
@@ -76,6 +76,9 @@
#define SFSM_DBACE 0x6000
#define SFSM_CBACE 0x7100
+
+#define netif_tx_napi_add netif_napi_add_tx_weight
+
enum {
US_DMA_PRE_RXCH = 0,
US_DMA_PRE_TXCH,
--- a/dcdp/tc_proc.c 2023-05-22 11:58:32.715356238 +0200
+++ b/dcdp/tc_proc.c 2023-05-22 11:59:13.454660657 +0200
@@ -343,7 +343,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = ((struct tc_comm *)PDE_DATA(file_inode(file)));
+ priv = ((struct tc_comm *)pde_data(file_inode(file)));
if (priv == NULL) {
pr_err("%s: Invalid priv data\n", __func__);
return -EFAULT;
@@ -476,7 +476,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = ((struct tc_comm *)PDE_DATA(file_inode(file)));
+ priv = ((struct tc_comm *)pde_data(file_inode(file)));
if (priv == NULL) {
pr_err("%s: priv pointer is NULL!!!\n", __func__);
return -EINVAL;
@@ -746,7 +746,7 @@
static int proc_read_pp32_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_pp32, PDE_DATA(inode));
+ return single_open(file, proc_read_pp32, pde_data(inode));
}
static const struct proc_ops pp32_proc_fops = {
@@ -822,7 +822,7 @@
len = count < sizeof(str) ? count : sizeof(str) - 1;
rlen = len - copy_from_user(str, buf, len);
str[rlen] = 0;
- priv = (struct tc_priv *)PDE_DATA(file_inode(file));
+ priv = (struct tc_priv *)pde_data(file_inode(file));
if (priv == NULL)
return count;
@@ -862,7 +862,7 @@
static int proc_read_tc_cfg_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_tc_cfg, PDE_DATA(inode));
+ return single_open(file, proc_read_tc_cfg, pde_data(inode));
}
static const struct proc_ops tc_cfg_proc_fops = {
@@ -888,7 +888,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct tc_priv *)PDE_DATA(file_inode(file));
+ priv = (struct tc_priv *)pde_data(file_inode(file));
if (priv == NULL)
return count;
@@ -947,7 +947,7 @@
static int proc_read_dbg_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_dbg, PDE_DATA(inode));
+ return single_open(file, proc_read_dbg, pde_data(inode));
}
static const struct proc_ops tc_dbg_proc_fops = {
@@ -970,7 +970,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct tc_priv *)PDE_DATA(file_inode(file));
+ priv = (struct tc_priv *)pde_data(file_inode(file));
len = count < sizeof(str) ? count : sizeof(str) - 1;
rlen = len - copy_from_user(str, buf, len);
@@ -1033,7 +1033,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct tc_priv *)PDE_DATA(file_inode(file));
+ priv = (struct tc_priv *)pde_data(file_inode(file));
len = count < sizeof(str) ? count : sizeof(str) - 1;
rlen = len - copy_from_user(str, buf, len);
@@ -1125,7 +1125,7 @@
static int proc_read_ver_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_ver, PDE_DATA(inode));
+ return single_open(file, proc_read_ver, pde_data(inode));
}
static const struct proc_ops tc_ver_proc_fops = {
@@ -1159,7 +1159,7 @@
static int proc_read_soc_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_soc, PDE_DATA(inode));
+ return single_open(file, proc_read_soc, pde_data(inode));
}
static const struct proc_ops tc_soc_proc_fops = {
@@ -1185,7 +1185,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct tc_priv *)PDE_DATA(file_inode(file));
+ priv = (struct tc_priv *)pde_data(file_inode(file));
if (priv == NULL)
return count;
@@ -1264,7 +1264,7 @@
static int proc_read_desc_conf_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_desc_conf, PDE_DATA(inode));
+ return single_open(file, proc_read_desc_conf, pde_data(inode));
}
#endif
@@ -1343,7 +1343,7 @@
static int proc_read_ptm_wanmib_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_ptm_wanmib, PDE_DATA(inode));
+ return single_open(file, proc_read_ptm_wanmib, pde_data(inode));
}
static const struct proc_ops ptm_wanmib_proc_fops = {
@@ -1382,7 +1382,7 @@
static int proc_read_cfg_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_ptm_read_cfg, PDE_DATA(inode));
+ return single_open(file, proc_ptm_read_cfg, pde_data(inode));
}
static ssize_t ptm_cfg_proc_write(struct file *file,
@@ -1398,7 +1398,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct ptm_ep_priv *)PDE_DATA(file_inode(file));
+ priv = (struct ptm_ep_priv *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("%s: Invalid private data\n", __func__);
return -EINVAL;
@@ -1478,7 +1478,7 @@
p1 = local_buf;
num = vrx_split_buffer(local_buf, param_list, ARRAY_SIZE(param_list));
- priv = (struct ptm_ep_priv *)PDE_DATA(file_inode(file));
+ priv = (struct ptm_ep_priv *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("%s: Invalid private data\n", __func__);
@@ -1554,7 +1554,7 @@
static int proc_ptm_read_prio_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_ptm_read_prio, PDE_DATA(inode));
+ return single_open(file, proc_ptm_read_prio, pde_data(inode));
}
static const struct proc_ops ptm_prio_proc_fops = {
@@ -1567,7 +1567,7 @@
static int proc_ptm_read_bond_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_ptm_read_bond, PDE_DATA(inode));
+ return single_open(file, proc_ptm_read_bond, pde_data(inode));
}
static const struct proc_ops ptm_bond_proc_fops = {
@@ -1580,7 +1580,7 @@
static int proc_ptm_read_bondmib_seq_open(struct inode *inode,
struct file *file)
{
- return single_open(file, proc_ptm_read_bondmib, PDE_DATA(inode));
+ return single_open(file, proc_ptm_read_bondmib, pde_data(inode));
}
static const struct proc_ops ptm_bondmib_proc_fops = {
@@ -1983,7 +1983,7 @@
num = vrx_split_buffer(local_buf, param_list,
ARRAY_SIZE(param_list));
- priv = (struct tc_comm *)PDE_DATA(file_inode(file));
+ priv = (struct tc_comm *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("<%s>: Invalid private data\n", __func__);
return count;
@@ -2158,7 +2158,7 @@
static int proc_read_atm_cfg_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_atm_cfg, PDE_DATA(inode));
+ return single_open(file, proc_read_atm_cfg, pde_data(inode));
}
static ssize_t atm_cfg_proc_write(struct file *file,
@@ -2174,7 +2174,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct atm_priv *)PDE_DATA(file_inode(file));
+ priv = (struct atm_priv *)pde_data(file_inode(file));
if (!access_ok(buf, count))
return -EFAULT;
@@ -2238,7 +2238,7 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- priv = (struct atm_priv *)PDE_DATA(file_inode(file));
+ priv = (struct atm_priv *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("%s: Invalid private data\n", __func__);
return -EINVAL;
@@ -2266,7 +2266,7 @@
static int proc_read_atm_wanmib_seq_open(struct inode *inode,
struct file *file)
{
- return single_open(file, proc_read_atm_wanmib, PDE_DATA(inode));
+ return single_open(file, proc_read_atm_wanmib, pde_data(inode));
}
@@ -2281,7 +2281,7 @@
static int proc_read_htu_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_htu, PDE_DATA(inode));
+ return single_open(file, proc_read_htu, pde_data(inode));
}
static const struct proc_ops htu_proc_fops = {
@@ -2293,7 +2293,7 @@
static int proc_read_queue_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_read_queue, PDE_DATA(inode));
+ return single_open(file, proc_read_queue, pde_data(inode));
}
static const struct proc_ops queue_proc_fops = {
@@ -2350,7 +2350,7 @@
p1 = local_buf;
num = vrx_split_buffer(local_buf, param_list, ARRAY_SIZE(param_list));
- priv = (struct atm_priv *)PDE_DATA(file_inode(file));
+ priv = (struct atm_priv *)pde_data(file_inode(file));
if (vrx_strcmpi(param_list[0], "help") == 0)
goto proc_atm_prio_help;
else if (vrx_strcmpi(param_list[0], "pvc") == 0) {
@@ -2513,7 +2513,7 @@
static int proc_atm_read_prio_seq_open(struct inode *inode, struct file *file)
{
- return single_open(file, proc_atm_read_prio, PDE_DATA(inode));
+ return single_open(file, proc_atm_read_prio, pde_data(inode));
}
static const struct seq_operations pvc_mib_seq_ops = {
@@ -2536,7 +2536,7 @@
int ret = seq_open(file, &pvc_mib_seq_ops);
if (ret == 0) {
struct seq_file *m = file->private_data;
- m->private = PDE_DATA(inode);
+ m->private = pde_data(inode);
}
return ret;
}
@@ -2574,7 +2574,7 @@
local_buf[len] = 0;
num = vrx_split_buffer(local_buf, param_list, ARRAY_SIZE(param_list));
- priv = (struct atm_priv *)PDE_DATA(file_inode(file));
+ priv = (struct atm_priv *)pde_data(file_inode(file));
if (priv == NULL) {
pr_err("<%s>: Invalid private data\n", __func__);
return count;
--- a/dcdp/ptm_tc.c 2023-06-29 11:30:37.060472655 +0200
+++ b/dcdp/ptm_tc.c 2023-06-29 11:31:01.376064210 +0200
@@ -88,7 +88,7 @@
unsigned int *data_addr, unsigned int *desc_addr);
-static inline void tc_ether_addr_copy(u8 *dst, const u8 *src)
+static inline void tc_ether_addr_copy(const u8 *dst, const u8 *src)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
*(u32 *)dst = *(const u32 *)src;