Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Ulisses Furquim <ulisses@profusion.mobi>
Cc: linux-bluetooth@vger.kernel.org, padovan@profusion.mobi
Subject: Re: [PATCH v2 2/2] Bluetooth: Make HCI call directly into SCO and L2CAP event functions
Date: Wed, 21 Dec 2011 13:33:31 +0200	[thread overview]
Message-ID: <20111221113330.GC21295@aemeltch-MOBL1> (raw)
In-Reply-To: <1324438330-9887-2-git-send-email-ulisses@profusion.mobi>

Hi Ulisses,

On Wed, Dec 21, 2011 at 01:32:10AM -0200, Ulisses Furquim wrote:
> The struct hci_proto and all related register/unregister and dispatching
> code was removed. HCI core code now call directly the SCO and L2CAP
> event functions.
> 
> Signed-off-by: Ulisses Furquim <ulisses@profusion.mobi>
> ---
>  include/net/bluetooth/hci_core.h |  125 ++++++++++++-------------------------
>  net/bluetooth/hci_core.c         |   59 +-----------------
>  net/bluetooth/l2cap_core.c       |   51 ++-------------
>  net/bluetooth/sco.c              |   38 +----------
>  4 files changed, 56 insertions(+), 217 deletions(-)

...

>  static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
>  								__u8 type)
>  {
> -	register struct hci_proto *hp;
> -	int mask = 0;
> -
> -	hp = hci_proto[HCI_PROTO_L2CAP];
> -	if (hp && hp->connect_ind)
> -		mask |= hp->connect_ind(hdev, bdaddr, type);
> +	if (type == ACL_LINK)
> +		return l2cap_connect_ind(hdev, bdaddr);
> +	else if (type == SCO_LINK || type == ESCO_LINK)
> +		return sco_connect_ind(hdev, bdaddr);

The patch looks OK though I think it is better to use switch instead of
"else if"s in your code.

Best regards 
Andrei Emeltchenko 

  parent reply	other threads:[~2011-12-21 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  3:32 [PATCH v2 1/2] Bluetooth: Always compile SCO and L2CAP in Bluetooth Core Ulisses Furquim
2011-12-21  3:32 ` [PATCH v2 2/2] Bluetooth: Make HCI call directly into SCO and L2CAP event functions Ulisses Furquim
2011-12-21  3:45   ` Marcel Holtmann
2011-12-21 11:33   ` Andrei Emeltchenko [this message]
2011-12-21 11:52     ` Ulisses Furquim
2011-12-21  3:39 ` [PATCH v2 1/2] Bluetooth: Always compile SCO and L2CAP in Bluetooth Core Marcel Holtmann
2011-12-21  4:22 ` Gustavo Padovan

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=20111221113330.GC21295@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    --cc=ulisses@profusion.mobi \
    /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