aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c29
-rw-r--r--net/bluetooth/l2cap_core.c7
-rw-r--r--net/bluetooth/mgmt.c8
-rw-r--r--net/nfc/Kconfig2
-rw-r--r--net/nfc/Makefile6
-rw-r--r--net/nfc/llcp.h (renamed from net/nfc/llcp/llcp.h)0
-rw-r--r--net/nfc/llcp/Kconfig7
-rw-r--r--net/nfc/llcp_commands.c (renamed from net/nfc/llcp/commands.c)2
-rw-r--r--net/nfc/llcp_core.c (renamed from net/nfc/llcp/llcp.c)2
-rw-r--r--net/nfc/llcp_sock.c (renamed from net/nfc/llcp/sock.c)2
-rw-r--r--net/nfc/netlink.c3
-rw-r--r--net/nfc/nfc.h64
12 files changed, 41 insertions, 91 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index ce82265f5619..33843c5c4939 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -79,7 +79,8 @@ static void hci_req_cancel(struct hci_dev *hdev, int err)
79 } 79 }
80} 80}
81 81
82struct sk_buff *hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 event) 82static struct sk_buff *hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,
83 u8 event)
83{ 84{
84 struct hci_ev_cmd_complete *ev; 85 struct hci_ev_cmd_complete *ev;
85 struct hci_event_hdr *hdr; 86 struct hci_event_hdr *hdr;
@@ -134,7 +135,7 @@ failed:
134} 135}
135 136
136struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, 137struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
137 void *param, u8 event, u32 timeout) 138 const void *param, u8 event, u32 timeout)
138{ 139{
139 DECLARE_WAITQUEUE(wait, current); 140 DECLARE_WAITQUEUE(wait, current);
140 struct hci_request req; 141 struct hci_request req;
@@ -188,7 +189,7 @@ struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
188EXPORT_SYMBOL(__hci_cmd_sync_ev); 189EXPORT_SYMBOL(__hci_cmd_sync_ev);
189 190
190struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, 191struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
191 void *param, u32 timeout) 192 const void *param, u32 timeout)
192{ 193{
193 return __hci_cmd_sync_ev(hdev, opcode, plen, param, 0, timeout); 194 return __hci_cmd_sync_ev(hdev, opcode, plen, param, 0, timeout);
194} 195}
@@ -377,6 +378,8 @@ static void bredr_setup(struct hci_request *req)
377 378
378static void le_setup(struct hci_request *req) 379static void le_setup(struct hci_request *req)
379{ 380{
381 struct hci_dev *hdev = req->hdev;
382
380 /* Read LE Buffer Size */ 383 /* Read LE Buffer Size */
381 hci_req_add(req, HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL); 384 hci_req_add(req, HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL);
382 385
@@ -391,6 +394,10 @@ static void le_setup(struct hci_request *req)
391 394
392 /* Read LE Supported States */ 395 /* Read LE Supported States */
393 hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL); 396 hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
397
398 /* LE-only controllers have LE implicitly enabled */
399 if (!lmp_bredr_capable(hdev))
400 set_bit(HCI_LE_ENABLED, &hdev->dev_flags);
394} 401}
395 402
396static u8 hci_get_inquiry_mode(struct hci_dev *hdev) 403static u8 hci_get_inquiry_mode(struct hci_dev *hdev)
@@ -574,6 +581,10 @@ static void hci_set_le_support(struct hci_request *req)
574 struct hci_dev *hdev = req->hdev; 581 struct hci_dev *hdev = req->hdev;
575 struct hci_cp_write_le_host_supported cp; 582 struct hci_cp_write_le_host_supported cp;
576 583
584 /* LE-only devices do not support explicit enablement */
585 if (!lmp_bredr_capable(hdev))
586 return;
587
577 memset(&cp, 0, sizeof(cp)); 588 memset(&cp, 0, sizeof(cp));
578 589
579 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 590 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
@@ -2602,7 +2613,7 @@ int hci_req_run(struct hci_request *req, hci_req_complete_t complete)
2602} 2613}
2603 2614
2604static struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, 2615static struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode,
2605 u32 plen, void *param) 2616 u32 plen, const void *param)
2606{ 2617{
2607 int len = HCI_COMMAND_HDR_SIZE + plen; 2618 int len = HCI_COMMAND_HDR_SIZE + plen;
2608 struct hci_command_hdr *hdr; 2619 struct hci_command_hdr *hdr;
@@ -2628,7 +2639,8 @@ static struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode,
2628} 2639}
2629 2640
2630/* Send HCI command */ 2641/* Send HCI command */
2631int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param) 2642int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
2643 const void *param)
2632{ 2644{
2633 struct sk_buff *skb; 2645 struct sk_buff *skb;
2634 2646
@@ -2652,8 +2664,8 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param)
2652} 2664}
2653 2665
2654/* Queue a command to an asynchronous HCI request */ 2666/* Queue a command to an asynchronous HCI request */
2655void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, void *param, 2667void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
2656 u8 event) 2668 const void *param, u8 event)
2657{ 2669{
2658 struct hci_dev *hdev = req->hdev; 2670 struct hci_dev *hdev = req->hdev;
2659 struct sk_buff *skb; 2671 struct sk_buff *skb;
@@ -2682,7 +2694,8 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, void *param,
2682 skb_queue_tail(&req->cmd_q, skb); 2694 skb_queue_tail(&req->cmd_q, skb);
2683} 2695}
2684 2696
2685void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param) 2697void hci_req_add(struct hci_request *req, u16 opcode, u32 plen,
2698 const void *param)
2686{ 2699{
2687 hci_req_add_ev(req, opcode, plen, param, 0); 2700 hci_req_add_ev(req, opcode, plen, param, 0);
2688} 2701}
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index eae1d9f90b68..a76d1ac0321b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6314,12 +6314,13 @@ drop:
6314 kfree_skb(skb); 6314 kfree_skb(skb);
6315} 6315}
6316 6316
6317static void l2cap_att_channel(struct l2cap_conn *conn, u16 cid, 6317static void l2cap_att_channel(struct l2cap_conn *conn,
6318 struct sk_buff *skb) 6318 struct sk_buff *skb)
6319{ 6319{
6320 struct l2cap_chan *chan; 6320 struct l2cap_chan *chan;
6321 6321
6322 chan = l2cap_global_chan_by_scid(0, cid, conn->src, conn->dst); 6322 chan = l2cap_global_chan_by_scid(0, L2CAP_CID_LE_DATA,
6323 conn->src, conn->dst);
6323 if (!chan) 6324 if (!chan)
6324 goto drop; 6325 goto drop;
6325 6326
@@ -6368,7 +6369,7 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
6368 break; 6369 break;
6369 6370
6370 case L2CAP_CID_LE_DATA: 6371 case L2CAP_CID_LE_DATA:
6371 l2cap_att_channel(conn, cid, skb); 6372 l2cap_att_channel(conn, skb);
6372 break; 6373 break;
6373 6374
6374 case L2CAP_CID_SMP: 6375 case L2CAP_CID_SMP:
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4c830c62ef74..35fef22703e9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1351,6 +1351,11 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1351 return cmd_status(sk, hdev->id, MGMT_OP_SET_LE, 1351 return cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
1352 MGMT_STATUS_INVALID_PARAMS); 1352 MGMT_STATUS_INVALID_PARAMS);
1353 1353
1354 /* LE-only devices do not allow toggling LE on/off */
1355 if (!lmp_bredr_capable(hdev))
1356 return cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
1357 MGMT_STATUS_REJECTED);
1358
1354 hci_dev_lock(hdev); 1359 hci_dev_lock(hdev);
1355 1360
1356 val = !!cp->val; 1361 val = !!cp->val;
@@ -3347,7 +3352,8 @@ static int powered_update_hci(struct hci_dev *hdev)
3347 hci_req_add(&req, HCI_OP_WRITE_SSP_MODE, 1, &ssp); 3352 hci_req_add(&req, HCI_OP_WRITE_SSP_MODE, 1, &ssp);
3348 } 3353 }
3349 3354
3350 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 3355 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags) &&
3356 lmp_bredr_capable(hdev)) {
3351 struct hci_cp_write_le_host_supported cp; 3357 struct hci_cp_write_le_host_supported cp;
3352 3358
3353 cp.le = 1; 3359 cp.le = 1;
diff --git a/net/nfc/Kconfig b/net/nfc/Kconfig
index 60c3bbb63e8e..5948b2fc72f6 100644
--- a/net/nfc/Kconfig
+++ b/net/nfc/Kconfig
@@ -4,6 +4,7 @@
4 4
5menuconfig NFC 5menuconfig NFC
6 depends on NET 6 depends on NET
7 depends on RFKILL || !RFKILL
7 tristate "NFC subsystem support" 8 tristate "NFC subsystem support"
8 default n 9 default n
9 help 10 help
@@ -15,6 +16,5 @@ menuconfig NFC
15 16
16source "net/nfc/nci/Kconfig" 17source "net/nfc/nci/Kconfig"
17source "net/nfc/hci/Kconfig" 18source "net/nfc/hci/Kconfig"
18source "net/nfc/llcp/Kconfig"
19 19
20source "drivers/nfc/Kconfig" 20source "drivers/nfc/Kconfig"
diff --git a/net/nfc/Makefile b/net/nfc/Makefile
index d1a117c2c401..fb799deaed4f 100644
--- a/net/nfc/Makefile
+++ b/net/nfc/Makefile
@@ -5,6 +5,8 @@
5obj-$(CONFIG_NFC) += nfc.o 5obj-$(CONFIG_NFC) += nfc.o
6obj-$(CONFIG_NFC_NCI) += nci/ 6obj-$(CONFIG_NFC_NCI) += nci/
7obj-$(CONFIG_NFC_HCI) += hci/ 7obj-$(CONFIG_NFC_HCI) += hci/
8#obj-$(CONFIG_NFC_LLCP) += llcp/
9
10nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \
11 llcp_sock.o
8 12
9nfc-objs := core.o netlink.o af_nfc.o rawsock.o
10nfc-$(CONFIG_NFC_LLCP) += llcp/llcp.o llcp/commands.o llcp/sock.o
diff --git a/net/nfc/llcp/llcp.h b/net/nfc/llcp.h
index ff8c434f7df8..ff8c434f7df8 100644
--- a/net/nfc/llcp/llcp.h
+++ b/net/nfc/llcp.h
diff --git a/net/nfc/llcp/Kconfig b/net/nfc/llcp/Kconfig
deleted file mode 100644
index a1a41cd68255..000000000000
--- a/net/nfc/llcp/Kconfig
+++ /dev/null
@@ -1,7 +0,0 @@
1config NFC_LLCP
2 depends on NFC
3 bool "NFC LLCP support"
4 default n
5 help
6 Say Y here if you want to build support for a kernel NFC LLCP
7 implementation. \ No newline at end of file
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp_commands.c
index 094f7e27e910..c1b23eef83ca 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp_commands.c
@@ -26,7 +26,7 @@
26 26
27#include <net/nfc/nfc.h> 27#include <net/nfc/nfc.h>
28 28
29#include "../nfc.h" 29#include "nfc.h"
30#include "llcp.h" 30#include "llcp.h"
31 31
32static u8 llcp_tlv_length[LLCP_TLV_MAX] = { 32static u8 llcp_tlv_length[LLCP_TLV_MAX] = {
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp_core.c
index 9e483c8e52f8..158bdbf668cc 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp_core.c
@@ -24,7 +24,7 @@
24#include <linux/list.h> 24#include <linux/list.h>
25#include <linux/nfc.h> 25#include <linux/nfc.h>
26 26
27#include "../nfc.h" 27#include "nfc.h"
28#include "llcp.h" 28#include "llcp.h"
29 29
30static u8 llcp_magic[3] = {0x46, 0x66, 0x6d}; 30static u8 llcp_magic[3] = {0x46, 0x66, 0x6d};
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp_sock.c
index d6faa47c9bba..38f08c31cdd8 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp_sock.c
@@ -24,7 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/nfc.h> 25#include <linux/nfc.h>
26 26
27#include "../nfc.h" 27#include "nfc.h"
28#include "llcp.h" 28#include "llcp.h"
29 29
30static int sock_wait_state(struct sock *sk, int state, unsigned long timeo) 30static int sock_wait_state(struct sock *sk, int state, unsigned long timeo)
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 73fd51098f4d..f0c4d61f37c0 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -28,8 +28,7 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29 29
30#include "nfc.h" 30#include "nfc.h"
31 31#include "llcp.h"
32#include "llcp/llcp.h"
33 32
34static struct genl_multicast_group nfc_genl_event_mcgrp = { 33static struct genl_multicast_group nfc_genl_event_mcgrp = {
35 .name = NFC_GENL_MCAST_EVENT_NAME, 34 .name = NFC_GENL_MCAST_EVENT_NAME,
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index 94bfe19ba678..afa1f84ba040 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -48,8 +48,6 @@ struct nfc_rawsock {
48 48
49struct nfc_llcp_sdp_tlv; 49struct nfc_llcp_sdp_tlv;
50 50
51#ifdef CONFIG_NFC_LLCP
52
53void nfc_llcp_mac_is_down(struct nfc_dev *dev); 51void nfc_llcp_mac_is_down(struct nfc_dev *dev);
54void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, 52void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
55 u8 comm_mode, u8 rf_mode); 53 u8 comm_mode, u8 rf_mode);
@@ -64,68 +62,6 @@ void nfc_llcp_exit(void);
64void nfc_llcp_free_sdp_tlv(struct nfc_llcp_sdp_tlv *sdp); 62void nfc_llcp_free_sdp_tlv(struct nfc_llcp_sdp_tlv *sdp);
65void nfc_llcp_free_sdp_tlv_list(struct hlist_head *head); 63void nfc_llcp_free_sdp_tlv_list(struct hlist_head *head);
66 64
67#else
68
69static inline void nfc_llcp_mac_is_down(struct nfc_dev *dev)
70{
71}
72
73static inline void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
74 u8 comm_mode, u8 rf_mode)
75{
76}
77
78static inline int nfc_llcp_register_device(struct nfc_dev *dev)
79{
80 return 0;
81}
82
83static inline void nfc_llcp_unregister_device(struct nfc_dev *dev)
84{
85}
86
87static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev,
88 u8 *gb, u8 gb_len)
89{
90 return 0;
91}
92
93static inline u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, size_t *gb_len)
94{
95 *gb_len = 0;
96 return NULL;
97}
98
99static inline int nfc_llcp_data_received(struct nfc_dev *dev,
100 struct sk_buff *skb)
101{
102 return 0;
103}
104
105static inline struct nfc_llcp_local *nfc_llcp_find_local(struct nfc_dev *dev)
106{
107 return NULL;
108}
109
110static inline int nfc_llcp_init(void)
111{
112 return 0;
113}
114
115static inline void nfc_llcp_exit(void)
116{
117}
118
119static inline void nfc_llcp_free_sdp_tlv(struct nfc_llcp_sdp_tlv *sdp)
120{
121}
122
123static inline void nfc_llcp_free_sdp_tlv_list(struct hlist_head *sdp_head)
124{
125}
126
127#endif
128
129int __init rawsock_init(void); 65int __init rawsock_init(void);
130void rawsock_exit(void); 66void rawsock_exit(void);
131 67