From: Johan Hedberg <johan.hedberg@gmail.com>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 07/14] Bluetooth: Add transaction cmd_complete and cmd_status functions
Date: Fri, 22 Feb 2013 16:31:15 +0200 [thread overview]
Message-ID: <20130222143115.GA2718@x220> (raw)
In-Reply-To: <20130222141740.GA6830@echo>
Hi Vinicius,
On Fri, Feb 22, 2013, Vinicius Costa Gomes wrote:
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -53,6 +53,7 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
> > hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
> > hci_dev_unlock(hdev);
> >
> > + hci_transaction_cmd_complete(hdev, HCI_OP_INQUIRY, status);
> > hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status);
> >
> > hci_conn_check_pending(hdev);
> > @@ -1692,6 +1693,7 @@ static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
> >
> > BT_DBG("%s status 0x%2.2x", hdev->name, status);
> >
> > + hci_transaction_cmd_complete(hdev, HCI_OP_INQUIRY, status);
>
> There are quite a few other commands that do not cause a Command Complete
> event, for example, LE Start Encryption, causes either a Encrypt Change or a
> Key Refresh; LE Create Connection, causes a Connection Complete.
>
> So if I want to add support for these commands to be part of a transaction I
> would need to add the appropriate handler to the associated "complete" events,
> right? I feel that I already know the answer ;-) This question is more about
> others developers losing time thinking: "Why transactions doesn't work for
> these particular commands?".
Right. Any multi-command transactions, or transactions with a complete
callback that contain HCI commands that do not result in command
complete will need to have these extra calls to
hci_transaction_cmd_complete added. Probably some comment might be worth
adding to the code about this.
Johan
next prev parent reply other threads:[~2013-02-22 14:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 13:12 [PATCH 00/14] Bluetooth: Add HCI transaction framework Johan Hedberg
2013-02-22 13:12 ` [PATCH 01/14] Bluetooth: Fix __hci_request() handling of empty requests Johan Hedberg
2013-02-22 13:12 ` [PATCH 02/14] Bluetooth: Split HCI init sequence into three stages Johan Hedberg
2013-02-22 13:12 ` [PATCH 03/14] Bluetooth: Add initial skeleton for HCI transaction framework Johan Hedberg
2013-02-22 13:34 ` [PATCH 03/14 v2] " Johan Hedberg
2013-02-22 13:12 ` [PATCH 04/14] Bluetooth: Refactor HCI command skb creation Johan Hedberg
2013-02-22 13:12 ` [PATCH 05/14] Bluetooth: Introduce new hci_transaction_cmd function Johan Hedberg
2013-02-22 13:12 ` [PATCH 06/14] Bluetooth: Introduce a hci_transaction_from_skb function Johan Hedberg
2013-02-22 13:12 ` [PATCH 07/14] Bluetooth: Add transaction cmd_complete and cmd_status functions Johan Hedberg
2013-02-22 14:17 ` Vinicius Costa Gomes
2013-02-22 14:31 ` Johan Hedberg [this message]
2013-02-22 13:12 ` [PATCH 08/14] Bluetooth: Convert hci_request to use HCI transaction framework Johan Hedberg
2013-02-22 13:12 ` [PATCH 09/14] Bluetooth: Update mgmt powered HCI commands to use transactions Johan Hedberg
2013-02-22 13:12 ` [PATCH 10/14] Bluetooth: Wait for HCI command completion with mgmt_set_powered Johan Hedberg
2013-02-22 13:12 ` [PATCH 11/14] Bluetooth: Fix busy condition testing for EIR and class updates Johan Hedberg
2013-02-22 13:12 ` [PATCH 12/14] Bluetooth: Fix UUID/class mgmt command response synchronization Johan Hedberg
2013-02-22 13:12 ` [PATCH 13/14] Bluetooth: Remove useless HCI_PENDING_CLASS flag Johan Hedberg
2013-02-22 13:12 ` [PATCH 14/14] 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=20130222143115.GA2718@x220 \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=vinicius.gomes@openbossa.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.