Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256402
b: refs/heads/master
c: 8c156c3
h: refs/heads/master
v: v3
  • Loading branch information
Andre Guedes authored and Gustavo F. Padovan committed Jul 7, 2011
1 parent 765ea02 commit 0488b56
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 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: 8aded7110a5625bc00aef05e94dd4b1a9cf3605f
refs/heads/master: 8c156c322f8a300afe59259bd554db166cf88203
88 changes: 44 additions & 44 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int read_controller_info(struct sock *sk, u16 index)

hci_del_off_timer(hdev);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

set_bit(HCI_MGMT, &hdev->flags);

Expand Down Expand Up @@ -208,7 +208,7 @@ static int read_controller_info(struct sock *sk, u16 index)

memcpy(rp.name, hdev->dev_name, sizeof(hdev->dev_name));

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return cmd_complete(sk, index, MGMT_OP_READ_INFO, &rp, sizeof(rp));
Expand Down Expand Up @@ -316,7 +316,7 @@ static int set_powered(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_POWERED, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

up = test_bit(HCI_UP, &hdev->flags);
if ((cp->val && up) || (!cp->val && !up)) {
Expand All @@ -343,7 +343,7 @@ static int set_powered(struct sock *sk, u16 index, unsigned char *data, u16 len)
err = 0;

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);
return err;
}
Expand All @@ -368,7 +368,7 @@ static int set_discoverable(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_SET_DISCOVERABLE, ENETDOWN);
Expand Down Expand Up @@ -403,7 +403,7 @@ static int set_discoverable(struct sock *sk, u16 index, unsigned char *data,
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -429,7 +429,7 @@ static int set_connectable(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_SET_CONNECTABLE, ENETDOWN);
Expand Down Expand Up @@ -463,7 +463,7 @@ static int set_connectable(struct sock *sk, u16 index, unsigned char *data,
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand Down Expand Up @@ -522,7 +522,7 @@ static int set_pairable(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_PAIRABLE, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (cp->val)
set_bit(HCI_PAIRABLE, &hdev->flags);
Expand All @@ -538,7 +538,7 @@ static int set_pairable(struct sock *sk, u16 index, unsigned char *data,
err = mgmt_event(MGMT_EV_PAIRABLE, index, &ev, sizeof(ev), sk);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand Down Expand Up @@ -739,7 +739,7 @@ static int add_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_ADD_UUID, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

uuid = kmalloc(sizeof(*uuid), GFP_ATOMIC);
if (!uuid) {
Expand All @@ -763,7 +763,7 @@ static int add_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len)
err = cmd_complete(sk, index, MGMT_OP_ADD_UUID, NULL, 0);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -788,7 +788,7 @@ static int remove_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_REMOVE_UUID, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) {
err = hci_uuids_clear(hdev);
Expand Down Expand Up @@ -823,7 +823,7 @@ static int remove_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len)
err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, NULL, 0);

unlock:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -847,7 +847,7 @@ static int set_dev_class(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

hdev->major_class = cp->major;
hdev->minor_class = cp->minor;
Expand All @@ -857,7 +857,7 @@ static int set_dev_class(struct sock *sk, u16 index, unsigned char *data,
if (err == 0)
err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, NULL, 0);

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -879,7 +879,7 @@ static int set_service_cache(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_SERVICE_CACHE, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

BT_DBG("hci%u enable %d", index, cp->enable);

Expand All @@ -897,7 +897,7 @@ static int set_service_cache(struct sock *sk, u16 index, unsigned char *data,
err = cmd_complete(sk, index, MGMT_OP_SET_SERVICE_CACHE, NULL,
0);

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand Down Expand Up @@ -931,7 +931,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len)
BT_DBG("hci%u debug_keys %u key_count %u", index, cp->debug_keys,
key_count);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

hci_link_keys_clear(hdev);

Expand All @@ -949,7 +949,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len)
key->pin_len);
}

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return 0;
Expand All @@ -971,7 +971,7 @@ static int remove_key(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_REMOVE_KEY, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

err = hci_remove_link_key(hdev, &cp->bdaddr);
if (err < 0) {
Expand All @@ -994,7 +994,7 @@ static int remove_key(struct sock *sk, u16 index, unsigned char *data, u16 len)
}

unlock:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1020,7 +1020,7 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_DISCONNECT, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_DISCONNECT, ENETDOWN);
Expand Down Expand Up @@ -1055,7 +1055,7 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len)
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1076,7 +1076,7 @@ static int get_connections(struct sock *sk, u16 index)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_GET_CONNECTIONS, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

count = 0;
list_for_each(p, &hdev->conn_hash.list) {
Expand All @@ -1103,7 +1103,7 @@ static int get_connections(struct sock *sk, u16 index)

unlock:
kfree(rp);
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);
return err;
}
Expand Down Expand Up @@ -1149,7 +1149,7 @@ static int pin_code_reply(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_PIN_CODE_REPLY, ENETDOWN);
Expand Down Expand Up @@ -1190,7 +1190,7 @@ static int pin_code_reply(struct sock *sk, u16 index, unsigned char *data,
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1216,7 +1216,7 @@ static int pin_code_neg_reply(struct sock *sk, u16 index, unsigned char *data,
return cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY,
ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_PIN_CODE_NEG_REPLY,
Expand All @@ -1227,7 +1227,7 @@ static int pin_code_neg_reply(struct sock *sk, u16 index, unsigned char *data,
err = send_pin_code_neg_reply(sk, index, hdev, cp);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1250,14 +1250,14 @@ static int set_io_capability(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_IO_CAPABILITY, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

hdev->io_capability = cp->io_capability;

BT_DBG("%s IO capability set to 0x%02x", hdev->name,
hdev->io_capability);

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return cmd_complete(sk, index, MGMT_OP_SET_IO_CAPABILITY, NULL, 0);
Expand Down Expand Up @@ -1343,7 +1343,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
if (!hdev)
return cmd_status(sk, index, MGMT_OP_PAIR_DEVICE, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (cp->io_cap == 0x03) {
sec_level = BT_SECURITY_MEDIUM;
Expand Down Expand Up @@ -1385,7 +1385,7 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
err = 0;

unlock:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand Down Expand Up @@ -1417,7 +1417,7 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, mgmt_op, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, mgmt_op, ENETDOWN);
Expand All @@ -1435,7 +1435,7 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data,
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1459,7 +1459,7 @@ static int set_local_name(struct sock *sk, u16 index, unsigned char *data,
if (!hdev)
return cmd_status(sk, index, MGMT_OP_SET_LOCAL_NAME, ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

cmd = mgmt_pending_add(sk, MGMT_OP_SET_LOCAL_NAME, index, data, len);
if (!cmd) {
Expand All @@ -1474,7 +1474,7 @@ static int set_local_name(struct sock *sk, u16 index, unsigned char *data,
mgmt_pending_remove(cmd);

failed:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1493,7 +1493,7 @@ static int read_local_oob_data(struct sock *sk, u16 index)
return cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA,
ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

if (!test_bit(HCI_UP, &hdev->flags)) {
err = cmd_status(sk, index, MGMT_OP_READ_LOCAL_OOB_DATA,
Expand Down Expand Up @@ -1523,7 +1523,7 @@ static int read_local_oob_data(struct sock *sk, u16 index)
mgmt_pending_remove(cmd);

unlock:
hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1547,7 +1547,7 @@ static int add_remote_oob_data(struct sock *sk, u16 index, unsigned char *data,
return cmd_status(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA,
ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

err = hci_add_remote_oob_data(hdev, &cp->bdaddr, cp->hash,
cp->randomizer);
Expand All @@ -1557,7 +1557,7 @@ static int add_remote_oob_data(struct sock *sk, u16 index, unsigned char *data,
err = cmd_complete(sk, index, MGMT_OP_ADD_REMOTE_OOB_DATA, NULL,
0);

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand All @@ -1581,7 +1581,7 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
return cmd_status(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA,
ENODEV);

hci_dev_lock(hdev);
hci_dev_lock_bh(hdev);

err = hci_remove_remote_oob_data(hdev, &cp->bdaddr);
if (err < 0)
Expand All @@ -1591,7 +1591,7 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
err = cmd_complete(sk, index, MGMT_OP_REMOVE_REMOTE_OOB_DATA,
NULL, 0);

hci_dev_unlock(hdev);
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);

return err;
Expand Down

0 comments on commit 0488b56

Please sign in to comment.