Commit f7c6869c authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo F. Padovan

Bluetooth: Move mgmt_set_fast_connectable to the right location

Fast connectable is logically after the connectable property so that's
where it should show up in the code as well (it's also after connectable
in the settings bitfield).
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 69ab39ea
...@@ -100,6 +100,8 @@ struct mgmt_cp_set_discoverable { ...@@ -100,6 +100,8 @@ struct mgmt_cp_set_discoverable {
#define MGMT_OP_SET_CONNECTABLE 0x0007 #define MGMT_OP_SET_CONNECTABLE 0x0007
#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F
#define MGMT_OP_SET_PAIRABLE 0x0008 #define MGMT_OP_SET_PAIRABLE 0x0008
#define MGMT_OP_ADD_UUID 0x0009 #define MGMT_OP_ADD_UUID 0x0009
...@@ -255,11 +257,6 @@ struct mgmt_cp_unblock_device { ...@@ -255,11 +257,6 @@ struct mgmt_cp_unblock_device {
bdaddr_t bdaddr; bdaddr_t bdaddr;
} __packed; } __packed;
#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F
struct mgmt_cp_set_fast_connectable {
__u8 enable;
} __packed;
#define MGMT_OP_USER_PASSKEY_REPLY 0x0020 #define MGMT_OP_USER_PASSKEY_REPLY 0x0020
struct mgmt_cp_user_passkey_reply { struct mgmt_cp_user_passkey_reply {
bdaddr_t bdaddr; bdaddr_t bdaddr;
......
...@@ -2052,7 +2052,7 @@ static int set_fast_connectable(struct sock *sk, u16 index, ...@@ -2052,7 +2052,7 @@ static int set_fast_connectable(struct sock *sk, u16 index,
unsigned char *data, u16 len) unsigned char *data, u16 len)
{ {
struct hci_dev *hdev; 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; struct hci_cp_write_page_scan_activity acp;
u8 type; u8 type;
int err; int err;
...@@ -2070,7 +2070,7 @@ static int set_fast_connectable(struct sock *sk, u16 index, ...@@ -2070,7 +2070,7 @@ static int set_fast_connectable(struct sock *sk, u16 index,
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (cp->enable) { if (cp->val) {
type = PAGE_SCAN_TYPE_INTERLACED; type = PAGE_SCAN_TYPE_INTERLACED;
acp.interval = 0x0024; /* 22.5 msec page scan interval */ acp.interval = 0x0024; /* 22.5 msec page scan interval */
} else { } else {
...@@ -2154,6 +2154,10 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) ...@@ -2154,6 +2154,10 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
case MGMT_OP_SET_CONNECTABLE: case MGMT_OP_SET_CONNECTABLE:
err = set_connectable(sk, index, buf + sizeof(*hdr), len); err = set_connectable(sk, index, buf + sizeof(*hdr), len);
break; break;
case MGMT_OP_SET_FAST_CONNECTABLE:
err = set_fast_connectable(sk, index, buf + sizeof(*hdr),
len);
break;
case MGMT_OP_SET_PAIRABLE: case MGMT_OP_SET_PAIRABLE:
err = set_pairable(sk, index, buf + sizeof(*hdr), len); err = set_pairable(sk, index, buf + sizeof(*hdr), len);
break; break;
...@@ -2232,10 +2236,6 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) ...@@ -2232,10 +2236,6 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
case MGMT_OP_UNBLOCK_DEVICE: case MGMT_OP_UNBLOCK_DEVICE:
err = unblock_device(sk, index, buf + sizeof(*hdr), len); err = unblock_device(sk, index, buf + sizeof(*hdr), len);
break; break;
case MGMT_OP_SET_FAST_CONNECTABLE:
err = set_fast_connectable(sk, index, buf + sizeof(*hdr),
len);
break;
default: default:
BT_DBG("Unknown op %u", opcode); BT_DBG("Unknown op %u", opcode);
err = cmd_status(sk, index, opcode, err = cmd_status(sk, index, opcode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment