diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-11-07 22:16:03 +0200 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-11-08 12:54:10 -0200 |
commit | 2d7cee5836d6d466829b255b1290c9386d4e884f (patch) | |
tree | e87b27c8fa32226f7368c9f01329696c30d3d39c /net/bluetooth/mgmt.c | |
parent | 16ab91ab48287aa4fc757f3618820f728ee4412f (diff) | |
download | lwn-2d7cee5836d6d466829b255b1290c9386d4e884f.tar.gz lwn-2d7cee5836d6d466829b255b1290c9386d4e884f.zip |
Bluetooth: Fix mgmt response when HCI_Write_Scan_Enable fails
A proper mgmt_command_status should be returned to user-space if either
discoverable or connectable enabling fails.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 724d4fee2bd7..0cb023e0edb4 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -2056,6 +2056,19 @@ int mgmt_connectable(u16 index, u8 connectable) return ret; } +int mgmt_write_scan_failed(u16 index, u8 scan, u8 status) +{ + if (scan & SCAN_PAGE) + mgmt_pending_foreach(MGMT_OP_SET_CONNECTABLE, index, + cmd_status_rsp, &status); + + if (scan & SCAN_INQUIRY) + mgmt_pending_foreach(MGMT_OP_SET_DISCOVERABLE, index, + cmd_status_rsp, &status); + + return 0; +} + int mgmt_new_key(u16 index, struct link_key *key, u8 persistent) { struct mgmt_ev_new_key ev; |