From: Johan Hedberg <johan.hedberg@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/4] Bluetooth: mgmt: Add support for Set Link Security command
Date: Fri, 17 Feb 2012 01:39:04 +0200 [thread overview]
Message-ID: <20120216233904.GA6607@x220.ger.corp.intel.com> (raw)
In-Reply-To: <1329434578-5928-2-git-send-email-johan.hedberg@gmail.com>
Hi,
On Fri, Feb 17, 2012, johan.hedberg@gmail.com wrote:
> + hdev = hci_dev_get(index);
> + if (!hdev)
> + return cmd_status(sk, index, MGMT_OP_SET_LINK_SECURITY,
> + MGMT_STATUS_INVALID_PARAMS);
> +
> + hci_dev_lock(hdev);
> +
> + if (mgmt_pending_find(MGMT_OP_SET_LINK_SECURITY, hdev)) {
> + err = cmd_status(sk, index, MGMT_OP_SET_LINK_SECURITY,
> + MGMT_STATUS_BUSY);
> + goto failed;
> + }
> +
> + val = !!cp->val;
> +
> + if (test_bit(HCI_AUTH, &hdev->flags) == val) {
> + err = send_settings_rsp(sk, MGMT_OP_SET_LINK_SECURITY, hdev);
> + goto failed;
> + }
> +
> + cmd = mgmt_pending_add(sk, MGMT_OP_SET_LINK_SECURITY, hdev, data, len);
> + if (!cmd) {
> + err = -ENOMEM;
> + goto failed;
> + }
> +
> + err = hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE, sizeof(val), &val);
> + if (err < 0) {
> + mgmt_pending_remove(cmd);
> + goto failed;
> + }
There's a missing check for HCI_UP here as well as in the corresponding
place of patch 3/4. I'll send v2's of 2/4 and 3/4 as a new patch-set
(1/4 and 4/4 are quite trivial so I wont bother resending them).
Johan
next prev parent reply other threads:[~2012-02-16 23:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 23:22 [PATCH 1/4] Bluetooth: Remove unused member from cmd_lookup struct johan.hedberg
2012-02-16 23:22 ` [PATCH 2/4] Bluetooth: mgmt: Add support for Set Link Security command johan.hedberg
2012-02-16 23:39 ` Johan Hedberg [this message]
2012-02-17 8:33 ` Marcel Holtmann
2012-02-16 23:22 ` [PATCH 3/4] Bluetooth: mgmt: Implement Set SSP command johan.hedberg
2012-02-17 8:33 ` Marcel Holtmann
2012-02-16 23:22 ` [PATCH 4/4] Bluetooth: mgmt: Use more consistent error variable names johan.hedberg
2012-02-17 8:33 ` Marcel Holtmann
2012-02-17 8:33 ` [PATCH 1/4] Bluetooth: Remove unused member from cmd_lookup struct 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=20120216233904.GA6607@x220.ger.corp.intel.com \
--to=johan.hedberg@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).