diff options
-rw-r--r-- | net/bluetooth/a2mp.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 26 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 6 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 16 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 90 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 6 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 26 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 4 | ||||
-rw-r--r-- | net/bluetooth/sco.c | 10 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 2 |
11 files changed, 96 insertions, 96 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index d6bb096ba0f1..9514cc9e850c 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -162,7 +162,7 @@ static int a2mp_discover_req(struct amp_mgr *mgr, struct sk_buff *skb, | |||
162 | return -ENOMEM; | 162 | return -ENOMEM; |
163 | } | 163 | } |
164 | 164 | ||
165 | rsp->mtu = __constant_cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU); | 165 | rsp->mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU); |
166 | rsp->ext_feat = 0; | 166 | rsp->ext_feat = 0; |
167 | 167 | ||
168 | __a2mp_add_cl(mgr, rsp->cl); | 168 | __a2mp_add_cl(mgr, rsp->cl); |
@@ -649,7 +649,7 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) | |||
649 | if (err) { | 649 | if (err) { |
650 | struct a2mp_cmd_rej rej; | 650 | struct a2mp_cmd_rej rej; |
651 | 651 | ||
652 | rej.reason = __constant_cpu_to_le16(0); | 652 | rej.reason = cpu_to_le16(0); |
653 | hdr = (void *) skb->data; | 653 | hdr = (void *) skb->data; |
654 | 654 | ||
655 | BT_DBG("Send A2MP Rej: cmd 0x%2.2x err %d", hdr->code, err); | 655 | BT_DBG("Send A2MP Rej: cmd 0x%2.2x err %d", hdr->code, err); |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 7c713c4675ba..b4809e473a19 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -82,7 +82,7 @@ static void hci_acl_create_connection(struct hci_conn *conn) | |||
82 | cp.pscan_rep_mode = ie->data.pscan_rep_mode; | 82 | cp.pscan_rep_mode = ie->data.pscan_rep_mode; |
83 | cp.pscan_mode = ie->data.pscan_mode; | 83 | cp.pscan_mode = ie->data.pscan_mode; |
84 | cp.clock_offset = ie->data.clock_offset | | 84 | cp.clock_offset = ie->data.clock_offset | |
85 | __constant_cpu_to_le16(0x8000); | 85 | cpu_to_le16(0x8000); |
86 | } | 86 | } |
87 | 87 | ||
88 | memcpy(conn->dev_class, ie->data.dev_class, 3); | 88 | memcpy(conn->dev_class, ie->data.dev_class, 3); |
@@ -182,8 +182,8 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) | |||
182 | 182 | ||
183 | cp.handle = cpu_to_le16(handle); | 183 | cp.handle = cpu_to_le16(handle); |
184 | 184 | ||
185 | cp.tx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 185 | cp.tx_bandwidth = cpu_to_le32(0x00001f40); |
186 | cp.rx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 186 | cp.rx_bandwidth = cpu_to_le32(0x00001f40); |
187 | cp.voice_setting = cpu_to_le16(conn->setting); | 187 | cp.voice_setting = cpu_to_le16(conn->setting); |
188 | 188 | ||
189 | switch (conn->setting & SCO_AIRMODE_MASK) { | 189 | switch (conn->setting & SCO_AIRMODE_MASK) { |
@@ -225,8 +225,8 @@ void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | |||
225 | cp.conn_interval_max = cpu_to_le16(max); | 225 | cp.conn_interval_max = cpu_to_le16(max); |
226 | cp.conn_latency = cpu_to_le16(latency); | 226 | cp.conn_latency = cpu_to_le16(latency); |
227 | cp.supervision_timeout = cpu_to_le16(to_multiplier); | 227 | cp.supervision_timeout = cpu_to_le16(to_multiplier); |
228 | cp.min_ce_len = __constant_cpu_to_le16(0x0000); | 228 | cp.min_ce_len = cpu_to_le16(0x0000); |
229 | cp.max_ce_len = __constant_cpu_to_le16(0x0000); | 229 | cp.max_ce_len = cpu_to_le16(0x0000); |
230 | 230 | ||
231 | hci_send_cmd(hdev, HCI_OP_LE_CONN_UPDATE, sizeof(cp), &cp); | 231 | hci_send_cmd(hdev, HCI_OP_LE_CONN_UPDATE, sizeof(cp), &cp); |
232 | } | 232 | } |
@@ -337,9 +337,9 @@ static void hci_conn_idle(struct work_struct *work) | |||
337 | if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { | 337 | if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { |
338 | struct hci_cp_sniff_subrate cp; | 338 | struct hci_cp_sniff_subrate cp; |
339 | cp.handle = cpu_to_le16(conn->handle); | 339 | cp.handle = cpu_to_le16(conn->handle); |
340 | cp.max_latency = __constant_cpu_to_le16(0); | 340 | cp.max_latency = cpu_to_le16(0); |
341 | cp.min_remote_timeout = __constant_cpu_to_le16(0); | 341 | cp.min_remote_timeout = cpu_to_le16(0); |
342 | cp.min_local_timeout = __constant_cpu_to_le16(0); | 342 | cp.min_local_timeout = cpu_to_le16(0); |
343 | hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp); | 343 | hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp); |
344 | } | 344 | } |
345 | 345 | ||
@@ -348,8 +348,8 @@ static void hci_conn_idle(struct work_struct *work) | |||
348 | cp.handle = cpu_to_le16(conn->handle); | 348 | cp.handle = cpu_to_le16(conn->handle); |
349 | cp.max_interval = cpu_to_le16(hdev->sniff_max_interval); | 349 | cp.max_interval = cpu_to_le16(hdev->sniff_max_interval); |
350 | cp.min_interval = cpu_to_le16(hdev->sniff_min_interval); | 350 | cp.min_interval = cpu_to_le16(hdev->sniff_min_interval); |
351 | cp.attempt = __constant_cpu_to_le16(4); | 351 | cp.attempt = cpu_to_le16(4); |
352 | cp.timeout = __constant_cpu_to_le16(1); | 352 | cp.timeout = cpu_to_le16(1); |
353 | hci_send_cmd(hdev, HCI_OP_SNIFF_MODE, sizeof(cp), &cp); | 353 | hci_send_cmd(hdev, HCI_OP_SNIFF_MODE, sizeof(cp), &cp); |
354 | } | 354 | } |
355 | } | 355 | } |
@@ -596,9 +596,9 @@ static void hci_req_add_le_create_conn(struct hci_request *req, | |||
596 | cp.own_address_type = own_addr_type; | 596 | cp.own_address_type = own_addr_type; |
597 | cp.conn_interval_min = cpu_to_le16(conn->le_conn_min_interval); | 597 | cp.conn_interval_min = cpu_to_le16(conn->le_conn_min_interval); |
598 | cp.conn_interval_max = cpu_to_le16(conn->le_conn_max_interval); | 598 | cp.conn_interval_max = cpu_to_le16(conn->le_conn_max_interval); |
599 | cp.supervision_timeout = __constant_cpu_to_le16(0x002a); | 599 | cp.supervision_timeout = cpu_to_le16(0x002a); |
600 | cp.min_ce_len = __constant_cpu_to_le16(0x0000); | 600 | cp.min_ce_len = cpu_to_le16(0x0000); |
601 | cp.max_ce_len = __constant_cpu_to_le16(0x0000); | 601 | cp.max_ce_len = cpu_to_le16(0x0000); |
602 | 602 | ||
603 | hci_req_add(req, HCI_OP_LE_CREATE_CONN, sizeof(cp), &cp); | 603 | hci_req_add(req, HCI_OP_LE_CREATE_CONN, sizeof(cp), &cp); |
604 | 604 | ||
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a27d0b86ba1e..1c6ffaa8902f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1349,7 +1349,7 @@ static void bredr_setup(struct hci_request *req) | |||
1349 | hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type); | 1349 | hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type); |
1350 | 1350 | ||
1351 | /* Connection accept timeout ~20 secs */ | 1351 | /* Connection accept timeout ~20 secs */ |
1352 | param = __constant_cpu_to_le16(0x7d00); | 1352 | param = cpu_to_le16(0x7d00); |
1353 | hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, ¶m); | 1353 | hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, ¶m); |
1354 | 1354 | ||
1355 | /* AVM Berlin (31), aka "BlueFRITZ!", reports version 1.2, | 1355 | /* AVM Berlin (31), aka "BlueFRITZ!", reports version 1.2, |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 82685c63cfe8..e97f1905aa5c 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1924,9 +1924,9 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
1924 | bacpy(&cp.bdaddr, &ev->bdaddr); | 1924 | bacpy(&cp.bdaddr, &ev->bdaddr); |
1925 | cp.pkt_type = cpu_to_le16(conn->pkt_type); | 1925 | cp.pkt_type = cpu_to_le16(conn->pkt_type); |
1926 | 1926 | ||
1927 | cp.tx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 1927 | cp.tx_bandwidth = cpu_to_le32(0x00001f40); |
1928 | cp.rx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 1928 | cp.rx_bandwidth = cpu_to_le32(0x00001f40); |
1929 | cp.max_latency = __constant_cpu_to_le16(0xffff); | 1929 | cp.max_latency = cpu_to_le16(0xffff); |
1930 | cp.content_format = cpu_to_le16(hdev->voice_setting); | 1930 | cp.content_format = cpu_to_le16(hdev->voice_setting); |
1931 | cp.retrans_effort = 0xff; | 1931 | cp.retrans_effort = 0xff; |
1932 | 1932 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 68e51a84e72d..b9a418e578e0 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -211,22 +211,22 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) | |||
211 | 211 | ||
212 | switch (bt_cb(skb)->pkt_type) { | 212 | switch (bt_cb(skb)->pkt_type) { |
213 | case HCI_COMMAND_PKT: | 213 | case HCI_COMMAND_PKT: |
214 | opcode = __constant_cpu_to_le16(HCI_MON_COMMAND_PKT); | 214 | opcode = cpu_to_le16(HCI_MON_COMMAND_PKT); |
215 | break; | 215 | break; |
216 | case HCI_EVENT_PKT: | 216 | case HCI_EVENT_PKT: |
217 | opcode = __constant_cpu_to_le16(HCI_MON_EVENT_PKT); | 217 | opcode = cpu_to_le16(HCI_MON_EVENT_PKT); |
218 | break; | 218 | break; |
219 | case HCI_ACLDATA_PKT: | 219 | case HCI_ACLDATA_PKT: |
220 | if (bt_cb(skb)->incoming) | 220 | if (bt_cb(skb)->incoming) |
221 | opcode = __constant_cpu_to_le16(HCI_MON_ACL_RX_PKT); | 221 | opcode = cpu_to_le16(HCI_MON_ACL_RX_PKT); |
222 | else | 222 | else |
223 | opcode = __constant_cpu_to_le16(HCI_MON_ACL_TX_PKT); | 223 | opcode = cpu_to_le16(HCI_MON_ACL_TX_PKT); |
224 | break; | 224 | break; |
225 | case HCI_SCODATA_PKT: | 225 | case HCI_SCODATA_PKT: |
226 | if (bt_cb(skb)->incoming) | 226 | if (bt_cb(skb)->incoming) |
227 | opcode = __constant_cpu_to_le16(HCI_MON_SCO_RX_PKT); | 227 | opcode = cpu_to_le16(HCI_MON_SCO_RX_PKT); |
228 | else | 228 | else |
229 | opcode = __constant_cpu_to_le16(HCI_MON_SCO_TX_PKT); | 229 | opcode = cpu_to_le16(HCI_MON_SCO_TX_PKT); |
230 | break; | 230 | break; |
231 | default: | 231 | default: |
232 | return; | 232 | return; |
@@ -319,7 +319,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) | |||
319 | bacpy(&ni->bdaddr, &hdev->bdaddr); | 319 | bacpy(&ni->bdaddr, &hdev->bdaddr); |
320 | memcpy(ni->name, hdev->name, 8); | 320 | memcpy(ni->name, hdev->name, 8); |
321 | 321 | ||
322 | opcode = __constant_cpu_to_le16(HCI_MON_NEW_INDEX); | 322 | opcode = cpu_to_le16(HCI_MON_NEW_INDEX); |
323 | break; | 323 | break; |
324 | 324 | ||
325 | case HCI_DEV_UNREG: | 325 | case HCI_DEV_UNREG: |
@@ -327,7 +327,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) | |||
327 | if (!skb) | 327 | if (!skb) |
328 | return NULL; | 328 | return NULL; |
329 | 329 | ||
330 | opcode = __constant_cpu_to_le16(HCI_MON_DEL_INDEX); | 330 | opcode = cpu_to_le16(HCI_MON_DEL_INDEX); |
331 | break; | 331 | break; |
332 | 332 | ||
333 | default: | 333 | default: |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 9ed2168fa59f..a1e5bb7d06e8 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -665,7 +665,7 @@ static void l2cap_chan_connect_reject(struct l2cap_chan *chan) | |||
665 | rsp.scid = cpu_to_le16(chan->dcid); | 665 | rsp.scid = cpu_to_le16(chan->dcid); |
666 | rsp.dcid = cpu_to_le16(chan->scid); | 666 | rsp.dcid = cpu_to_le16(chan->scid); |
667 | rsp.result = cpu_to_le16(result); | 667 | rsp.result = cpu_to_le16(result); |
668 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 668 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
669 | 669 | ||
670 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, sizeof(rsp), &rsp); | 670 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, sizeof(rsp), &rsp); |
671 | } | 671 | } |
@@ -727,7 +727,7 @@ static inline u8 l2cap_get_auth_type(struct l2cap_chan *chan) | |||
727 | } | 727 | } |
728 | break; | 728 | break; |
729 | case L2CAP_CHAN_CONN_LESS: | 729 | case L2CAP_CHAN_CONN_LESS: |
730 | if (chan->psm == __constant_cpu_to_le16(L2CAP_PSM_3DSP)) { | 730 | if (chan->psm == cpu_to_le16(L2CAP_PSM_3DSP)) { |
731 | if (chan->sec_level == BT_SECURITY_LOW) | 731 | if (chan->sec_level == BT_SECURITY_LOW) |
732 | chan->sec_level = BT_SECURITY_SDP; | 732 | chan->sec_level = BT_SECURITY_SDP; |
733 | } | 733 | } |
@@ -738,7 +738,7 @@ static inline u8 l2cap_get_auth_type(struct l2cap_chan *chan) | |||
738 | return HCI_AT_NO_BONDING; | 738 | return HCI_AT_NO_BONDING; |
739 | break; | 739 | break; |
740 | case L2CAP_CHAN_CONN_ORIENTED: | 740 | case L2CAP_CHAN_CONN_ORIENTED: |
741 | if (chan->psm == __constant_cpu_to_le16(L2CAP_PSM_SDP)) { | 741 | if (chan->psm == cpu_to_le16(L2CAP_PSM_SDP)) { |
742 | if (chan->sec_level == BT_SECURITY_LOW) | 742 | if (chan->sec_level == BT_SECURITY_LOW) |
743 | chan->sec_level = BT_SECURITY_SDP; | 743 | chan->sec_level = BT_SECURITY_SDP; |
744 | 744 | ||
@@ -1273,7 +1273,7 @@ static void l2cap_do_start(struct l2cap_chan *chan) | |||
1273 | } | 1273 | } |
1274 | } else { | 1274 | } else { |
1275 | struct l2cap_info_req req; | 1275 | struct l2cap_info_req req; |
1276 | req.type = __constant_cpu_to_le16(L2CAP_IT_FEAT_MASK); | 1276 | req.type = cpu_to_le16(L2CAP_IT_FEAT_MASK); |
1277 | 1277 | ||
1278 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; | 1278 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; |
1279 | conn->info_ident = l2cap_get_ident(conn); | 1279 | conn->info_ident = l2cap_get_ident(conn); |
@@ -1370,18 +1370,18 @@ static void l2cap_conn_start(struct l2cap_conn *conn) | |||
1370 | 1370 | ||
1371 | if (l2cap_chan_check_security(chan)) { | 1371 | if (l2cap_chan_check_security(chan)) { |
1372 | if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) { | 1372 | if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) { |
1373 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_PEND); | 1373 | rsp.result = cpu_to_le16(L2CAP_CR_PEND); |
1374 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_AUTHOR_PEND); | 1374 | rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); |
1375 | chan->ops->defer(chan); | 1375 | chan->ops->defer(chan); |
1376 | 1376 | ||
1377 | } else { | 1377 | } else { |
1378 | l2cap_state_change(chan, BT_CONFIG); | 1378 | l2cap_state_change(chan, BT_CONFIG); |
1379 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS); | 1379 | rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); |
1380 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 1380 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
1381 | } | 1381 | } |
1382 | } else { | 1382 | } else { |
1383 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_PEND); | 1383 | rsp.result = cpu_to_le16(L2CAP_CR_PEND); |
1384 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_AUTHEN_PEND); | 1384 | rsp.status = cpu_to_le16(L2CAP_CS_AUTHEN_PEND); |
1385 | } | 1385 | } |
1386 | 1386 | ||
1387 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, | 1387 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, |
@@ -2895,9 +2895,9 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code, | |||
2895 | lh->len = cpu_to_le16(L2CAP_CMD_HDR_SIZE + dlen); | 2895 | lh->len = cpu_to_le16(L2CAP_CMD_HDR_SIZE + dlen); |
2896 | 2896 | ||
2897 | if (conn->hcon->type == LE_LINK) | 2897 | if (conn->hcon->type == LE_LINK) |
2898 | lh->cid = __constant_cpu_to_le16(L2CAP_CID_LE_SIGNALING); | 2898 | lh->cid = cpu_to_le16(L2CAP_CID_LE_SIGNALING); |
2899 | else | 2899 | else |
2900 | lh->cid = __constant_cpu_to_le16(L2CAP_CID_SIGNALING); | 2900 | lh->cid = cpu_to_le16(L2CAP_CID_SIGNALING); |
2901 | 2901 | ||
2902 | cmd = (struct l2cap_cmd_hdr *) skb_put(skb, L2CAP_CMD_HDR_SIZE); | 2902 | cmd = (struct l2cap_cmd_hdr *) skb_put(skb, L2CAP_CMD_HDR_SIZE); |
2903 | cmd->code = code; | 2903 | cmd->code = code; |
@@ -3010,8 +3010,8 @@ static void l2cap_add_opt_efs(void **ptr, struct l2cap_chan *chan) | |||
3010 | efs.stype = chan->local_stype; | 3010 | efs.stype = chan->local_stype; |
3011 | efs.msdu = cpu_to_le16(chan->local_msdu); | 3011 | efs.msdu = cpu_to_le16(chan->local_msdu); |
3012 | efs.sdu_itime = cpu_to_le32(chan->local_sdu_itime); | 3012 | efs.sdu_itime = cpu_to_le32(chan->local_sdu_itime); |
3013 | efs.acc_lat = __constant_cpu_to_le32(L2CAP_DEFAULT_ACC_LAT); | 3013 | efs.acc_lat = cpu_to_le32(L2CAP_DEFAULT_ACC_LAT); |
3014 | efs.flush_to = __constant_cpu_to_le32(L2CAP_EFS_DEFAULT_FLUSH_TO); | 3014 | efs.flush_to = cpu_to_le32(L2CAP_EFS_DEFAULT_FLUSH_TO); |
3015 | break; | 3015 | break; |
3016 | 3016 | ||
3017 | case L2CAP_MODE_STREAMING: | 3017 | case L2CAP_MODE_STREAMING: |
@@ -3152,8 +3152,8 @@ static void __l2cap_set_ertm_timeouts(struct l2cap_chan *chan, | |||
3152 | rfc->retrans_timeout = cpu_to_le16((u16) ertm_to); | 3152 | rfc->retrans_timeout = cpu_to_le16((u16) ertm_to); |
3153 | rfc->monitor_timeout = rfc->retrans_timeout; | 3153 | rfc->monitor_timeout = rfc->retrans_timeout; |
3154 | } else { | 3154 | } else { |
3155 | rfc->retrans_timeout = __constant_cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO); | 3155 | rfc->retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO); |
3156 | rfc->monitor_timeout = __constant_cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO); | 3156 | rfc->monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO); |
3157 | } | 3157 | } |
3158 | } | 3158 | } |
3159 | 3159 | ||
@@ -3285,7 +3285,7 @@ done: | |||
3285 | } | 3285 | } |
3286 | 3286 | ||
3287 | req->dcid = cpu_to_le16(chan->dcid); | 3287 | req->dcid = cpu_to_le16(chan->dcid); |
3288 | req->flags = __constant_cpu_to_le16(0); | 3288 | req->flags = cpu_to_le16(0); |
3289 | 3289 | ||
3290 | return ptr - data; | 3290 | return ptr - data; |
3291 | } | 3291 | } |
@@ -3499,7 +3499,7 @@ done: | |||
3499 | } | 3499 | } |
3500 | rsp->scid = cpu_to_le16(chan->dcid); | 3500 | rsp->scid = cpu_to_le16(chan->dcid); |
3501 | rsp->result = cpu_to_le16(result); | 3501 | rsp->result = cpu_to_le16(result); |
3502 | rsp->flags = __constant_cpu_to_le16(0); | 3502 | rsp->flags = cpu_to_le16(0); |
3503 | 3503 | ||
3504 | return ptr - data; | 3504 | return ptr - data; |
3505 | } | 3505 | } |
@@ -3608,7 +3608,7 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, | |||
3608 | } | 3608 | } |
3609 | 3609 | ||
3610 | req->dcid = cpu_to_le16(chan->dcid); | 3610 | req->dcid = cpu_to_le16(chan->dcid); |
3611 | req->flags = __constant_cpu_to_le16(0); | 3611 | req->flags = cpu_to_le16(0); |
3612 | 3612 | ||
3613 | return ptr - data; | 3613 | return ptr - data; |
3614 | } | 3614 | } |
@@ -3639,7 +3639,7 @@ void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan) | |||
3639 | rsp.mtu = cpu_to_le16(chan->imtu); | 3639 | rsp.mtu = cpu_to_le16(chan->imtu); |
3640 | rsp.mps = cpu_to_le16(chan->mps); | 3640 | rsp.mps = cpu_to_le16(chan->mps); |
3641 | rsp.credits = cpu_to_le16(chan->rx_credits); | 3641 | rsp.credits = cpu_to_le16(chan->rx_credits); |
3642 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS); | 3642 | rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); |
3643 | 3643 | ||
3644 | l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CONN_RSP, sizeof(rsp), | 3644 | l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CONN_RSP, sizeof(rsp), |
3645 | &rsp); | 3645 | &rsp); |
@@ -3654,8 +3654,8 @@ void __l2cap_connect_rsp_defer(struct l2cap_chan *chan) | |||
3654 | 3654 | ||
3655 | rsp.scid = cpu_to_le16(chan->dcid); | 3655 | rsp.scid = cpu_to_le16(chan->dcid); |
3656 | rsp.dcid = cpu_to_le16(chan->scid); | 3656 | rsp.dcid = cpu_to_le16(chan->scid); |
3657 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS); | 3657 | rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); |
3658 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 3658 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
3659 | 3659 | ||
3660 | if (chan->hs_hcon) | 3660 | if (chan->hs_hcon) |
3661 | rsp_code = L2CAP_CREATE_CHAN_RSP; | 3661 | rsp_code = L2CAP_CREATE_CHAN_RSP; |
@@ -3684,8 +3684,8 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) | |||
3684 | u16 txwin_ext = chan->ack_win; | 3684 | u16 txwin_ext = chan->ack_win; |
3685 | struct l2cap_conf_rfc rfc = { | 3685 | struct l2cap_conf_rfc rfc = { |
3686 | .mode = chan->mode, | 3686 | .mode = chan->mode, |
3687 | .retrans_timeout = __constant_cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO), | 3687 | .retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO), |
3688 | .monitor_timeout = __constant_cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO), | 3688 | .monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO), |
3689 | .max_pdu_size = cpu_to_le16(chan->imtu), | 3689 | .max_pdu_size = cpu_to_le16(chan->imtu), |
3690 | .txwin_size = min_t(u16, chan->ack_win, L2CAP_DEFAULT_TX_WINDOW), | 3690 | .txwin_size = min_t(u16, chan->ack_win, L2CAP_DEFAULT_TX_WINDOW), |
3691 | }; | 3691 | }; |
@@ -3776,7 +3776,7 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, | |||
3776 | l2cap_chan_lock(pchan); | 3776 | l2cap_chan_lock(pchan); |
3777 | 3777 | ||
3778 | /* Check if the ACL is secure enough (if not SDP) */ | 3778 | /* Check if the ACL is secure enough (if not SDP) */ |
3779 | if (psm != __constant_cpu_to_le16(L2CAP_PSM_SDP) && | 3779 | if (psm != cpu_to_le16(L2CAP_PSM_SDP) && |
3780 | !hci_conn_check_link_mode(conn->hcon)) { | 3780 | !hci_conn_check_link_mode(conn->hcon)) { |
3781 | conn->disc_reason = HCI_ERROR_AUTH_FAILURE; | 3781 | conn->disc_reason = HCI_ERROR_AUTH_FAILURE; |
3782 | result = L2CAP_CR_SEC_BLOCK; | 3782 | result = L2CAP_CR_SEC_BLOCK; |
@@ -3861,7 +3861,7 @@ sendresp: | |||
3861 | 3861 | ||
3862 | if (result == L2CAP_CR_PEND && status == L2CAP_CS_NO_INFO) { | 3862 | if (result == L2CAP_CR_PEND && status == L2CAP_CS_NO_INFO) { |
3863 | struct l2cap_info_req info; | 3863 | struct l2cap_info_req info; |
3864 | info.type = __constant_cpu_to_le16(L2CAP_IT_FEAT_MASK); | 3864 | info.type = cpu_to_le16(L2CAP_IT_FEAT_MASK); |
3865 | 3865 | ||
3866 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; | 3866 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; |
3867 | conn->info_ident = l2cap_get_ident(conn); | 3867 | conn->info_ident = l2cap_get_ident(conn); |
@@ -4010,7 +4010,7 @@ static void cmd_reject_invalid_cid(struct l2cap_conn *conn, u8 ident, | |||
4010 | { | 4010 | { |
4011 | struct l2cap_cmd_rej_cid rej; | 4011 | struct l2cap_cmd_rej_cid rej; |
4012 | 4012 | ||
4013 | rej.reason = __constant_cpu_to_le16(L2CAP_REJ_INVALID_CID); | 4013 | rej.reason = cpu_to_le16(L2CAP_REJ_INVALID_CID); |
4014 | rej.scid = __cpu_to_le16(scid); | 4014 | rej.scid = __cpu_to_le16(scid); |
4015 | rej.dcid = __cpu_to_le16(dcid); | 4015 | rej.dcid = __cpu_to_le16(dcid); |
4016 | 4016 | ||
@@ -4342,8 +4342,8 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, | |||
4342 | u8 buf[8]; | 4342 | u8 buf[8]; |
4343 | u32 feat_mask = l2cap_feat_mask; | 4343 | u32 feat_mask = l2cap_feat_mask; |
4344 | struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf; | 4344 | struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf; |
4345 | rsp->type = __constant_cpu_to_le16(L2CAP_IT_FEAT_MASK); | 4345 | rsp->type = cpu_to_le16(L2CAP_IT_FEAT_MASK); |
4346 | rsp->result = __constant_cpu_to_le16(L2CAP_IR_SUCCESS); | 4346 | rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS); |
4347 | if (!disable_ertm) | 4347 | if (!disable_ertm) |
4348 | feat_mask |= L2CAP_FEAT_ERTM | L2CAP_FEAT_STREAMING | 4348 | feat_mask |= L2CAP_FEAT_ERTM | L2CAP_FEAT_STREAMING |
4349 | | L2CAP_FEAT_FCS; | 4349 | | L2CAP_FEAT_FCS; |
@@ -4363,15 +4363,15 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, | |||
4363 | else | 4363 | else |
4364 | l2cap_fixed_chan[0] &= ~L2CAP_FC_A2MP; | 4364 | l2cap_fixed_chan[0] &= ~L2CAP_FC_A2MP; |
4365 | 4365 | ||
4366 | rsp->type = __constant_cpu_to_le16(L2CAP_IT_FIXED_CHAN); | 4366 | rsp->type = cpu_to_le16(L2CAP_IT_FIXED_CHAN); |
4367 | rsp->result = __constant_cpu_to_le16(L2CAP_IR_SUCCESS); | 4367 | rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS); |
4368 | memcpy(rsp->data, l2cap_fixed_chan, sizeof(l2cap_fixed_chan)); | 4368 | memcpy(rsp->data, l2cap_fixed_chan, sizeof(l2cap_fixed_chan)); |
4369 | l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(buf), | 4369 | l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(buf), |
4370 | buf); | 4370 | buf); |
4371 | } else { | 4371 | } else { |
4372 | struct l2cap_info_rsp rsp; | 4372 | struct l2cap_info_rsp rsp; |
4373 | rsp.type = cpu_to_le16(type); | 4373 | rsp.type = cpu_to_le16(type); |
4374 | rsp.result = __constant_cpu_to_le16(L2CAP_IR_NOTSUPP); | 4374 | rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP); |
4375 | l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), | 4375 | l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), |
4376 | &rsp); | 4376 | &rsp); |
4377 | } | 4377 | } |
@@ -4416,7 +4416,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, | |||
4416 | 4416 | ||
4417 | if (conn->feat_mask & L2CAP_FEAT_FIXED_CHAN) { | 4417 | if (conn->feat_mask & L2CAP_FEAT_FIXED_CHAN) { |
4418 | struct l2cap_info_req req; | 4418 | struct l2cap_info_req req; |
4419 | req.type = __constant_cpu_to_le16(L2CAP_IT_FIXED_CHAN); | 4419 | req.type = cpu_to_le16(L2CAP_IT_FIXED_CHAN); |
4420 | 4420 | ||
4421 | conn->info_ident = l2cap_get_ident(conn); | 4421 | conn->info_ident = l2cap_get_ident(conn); |
4422 | 4422 | ||
@@ -4510,8 +4510,8 @@ static int l2cap_create_channel_req(struct l2cap_conn *conn, | |||
4510 | error: | 4510 | error: |
4511 | rsp.dcid = 0; | 4511 | rsp.dcid = 0; |
4512 | rsp.scid = cpu_to_le16(scid); | 4512 | rsp.scid = cpu_to_le16(scid); |
4513 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_BAD_AMP); | 4513 | rsp.result = cpu_to_le16(L2CAP_CR_BAD_AMP); |
4514 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 4514 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
4515 | 4515 | ||
4516 | l2cap_send_cmd(conn, cmd->ident, L2CAP_CREATE_CHAN_RSP, | 4516 | l2cap_send_cmd(conn, cmd->ident, L2CAP_CREATE_CHAN_RSP, |
4517 | sizeof(rsp), &rsp); | 4517 | sizeof(rsp), &rsp); |
@@ -4575,7 +4575,7 @@ static void l2cap_send_move_chan_cfm_icid(struct l2cap_conn *conn, u16 icid) | |||
4575 | BT_DBG("conn %p, icid 0x%4.4x", conn, icid); | 4575 | BT_DBG("conn %p, icid 0x%4.4x", conn, icid); |
4576 | 4576 | ||
4577 | cfm.icid = cpu_to_le16(icid); | 4577 | cfm.icid = cpu_to_le16(icid); |
4578 | cfm.result = __constant_cpu_to_le16(L2CAP_MC_UNCONFIRMED); | 4578 | cfm.result = cpu_to_le16(L2CAP_MC_UNCONFIRMED); |
4579 | 4579 | ||
4580 | l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_MOVE_CHAN_CFM, | 4580 | l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_MOVE_CHAN_CFM, |
4581 | sizeof(cfm), &cfm); | 4581 | sizeof(cfm), &cfm); |
@@ -4758,12 +4758,12 @@ static void l2cap_do_create(struct l2cap_chan *chan, int result, | |||
4758 | 4758 | ||
4759 | if (result == L2CAP_CR_SUCCESS) { | 4759 | if (result == L2CAP_CR_SUCCESS) { |
4760 | /* Send successful response */ | 4760 | /* Send successful response */ |
4761 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS); | 4761 | rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); |
4762 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 4762 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
4763 | } else { | 4763 | } else { |
4764 | /* Send negative response */ | 4764 | /* Send negative response */ |
4765 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_NO_MEM); | 4765 | rsp.result = cpu_to_le16(L2CAP_CR_NO_MEM); |
4766 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_NO_INFO); | 4766 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
4767 | } | 4767 | } |
4768 | 4768 | ||
4769 | l2cap_send_cmd(chan->conn, chan->ident, L2CAP_CREATE_CHAN_RSP, | 4769 | l2cap_send_cmd(chan->conn, chan->ident, L2CAP_CREATE_CHAN_RSP, |
@@ -4891,7 +4891,7 @@ static inline int l2cap_move_channel_req(struct l2cap_conn *conn, | |||
4891 | chan = l2cap_get_chan_by_dcid(conn, icid); | 4891 | chan = l2cap_get_chan_by_dcid(conn, icid); |
4892 | if (!chan) { | 4892 | if (!chan) { |
4893 | rsp.icid = cpu_to_le16(icid); | 4893 | rsp.icid = cpu_to_le16(icid); |
4894 | rsp.result = __constant_cpu_to_le16(L2CAP_MR_NOT_ALLOWED); | 4894 | rsp.result = cpu_to_le16(L2CAP_MR_NOT_ALLOWED); |
4895 | l2cap_send_cmd(conn, cmd->ident, L2CAP_MOVE_CHAN_RSP, | 4895 | l2cap_send_cmd(conn, cmd->ident, L2CAP_MOVE_CHAN_RSP, |
4896 | sizeof(rsp), &rsp); | 4896 | sizeof(rsp), &rsp); |
4897 | return 0; | 4897 | return 0; |
@@ -5235,9 +5235,9 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, | |||
5235 | 5235 | ||
5236 | err = l2cap_check_conn_param(min, max, latency, to_multiplier); | 5236 | err = l2cap_check_conn_param(min, max, latency, to_multiplier); |
5237 | if (err) | 5237 | if (err) |
5238 | rsp.result = __constant_cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); | 5238 | rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); |
5239 | else | 5239 | else |
5240 | rsp.result = __constant_cpu_to_le16(L2CAP_CONN_PARAM_ACCEPTED); | 5240 | rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_ACCEPTED); |
5241 | 5241 | ||
5242 | l2cap_send_cmd(conn, cmd->ident, L2CAP_CONN_PARAM_UPDATE_RSP, | 5242 | l2cap_send_cmd(conn, cmd->ident, L2CAP_CONN_PARAM_UPDATE_RSP, |
5243 | sizeof(rsp), &rsp); | 5243 | sizeof(rsp), &rsp); |
@@ -5650,7 +5650,7 @@ static inline void l2cap_le_sig_channel(struct l2cap_conn *conn, | |||
5650 | 5650 | ||
5651 | BT_ERR("Wrong link type (%d)", err); | 5651 | BT_ERR("Wrong link type (%d)", err); |
5652 | 5652 | ||
5653 | rej.reason = __constant_cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); | 5653 | rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); |
5654 | l2cap_send_cmd(conn, cmd->ident, L2CAP_COMMAND_REJ, | 5654 | l2cap_send_cmd(conn, cmd->ident, L2CAP_COMMAND_REJ, |
5655 | sizeof(rej), &rej); | 5655 | sizeof(rej), &rej); |
5656 | } | 5656 | } |
@@ -5695,7 +5695,7 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn, | |||
5695 | 5695 | ||
5696 | BT_ERR("Wrong link type (%d)", err); | 5696 | BT_ERR("Wrong link type (%d)", err); |
5697 | 5697 | ||
5698 | rej.reason = __constant_cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); | 5698 | rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); |
5699 | l2cap_send_cmd(conn, cmd.ident, L2CAP_COMMAND_REJ, | 5699 | l2cap_send_cmd(conn, cmd.ident, L2CAP_COMMAND_REJ, |
5700 | sizeof(rej), &rej); | 5700 | sizeof(rej), &rej); |
5701 | } | 5701 | } |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index b247f9d27fed..33cd5615ff1e 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -111,7 +111,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) | |||
111 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { | 111 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { |
112 | /* We only allow ATT user space socket */ | 112 | /* We only allow ATT user space socket */ |
113 | if (la.l2_cid && | 113 | if (la.l2_cid && |
114 | la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) | 114 | la.l2_cid != cpu_to_le16(L2CAP_CID_ATT)) |
115 | return -EINVAL; | 115 | return -EINVAL; |
116 | } | 116 | } |
117 | 117 | ||
@@ -209,7 +209,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, | |||
209 | * ATT. Anything else is an invalid combination. | 209 | * ATT. Anything else is an invalid combination. |
210 | */ | 210 | */ |
211 | if (chan->scid != L2CAP_CID_ATT || | 211 | if (chan->scid != L2CAP_CID_ATT || |
212 | la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) | 212 | la.l2_cid != cpu_to_le16(L2CAP_CID_ATT)) |
213 | return -EINVAL; | 213 | return -EINVAL; |
214 | 214 | ||
215 | /* We don't have the hdev available here to make a | 215 | /* We don't have the hdev available here to make a |
@@ -227,7 +227,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, | |||
227 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { | 227 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { |
228 | /* We only allow ATT user space socket */ | 228 | /* We only allow ATT user space socket */ |
229 | if (la.l2_cid && | 229 | if (la.l2_cid && |
230 | la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) | 230 | la.l2_cid != cpu_to_le16(L2CAP_CID_ATT)) |
231 | return -EINVAL; | 231 | return -EINVAL; |
232 | } | 232 | } |
233 | 233 | ||
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index fbcf9d4f130b..75df93679276 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -213,7 +213,7 @@ static int cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status) | |||
213 | 213 | ||
214 | hdr = (void *) skb_put(skb, sizeof(*hdr)); | 214 | hdr = (void *) skb_put(skb, sizeof(*hdr)); |
215 | 215 | ||
216 | hdr->opcode = __constant_cpu_to_le16(MGMT_EV_CMD_STATUS); | 216 | hdr->opcode = cpu_to_le16(MGMT_EV_CMD_STATUS); |
217 | hdr->index = cpu_to_le16(index); | 217 | hdr->index = cpu_to_le16(index); |
218 | hdr->len = cpu_to_le16(sizeof(*ev)); | 218 | hdr->len = cpu_to_le16(sizeof(*ev)); |
219 | 219 | ||
@@ -244,7 +244,7 @@ static int cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status, | |||
244 | 244 | ||
245 | hdr = (void *) skb_put(skb, sizeof(*hdr)); | 245 | hdr = (void *) skb_put(skb, sizeof(*hdr)); |
246 | 246 | ||
247 | hdr->opcode = __constant_cpu_to_le16(MGMT_EV_CMD_COMPLETE); | 247 | hdr->opcode = cpu_to_le16(MGMT_EV_CMD_COMPLETE); |
248 | hdr->index = cpu_to_le16(index); | 248 | hdr->index = cpu_to_le16(index); |
249 | hdr->len = cpu_to_le16(sizeof(*ev) + rp_len); | 249 | hdr->len = cpu_to_le16(sizeof(*ev) + rp_len); |
250 | 250 | ||
@@ -270,7 +270,7 @@ static int read_version(struct sock *sk, struct hci_dev *hdev, void *data, | |||
270 | BT_DBG("sock %p", sk); | 270 | BT_DBG("sock %p", sk); |
271 | 271 | ||
272 | rp.version = MGMT_VERSION; | 272 | rp.version = MGMT_VERSION; |
273 | rp.revision = __constant_cpu_to_le16(MGMT_REVISION); | 273 | rp.revision = cpu_to_le16(MGMT_REVISION); |
274 | 274 | ||
275 | return cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_VERSION, 0, &rp, | 275 | return cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_VERSION, 0, &rp, |
276 | sizeof(rp)); | 276 | sizeof(rp)); |
@@ -294,8 +294,8 @@ static int read_commands(struct sock *sk, struct hci_dev *hdev, void *data, | |||
294 | if (!rp) | 294 | if (!rp) |
295 | return -ENOMEM; | 295 | return -ENOMEM; |
296 | 296 | ||
297 | rp->num_commands = __constant_cpu_to_le16(num_commands); | 297 | rp->num_commands = cpu_to_le16(num_commands); |
298 | rp->num_events = __constant_cpu_to_le16(num_events); | 298 | rp->num_events = cpu_to_le16(num_events); |
299 | 299 | ||
300 | for (i = 0, opcode = rp->opcodes; i < num_commands; i++, opcode++) | 300 | for (i = 0, opcode = rp->opcodes; i < num_commands; i++, opcode++) |
301 | put_unaligned_le16(mgmt_commands[i], opcode); | 301 | put_unaligned_le16(mgmt_commands[i], opcode); |
@@ -858,8 +858,8 @@ static void enable_advertising(struct hci_request *req) | |||
858 | return; | 858 | return; |
859 | 859 | ||
860 | memset(&cp, 0, sizeof(cp)); | 860 | memset(&cp, 0, sizeof(cp)); |
861 | cp.min_interval = __constant_cpu_to_le16(0x0800); | 861 | cp.min_interval = cpu_to_le16(0x0800); |
862 | cp.max_interval = __constant_cpu_to_le16(0x0800); | 862 | cp.max_interval = cpu_to_le16(0x0800); |
863 | cp.type = connectable ? LE_ADV_IND : LE_ADV_NONCONN_IND; | 863 | cp.type = connectable ? LE_ADV_IND : LE_ADV_NONCONN_IND; |
864 | cp.own_address_type = own_addr_type; | 864 | cp.own_address_type = own_addr_type; |
865 | cp.channel_map = hdev->le_adv_channel_map; | 865 | cp.channel_map = hdev->le_adv_channel_map; |
@@ -1181,7 +1181,7 @@ static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 data_len, | |||
1181 | if (hdev) | 1181 | if (hdev) |
1182 | hdr->index = cpu_to_le16(hdev->id); | 1182 | hdr->index = cpu_to_le16(hdev->id); |
1183 | else | 1183 | else |
1184 | hdr->index = __constant_cpu_to_le16(MGMT_INDEX_NONE); | 1184 | hdr->index = cpu_to_le16(MGMT_INDEX_NONE); |
1185 | hdr->len = cpu_to_le16(data_len); | 1185 | hdr->len = cpu_to_le16(data_len); |
1186 | 1186 | ||
1187 | if (data) | 1187 | if (data) |
@@ -1493,15 +1493,15 @@ static void write_fast_connectable(struct hci_request *req, bool enable) | |||
1493 | type = PAGE_SCAN_TYPE_INTERLACED; | 1493 | type = PAGE_SCAN_TYPE_INTERLACED; |
1494 | 1494 | ||
1495 | /* 160 msec page scan interval */ | 1495 | /* 160 msec page scan interval */ |
1496 | acp.interval = __constant_cpu_to_le16(0x0100); | 1496 | acp.interval = cpu_to_le16(0x0100); |
1497 | } else { | 1497 | } else { |
1498 | type = PAGE_SCAN_TYPE_STANDARD; /* default */ | 1498 | type = PAGE_SCAN_TYPE_STANDARD; /* default */ |
1499 | 1499 | ||
1500 | /* default 1.28 sec page scan */ | 1500 | /* default 1.28 sec page scan */ |
1501 | acp.interval = __constant_cpu_to_le16(0x0800); | 1501 | acp.interval = cpu_to_le16(0x0800); |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | acp.window = __constant_cpu_to_le16(0x0012); | 1504 | acp.window = cpu_to_le16(0x0012); |
1505 | 1505 | ||
1506 | if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval || | 1506 | if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval || |
1507 | __cpu_to_le16(hdev->page_scan_window) != acp.window) | 1507 | __cpu_to_le16(hdev->page_scan_window) != acp.window) |
@@ -5696,9 +5696,9 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
5696 | 5696 | ||
5697 | ev->rssi = rssi; | 5697 | ev->rssi = rssi; |
5698 | if (cfm_name) | 5698 | if (cfm_name) |
5699 | ev->flags |= __constant_cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME); | 5699 | ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME); |
5700 | if (!ssp) | 5700 | if (!ssp) |
5701 | ev->flags |= __constant_cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING); | 5701 | ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING); |
5702 | 5702 | ||
5703 | if (eir_len > 0) | 5703 | if (eir_len > 0) |
5704 | memcpy(ev->eir, eir, eir_len); | 5704 | memcpy(ev->eir, eir, eir_len); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 21e15318937c..633cceeb943e 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -768,7 +768,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, | |||
768 | 768 | ||
769 | bacpy(&addr.l2_bdaddr, dst); | 769 | bacpy(&addr.l2_bdaddr, dst); |
770 | addr.l2_family = AF_BLUETOOTH; | 770 | addr.l2_family = AF_BLUETOOTH; |
771 | addr.l2_psm = __constant_cpu_to_le16(RFCOMM_PSM); | 771 | addr.l2_psm = cpu_to_le16(RFCOMM_PSM); |
772 | addr.l2_cid = 0; | 772 | addr.l2_cid = 0; |
773 | addr.l2_bdaddr_type = BDADDR_BREDR; | 773 | addr.l2_bdaddr_type = BDADDR_BREDR; |
774 | *err = kernel_connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK); | 774 | *err = kernel_connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK); |
@@ -2032,7 +2032,7 @@ static int rfcomm_add_listener(bdaddr_t *ba) | |||
2032 | /* Bind socket */ | 2032 | /* Bind socket */ |
2033 | bacpy(&addr.l2_bdaddr, ba); | 2033 | bacpy(&addr.l2_bdaddr, ba); |
2034 | addr.l2_family = AF_BLUETOOTH; | 2034 | addr.l2_family = AF_BLUETOOTH; |
2035 | addr.l2_psm = __constant_cpu_to_le16(RFCOMM_PSM); | 2035 | addr.l2_psm = cpu_to_le16(RFCOMM_PSM); |
2036 | addr.l2_cid = 0; | 2036 | addr.l2_cid = 0; |
2037 | addr.l2_bdaddr_type = BDADDR_BREDR; | 2037 | addr.l2_bdaddr_type = BDADDR_BREDR; |
2038 | err = kernel_bind(sock, (struct sockaddr *) &addr, sizeof(addr)); | 2038 | err = kernel_bind(sock, (struct sockaddr *) &addr, sizeof(addr)); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 24fa3964b3c8..ab1e6fcca4c5 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -676,20 +676,20 @@ static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting) | |||
676 | bacpy(&cp.bdaddr, &conn->dst); | 676 | bacpy(&cp.bdaddr, &conn->dst); |
677 | cp.pkt_type = cpu_to_le16(conn->pkt_type); | 677 | cp.pkt_type = cpu_to_le16(conn->pkt_type); |
678 | 678 | ||
679 | cp.tx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 679 | cp.tx_bandwidth = cpu_to_le32(0x00001f40); |
680 | cp.rx_bandwidth = __constant_cpu_to_le32(0x00001f40); | 680 | cp.rx_bandwidth = cpu_to_le32(0x00001f40); |
681 | cp.content_format = cpu_to_le16(setting); | 681 | cp.content_format = cpu_to_le16(setting); |
682 | 682 | ||
683 | switch (setting & SCO_AIRMODE_MASK) { | 683 | switch (setting & SCO_AIRMODE_MASK) { |
684 | case SCO_AIRMODE_TRANSP: | 684 | case SCO_AIRMODE_TRANSP: |
685 | if (conn->pkt_type & ESCO_2EV3) | 685 | if (conn->pkt_type & ESCO_2EV3) |
686 | cp.max_latency = __constant_cpu_to_le16(0x0008); | 686 | cp.max_latency = cpu_to_le16(0x0008); |
687 | else | 687 | else |
688 | cp.max_latency = __constant_cpu_to_le16(0x000D); | 688 | cp.max_latency = cpu_to_le16(0x000D); |
689 | cp.retrans_effort = 0x02; | 689 | cp.retrans_effort = 0x02; |
690 | break; | 690 | break; |
691 | case SCO_AIRMODE_CVSD: | 691 | case SCO_AIRMODE_CVSD: |
692 | cp.max_latency = __constant_cpu_to_le16(0xffff); | 692 | cp.max_latency = cpu_to_le16(0xffff); |
693 | cp.retrans_effort = 0xff; | 693 | cp.retrans_effort = 0xff; |
694 | break; | 694 | break; |
695 | } | 695 | } |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 7f25dda9c770..74a17cf91b26 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -218,7 +218,7 @@ static struct sk_buff *smp_build_cmd(struct l2cap_conn *conn, u8 code, | |||
218 | 218 | ||
219 | lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); | 219 | lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); |
220 | lh->len = cpu_to_le16(sizeof(code) + dlen); | 220 | lh->len = cpu_to_le16(sizeof(code) + dlen); |
221 | lh->cid = __constant_cpu_to_le16(L2CAP_CID_SMP); | 221 | lh->cid = cpu_to_le16(L2CAP_CID_SMP); |
222 | 222 | ||
223 | memcpy(skb_put(skb, sizeof(code)), &code, sizeof(code)); | 223 | memcpy(skb_put(skb, sizeof(code)), &code, sizeof(code)); |
224 | 224 | ||