Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277712
b: refs/heads/master
c: 164a6e7
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Nov 7, 2011
1 parent 34d3159 commit 75402f6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 262038fcb2a50e9b5553243452918fda08cdf83d
refs/heads/master: 164a6e78990f6201dc3105ff88335ca91392a427
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer,
int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
u8 *eir);
int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name);
int mgmt_inquiry_failed(u16 index, u8 status);
int mgmt_discovering(u16 index, u8 discovering);
int mgmt_device_blocked(u16 index, bdaddr_t *bdaddr);
int mgmt_device_unblocked(u16 index, bdaddr_t *bdaddr);
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
if (status) {
hci_req_complete(hdev, HCI_OP_INQUIRY, status);
hci_conn_check_pending(hdev);
if (test_bit(HCI_MGMT, &hdev->flags))
mgmt_inquiry_failed(hdev->id, status);
return;
}

Expand Down
27 changes: 27 additions & 0 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2339,8 +2339,35 @@ int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name)
return mgmt_event(MGMT_EV_REMOTE_NAME, index, &ev, sizeof(ev), NULL);
}

int mgmt_inquiry_failed(u16 index, u8 status)
{
struct pending_cmd *cmd;
int err;

cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, index);
if (!cmd)
return -ENOENT;

err = cmd_status(cmd->sk, index, cmd->opcode, status);
mgmt_pending_remove(cmd);

return err;
}

int mgmt_discovering(u16 index, u8 discovering)
{
struct pending_cmd *cmd;

if (discovering)
cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, index);
else
cmd = mgmt_pending_find(MGMT_OP_STOP_DISCOVERY, index);

if (cmd != NULL) {
cmd_complete(cmd->sk, index, cmd->opcode, NULL, 0);
mgmt_pending_remove(cmd);
}

return mgmt_event(MGMT_EV_DISCOVERING, index, &discovering,
sizeof(discovering), NULL);
}
Expand Down

0 comments on commit 75402f6

Please sign in to comment.