diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 23:36:20 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:01 -0400 |
commit | 8ce8e2b56f36c737888d040016f103d91ecbfbad (patch) | |
tree | 8174acf15e2f8e24c352f7d5736f54d4541ce8d9 /net/bluetooth/mgmt.c | |
parent | f8f5701bdaf9134b1f90e5044a82c66324d2073f (diff) |
Bluetooth: Fix coding style in mgmt.c
Follow the coding style of the net subsystem.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 25d22077607..6a7e926c418 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -871,7 +871,7 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
871 | } | 871 | } |
872 | 872 | ||
873 | if (mgmt_pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || | 873 | if (mgmt_pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || |
874 | mgmt_pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { | 874 | mgmt_pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { |
875 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, | 875 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, |
876 | MGMT_STATUS_BUSY); | 876 | MGMT_STATUS_BUSY); |
877 | goto failed; | 877 | goto failed; |
@@ -978,7 +978,7 @@ static int set_connectable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
978 | } | 978 | } |
979 | 979 | ||
980 | if (mgmt_pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || | 980 | if (mgmt_pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || |
981 | mgmt_pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { | 981 | mgmt_pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { |
982 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_CONNECTABLE, | 982 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_CONNECTABLE, |
983 | MGMT_STATUS_BUSY); | 983 | MGMT_STATUS_BUSY); |
984 | goto failed; | 984 | goto failed; |
@@ -1001,7 +1001,7 @@ static int set_connectable(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1001 | scan = 0; | 1001 | scan = 0; |
1002 | 1002 | ||
1003 | if (test_bit(HCI_ISCAN, &hdev->flags) && | 1003 | if (test_bit(HCI_ISCAN, &hdev->flags) && |
1004 | hdev->discov_timeout > 0) | 1004 | hdev->discov_timeout > 0) |
1005 | cancel_delayed_work(&hdev->discov_off); | 1005 | cancel_delayed_work(&hdev->discov_off); |
1006 | } | 1006 | } |
1007 | 1007 | ||
@@ -1056,7 +1056,7 @@ static int set_link_security(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1056 | bool changed = false; | 1056 | bool changed = false; |
1057 | 1057 | ||
1058 | if (!!cp->val != test_bit(HCI_LINK_SECURITY, | 1058 | if (!!cp->val != test_bit(HCI_LINK_SECURITY, |
1059 | &hdev->dev_flags)) { | 1059 | &hdev->dev_flags)) { |
1060 | change_bit(HCI_LINK_SECURITY, &hdev->dev_flags); | 1060 | change_bit(HCI_LINK_SECURITY, &hdev->dev_flags); |
1061 | changed = true; | 1061 | changed = true; |
1062 | } | 1062 | } |
@@ -1317,7 +1317,7 @@ static bool enable_service_cache(struct hci_dev *hdev) | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data, | 1319 | static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data, |
1320 | u16 len) | 1320 | u16 len) |
1321 | { | 1321 | { |
1322 | struct mgmt_cp_remove_uuid *cp = data; | 1322 | struct mgmt_cp_remove_uuid *cp = data; |
1323 | struct pending_cmd *cmd; | 1323 | struct pending_cmd *cmd; |
@@ -1442,7 +1442,7 @@ unlock: | |||
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, | 1444 | static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, |
1445 | u16 len) | 1445 | u16 len) |
1446 | { | 1446 | { |
1447 | struct mgmt_cp_load_link_keys *cp = data; | 1447 | struct mgmt_cp_load_link_keys *cp = data; |
1448 | u16 key_count, expected_len; | 1448 | u16 key_count, expected_len; |
@@ -1454,13 +1454,13 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1454 | sizeof(struct mgmt_link_key_info); | 1454 | sizeof(struct mgmt_link_key_info); |
1455 | if (expected_len != len) { | 1455 | if (expected_len != len) { |
1456 | BT_ERR("load_link_keys: expected %u bytes, got %u bytes", | 1456 | BT_ERR("load_link_keys: expected %u bytes, got %u bytes", |
1457 | len, expected_len); | 1457 | len, expected_len); |
1458 | return cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, | 1458 | return cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, |
1459 | MGMT_STATUS_INVALID_PARAMS); | 1459 | MGMT_STATUS_INVALID_PARAMS); |
1460 | } | 1460 | } |
1461 | 1461 | ||
1462 | BT_DBG("%s debug_keys %u key_count %u", hdev->name, cp->debug_keys, | 1462 | BT_DBG("%s debug_keys %u key_count %u", hdev->name, cp->debug_keys, |
1463 | key_count); | 1463 | key_count); |
1464 | 1464 | ||
1465 | hci_dev_lock(hdev); | 1465 | hci_dev_lock(hdev); |
1466 | 1466 | ||
@@ -1535,10 +1535,10 @@ static int unpair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1535 | if (cp->disconnect) { | 1535 | if (cp->disconnect) { |
1536 | if (cp->addr.type == BDADDR_BREDR) | 1536 | if (cp->addr.type == BDADDR_BREDR) |
1537 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, | 1537 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, |
1538 | &cp->addr.bdaddr); | 1538 | &cp->addr.bdaddr); |
1539 | else | 1539 | else |
1540 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, | 1540 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, |
1541 | &cp->addr.bdaddr); | 1541 | &cp->addr.bdaddr); |
1542 | } else { | 1542 | } else { |
1543 | conn = NULL; | 1543 | conn = NULL; |
1544 | } | 1544 | } |
@@ -1813,7 +1813,7 @@ static int set_io_capability(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1813 | hdev->io_capability = cp->io_capability; | 1813 | hdev->io_capability = cp->io_capability; |
1814 | 1814 | ||
1815 | BT_DBG("%s IO capability set to 0x%02x", hdev->name, | 1815 | BT_DBG("%s IO capability set to 0x%02x", hdev->name, |
1816 | hdev->io_capability); | 1816 | hdev->io_capability); |
1817 | 1817 | ||
1818 | hci_dev_unlock(hdev); | 1818 | hci_dev_unlock(hdev); |
1819 | 1819 | ||
@@ -1941,7 +1941,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1941 | cmd->user_data = conn; | 1941 | cmd->user_data = conn; |
1942 | 1942 | ||
1943 | if (conn->state == BT_CONNECTED && | 1943 | if (conn->state == BT_CONNECTED && |
1944 | hci_conn_security(conn, sec_level, auth_type)) | 1944 | hci_conn_security(conn, sec_level, auth_type)) |
1945 | pairing_complete(cmd, 0); | 1945 | pairing_complete(cmd, 0); |
1946 | 1946 | ||
1947 | err = 0; | 1947 | err = 0; |
@@ -2238,7 +2238,7 @@ unlock: | |||
2238 | } | 2238 | } |
2239 | 2239 | ||
2240 | static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | 2240 | static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev, |
2241 | void *data, u16 len) | 2241 | void *data, u16 len) |
2242 | { | 2242 | { |
2243 | struct mgmt_cp_remove_remote_oob_data *cp = data; | 2243 | struct mgmt_cp_remove_remote_oob_data *cp = data; |
2244 | u8 status; | 2244 | u8 status; |
@@ -2407,7 +2407,7 @@ static int stop_discovery(struct sock *sk, struct hci_dev *hdev, void *data, | |||
2407 | 2407 | ||
2408 | case DISCOVERY_RESOLVING: | 2408 | case DISCOVERY_RESOLVING: |
2409 | e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, | 2409 | e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, |
2410 | NAME_PENDING); | 2410 | NAME_PENDING); |
2411 | if (!e) { | 2411 | if (!e) { |
2412 | mgmt_pending_remove(cmd); | 2412 | mgmt_pending_remove(cmd); |
2413 | err = cmd_complete(sk, hdev->id, | 2413 | err = cmd_complete(sk, hdev->id, |
@@ -2629,7 +2629,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, | |||
2629 | sizeof(struct mgmt_ltk_info); | 2629 | sizeof(struct mgmt_ltk_info); |
2630 | if (expected_len != len) { | 2630 | if (expected_len != len) { |
2631 | BT_ERR("load_keys: expected %u bytes, got %u bytes", | 2631 | BT_ERR("load_keys: expected %u bytes, got %u bytes", |
2632 | len, expected_len); | 2632 | len, expected_len); |
2633 | return cmd_status(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, | 2633 | return cmd_status(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, |
2634 | EINVAL); | 2634 | EINVAL); |
2635 | } | 2635 | } |
@@ -2754,7 +2754,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
2754 | } | 2754 | } |
2755 | 2755 | ||
2756 | if (opcode >= ARRAY_SIZE(mgmt_handlers) || | 2756 | if (opcode >= ARRAY_SIZE(mgmt_handlers) || |
2757 | mgmt_handlers[opcode].func == NULL) { | 2757 | mgmt_handlers[opcode].func == NULL) { |
2758 | BT_DBG("Unknown op %u", opcode); | 2758 | BT_DBG("Unknown op %u", opcode); |
2759 | err = cmd_status(sk, index, opcode, | 2759 | err = cmd_status(sk, index, opcode, |
2760 | MGMT_STATUS_UNKNOWN_COMMAND); | 2760 | MGMT_STATUS_UNKNOWN_COMMAND); |
@@ -2762,7 +2762,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
2762 | } | 2762 | } |
2763 | 2763 | ||
2764 | if ((hdev && opcode < MGMT_OP_READ_INFO) || | 2764 | if ((hdev && opcode < MGMT_OP_READ_INFO) || |
2765 | (!hdev && opcode >= MGMT_OP_READ_INFO)) { | 2765 | (!hdev && opcode >= MGMT_OP_READ_INFO)) { |
2766 | err = cmd_status(sk, index, opcode, | 2766 | err = cmd_status(sk, index, opcode, |
2767 | MGMT_STATUS_INVALID_INDEX); | 2767 | MGMT_STATUS_INVALID_INDEX); |
2768 | goto done; | 2768 | goto done; |
@@ -2771,7 +2771,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
2771 | handler = &mgmt_handlers[opcode]; | 2771 | handler = &mgmt_handlers[opcode]; |
2772 | 2772 | ||
2773 | if ((handler->var_len && len < handler->data_len) || | 2773 | if ((handler->var_len && len < handler->data_len) || |
2774 | (!handler->var_len && len != handler->data_len)) { | 2774 | (!handler->var_len && len != handler->data_len)) { |
2775 | err = cmd_status(sk, index, opcode, | 2775 | err = cmd_status(sk, index, opcode, |
2776 | MGMT_STATUS_INVALID_PARAMS); | 2776 | MGMT_STATUS_INVALID_PARAMS); |
2777 | goto done; | 2777 | goto done; |
@@ -3090,7 +3090,7 @@ int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3090 | mgmt_pending_remove(cmd); | 3090 | mgmt_pending_remove(cmd); |
3091 | 3091 | ||
3092 | mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp, | 3092 | mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp, |
3093 | hdev); | 3093 | hdev); |
3094 | return err; | 3094 | return err; |
3095 | } | 3095 | } |
3096 | 3096 | ||
@@ -3180,7 +3180,7 @@ int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3180 | } | 3180 | } |
3181 | 3181 | ||
3182 | int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | 3182 | int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, |
3183 | u8 link_type, u8 addr_type) | 3183 | u8 link_type, u8 addr_type) |
3184 | { | 3184 | { |
3185 | struct mgmt_ev_user_passkey_request ev; | 3185 | struct mgmt_ev_user_passkey_request ev; |
3186 | 3186 | ||
@@ -3194,8 +3194,8 @@ int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3194 | } | 3194 | } |
3195 | 3195 | ||
3196 | static int user_pairing_resp_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 3196 | static int user_pairing_resp_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
3197 | u8 link_type, u8 addr_type, u8 status, | 3197 | u8 link_type, u8 addr_type, u8 status, |
3198 | u8 opcode) | 3198 | u8 opcode) |
3199 | { | 3199 | { |
3200 | struct pending_cmd *cmd; | 3200 | struct pending_cmd *cmd; |
3201 | struct mgmt_rp_user_confirm_reply rp; | 3201 | struct mgmt_rp_user_confirm_reply rp; |