aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-05-16 23:36:25 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-04 23:34:01 -0400
commit5974e4c469658696e6e0ce8951a59a61b122415a (patch)
treef72996a8af49fc2f86be70bb4927be8f63364f68 /net/bluetooth/hci_conn.c
parent807deac275cfd5b1d1d634d6aff2f9f77a843c73 (diff)
Bluetooth: Fix coding style in hci_conn.c
Follow net subsystem rules. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 3f18a6ed9731..971601e0ad4a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -185,7 +185,7 @@ void hci_setup_sync(struct hci_conn *conn, __u16 handle)
185} 185}
186 186
187void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 187void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
188 u16 latency, u16 to_multiplier) 188 u16 latency, u16 to_multiplier)
189{ 189{
190 struct hci_cp_le_conn_update cp; 190 struct hci_cp_le_conn_update cp;
191 struct hci_dev *hdev = conn->hdev; 191 struct hci_dev *hdev = conn->hdev;
@@ -205,7 +205,7 @@ void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
205EXPORT_SYMBOL(hci_le_conn_update); 205EXPORT_SYMBOL(hci_le_conn_update);
206 206
207void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], 207void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
208 __u8 ltk[16]) 208 __u8 ltk[16])
209{ 209{
210 struct hci_dev *hdev = conn->hdev; 210 struct hci_dev *hdev = conn->hdev;
211 struct hci_cp_le_start_enc cp; 211 struct hci_cp_le_start_enc cp;
@@ -247,7 +247,7 @@ void hci_sco_setup(struct hci_conn *conn, __u8 status)
247static void hci_conn_timeout(struct work_struct *work) 247static void hci_conn_timeout(struct work_struct *work)
248{ 248{
249 struct hci_conn *conn = container_of(work, struct hci_conn, 249 struct hci_conn *conn = container_of(work, struct hci_conn,
250 disc_work.work); 250 disc_work.work);
251 __u8 reason; 251 __u8 reason;
252 252
253 BT_DBG("conn %p state %s", conn, state_to_string(conn->state)); 253 BT_DBG("conn %p state %s", conn, state_to_string(conn->state));
@@ -327,7 +327,7 @@ static void hci_conn_auto_accept(unsigned long arg)
327 struct hci_dev *hdev = conn->hdev; 327 struct hci_dev *hdev = conn->hdev;
328 328
329 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY, sizeof(conn->dst), 329 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY, sizeof(conn->dst),
330 &conn->dst); 330 &conn->dst);
331} 331}
332 332
333struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) 333struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
@@ -376,7 +376,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
376 INIT_DELAYED_WORK(&conn->disc_work, hci_conn_timeout); 376 INIT_DELAYED_WORK(&conn->disc_work, hci_conn_timeout);
377 setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn); 377 setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn);
378 setup_timer(&conn->auto_accept_timer, hci_conn_auto_accept, 378 setup_timer(&conn->auto_accept_timer, hci_conn_auto_accept,
379 (unsigned long) conn); 379 (unsigned long) conn);
380 380
381 atomic_set(&conn->refcnt, 0); 381 atomic_set(&conn->refcnt, 0);
382 382
@@ -545,7 +545,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
545 hci_conn_hold(sco); 545 hci_conn_hold(sco);
546 546
547 if (acl->state == BT_CONNECTED && 547 if (acl->state == BT_CONNECTED &&
548 (sco->state == BT_OPEN || sco->state == BT_CLOSED)) { 548 (sco->state == BT_OPEN || sco->state == BT_CLOSED)) {
549 set_bit(HCI_CONN_POWER_SAVE, &acl->flags); 549 set_bit(HCI_CONN_POWER_SAVE, &acl->flags);
550 hci_conn_enter_active_mode(acl, BT_POWER_FORCE_ACTIVE_ON); 550 hci_conn_enter_active_mode(acl, BT_POWER_FORCE_ACTIVE_ON);
551 551
@@ -600,7 +600,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
600 600
601 cp.handle = cpu_to_le16(conn->handle); 601 cp.handle = cpu_to_le16(conn->handle);
602 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, 602 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
603 sizeof(cp), &cp); 603 sizeof(cp), &cp);
604 if (conn->key_type != 0xff) 604 if (conn->key_type != 0xff)
605 set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); 605 set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
606 } 606 }
@@ -618,7 +618,7 @@ static void hci_conn_encrypt(struct hci_conn *conn)
618 cp.handle = cpu_to_le16(conn->handle); 618 cp.handle = cpu_to_le16(conn->handle);
619 cp.encrypt = 0x01; 619 cp.encrypt = 0x01;
620 hci_send_cmd(conn->hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), 620 hci_send_cmd(conn->hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp),
621 &cp); 621 &cp);
622 } 622 }
623} 623}
624 624
@@ -648,8 +648,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
648 /* An unauthenticated combination key has sufficient security for 648 /* An unauthenticated combination key has sufficient security for
649 security level 1 and 2. */ 649 security level 1 and 2. */
650 if (conn->key_type == HCI_LK_UNAUTH_COMBINATION && 650 if (conn->key_type == HCI_LK_UNAUTH_COMBINATION &&
651 (sec_level == BT_SECURITY_MEDIUM || 651 (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW))
652 sec_level == BT_SECURITY_LOW))
653 goto encrypt; 652 goto encrypt;
654 653
655 /* A combination key has always sufficient security for the security 654 /* A combination key has always sufficient security for the security
@@ -657,8 +656,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
657 is generated using maximum PIN code length (16). 656 is generated using maximum PIN code length (16).
658 For pre 2.1 units. */ 657 For pre 2.1 units. */
659 if (conn->key_type == HCI_LK_COMBINATION && 658 if (conn->key_type == HCI_LK_COMBINATION &&
660 (sec_level != BT_SECURITY_HIGH || 659 (sec_level != BT_SECURITY_HIGH || conn->pin_length == 16))
661 conn->pin_length == 16))
662 goto encrypt; 660 goto encrypt;
663 661
664auth: 662auth:
@@ -701,7 +699,7 @@ int hci_conn_change_link_key(struct hci_conn *conn)
701 struct hci_cp_change_conn_link_key cp; 699 struct hci_cp_change_conn_link_key cp;
702 cp.handle = cpu_to_le16(conn->handle); 700 cp.handle = cpu_to_le16(conn->handle);
703 hci_send_cmd(conn->hdev, HCI_OP_CHANGE_CONN_LINK_KEY, 701 hci_send_cmd(conn->hdev, HCI_OP_CHANGE_CONN_LINK_KEY,
704 sizeof(cp), &cp); 702 sizeof(cp), &cp);
705 } 703 }
706 704
707 return 0; 705 return 0;
@@ -752,7 +750,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
752timer: 750timer:
753 if (hdev->idle_timeout > 0) 751 if (hdev->idle_timeout > 0)
754 mod_timer(&conn->idle_timer, 752 mod_timer(&conn->idle_timer,
755 jiffies + msecs_to_jiffies(hdev->idle_timeout)); 753 jiffies + msecs_to_jiffies(hdev->idle_timeout));
756} 754}
757 755
758/* Drop all connection on the device */ 756/* Drop all connection on the device */