mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amitkumar Karwar <akarwar@marvell.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ganapathi Bhat <gbhat@marvell.com>
Subject: RE: [PATCH v9 3/3] Bluetooth: hci_uart: Support firmware download for Marvell
Date: Wed, 4 May 2016 14:40:10 +0000	[thread overview]
Message-ID: <7a96f0ab0acb4b97a4590ba037cc8dd2@SC-EXCH04.marvell.com> (raw)
In-Reply-To: <D3B4A169-777A-4235-B3C9-EBFA2117CE3D@holtmann.org>

Hi Marcel,

Thanks for your comments.
We are working to resolve them.

> > +
> > +/* 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;
> > +	}
> 
> So I really want to get rid of this part in the driver ->recv should be
> kept compartmentalized between before HCI is ready and when HCI is
> ready.
> 

We already have HCI_UART_REGISTERED bit in "hu->flags". I think, we can use it to know if HCI is ready or not.
We will define two recv handlers. "->recv" and "->recv_for_prepare"

OR let us know if you want us to use single "->recv" and have code under "if (HCI_UART_REGISTERED)" and "else" in our handler.

Regards,
Amitkumar

      reply	other threads:[~2016-05-04 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 10:24 [PATCH v9 1/3] Bluetooth: hci_uart: add prepare callback Amitkumar Karwar
2016-04-29 10:24 ` [PATCH v9 2/3] Bluetooth: hci_uart: check if hdev is present before using it Amitkumar Karwar
2016-04-29 10:24 ` [PATCH v9 3/3] Bluetooth: hci_uart: Support firmware download for Marvell Amitkumar Karwar
2016-05-02 17:43   ` Marcel Holtmann
2016-05-04 14:40     ` Amitkumar Karwar [this message]

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=7a96f0ab0acb4b97a4590ba037cc8dd2@SC-EXCH04.marvell.com \
    --to=akarwar@marvell.com \
    --cc=gbhat@marvell.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.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®