linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: linux-bluetooth@vger.kernel.org,
	par-gunnar.p.hjalmdahl@stericsson.com,
	henrik.possung@stericsson.com
Subject: Re: [PATCH v2 3/4] Bluetooth: Add read_local_oob_data management command
Date: Thu, 17 Mar 2011 15:18:59 -0300	[thread overview]
Message-ID: <20110317181859.GC2214@joana> (raw)
In-Reply-To: <1299000216-6570-4-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

* Szymon Janc <szymon.janc@tieto.com> [2011-03-01 18:23:35 +0100]:

> This patch adds a command to read local OOB data to the managment interface.
> The command maps directly to the Read Local OOB Data HCI command.
> 
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  include/net/bluetooth/hci.h      |    7 +++
>  include/net/bluetooth/hci_core.h |    2 +
>  include/net/bluetooth/mgmt.h     |    6 +++
>  net/bluetooth/hci_event.c        |   15 +++++++
>  net/bluetooth/mgmt.c             |   85 ++++++++++++++++++++++++++++++++++++++
>  5 files changed, 115 insertions(+), 0 deletions(-)
> 
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index ec6acf2..20840dc 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -611,6 +611,13 @@ struct hci_cp_write_ssp_mode {
>  	__u8     mode;
>  } __packed;
>  
> +#define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
> +struct hci_rp_read_local_oob_data {
> +	__u8     status;
> +	__u8     hash[16];
> +	__u8     randomizer[16];
> +} __packed;
> +
>  #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
>  
>  #define HCI_OP_READ_LOCAL_VERSION	0x1001
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index 441dadb..c8b7ee6 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -767,6 +767,8 @@ int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
>  int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
>  								u8 status);
>  int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status);
> +int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer,
> +								u8 status);
>  
>  /* HCI info for socket */
>  #define hci_pi(sk) ((struct hci_pinfo *) sk)
> diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
> index 5fabfa8..916b1c6 100644
> --- a/include/net/bluetooth/mgmt.h
> +++ b/include/net/bluetooth/mgmt.h
> @@ -167,6 +167,12 @@ struct mgmt_rp_user_confirm_reply {
>  
>  #define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x0016
>  
> +#define MGMT_OP_READ_LOCAL_OOB_DATA	0x0017
> +struct mgmt_rp_read_local_oob_data {
> +	__u8 hash[16];
> +	__u8 randomizer[16];
> +} __packed;
> +
>  #define MGMT_EV_CMD_COMPLETE		0x0001
>  struct mgmt_ev_cmd_complete {
>  	__le16 opcode;
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 3fbfa50..4faab87 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -807,6 +807,17 @@ static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb)
>  								rp->status);
>  }
>  
> +static void hci_cc_read_local_oob_data_reply(struct hci_dev *hdev,
> +							struct sk_buff *skb)
> +{
> +	struct hci_rp_read_local_oob_data *rp = (void *) skb->data;
> +
> +	BT_DBG("%s status 0x%x", hdev->name, rp->status);
> +
> +	mgmt_read_local_oob_data_reply_complete(hdev->id, rp->hash,
> +						rp->randomizer, rp->status);
> +}
> +

This should be after hci_cc_pin_code_neg_reply() and not
hci_cc_user_confirm_reply().


-- 
Gustavo F. Padovan
http://profusion.mobi

  reply	other threads:[~2011-03-17 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 17:23 [PATCH v2 0/4] Support for OOB in mgmt interface Szymon Janc
2011-03-01 17:23 ` [PATCH v2 1/4] Bluetooth: Rename cmd to cmd_params in pending_cmd Szymon Janc
2011-03-17 18:15   ` Gustavo F. Padovan
2011-03-01 17:23 ` [PATCH v2 2/4] Bluetooth: Allow for NULL data in mgmt_pending_add Szymon Janc
2011-03-01 17:23 ` [PATCH v2 3/4] Bluetooth: Add read_local_oob_data management command Szymon Janc
2011-03-17 18:18   ` Gustavo F. Padovan [this message]
2011-03-01 17:23 ` [PATCH v2 4/4] Bluetooth: Add add/remove_remote_oob_data management commands Szymon Janc
2011-03-17 18:26   ` Gustavo F. 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=20110317181859.GC2214@joana \
    --to=padovan@profusion.mobi \
    --cc=henrik.possung@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=par-gunnar.p.hjalmdahl@stericsson.com \
    --cc=szymon.janc@tieto.com \
    /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).