From 553f527adf1ecd3599ca20c413081af3594b16e2 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Fri, 27 Feb 2026 09:06:55 +0100 Subject: [PATCH] New master module parameter sii_caching. --- master/master.c | 6 ++++-- master/master.h | 8 +++++--- master/module.c | 12 ++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/master/master.c b/master/master.c index 180471aa..c38e69c5 100644 --- a/master/master.c +++ b/master/master.c @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 2006-2020 Florian Pose, Ingenieurgemeinschaft IgH + * Copyright (C) 2006-2026 Florian Pose, Ingenieurgemeinschaft IgH * * This file is part of the IgH EtherCAT Master. * @@ -162,7 +162,8 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */ dev_t device_number, /**< Character device number. */ struct class *class, /**< Device class. */ unsigned int debug_level, /**< Debug level (module parameter). */ - unsigned int run_on_cpu /**< bind created kernel threads to a cpu */ + unsigned int run_on_cpu, /**< Bind created kernel threads to a cpu. */ + unsigned int sii_caching /**< SII caching mode. */ ) { int ret; @@ -242,6 +243,7 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */ master->debug_level = debug_level; master->run_on_cpu = run_on_cpu; + master->sii_caching = sii_caching; master->stats.timeouts = 0; master->stats.corrupted = 0; master->stats.unmatched = 0; diff --git a/master/master.h b/master/master.h index a1125e85..d91d08f0 100644 --- a/master/master.h +++ b/master/master.h @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 2006-2024 Florian Pose, Ingenieurgemeinschaft IgH + * Copyright (C) 2006-2026 Florian Pose, Ingenieurgemeinschaft IgH * * This file is part of the IgH EtherCAT Master. * @@ -273,7 +273,8 @@ struct ec_master { unsigned int fsm_exec_count; /**< Number of entries in execution list. */ unsigned int debug_level; /**< Master debug level. */ - unsigned int run_on_cpu; /**< bind kernel threads to this cpu */ + unsigned int run_on_cpu; /**< Bind kernel threads to this cpu. */ + unsigned int sii_caching; /**< SII caching mode. */ ec_stats_t stats; /**< Cyclic statistics. */ struct task_struct *thread; /**< Master thread. */ @@ -312,7 +313,8 @@ void ec_master_init_static(void); // master creation/deletion int ec_master_init(ec_master_t *, unsigned int, const uint8_t *, - const uint8_t *, dev_t, struct class *, unsigned int, unsigned int); + const uint8_t *, dev_t, struct class *, unsigned int, unsigned int, + unsigned int); void ec_master_clear(ec_master_t *); /** Number of Ethernet devices. diff --git a/master/module.c b/master/module.c index b8156a1d..04e6940e 100644 --- a/master/module.c +++ b/master/module.c @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH + * Copyright (C) 2006-2026 Florian Pose, Ingenieurgemeinschaft IgH * * This file is part of the IgH EtherCAT Master. * @@ -56,6 +56,7 @@ static unsigned int debug_level; /**< Debug level parameter. */ static unsigned int run_on_cpu = 0xffffffff; /**< Bind created kernel threads to a cpu. Default do not bind. */ +static unsigned int sii_caching; /**< SII Caching mode. */ static ec_master_t *masters; /**< Array of masters. */ static struct semaphore master_sem; /**< Master semaphore. */ @@ -80,10 +81,12 @@ module_param_array(main_devices, charp, &master_count, S_IRUGO); MODULE_PARM_DESC(main_devices, "MAC addresses of main devices"); module_param_array(backup_devices, charp, &backup_count, S_IRUGO); MODULE_PARM_DESC(backup_devices, "MAC addresses of backup devices"); -module_param_named(debug_level, debug_level, uint, S_IRUGO); +module_param(debug_level, uint, S_IRUGO); MODULE_PARM_DESC(debug_level, "Debug level"); -module_param_named(run_on_cpu, run_on_cpu, uint, S_IRUGO); +module_param(run_on_cpu, uint, S_IRUGO); MODULE_PARM_DESC(run_on_cpu, "Bind kthreads to a specific cpu"); +module_param(sii_caching, uint, S_IRUGO); +MODULE_PARM_DESC(sii_caching, "SII caching mode (default=0=off)"); /** \endcond */ @@ -153,7 +156,8 @@ int __init ec_init_module(void) for (i = 0; i < master_count; i++) { ret = ec_master_init(&masters[i], i, macs[i][0], macs[i][1], - device_number, class, debug_level, run_on_cpu); + device_number, class, debug_level, run_on_cpu, + sii_caching); if (ret) goto out_free_masters; }