Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279282
b: refs/heads/master
c: f7c6869
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Dec 18, 2011
1 parent a1d3429 commit 547e0d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 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: 69ab39ea5da03e632a51b31534da713aff8d1e3b
refs/heads/master: f7c6869cebe631582fdc2ac57459ee217ce9b015
7 changes: 2 additions & 5 deletions trunk/include/net/bluetooth/mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ struct mgmt_cp_set_discoverable {

#define MGMT_OP_SET_CONNECTABLE 0x0007

#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F

#define MGMT_OP_SET_PAIRABLE 0x0008

#define MGMT_OP_ADD_UUID 0x0009
Expand Down Expand Up @@ -255,11 +257,6 @@ struct mgmt_cp_unblock_device {
bdaddr_t bdaddr;
} __packed;

#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F
struct mgmt_cp_set_fast_connectable {
__u8 enable;
} __packed;

#define MGMT_OP_USER_PASSKEY_REPLY 0x0020
struct mgmt_cp_user_passkey_reply {
bdaddr_t bdaddr;
Expand Down
12 changes: 6 additions & 6 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ static int set_fast_connectable(struct sock *sk, u16 index,
unsigned char *data, u16 len)
{
struct hci_dev *hdev;
struct mgmt_cp_set_fast_connectable *cp = (void *) data;
struct mgmt_mode *cp = (void *) data;
struct hci_cp_write_page_scan_activity acp;
u8 type;
int err;
Expand All @@ -2070,7 +2070,7 @@ static int set_fast_connectable(struct sock *sk, u16 index,

hci_dev_lock(hdev);

if (cp->enable) {
if (cp->val) {
type = PAGE_SCAN_TYPE_INTERLACED;
acp.interval = 0x0024; /* 22.5 msec page scan interval */
} else {
Expand Down Expand Up @@ -2154,6 +2154,10 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
case MGMT_OP_SET_CONNECTABLE:
err = set_connectable(sk, index, buf + sizeof(*hdr), len);
break;
case MGMT_OP_SET_FAST_CONNECTABLE:
err = set_fast_connectable(sk, index, buf + sizeof(*hdr),
len);
break;
case MGMT_OP_SET_PAIRABLE:
err = set_pairable(sk, index, buf + sizeof(*hdr), len);
break;
Expand Down Expand Up @@ -2232,10 +2236,6 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
case MGMT_OP_UNBLOCK_DEVICE:
err = unblock_device(sk, index, buf + sizeof(*hdr), len);
break;
case MGMT_OP_SET_FAST_CONNECTABLE:
err = set_fast_connectable(sk, index, buf + sizeof(*hdr),
len);
break;
default:
BT_DBG("Unknown op %u", opcode);
err = cmd_status(sk, index, opcode,
Expand Down

0 comments on commit 547e0d0

Please sign in to comment.