Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352239
b: refs/heads/master
c: 13ecd8b
h: refs/heads/master
i:
  352237: eb31da7
  352235: 264864d
  352231: 39fcb16
  352223: 4a360b6
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jan 10, 2013
1 parent 754d354 commit 3a68e96
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 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: ee98f4738050bb93823ce9ba849f5d78f5b8c1a1
refs/heads/master: 13ecd8b6628c14c9a27832ce7c48315385272208
46 changes: 18 additions & 28 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,13 +1133,11 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

BT_DBG("request for %s", hdev->name);

hci_dev_lock(hdev);
if (!lmp_ssp_capable(hdev))
return cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
MGMT_STATUS_NOT_SUPPORTED);

if (!lmp_ssp_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
MGMT_STATUS_NOT_SUPPORTED);
goto failed;
}
hci_dev_lock(hdev);

val = !!cp->val;

Expand Down Expand Up @@ -1217,13 +1215,11 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

BT_DBG("request for %s", hdev->name);

hci_dev_lock(hdev);
if (!lmp_le_capable(hdev))
return cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
MGMT_STATUS_NOT_SUPPORTED);

if (!lmp_le_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
MGMT_STATUS_NOT_SUPPORTED);
goto unlock;
}
hci_dev_lock(hdev);

val = !!cp->val;
enabled = lmp_host_le_capable(hdev);
Expand Down Expand Up @@ -1422,25 +1418,19 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,

BT_DBG("request for %s", hdev->name);

hci_dev_lock(hdev);
if (!lmp_bredr_capable(hdev))
return cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_NOT_SUPPORTED);

if (!lmp_bredr_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_NOT_SUPPORTED);
goto unlock;
}
if (test_bit(HCI_PENDING_CLASS, &hdev->dev_flags))
return cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_BUSY);

if (test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_BUSY);
goto unlock;
}
if ((cp->minor & 0x03) != 0 || (cp->major & 0xe0) != 0)
return cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_INVALID_PARAMS);

if ((cp->minor & 0x03) != 0 || (cp->major & 0xe0) != 0) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS,
MGMT_STATUS_INVALID_PARAMS);
goto unlock;
}
hci_dev_lock(hdev);

hdev->major_class = cp->major;
hdev->minor_class = cp->minor;
Expand Down

0 comments on commit 3a68e96

Please sign in to comment.