aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/nfc/nci.h27
-rw-r--r--include/net/nfc/nci_core.h4
-rw-r--r--net/nfc/nci/core.c6
-rw-r--r--net/nfc/nci/ntf.c15
-rw-r--r--net/nfc/nci/rsp.c25
5 files changed, 3 insertions, 74 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 0ebf842b5946..0b34fde9b130 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -193,16 +193,6 @@ struct nci_core_reset_cmd {
193 193
194#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01) 194#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)
195 195
196#define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02)
197
198#define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04)
199struct nci_core_conn_create_cmd {
200 __u8 target_handle;
201 __u8 num_target_specific_params;
202} __packed;
203
204#define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x06)
205
206#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) 196#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
207struct disc_map_config { 197struct disc_map_config {
208 __u8 rf_protocol; 198 __u8 rf_protocol;
@@ -262,18 +252,6 @@ struct nci_core_init_rsp_2 {
262 __le32 manufact_specific_info; 252 __le32 manufact_specific_info;
263} __packed; 253} __packed;
264 254
265#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02)
266
267#define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04)
268struct nci_core_conn_create_rsp {
269 __u8 status;
270 __u8 max_pkt_payload_size;
271 __u8 initial_num_credits;
272 __u8 conn_id;
273} __packed;
274
275#define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x06)
276
277#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) 255#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
278 256
279#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) 257#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
@@ -294,11 +272,6 @@ struct nci_core_conn_credit_ntf {
294 struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN]; 272 struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
295} __packed; 273} __packed;
296 274
297#define NCI_OP_RF_FIELD_INFO_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
298struct nci_rf_field_info_ntf {
299 __u8 rf_field_status;
300} __packed;
301
302#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05) 275#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
303struct rf_tech_specific_params_nfca_poll { 276struct rf_tech_specific_params_nfca_poll {
304 __u16 sens_res; 277 __u16 sens_res;
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 6e6a7be485c1..c92b69d7e0c2 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -116,10 +116,6 @@ struct nci_dev {
116 __u8 manufact_id; 116 __u8 manufact_id;
117 __u32 manufact_specific_info; 117 __u32 manufact_specific_info;
118 118
119 /* received during NCI_OP_CORE_CONN_CREATE_RSP for static conn 0 */
120 __u8 max_pkt_payload_size;
121 __u8 conn_id;
122
123 /* stored during nci_data_exchange */ 119 /* stored during nci_data_exchange */
124 data_exchange_cb_t data_exchange_cb; 120 data_exchange_cb_t data_exchange_cb;
125 void *data_exchange_cb_context; 121 void *data_exchange_cb_context;
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 557fe92d29c7..9d0b5305c36e 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -138,17 +138,11 @@ static void nci_init_req(struct nci_dev *ndev, unsigned long opt)
138 138
139static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt) 139static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt)
140{ 140{
141 struct nci_core_conn_create_cmd conn_cmd;
142 struct nci_rf_disc_map_cmd cmd; 141 struct nci_rf_disc_map_cmd cmd;
143 struct disc_map_config *cfg = cmd.mapping_configs; 142 struct disc_map_config *cfg = cmd.mapping_configs;
144 __u8 *num = &cmd.num_mapping_configs; 143 __u8 *num = &cmd.num_mapping_configs;
145 int i; 144 int i;
146 145
147 /* create static rf connection */
148 conn_cmd.target_handle = 0;
149 conn_cmd.num_target_specific_params = 0;
150 nci_send_cmd(ndev, NCI_OP_CORE_CONN_CREATE_CMD, 2, &conn_cmd);
151
152 /* set rf mapping configurations */ 146 /* set rf mapping configurations */
153 *num = 0; 147 *num = 0;
154 148
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 6789f4828c0b..c1bf54172c25 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -66,14 +66,6 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
66 queue_work(ndev->tx_wq, &ndev->tx_work); 66 queue_work(ndev->tx_wq, &ndev->tx_work);
67} 67}
68 68
69static void nci_rf_field_info_ntf_packet(struct nci_dev *ndev,
70 struct sk_buff *skb)
71{
72 struct nci_rf_field_info_ntf *ntf = (void *) skb->data;
73
74 nfc_dbg("entry, rf_field_status %d", ntf->rf_field_status);
75}
76
77static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev, 69static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
78 struct nci_rf_intf_activated_ntf *ntf, __u8 *data) 70 struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
79{ 71{
@@ -251,6 +243,9 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
251 ndev->rx_data_reassembly = 0; 243 ndev->rx_data_reassembly = 0;
252 } 244 }
253 245
246 /* set the available credits to initial value */
247 atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
248
254 /* complete the data exchange transaction, if exists */ 249 /* complete the data exchange transaction, if exists */
255 if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) 250 if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
256 nci_data_exchange_complete(ndev, NULL, -EIO); 251 nci_data_exchange_complete(ndev, NULL, -EIO);
@@ -274,10 +269,6 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
274 nci_core_conn_credits_ntf_packet(ndev, skb); 269 nci_core_conn_credits_ntf_packet(ndev, skb);
275 break; 270 break;
276 271
277 case NCI_OP_RF_FIELD_INFO_NTF:
278 nci_rf_field_info_ntf_packet(ndev, skb);
279 break;
280
281 case NCI_OP_RF_INTF_ACTIVATED_NTF: 272 case NCI_OP_RF_INTF_ACTIVATED_NTF:
282 nci_rf_intf_activated_ntf_packet(ndev, skb); 273 nci_rf_intf_activated_ntf_packet(ndev, skb);
283 break; 274 break;
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 64fc58a6e28b..0591f5aff89f 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -128,27 +128,6 @@ exit:
128 nci_req_complete(ndev, rsp_1->status); 128 nci_req_complete(ndev, rsp_1->status);
129} 129}
130 130
131static void nci_core_conn_create_rsp_packet(struct nci_dev *ndev,
132 struct sk_buff *skb)
133{
134 struct nci_core_conn_create_rsp *rsp = (void *) skb->data;
135
136 nfc_dbg("entry, status 0x%x", rsp->status);
137
138 if (rsp->status != NCI_STATUS_OK)
139 return;
140
141 ndev->max_pkt_payload_size = rsp->max_pkt_payload_size;
142 ndev->initial_num_credits = rsp->initial_num_credits;
143 ndev->conn_id = rsp->conn_id;
144
145 atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
146
147 nfc_dbg("max_pkt_payload_size %d", ndev->max_pkt_payload_size);
148 nfc_dbg("initial_num_credits %d", ndev->initial_num_credits);
149 nfc_dbg("conn_id %d", ndev->conn_id);
150}
151
152static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev, 131static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
153 struct sk_buff *skb) 132 struct sk_buff *skb)
154{ 133{
@@ -208,10 +187,6 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
208 nci_core_init_rsp_packet(ndev, skb); 187 nci_core_init_rsp_packet(ndev, skb);
209 break; 188 break;
210 189
211 case NCI_OP_CORE_CONN_CREATE_RSP:
212 nci_core_conn_create_rsp_packet(ndev, skb);
213 break;
214
215 case NCI_OP_RF_DISCOVER_MAP_RSP: 190 case NCI_OP_RF_DISCOVER_MAP_RSP:
216 nci_rf_disc_map_rsp_packet(ndev, skb); 191 nci_rf_disc_map_rsp_packet(ndev, skb);
217 break; 192 break;