linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 3/3] Bluetooth: Add AMP initialization
Date: Thu, 17 Nov 2011 06:49:44 +0900	[thread overview]
Message-ID: <1321480186.15441.554.camel@aeonflux> (raw)
In-Reply-To: <1321457422-31641-3-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> Define init sequence for AMP controller. Code based on Code Aurora
> sequence.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/hci_core.c  |   58 ++++++++++++++++++++++++++++----------------
>  net/bluetooth/hci_event.c |    2 +-
>  2 files changed, 38 insertions(+), 22 deletions(-)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index d1eef7c..290acb2 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -219,40 +219,56 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
>  			hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL);
>  	}
>  
> -	/* Read Local Supported Features */
> -	hci_send_cmd(hdev, HCI_OP_READ_LOCAL_FEATURES, 0, NULL);
> -
>  	/* Read Local Version */
>  	hci_send_cmd(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL);
>  
>  	/* Read Buffer Size (ACL mtu, max pkt, etc.) */
>  	hci_send_cmd(hdev, HCI_OP_READ_BUFFER_SIZE, 0, NULL);
>  
> -	/* Read BD Address */
> -	hci_send_cmd(hdev, HCI_OP_READ_BD_ADDR, 0, NULL);
> +	switch (hdev->dev_type) {
> +	case HCI_BREDR:

stop right here and first split this out into proper helper functions.
Making this part longer and more convoluted is not going to work well in
the long run.
 
> -	if (test_bit(HCI_INIT, &hdev->flags))
> +	if (hdev->dev_type == HCI_BREDR && test_bit(HCI_INIT, &hdev->flags))
>  		hci_setup(hdev);
>  }
>  

This is ugly. Why don't we set HCI_INIT for AMP controllers as well?

Regards

Marcel



  reply	other threads:[~2011-11-16 21:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 15:30 [RFC 1/3] Bluetooth: Use queue in the device list Emeltchenko Andrei
2011-11-16 15:30 ` [RFC 2/3] Bluetooth: remove old code Emeltchenko Andrei
2011-11-16 20:44   ` Gustavo Padovan
2011-11-16 21:47     ` Marcel Holtmann
2011-11-16 15:30 ` [RFC 3/3] Bluetooth: Add AMP initialization Emeltchenko Andrei
2011-11-16 21:49   ` Marcel Holtmann [this message]
2011-11-17 13:20     ` Emeltchenko Andrei
2011-11-17 15:45       ` Marcel Holtmann
2011-11-17 18:17         ` Peter Krystad
2011-11-18  5:14           ` Marcel Holtmann
2011-11-18 13:54             ` 'Emeltchenko Andrei'
2011-11-18 16:23               ` Marcel Holtmann
2011-11-21 10:13                 ` 'Emeltchenko Andrei'
2011-11-21 13:00                   ` Marcel Holtmann
2011-11-16 21:48 ` [RFC 1/3] Bluetooth: Use queue in the device list Marcel Holtmann
2011-11-21 16:46 ` Gustavo Padovan
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21 16:23 [RFC 3/3] Bluetooth: Add AMP initialization james.steele
2011-11-21 16:53 ` Marcel Holtmann
2011-11-23 10:04   ` Andrei Emeltchenko
2011-11-23 14:51     ` Marcel Holtmann

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=1321480186.15441.554.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).