aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-03-25 23:12:50 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:23:54 -0400
commitaca3192cc60d2bf193c2252e45563c32e3117289 (patch)
treed73dc39ae9c9f499a026c56517604af21d63bfd9 /net/bluetooth/hci_conn.c
parentacde4855bb8f5fba8bb065d35ff6ac8a94b3dfa8 (diff)
[NET] BLUETOOTH: Use cpu_to_le{16,32}() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f3403fdb59f8..63980bd6b5f2 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -72,11 +72,11 @@ void hci_acl_connect(struct hci_conn *conn)
72 inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) { 72 inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
73 cp.pscan_rep_mode = ie->data.pscan_rep_mode; 73 cp.pscan_rep_mode = ie->data.pscan_rep_mode;
74 cp.pscan_mode = ie->data.pscan_mode; 74 cp.pscan_mode = ie->data.pscan_mode;
75 cp.clock_offset = ie->data.clock_offset | __cpu_to_le16(0x8000); 75 cp.clock_offset = ie->data.clock_offset | cpu_to_le16(0x8000);
76 memcpy(conn->dev_class, ie->data.dev_class, 3); 76 memcpy(conn->dev_class, ie->data.dev_class, 3);
77 } 77 }
78 78
79 cp.pkt_type = __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK); 79 cp.pkt_type = cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK);
80 if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER)) 80 if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER))
81 cp.role_switch = 0x01; 81 cp.role_switch = 0x01;
82 else 82 else
@@ -107,7 +107,7 @@ void hci_acl_disconn(struct hci_conn *conn, __u8 reason)
107 107
108 conn->state = BT_DISCONN; 108 conn->state = BT_DISCONN;
109 109
110 cp.handle = __cpu_to_le16(conn->handle); 110 cp.handle = cpu_to_le16(conn->handle);
111 cp.reason = reason; 111 cp.reason = reason;
112 hci_send_cmd(conn->hdev, OGF_LINK_CTL, 112 hci_send_cmd(conn->hdev, OGF_LINK_CTL,
113 OCF_DISCONNECT, sizeof(cp), &cp); 113 OCF_DISCONNECT, sizeof(cp), &cp);
@@ -123,8 +123,8 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle)
123 conn->state = BT_CONNECT; 123 conn->state = BT_CONNECT;
124 conn->out = 1; 124 conn->out = 1;
125 125
126 cp.pkt_type = __cpu_to_le16(hdev->pkt_type & SCO_PTYPE_MASK); 126 cp.pkt_type = cpu_to_le16(hdev->pkt_type & SCO_PTYPE_MASK);
127 cp.handle = __cpu_to_le16(handle); 127 cp.handle = cpu_to_le16(handle);
128 128
129 hci_send_cmd(hdev, OGF_LINK_CTL, OCF_ADD_SCO, sizeof(cp), &cp); 129 hci_send_cmd(hdev, OGF_LINK_CTL, OCF_ADD_SCO, sizeof(cp), &cp);
130} 130}
@@ -348,7 +348,7 @@ int hci_conn_auth(struct hci_conn *conn)
348 348
349 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { 349 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
350 struct hci_cp_auth_requested cp; 350 struct hci_cp_auth_requested cp;
351 cp.handle = __cpu_to_le16(conn->handle); 351 cp.handle = cpu_to_le16(conn->handle);
352 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_AUTH_REQUESTED, sizeof(cp), &cp); 352 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_AUTH_REQUESTED, sizeof(cp), &cp);
353 } 353 }
354 return 0; 354 return 0;
@@ -368,7 +368,7 @@ int hci_conn_encrypt(struct hci_conn *conn)
368 368
369 if (hci_conn_auth(conn)) { 369 if (hci_conn_auth(conn)) {
370 struct hci_cp_set_conn_encrypt cp; 370 struct hci_cp_set_conn_encrypt cp;
371 cp.handle = __cpu_to_le16(conn->handle); 371 cp.handle = cpu_to_le16(conn->handle);
372 cp.encrypt = 1; 372 cp.encrypt = 1;
373 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp); 373 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp);
374 } 374 }
@@ -383,7 +383,7 @@ int hci_conn_change_link_key(struct hci_conn *conn)
383 383
384 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { 384 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
385 struct hci_cp_change_conn_link_key cp; 385 struct hci_cp_change_conn_link_key cp;
386 cp.handle = __cpu_to_le16(conn->handle); 386 cp.handle = cpu_to_le16(conn->handle);
387 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_CHANGE_CONN_LINK_KEY, sizeof(cp), &cp); 387 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_CHANGE_CONN_LINK_KEY, sizeof(cp), &cp);
388 } 388 }
389 return 0; 389 return 0;
@@ -423,7 +423,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn)
423 423
424 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { 424 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
425 struct hci_cp_exit_sniff_mode cp; 425 struct hci_cp_exit_sniff_mode cp;
426 cp.handle = __cpu_to_le16(conn->handle); 426 cp.handle = cpu_to_le16(conn->handle);
427 hci_send_cmd(hdev, OGF_LINK_POLICY, 427 hci_send_cmd(hdev, OGF_LINK_POLICY,
428 OCF_EXIT_SNIFF_MODE, sizeof(cp), &cp); 428 OCF_EXIT_SNIFF_MODE, sizeof(cp), &cp);
429 } 429 }
@@ -452,21 +452,21 @@ void hci_conn_enter_sniff_mode(struct hci_conn *conn)
452 452
453 if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { 453 if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) {
454 struct hci_cp_sniff_subrate cp; 454 struct hci_cp_sniff_subrate cp;
455 cp.handle = __cpu_to_le16(conn->handle); 455 cp.handle = cpu_to_le16(conn->handle);
456 cp.max_latency = __constant_cpu_to_le16(0); 456 cp.max_latency = cpu_to_le16(0);
457 cp.min_remote_timeout = __constant_cpu_to_le16(0); 457 cp.min_remote_timeout = cpu_to_le16(0);
458 cp.min_local_timeout = __constant_cpu_to_le16(0); 458 cp.min_local_timeout = cpu_to_le16(0);
459 hci_send_cmd(hdev, OGF_LINK_POLICY, 459 hci_send_cmd(hdev, OGF_LINK_POLICY,
460 OCF_SNIFF_SUBRATE, sizeof(cp), &cp); 460 OCF_SNIFF_SUBRATE, sizeof(cp), &cp);
461 } 461 }
462 462
463 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { 463 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
464 struct hci_cp_sniff_mode cp; 464 struct hci_cp_sniff_mode cp;
465 cp.handle = __cpu_to_le16(conn->handle); 465 cp.handle = cpu_to_le16(conn->handle);
466 cp.max_interval = __cpu_to_le16(hdev->sniff_max_interval); 466 cp.max_interval = cpu_to_le16(hdev->sniff_max_interval);
467 cp.min_interval = __cpu_to_le16(hdev->sniff_min_interval); 467 cp.min_interval = cpu_to_le16(hdev->sniff_min_interval);
468 cp.attempt = __constant_cpu_to_le16(4); 468 cp.attempt = cpu_to_le16(4);
469 cp.timeout = __constant_cpu_to_le16(1); 469 cp.timeout = cpu_to_le16(1);
470 hci_send_cmd(hdev, OGF_LINK_POLICY, 470 hci_send_cmd(hdev, OGF_LINK_POLICY,
471 OCF_SNIFF_MODE, sizeof(cp), &cp); 471 OCF_SNIFF_MODE, sizeof(cp), &cp);
472 } 472 }