Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278572
b: refs/heads/master
c: 450dfda
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Nov 16, 2011
1 parent 1649a52 commit b5b549d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e5f875a8f4fa78edf5762d6d0a9843e1d9ae85e
refs/heads/master: 450dfdafbcfbf19e39481d0e4737a832b991333a
3 changes: 3 additions & 0 deletions trunk/include/net/bluetooth/mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ struct mgmt_cp_remove_remote_oob_data {
} __packed;

#define MGMT_OP_START_DISCOVERY 0x001B
struct mgmt_cp_start_discovery {
__u8 type;
} __packed;

#define MGMT_OP_STOP_DISCOVERY 0x001C

Expand Down
10 changes: 8 additions & 2 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,14 +1779,20 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
return err;
}

static int start_discovery(struct sock *sk, u16 index)
static int start_discovery(struct sock *sk, u16 index,
unsigned char *data, u16 len)
{
struct mgmt_cp_start_discovery *cp = (void *) data;
struct pending_cmd *cmd;
struct hci_dev *hdev;
int err;

BT_DBG("hci%u", index);

if (len != sizeof(*cp))
return cmd_status(sk, index, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_INVALID_PARAMS);

hdev = hci_dev_get(index);
if (!hdev)
return cmd_status(sk, index, MGMT_OP_START_DISCOVERY,
Expand Down Expand Up @@ -2083,7 +2089,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
len);
break;
case MGMT_OP_START_DISCOVERY:
err = start_discovery(sk, index);
err = start_discovery(sk, index, buf + sizeof(*hdr), len);
break;
case MGMT_OP_STOP_DISCOVERY:
err = stop_discovery(sk, index);
Expand Down

0 comments on commit b5b549d

Please sign in to comment.