Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 03/11] Bluetooth: Split HCI init sequence into three stages
Date: Mon, 4 Mar 2013 13:35:11 +0200	[thread overview]
Message-ID: <20130304113511.GA24442@x220> (raw)
In-Reply-To: <CAJdJm_Pj4_O8N1uYVSg6qsJm+L7PyGyPGNo-_y-FC+dWybotqQ@mail.gmail.com>

Hi Lizardo,

On Mon, Mar 04, 2013, Anderson Lizardo wrote:
> On Mon, Mar 4, 2013 at 6:09 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> > From: Johan Hedberg <johan.hedberg@intel.com>
> >
> > Having contitional command sending during a request has always been
> > problematic and caused hacks like the hdev->init_last_cmd variable. This
> > patch removes these conditionals and instead splits the init sequence
> > into three stages, each with its own __hci_request() call.
> 
> Typos:
> 
> contitional -> conditional
> __hci_request() -> __hci_req_sync()

Thanks. Will fix.

> > +static int __hci_init(struct hci_dev *hdev)
> > +{
> > +       int err;
> > +
> > +       err = __hci_req_sync(hdev, hci_init1_req, 0, HCI_INIT_TIMEOUT);
> > +       if (err < 0)
> > +               return err;
> > +
> > +       /* AMP controllers do not need stage 2/3 init */
> > +       if (hdev->dev_type != HCI_BREDR)
> > +               return 0;
> 
> What about checking for "dev_type == HCI_AMP" instead? I had to check
> net/bluetooth/hci.h because for a moment I thought Dual mode and
> single mode LE devices were being left out as well. I then realized
> you can only have BREDR vs. AMP controller types.

This logic is a direct copy-paste from the beginning of the existing
hci_setup() function in net/bluetooth/hci_event.c. I could change it to
test specifically for AMP, but then what happens if we add more dev_type
values that also shouldn't have more than the stage 1 init? In that case
a stricter != HCI_BREDR test is safer than a looser == HCI_AMP test.

Johan

  reply	other threads:[~2013-03-04 11:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 10:08 [PATCH 00/11] Bluetooth: Add asynchronous request support Johan Hedberg
2013-03-04 10:08 ` [PATCH 01/11] Bluetooth: Rename hci_request to hci_req_sync Johan Hedberg
2013-03-04 18:57   ` Marcel Holtmann
2013-03-04 10:08 ` [PATCH 02/11] Bluetooth: Fix __hci_req_sync() handling of empty requests Johan Hedberg
2013-03-04 10:09 ` [PATCH 03/11] Bluetooth: Split HCI init sequence into three stages Johan Hedberg
2013-03-04 10:59   ` Anderson Lizardo
2013-03-04 11:35     ` Johan Hedberg [this message]
2013-03-04 13:36       ` Anderson Lizardo
2013-03-04 18:54         ` Marcel Holtmann
2013-03-04 21:07           ` Johan Hedberg
2013-03-04 21:58             ` Marcel Holtmann
2013-03-04 10:09 ` [PATCH 04/11] Bluetooth: Add initial skeleton for asynchronous HCI requests Johan Hedberg
2013-03-04 19:03   ` Marcel Holtmann
2013-03-04 21:16     ` Johan Hedberg
2013-03-04 21:54       ` Marcel Holtmann
2013-03-04 10:09 ` [PATCH 05/11] Bluetooth: Refactor HCI command skb creation Johan Hedberg
2013-03-04 10:09 ` [PATCH 06/11] Bluetooth: Introduce new hci_req_cmd function Johan Hedberg
2013-03-04 19:06   ` Marcel Holtmann
2013-03-04 21:17     ` Johan Hedberg
2013-03-04 10:09 ` [PATCH 07/11] Bluetooth: Introduce a hci_req_from_skb function Johan Hedberg
2013-03-04 10:09 ` [PATCH 08/11] Bluetooth: Add request cmd_complete and cmd_status functions Johan Hedberg
2013-03-04 10:09 ` [PATCH 09/11] Bluetooth: Use async requests internally in hci_req_sync Johan Hedberg
2013-03-04 10:09 ` [PATCH 10/11] Bluetooth: Remove unused hdev->init_last_cmd Johan Hedberg
2013-03-04 10:09 ` [PATCH 11/11] Bluetooth: Remove empty HCI event handlers Johan Hedberg

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=20130304113511.GA24442@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=anderson.lizardo@openbossa.org \
    --cc=linux-bluetooth@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