linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Guodong Xu <guodong.xu@linaro.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Xu Wei <xuwei5@hisilicon.com>, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tony Lindgren <tony@atomide.com>,
	"open list:BLUETOOTH DRIVERS" <linux-bluetooth@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	devicetree@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] Bluetooth: Add LED triggers for HCI frames tx and rx
Date: Thu, 14 Jul 2016 10:42:16 +0100	[thread overview]
Message-ID: <3C106ED5-5F2C-4EAC-8E60-D915D2AD027A@holtmann.org> (raw)
In-Reply-To: <CAFGCpxwuOH83hdPc-c0DV5A_cKMp-0rjxg+3tMwOPTukHGd6vA@mail.gmail.com>

Hi Guodong,

>>> Two LED triggers are defined: tx_led and rx_led. Upon frames
>>> available in HCI core layer, for tx or for rx, the combined LED
>>> can blink.
>>> 
>>> Verified on HiKey, 96boards. It uses hi6220 SoC and TI WL1835 combo
>>> chip.
>>> 
>>> Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
>>> ---
>>> include/net/bluetooth/hci_core.h |  1 +
>>> net/bluetooth/hci_core.c         |  3 +++
>>> net/bluetooth/leds.c             | 15 +++++++++++++++
>>> net/bluetooth/leds.h             |  2 ++
>>> 4 files changed, 21 insertions(+)
>>> 
>>> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
>>> index dc71473..37b8dd9 100644
>>> --- a/include/net/bluetooth/hci_core.h
>>> +++ b/include/net/bluetooth/hci_core.h
>>> @@ -398,6 +398,7 @@ struct hci_dev {
>>>      bdaddr_t                rpa;
>>> 
>>>      struct led_trigger      *power_led;
>>> +     struct led_trigger      *tx_led, *rx_led;
>>> 
>>>      int (*open)(struct hci_dev *hdev);
>>>      int (*close)(struct hci_dev *hdev);
>>> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
>>> index 45a9fc6..c6e1210 100644
>>> --- a/net/bluetooth/hci_core.c
>>> +++ b/net/bluetooth/hci_core.c
>>> @@ -3248,6 +3248,7 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
>>>      skb_queue_tail(&hdev->rx_q, skb);
>>>      queue_work(hdev->workqueue, &hdev->rx_work);
>>> 
>>> +     hci_leds_blink_oneshot(hdev->rx_led);
>>>      return 0;
>>> }
>>> EXPORT_SYMBOL(hci_recv_frame);
>>> @@ -3325,6 +3326,8 @@ static void hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
>>>              BT_ERR("%s sending frame failed (%d)", hdev->name, err);
>>>              kfree_skb(skb);
>>>      }
>>> +
>>> +     hci_leds_blink_oneshot(hdev->tx_led);
>>> }
>> 
>> so I am not convinced that this is the right way of doing TX/RX activity leds. This would have them purely based on HCI traffic and this would include control frames.
>> 
> 
> Hi, Marcel
> 
> +       if (hci_skb_pkt_type(skb) == HCI_ACLDATA_PKT ||
> +           hci_skb_pkt_type(skb) == HCI_SCODATA_PKT)
> +               hci_leds_blink_oneshot(hdev->rx_led);
> +
> 
> By adding pkt_type checks, we can limit LED blinks only at ACL/SCO
> DATA_PKT. Similar checks can be added for tx_led too.
> 
> Does this look good to you? If you agree, I can send v2 to include this change.

we are not going to keep comparing packet types over and over again. The code is already doing that. So functions like hci_sched_acl and hci_acldata_packet are already present in the code.

>> I think that we want activity leds for actual radio activity. Meaning that when we have an active connection and ACL packets are exchanged or when we are scanning.
>> 
> 
> Radio is controlled in Bluetooth module side, not Host. So I'm afraid
> actual radio activity cannot be captured in its exact form in Host
> side. The purpose of this patch is not for radio, it is for
> incoming/outgoing data. For example, it can give user a blinking
> indicator on RX frames after a Bluetooth mouse is connected. Another
> example, it can blink at bluetooth streamed audio (TX).

So radio activity is caused by RX/TX meaning ACL/SCO packets for sure. There is also other radio activity caused by scanning, inquiry, create connection etc. And the question is if this should be there as well.

Regards

Marcel

  reply	other threads:[~2016-07-14  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23  4:58 [PATCH 1/2] Bluetooth: Add LED triggers for HCI frames tx and rx Guodong Xu
2016-06-23  4:58 ` [PATCH 2/2] arm64: dts: hikey: set bluetooth led trigger Guodong Xu
2016-07-12  5:31 ` [PATCH 1/2] Bluetooth: Add LED triggers for HCI frames tx and rx Guodong Xu
2016-07-13  8:07 ` Marcel Holtmann
2016-07-14  7:08   ` Guodong Xu
2016-07-14  9:30   ` Guodong Xu
2016-07-14  9:42     ` Marcel Holtmann [this message]
2016-07-15 12:08       ` Guodong Xu

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=3C106ED5-5F2C-4EAC-8E60-D915D2AD027A@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=guodong.xu@linaro.org \
    --cc=gustavo@padovan.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=johan.hedberg@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=will.deacon@arm.com \
    --cc=xuwei5@hisilicon.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).