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>
This commit is contained in:
Johan Hedberg
2011-11-07 22:16:03 +02:00
committed by Gustavo F. Padovan
parent 16ab91ab48
commit 2d7cee5836
3 changed files with 20 additions and 3 deletions

View File

@@ -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;