diff --git a/kernel/mars.h b/kernel/mars.h index 5cf0d31b..60d8c5e4 100644 --- a/kernel/mars.h +++ b/kernel/mars.h @@ -352,9 +352,10 @@ extern void mars_power_led_off(struct mars_brick *brick, bool val); /* this should disappear! */ extern void (*_mars_trigger)(void); -extern void (*_mars_remote_trigger)(void); +extern void (*_mars_remote_trigger)(bool do_all); #define mars_trigger() do { if (_mars_trigger) { MARS_DBG("trigger...\n"); _mars_trigger(); } } while (0) -#define mars_remote_trigger() do { if (_mars_remote_trigger) { MARS_DBG("remote_trigger...\n"); _mars_remote_trigger(); } } while (0) +#define mars_remote_trigger() do { if (_mars_remote_trigger) { MARS_DBG("remote_trigger...\n"); _mars_remote_trigger(false); } } while (0) +#define mars_remote_trigger_all() do { if (_mars_remote_trigger) { MARS_DBG("remote_trigger_all...\n"); _mars_remote_trigger(true); } } while (0) ///////////////////////////////////////////////////////////////////////// diff --git a/kernel/sy_old/mars_main.c b/kernel/sy_old/mars_main.c index 86ce208c..f67a54e3 100644 --- a/kernel/sy_old/mars_main.c +++ b/kernel/sy_old/mars_main.c @@ -2435,7 +2435,7 @@ void from_remote_trigger(void) EXPORT_SYMBOL_GPL(from_remote_trigger); static -void __mars_remote_trigger(void) +void __mars_remote_trigger(bool do_all) { struct list_head *tmp; int count = 0; @@ -2443,6 +2443,9 @@ void __mars_remote_trigger(void) down_read(&peer_lock); for (tmp = peer_anchor.next; tmp != &peer_anchor; tmp = tmp->next) { struct mars_peerinfo *peer = container_of(tmp, struct mars_peerinfo, peer_head); + /* skip some peers when requested */ + if (!do_all && !peer->do_communicate) + continue; peer->to_remote_trigger = true; count++; } @@ -5898,7 +5901,7 @@ static int exit_fn_nr = 0; } while (0) -void (*_mars_remote_trigger)(void); +void (*_mars_remote_trigger)(bool do_all); EXPORT_SYMBOL_GPL(_mars_remote_trigger); static void exit_main(void) diff --git a/kernel/sy_old/mars_proc.c b/kernel/sy_old/mars_proc.c index 9b5229cf..3242c849 100644 --- a/kernel/sy_old/mars_proc.c +++ b/kernel/sy_old/mars_proc.c @@ -92,7 +92,9 @@ int trigger_sysctl_handler( if (code > 0) { mars_trigger(); } - if (code > 1) { + if (code > 2) { + mars_remote_trigger_all(); + } else if (code > 1) { mars_remote_trigger(); } }