diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-18 08:20:03 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-19 07:04:41 -0500 |
commit | e211326c0b064e8fe2a8cb51427c3f2044ad84be (patch) | |
tree | f0800bdd0f56e9c032396f3f2da752e974eb54fe /net/bluetooth/mgmt.c | |
parent | aee9b218036476b8b659de5bbfada3a4633f635b (diff) |
Bluetooth: mgmt: Fix Pair Device response status values
This patch fixes the status in Pair Device responses to follow proper
mgmt status values.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 61d0250bd77e..79255f536278 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1728,7 +1728,7 @@ static void pairing_complete_cb(struct hci_conn *conn, u8 status) | |||
1728 | if (!cmd) | 1728 | if (!cmd) |
1729 | BT_DBG("Unable to find a pending command"); | 1729 | BT_DBG("Unable to find a pending command"); |
1730 | else | 1730 | else |
1731 | pairing_complete(cmd, status); | 1731 | pairing_complete(cmd, mgmt_status(status)); |
1732 | } | 1732 | } |
1733 | 1733 | ||
1734 | static int pair_device(struct sock *sk, u16 index, void *data, u16 len) | 1734 | static int pair_device(struct sock *sk, u16 index, void *data, u16 len) |
@@ -1739,7 +1739,6 @@ static int pair_device(struct sock *sk, u16 index, void *data, u16 len) | |||
1739 | struct pending_cmd *cmd; | 1739 | struct pending_cmd *cmd; |
1740 | u8 sec_level, auth_type; | 1740 | u8 sec_level, auth_type; |
1741 | struct hci_conn *conn; | 1741 | struct hci_conn *conn; |
1742 | u8 status = 0; | ||
1743 | int err; | 1742 | int err; |
1744 | 1743 | ||
1745 | BT_DBG(""); | 1744 | BT_DBG(""); |
@@ -1773,17 +1772,16 @@ static int pair_device(struct sock *sk, u16 index, void *data, u16 len) | |||
1773 | rp.addr.type = cp->addr.type; | 1772 | rp.addr.type = cp->addr.type; |
1774 | 1773 | ||
1775 | if (IS_ERR(conn)) { | 1774 | if (IS_ERR(conn)) { |
1776 | status = -PTR_ERR(conn); | 1775 | err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE, |
1777 | err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE, status, | 1776 | MGMT_STATUS_CONNECT_FAILED, |
1778 | &rp, sizeof(rp)); | 1777 | &rp, sizeof(rp)); |
1779 | goto unlock; | 1778 | goto unlock; |
1780 | } | 1779 | } |
1781 | 1780 | ||
1782 | if (conn->connect_cfm_cb) { | 1781 | if (conn->connect_cfm_cb) { |
1783 | hci_conn_put(conn); | 1782 | hci_conn_put(conn); |
1784 | status = EBUSY; | 1783 | err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE, |
1785 | err = cmd_complete(sk, index, MGMT_OP_PAIR_DEVICE, status, | 1784 | MGMT_STATUS_BUSY, &rp, sizeof(rp)); |
1786 | &rp, sizeof(rp)); | ||
1787 | goto unlock; | 1785 | goto unlock; |
1788 | } | 1786 | } |
1789 | 1787 | ||