diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-02-19 10:05:59 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-21 15:22:44 -0500 |
commit | ac56fb13c0508181b4227b8ada6d47aaaf72794c (patch) | |
tree | 204274e61cc84931e275d5a6ef65102bb4efe864 /net/bluetooth | |
parent | 59a24b5d0d4befc2498f51c57905cb02963ff275 (diff) |
Bluetooth: Fix mgmt_pin_code_reply return parameters
The command complete event for mgmt_pin_code_reply &
mgmt_pin_code_neg_reply should have the adapter index, Bluetooth address
as well as the status.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d1d9b8c3a1b0..0d3d613baac2 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1558,17 +1558,18 @@ int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr) | |||
1558 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status) | 1558 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status) |
1559 | { | 1559 | { |
1560 | struct pending_cmd *cmd; | 1560 | struct pending_cmd *cmd; |
1561 | struct mgmt_rp_pin_code_reply rp; | ||
1561 | int err; | 1562 | int err; |
1562 | 1563 | ||
1563 | cmd = mgmt_pending_find(MGMT_OP_PIN_CODE_REPLY, index); | 1564 | cmd = mgmt_pending_find(MGMT_OP_PIN_CODE_REPLY, index); |
1564 | if (!cmd) | 1565 | if (!cmd) |
1565 | return -ENOENT; | 1566 | return -ENOENT; |
1566 | 1567 | ||
1567 | if (status != 0) | 1568 | put_unaligned_le16(index, &rp.index); |
1568 | err = cmd_status(cmd->sk, MGMT_OP_PIN_CODE_REPLY, status); | 1569 | bacpy(&rp.bdaddr, bdaddr); |
1569 | else | 1570 | rp.status = status; |
1570 | err = cmd_complete(cmd->sk, MGMT_OP_PIN_CODE_REPLY, | 1571 | |
1571 | bdaddr, sizeof(*bdaddr)); | 1572 | err = cmd_complete(cmd->sk, MGMT_OP_PIN_CODE_REPLY, &rp, sizeof(rp)); |
1572 | 1573 | ||
1573 | list_del(&cmd->list); | 1574 | list_del(&cmd->list); |
1574 | mgmt_pending_free(cmd); | 1575 | mgmt_pending_free(cmd); |
@@ -1579,17 +1580,19 @@ int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status) | |||
1579 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status) | 1580 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status) |
1580 | { | 1581 | { |
1581 | struct pending_cmd *cmd; | 1582 | struct pending_cmd *cmd; |
1583 | struct mgmt_rp_pin_code_reply rp; | ||
1582 | int err; | 1584 | int err; |
1583 | 1585 | ||
1584 | cmd = mgmt_pending_find(MGMT_OP_PIN_CODE_NEG_REPLY, index); | 1586 | cmd = mgmt_pending_find(MGMT_OP_PIN_CODE_NEG_REPLY, index); |
1585 | if (!cmd) | 1587 | if (!cmd) |
1586 | return -ENOENT; | 1588 | return -ENOENT; |
1587 | 1589 | ||
1588 | if (status != 0) | 1590 | put_unaligned_le16(index, &rp.index); |
1589 | err = cmd_status(cmd->sk, MGMT_OP_PIN_CODE_NEG_REPLY, status); | 1591 | bacpy(&rp.bdaddr, bdaddr); |
1590 | else | 1592 | rp.status = status; |
1591 | err = cmd_complete(cmd->sk, MGMT_OP_PIN_CODE_NEG_REPLY, | 1593 | |
1592 | bdaddr, sizeof(*bdaddr)); | 1594 | err = cmd_complete(cmd->sk, MGMT_OP_PIN_CODE_NEG_REPLY, |
1595 | &rp, sizeof(rp)); | ||
1593 | 1596 | ||
1594 | list_del(&cmd->list); | 1597 | list_del(&cmd->list); |
1595 | mgmt_pending_free(cmd); | 1598 | mgmt_pending_free(cmd); |