From: Johan Hedberg <johan.hedberg@gmail.com>
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 v6 3/6] Add support for Out of Band (OOB) association model in hciops
Date: Fri, 25 Mar 2011 10:33:50 +0200 [thread overview]
Message-ID: <20110325083350.GC30796@jh-x301> (raw)
In-Reply-To: <1300974459-24076-4-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Thu, Mar 24, 2011, Szymon Janc wrote:
> +static void remote_oob_data_request(int index, bdaddr_t *bdaddr)
> {
> struct dev_info *dev = &devs[index];
> + GSList *match;
>
> DBG("hci%d", index);
>
> - hci_send_cmd(dev->sk, OGF_LINK_CTL,
> - OCF_REMOTE_OOB_DATA_NEG_REPLY, 6, ptr);
> + match = g_slist_find_custom(dev->oob_data, bdaddr, oob_bdaddr_cmp);
> +
> + if (match) {
> + struct oob_data *data;
> + remote_oob_data_reply_cp cp;
> +
> + data = match->data;
> +
> + bacpy(&cp.bdaddr, &data->bdaddr);
> + memcpy(cp.hash, data->hash, sizeof(cp.hash));
> + memcpy(cp.randomizer, data->randomizer, sizeof(cp.randomizer));
> +
> + dev->oob_data = g_slist_delete_link(dev->oob_data, match);
> +
> + hci_send_cmd(dev->sk, OGF_LINK_CTL, OCF_REMOTE_OOB_DATA_REPLY,
> + REMOTE_OOB_DATA_REPLY_CP_SIZE, &cp);
> +
> + } else {
> + hci_send_cmd(dev->sk, OGF_LINK_CTL,
> + OCF_REMOTE_OOB_DATA_NEG_REPLY, 6, bdaddr);
> + }
> +
> }
Unnecessary empty line at the end of the function.
> + data = g_new(struct oob_data, 1);
> + bacpy(&data->bdaddr, bdaddr);
> + dev->oob_data = g_slist_prepend(dev->oob_data, data);
Probably g_new0 would be better here (doesn't oob_data have more members
than just the bdaddr?
Johan
next prev parent reply other threads:[~2011-03-25 8:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 13:47 [PATCH v6 0/6] Support for out of band association model Szymon Janc
2011-03-24 13:47 ` [PATCH v6 1/6] Add initial support for Out of Band (OOB) " Szymon Janc
2011-03-25 8:28 ` Johan Hedberg
2011-03-24 13:47 ` [PATCH v6 2/6] Add support for Out of Band (OOB) association model in mgmtops Szymon Janc
2011-03-25 8:30 ` Johan Hedberg
2011-03-24 13:47 ` [PATCH v6 3/6] Add support for Out of Band (OOB) association model in hciops Szymon Janc
2011-03-25 8:33 ` Johan Hedberg [this message]
2011-03-26 11:26 ` Szymon Janc
2011-03-24 13:47 ` [PATCH v6 4/6] Add D-Bus OOB plugin Szymon Janc
2011-03-25 8:54 ` Johan Hedberg
2011-03-24 13:47 ` [PATCH v6 5/6] Update mgmt-api.txt with OOB commands Szymon Janc
2011-03-24 13:47 ` [PATCH v6 6/6] Add oob-api.txt with documentation about OOB D-Bus methods Szymon Janc
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=20110325083350.GC30796@jh-x301 \
--to=johan.hedberg@gmail.com \
--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).