All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Baltieri <fabio.baltieri@gmail.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>,
	linux-can@vger.kernel.org
Subject: Re: [RFC PATCH] can: add tx/rx led trigger support
Date: Thu, 12 Apr 2012 20:30:18 +0200	[thread overview]
Message-ID: <CABkP77dTiaziwkYY5bpUZ8PMpj_P7q3zg4Kye4CY=tXV-1OgwQ@mail.gmail.com> (raw)
In-Reply-To: <4F86FA24.9000404@hartkopp.net>

On Thu, Apr 12, 2012 at 5:52 PM, Oliver Hartkopp <socketcan@hartkopp.net> wrote:
>>>> Is the LED "blinking" on traffic or is it just "on" for some time when a
>>>> CAN frame is processed?
>>>
>>> It stays on for some time after each frame. Above a certain
>>> packet-rate (1/led_off_delay) LED appear to be constantly on. You can
>>> tell periodic packets from bursts from it but nothing more.
>>
>> I think a Tx or Rx trigger should just "start" one LED blink, e.g. ON for
>> 100ms and OFF for 100ms no matter if other packets being processed. This way
>> you will constantly see a LED blinking if a specific load is exceeded. If it
>> is at lower rate the LED will blink more rarely.
>> You could even go one step further and activate a LED if the CAN interface is
>> UP and turn it off for some time if there is some traffic. So the LED could
>> inidicate if the interface is being used and/or if there is some traffic.
>
>
> Hi Alexander,
>
> the latter is implemented in my WIFI LED in my notebook:
>
> Interface up -> LED is ON
>
> Interface traffic -> LED is doing a off-on-sequence which leads to constant
> blinking when downloading files ...

I like the idea too.

So, I'll try to recap the points posted for a v2 o the patch:
- move the trigger code away from the net layer and put it the drivers
one for direct use of the drivers, I'll keep it in a separate source
file with #ifdef to redefine functions as no-op, as it seems to be
what most other triggers do (and it looks clean to me).
- implement functions as led_can_init, led_can_exit, led_can_event
with an event-id for tx, rx, error, open, stop
- implement event call from some driver as reference (I can only test
on vcan, slcan and flexcan, that's probably enough to test it out).
- implement blink function as follows:
  - for tx/rx trigger, turn full-on on device open, off on device stop
and one cycle of "blink_delay off - blink_delay on" on event, other
frames are ignored until the off-on sequence is over.
  - for error trigger, just blink on-off on each error event.
- keep delay time as parameter and skip triggers altogether if 0 - or
- use the activate/deactivate functions of the trigger subsystem to do
that automatically, that would cost some atomic usage counters.
- shorten trigger names to 16 characters (32 bytes look i bit big now
that I think at it).

Am I missing anything?

Regards.

-- 
Fabio Baltieri

  reply	other threads:[~2012-04-12 18:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 21:39 [RFC PATCH] can: add tx/rx led trigger support Fabio Baltieri
2012-04-11  6:14 ` Oliver Hartkopp
2012-04-11 17:58   ` Fabio Baltieri
2012-04-11 18:29     ` Oliver Hartkopp
2012-04-11 18:58       ` Wolfgang Grandegger
2012-04-12  6:16         ` Oliver Hartkopp
2012-04-11 19:02     ` Oliver Hartkopp
2012-04-11 19:36       ` Fabio Baltieri
2012-04-12  6:05         ` Oliver Hartkopp
2012-04-12  6:32         ` Alexander Stein
2012-04-12 15:52           ` Oliver Hartkopp
2012-04-12 18:30             ` Fabio Baltieri [this message]
2012-04-13 19:00               ` Oliver Hartkopp
2012-04-12  7:37         ` Wolfgang Grandegger
2012-04-12 11:07           ` Martin Gysel
2012-04-12 16:02             ` Oliver Hartkopp
2012-04-12 16:13               ` Wolfgang Grandegger
2012-04-12 17:28                 ` Fabio Baltieri
2012-04-12 18:47                   ` Wolfgang Grandegger
2012-04-12 17:46           ` Fabio Baltieri
2012-04-12 18:53             ` Wolfgang Grandegger
2012-04-11  6:29 ` Alexander Stein
2012-04-11 18:03   ` Fabio Baltieri
2012-04-11 14:45 ` Wolfgang Grandegger
2012-04-11 16:24   ` Oliver Hartkopp
2012-04-11 19:11   ` Fabio Baltieri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABkP77dTiaziwkYY5bpUZ8PMpj_P7q3zg4Kye4CY=tXV-1OgwQ@mail.gmail.com' \
    --to=fabio.baltieri@gmail.com \
    --cc=alexander.stein@systec-electronic.com \
    --cc=linux-can@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.