From: Marcel Holtmann <marcel@holtmann.org>
To: Amitkumar Karwar <akarwar@marvell.com>
Cc: Linux Bluetooth <linux-bluetooth@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Ganapathi Bhat <gbhat@marvell.com>
Subject: Re: [PATCH v7] Bluetooth: hci_uart: Support firmware download for Marvell
Date: Wed, 20 Apr 2016 16:42:53 +0200 [thread overview]
Message-ID: <AFF1BDDA-EB1A-4C99-976E-643A093FFD48@holtmann.org> (raw)
In-Reply-To: <d3b0292dba1f4951ad5aaf8a683b8b7a@SC-EXCH04.marvell.com>
Hi Amitkumar,
> Thanks for your review.
> We will address these comments in updated version.
>
>>> +
>>> +/* Receive data */
>>> +static int mrvl_recv(struct hci_uart *hu, const void *data, int
>>> +count) {
>>> + struct mrvl_data *mrvl = hu->priv;
>>> +
>>> + if (test_bit(HCI_UART_DNLD_FW, &mrvl->flags)) {
>>> + mrvl->fwdata->skb = mrvl_process_fw_data(hu, mrvl->fwdata-
>>> skb,
>>> + (u8 *)data, count);
>>> + if (IS_ERR(mrvl->fwdata->skb)) {
>>> + int err = PTR_ERR(mrvl->fwdata->skb);
>>> +
>>> + bt_dev_err(hu->hdev,
>>> + "Receive firmware data failed (%d)", err);
>>> + mrvl->fwdata->skb = NULL;
>>> + return err;
>>> + }
>>> + return 0;
>>> + }
>>
>> This part actually worries me a bit. Yes, we can do it this way, but in
>> general it sounds a bit more like we need a generic approach in
>> hci_ldisc.c to handle pre-HCI firmware loading and/or setup.
>>
>> In the btusb.c driver we added ->setup_on_usb callback. And for it
>> sounds like we need something similar here. So that hci_ldisc.c can
>> handle most of the basic TX/RX.
>
> Even if we added "->setup_on_usb" in hci_ldisc.c, we will need protocol specific changes in receive path during firmware download.
> With this patch, those changes are smoothly handled in hci_mrvl.c file.
> [hci_uart_tty_receive] -> [proto->recv] -> [mrvl_recv] -> [normal Rx path/FW download Rx handling]
we might need to find a better callback name, but yes, we want to make this generic in hci_ldisc.c. I do not have a perfect solution or quick answer, but I think this needs a bit more generic framework.
Regards
Marcel
next prev parent reply other threads:[~2016-04-20 14:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 8:34 Amitkumar Karwar
2016-04-20 13:12 ` Marcel Holtmann
2016-04-20 14:34 ` Amitkumar Karwar
2016-04-20 14:42 ` Marcel Holtmann [this message]
2016-04-22 11:24 ` Amitkumar Karwar
2016-04-22 12:49 ` Marcel Holtmann
2016-04-22 15:01 ` Amitkumar Karwar
2016-04-26 10:39 ` Amitkumar Karwar
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=AFF1BDDA-EB1A-4C99-976E-643A093FFD48@holtmann.org \
--to=marcel@holtmann.org \
--cc=akarwar@marvell.com \
--cc=gbhat@marvell.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®