diff options
author | Ilan Elias <ilane@ti.com> | 2011-12-20 09:57:40 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-04 14:30:39 -0500 |
commit | 637d85a7cdfe4240a56da7d70cf95cca65ea21d3 (patch) | |
tree | 955b49a8a27b871725c0f262f4d475cab59db01c | |
parent | cee0bec58a922976a5f4d70081a3b2fd73e108e9 (diff) |
NFC: Update names and structs to NCI spec 1.0 d22
Addition, deletion, and modification of NCI constants.
Changes in NCI commands, responses, and notifications structures.
Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/nfc/nci.h | 43 | ||||
-rw-r--r-- | include/net/nfc/nci_core.h | 6 | ||||
-rw-r--r-- | net/nfc/nci/core.c | 22 | ||||
-rw-r--r-- | net/nfc/nci/lib.c | 3 | ||||
-rw-r--r-- | net/nfc/nci/ntf.c | 26 | ||||
-rw-r--r-- | net/nfc/nci/rsp.c | 10 |
6 files changed, 49 insertions, 61 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index b61eb6c9df14..2a7fdb265611 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
@@ -54,11 +54,10 @@ | |||
54 | #define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1 | 54 | #define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1 |
55 | #define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2 | 55 | #define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2 |
56 | /* NFCEE Interface Specific Status Codes */ | 56 | /* NFCEE Interface Specific Status Codes */ |
57 | #define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0 | 57 | #define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc0 |
58 | #define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1 | 58 | #define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc1 |
59 | #define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc2 | 59 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 |
60 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc3 | 60 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 |
61 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc4 | ||
62 | 61 | ||
63 | /* NCI RF Technology and Mode */ | 62 | /* NCI RF Technology and Mode */ |
64 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 | 63 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 |
@@ -66,11 +65,13 @@ | |||
66 | #define NCI_NFC_F_PASSIVE_POLL_MODE 0x02 | 65 | #define NCI_NFC_F_PASSIVE_POLL_MODE 0x02 |
67 | #define NCI_NFC_A_ACTIVE_POLL_MODE 0x03 | 66 | #define NCI_NFC_A_ACTIVE_POLL_MODE 0x03 |
68 | #define NCI_NFC_F_ACTIVE_POLL_MODE 0x05 | 67 | #define NCI_NFC_F_ACTIVE_POLL_MODE 0x05 |
68 | #define NCI_NFC_15693_PASSIVE_POLL_MODE 0x06 | ||
69 | #define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80 | 69 | #define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80 |
70 | #define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81 | 70 | #define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81 |
71 | #define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82 | 71 | #define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82 |
72 | #define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 | 72 | #define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 |
73 | #define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 | 73 | #define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 |
74 | #define NCI_NFC_15693_PASSIVE_LISTEN_MODE 0x86 | ||
74 | 75 | ||
75 | /* NCI RF Technologies */ | 76 | /* NCI RF Technologies */ |
76 | #define NCI_NFC_RF_TECHNOLOGY_A 0x00 | 77 | #define NCI_NFC_RF_TECHNOLOGY_A 0x00 |
@@ -83,9 +84,9 @@ | |||
83 | #define NCI_NFC_BIT_RATE_212 0x01 | 84 | #define NCI_NFC_BIT_RATE_212 0x01 |
84 | #define NCI_NFC_BIT_RATE_424 0x02 | 85 | #define NCI_NFC_BIT_RATE_424 0x02 |
85 | #define NCI_NFC_BIT_RATE_848 0x03 | 86 | #define NCI_NFC_BIT_RATE_848 0x03 |
86 | #define NCI_NFC_BIT_RATE_1696 0x04 | 87 | #define NCI_NFC_BIT_RATE_1695 0x04 |
87 | #define NCI_NFC_BIT_RATE_3392 0x05 | 88 | #define NCI_NFC_BIT_RATE_3390 0x05 |
88 | #define NCI_NFC_BIT_RATE_6784 0x06 | 89 | #define NCI_NFC_BIT_RATE_6780 0x06 |
89 | 90 | ||
90 | /* NCI RF Protocols */ | 91 | /* NCI RF Protocols */ |
91 | #define NCI_RF_PROTOCOL_UNKNOWN 0x00 | 92 | #define NCI_RF_PROTOCOL_UNKNOWN 0x00 |
@@ -114,20 +115,6 @@ | |||
114 | /* NCI RF_DISCOVER_MAP_CMD modes */ | 115 | /* NCI RF_DISCOVER_MAP_CMD modes */ |
115 | #define NCI_DISC_MAP_MODE_POLL 0x01 | 116 | #define NCI_DISC_MAP_MODE_POLL 0x01 |
116 | #define NCI_DISC_MAP_MODE_LISTEN 0x02 | 117 | #define NCI_DISC_MAP_MODE_LISTEN 0x02 |
117 | #define NCI_DISC_MAP_MODE_BOTH 0x03 | ||
118 | |||
119 | /* NCI Discovery Types */ | ||
120 | #define NCI_DISCOVERY_TYPE_POLL_A_PASSIVE 0x00 | ||
121 | #define NCI_DISCOVERY_TYPE_POLL_B_PASSIVE 0x01 | ||
122 | #define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02 | ||
123 | #define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03 | ||
124 | #define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05 | ||
125 | #define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09 | ||
126 | #define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80 | ||
127 | #define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81 | ||
128 | #define NCI_DISCOVERY_TYPE_LISTEN_F_PASSIVE 0x82 | ||
129 | #define NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE 0x83 | ||
130 | #define NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE 0x85 | ||
131 | 118 | ||
132 | /* NCI Deactivation Type */ | 119 | /* NCI Deactivation Type */ |
133 | #define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00 | 120 | #define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00 |
@@ -200,7 +187,7 @@ struct nci_core_reset_cmd { | |||
200 | struct disc_map_config { | 187 | struct disc_map_config { |
201 | __u8 rf_protocol; | 188 | __u8 rf_protocol; |
202 | __u8 mode; | 189 | __u8 mode; |
203 | __u8 rf_interface_type; | 190 | __u8 rf_interface; |
204 | } __packed; | 191 | } __packed; |
205 | 192 | ||
206 | struct nci_rf_disc_map_cmd { | 193 | struct nci_rf_disc_map_cmd { |
@@ -211,7 +198,7 @@ struct nci_rf_disc_map_cmd { | |||
211 | 198 | ||
212 | #define NCI_OP_RF_DISCOVER_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | 199 | #define NCI_OP_RF_DISCOVER_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) |
213 | struct disc_config { | 200 | struct disc_config { |
214 | __u8 type; | 201 | __u8 rf_tech_and_mode; |
215 | __u8 frequency; | 202 | __u8 frequency; |
216 | } __packed; | 203 | } __packed; |
217 | 204 | ||
@@ -249,8 +236,6 @@ struct nci_core_init_rsp_2 { | |||
249 | __le16 max_routing_table_size; | 236 | __le16 max_routing_table_size; |
250 | __u8 max_ctrl_pkt_payload_len; | 237 | __u8 max_ctrl_pkt_payload_len; |
251 | __le16 max_size_for_large_params; | 238 | __le16 max_size_for_large_params; |
252 | __u8 max_data_pkt_payload_size; | ||
253 | __u8 initial_num_credits; | ||
254 | __u8 manufact_id; | 239 | __u8 manufact_id; |
255 | __le32 manufact_specific_info; | 240 | __le32 manufact_specific_info; |
256 | } __packed; | 241 | } __packed; |
@@ -264,7 +249,7 @@ struct nci_core_init_rsp_2 { | |||
264 | /* --------------------------- */ | 249 | /* --------------------------- */ |
265 | /* ---- NCI Notifications ---- */ | 250 | /* ---- NCI Notifications ---- */ |
266 | /* --------------------------- */ | 251 | /* --------------------------- */ |
267 | #define NCI_OP_CORE_CONN_CREDITS_NTF nci_opcode_pack(NCI_GID_CORE, 0x07) | 252 | #define NCI_OP_CORE_CONN_CREDITS_NTF nci_opcode_pack(NCI_GID_CORE, 0x06) |
268 | struct conn_credit_entry { | 253 | struct conn_credit_entry { |
269 | __u8 conn_id; | 254 | __u8 conn_id; |
270 | __u8 credits; | 255 | __u8 credits; |
@@ -291,9 +276,11 @@ struct activation_params_nfca_poll_iso_dep { | |||
291 | 276 | ||
292 | struct nci_rf_intf_activated_ntf { | 277 | struct nci_rf_intf_activated_ntf { |
293 | __u8 rf_discovery_id; | 278 | __u8 rf_discovery_id; |
294 | __u8 rf_interface_type; | 279 | __u8 rf_interface; |
295 | __u8 rf_protocol; | 280 | __u8 rf_protocol; |
296 | __u8 activation_rf_tech_and_mode; | 281 | __u8 activation_rf_tech_and_mode; |
282 | __u8 max_data_pkt_payload_size; | ||
283 | __u8 initial_num_credits; | ||
297 | __u8 rf_tech_specific_params_len; | 284 | __u8 rf_tech_specific_params_len; |
298 | 285 | ||
299 | union { | 286 | union { |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index c92b69d7e0c2..bccd89e9d4c2 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
@@ -111,11 +111,13 @@ struct nci_dev { | |||
111 | __u16 max_routing_table_size; | 111 | __u16 max_routing_table_size; |
112 | __u8 max_ctrl_pkt_payload_len; | 112 | __u8 max_ctrl_pkt_payload_len; |
113 | __u16 max_size_for_large_params; | 113 | __u16 max_size_for_large_params; |
114 | __u8 max_data_pkt_payload_size; | ||
115 | __u8 initial_num_credits; | ||
116 | __u8 manufact_id; | 114 | __u8 manufact_id; |
117 | __u32 manufact_specific_info; | 115 | __u32 manufact_specific_info; |
118 | 116 | ||
117 | /* received during NCI_OP_RF_INTF_ACTIVATED_NTF */ | ||
118 | __u8 max_data_pkt_payload_size; | ||
119 | __u8 initial_num_credits; | ||
120 | |||
119 | /* stored during nci_data_exchange */ | 121 | /* stored during nci_data_exchange */ |
120 | data_exchange_cb_t data_exchange_cb; | 122 | data_exchange_cb_t data_exchange_cb; |
121 | void *data_exchange_cb_context; | 123 | void *data_exchange_cb_context; |
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 2deb4aebf568..7650139a1a05 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -154,14 +154,16 @@ static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt) | |||
154 | if (ndev->supported_rf_interfaces[i] == | 154 | if (ndev->supported_rf_interfaces[i] == |
155 | NCI_RF_INTERFACE_ISO_DEP) { | 155 | NCI_RF_INTERFACE_ISO_DEP) { |
156 | cfg[*num].rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; | 156 | cfg[*num].rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; |
157 | cfg[*num].mode = NCI_DISC_MAP_MODE_BOTH; | 157 | cfg[*num].mode = NCI_DISC_MAP_MODE_POLL | |
158 | cfg[*num].rf_interface_type = NCI_RF_INTERFACE_ISO_DEP; | 158 | NCI_DISC_MAP_MODE_LISTEN; |
159 | cfg[*num].rf_interface = NCI_RF_INTERFACE_ISO_DEP; | ||
159 | (*num)++; | 160 | (*num)++; |
160 | } else if (ndev->supported_rf_interfaces[i] == | 161 | } else if (ndev->supported_rf_interfaces[i] == |
161 | NCI_RF_INTERFACE_NFC_DEP) { | 162 | NCI_RF_INTERFACE_NFC_DEP) { |
162 | cfg[*num].rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; | 163 | cfg[*num].rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; |
163 | cfg[*num].mode = NCI_DISC_MAP_MODE_BOTH; | 164 | cfg[*num].mode = NCI_DISC_MAP_MODE_POLL | |
164 | cfg[*num].rf_interface_type = NCI_RF_INTERFACE_NFC_DEP; | 165 | NCI_DISC_MAP_MODE_LISTEN; |
166 | cfg[*num].rf_interface = NCI_RF_INTERFACE_NFC_DEP; | ||
165 | (*num)++; | 167 | (*num)++; |
166 | } | 168 | } |
167 | 169 | ||
@@ -186,16 +188,16 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt) | |||
186 | || protocols & NFC_PROTO_MIFARE_MASK | 188 | || protocols & NFC_PROTO_MIFARE_MASK |
187 | || protocols & NFC_PROTO_ISO14443_MASK | 189 | || protocols & NFC_PROTO_ISO14443_MASK |
188 | || protocols & NFC_PROTO_NFC_DEP_MASK)) { | 190 | || protocols & NFC_PROTO_NFC_DEP_MASK)) { |
189 | cmd.disc_configs[cmd.num_disc_configs].type = | 191 | cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = |
190 | NCI_DISCOVERY_TYPE_POLL_A_PASSIVE; | 192 | NCI_NFC_A_PASSIVE_POLL_MODE; |
191 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; | 193 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; |
192 | cmd.num_disc_configs++; | 194 | cmd.num_disc_configs++; |
193 | } | 195 | } |
194 | 196 | ||
195 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && | 197 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && |
196 | (protocols & NFC_PROTO_ISO14443_MASK)) { | 198 | (protocols & NFC_PROTO_ISO14443_MASK)) { |
197 | cmd.disc_configs[cmd.num_disc_configs].type = | 199 | cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = |
198 | NCI_DISCOVERY_TYPE_POLL_B_PASSIVE; | 200 | NCI_NFC_B_PASSIVE_POLL_MODE; |
199 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; | 201 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; |
200 | cmd.num_disc_configs++; | 202 | cmd.num_disc_configs++; |
201 | } | 203 | } |
@@ -203,8 +205,8 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt) | |||
203 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && | 205 | if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && |
204 | (protocols & NFC_PROTO_FELICA_MASK | 206 | (protocols & NFC_PROTO_FELICA_MASK |
205 | || protocols & NFC_PROTO_NFC_DEP_MASK)) { | 207 | || protocols & NFC_PROTO_NFC_DEP_MASK)) { |
206 | cmd.disc_configs[cmd.num_disc_configs].type = | 208 | cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = |
207 | NCI_DISCOVERY_TYPE_POLL_F_PASSIVE; | 209 | NCI_NFC_F_PASSIVE_POLL_MODE; |
208 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; | 210 | cmd.disc_configs[cmd.num_disc_configs].frequency = 1; |
209 | cmd.num_disc_configs++; | 211 | cmd.num_disc_configs++; |
210 | } | 212 | } |
diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c index e99adcfb1bcf..6a63e5eb483d 100644 --- a/net/nfc/nci/lib.c +++ b/net/nfc/nci/lib.c | |||
@@ -77,9 +77,6 @@ int nci_to_errno(__u8 code) | |||
77 | case NCI_STATUS_NFCEE_TIMEOUT_ERROR: | 77 | case NCI_STATUS_NFCEE_TIMEOUT_ERROR: |
78 | return -ETIMEDOUT; | 78 | return -ETIMEDOUT; |
79 | 79 | ||
80 | case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED: | ||
81 | return -EDQUOT; | ||
82 | |||
83 | case NCI_STATUS_FAILED: | 80 | case NCI_STATUS_FAILED: |
84 | default: | 81 | default: |
85 | return -ENOSYS; | 82 | return -ENOSYS; |
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 003846b2c326..c8813eda7865 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -52,6 +52,9 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, | |||
52 | 52 | ||
53 | /* update the credits */ | 53 | /* update the credits */ |
54 | for (i = 0; i < ntf->num_entries; i++) { | 54 | for (i = 0; i < ntf->num_entries; i++) { |
55 | ntf->conn_entries[i].conn_id = | ||
56 | nci_conn_id(&ntf->conn_entries[i].conn_id); | ||
57 | |||
55 | pr_debug("entry[%d]: conn_id %d, credits %d\n", | 58 | pr_debug("entry[%d]: conn_id %d, credits %d\n", |
56 | i, ntf->conn_entries[i].conn_id, | 59 | i, ntf->conn_entries[i].conn_id, |
57 | ntf->conn_entries[i].credits); | 60 | ntf->conn_entries[i].credits); |
@@ -147,6 +150,11 @@ static void nci_target_found(struct nci_dev *ndev, | |||
147 | nfc_tgt.supported_protocols); | 150 | nfc_tgt.supported_protocols); |
148 | 151 | ||
149 | ndev->target_available_prots = nfc_tgt.supported_protocols; | 152 | ndev->target_available_prots = nfc_tgt.supported_protocols; |
153 | ndev->max_data_pkt_payload_size = ntf->max_data_pkt_payload_size; | ||
154 | ndev->initial_num_credits = ntf->initial_num_credits; | ||
155 | |||
156 | /* set the available credits to initial value */ | ||
157 | atomic_set(&ndev->credits_cnt, ndev->initial_num_credits); | ||
150 | 158 | ||
151 | nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1); | 159 | nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1); |
152 | } | 160 | } |
@@ -162,16 +170,21 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, | |||
162 | set_bit(NCI_POLL_ACTIVE, &ndev->flags); | 170 | set_bit(NCI_POLL_ACTIVE, &ndev->flags); |
163 | 171 | ||
164 | ntf.rf_discovery_id = *data++; | 172 | ntf.rf_discovery_id = *data++; |
165 | ntf.rf_interface_type = *data++; | 173 | ntf.rf_interface = *data++; |
166 | ntf.rf_protocol = *data++; | 174 | ntf.rf_protocol = *data++; |
167 | ntf.activation_rf_tech_and_mode = *data++; | 175 | ntf.activation_rf_tech_and_mode = *data++; |
176 | ntf.max_data_pkt_payload_size = *data++; | ||
177 | ntf.initial_num_credits = *data++; | ||
168 | ntf.rf_tech_specific_params_len = *data++; | 178 | ntf.rf_tech_specific_params_len = *data++; |
169 | 179 | ||
170 | pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id); | 180 | pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id); |
171 | pr_debug("rf_interface_type 0x%x\n", ntf.rf_interface_type); | 181 | pr_debug("rf_interface 0x%x\n", ntf.rf_interface); |
172 | pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol); | 182 | pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol); |
173 | pr_debug("activation_rf_tech_and_mode 0x%x\n", | 183 | pr_debug("activation_rf_tech_and_mode 0x%x\n", |
174 | ntf.activation_rf_tech_and_mode); | 184 | ntf.activation_rf_tech_and_mode); |
185 | pr_debug("max_data_pkt_payload_size 0x%x\n", | ||
186 | ntf.max_data_pkt_payload_size); | ||
187 | pr_debug("initial_num_credits 0x%x\n", ntf.initial_num_credits); | ||
175 | pr_debug("rf_tech_specific_params_len %d\n", | 188 | pr_debug("rf_tech_specific_params_len %d\n", |
176 | ntf.rf_tech_specific_params_len); | 189 | ntf.rf_tech_specific_params_len); |
177 | 190 | ||
@@ -204,7 +217,7 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, | |||
204 | ntf.activation_params_len); | 217 | ntf.activation_params_len); |
205 | 218 | ||
206 | if (ntf.activation_params_len > 0) { | 219 | if (ntf.activation_params_len > 0) { |
207 | switch (ntf.rf_interface_type) { | 220 | switch (ntf.rf_interface) { |
208 | case NCI_RF_INTERFACE_ISO_DEP: | 221 | case NCI_RF_INTERFACE_ISO_DEP: |
209 | err = nci_extract_activation_params_iso_dep(ndev, | 222 | err = nci_extract_activation_params_iso_dep(ndev, |
210 | &ntf, data); | 223 | &ntf, data); |
@@ -215,8 +228,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, | |||
215 | break; | 228 | break; |
216 | 229 | ||
217 | default: | 230 | default: |
218 | pr_err("unsupported rf_interface_type 0x%x\n", | 231 | pr_err("unsupported rf_interface 0x%x\n", |
219 | ntf.rf_interface_type); | 232 | ntf.rf_interface); |
220 | return; | 233 | return; |
221 | } | 234 | } |
222 | } | 235 | } |
@@ -244,9 +257,6 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, | |||
244 | ndev->rx_data_reassembly = 0; | 257 | ndev->rx_data_reassembly = 0; |
245 | } | 258 | } |
246 | 259 | ||
247 | /* set the available credits to initial value */ | ||
248 | atomic_set(&ndev->credits_cnt, ndev->initial_num_credits); | ||
249 | |||
250 | /* complete the data exchange transaction, if exists */ | 260 | /* complete the data exchange transaction, if exists */ |
251 | if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) | 261 | if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) |
252 | nci_data_exchange_complete(ndev, NULL, -EIO); | 262 | nci_data_exchange_complete(ndev, NULL, -EIO); |
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c index 3f444c8a66e9..2840ae2f3615 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c | |||
@@ -86,17 +86,11 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
86 | rsp_2->max_ctrl_pkt_payload_len; | 86 | rsp_2->max_ctrl_pkt_payload_len; |
87 | ndev->max_size_for_large_params = | 87 | ndev->max_size_for_large_params = |
88 | __le16_to_cpu(rsp_2->max_size_for_large_params); | 88 | __le16_to_cpu(rsp_2->max_size_for_large_params); |
89 | ndev->max_data_pkt_payload_size = | ||
90 | rsp_2->max_data_pkt_payload_size; | ||
91 | ndev->initial_num_credits = | ||
92 | rsp_2->initial_num_credits; | ||
93 | ndev->manufact_id = | 89 | ndev->manufact_id = |
94 | rsp_2->manufact_id; | 90 | rsp_2->manufact_id; |
95 | ndev->manufact_specific_info = | 91 | ndev->manufact_specific_info = |
96 | __le32_to_cpu(rsp_2->manufact_specific_info); | 92 | __le32_to_cpu(rsp_2->manufact_specific_info); |
97 | 93 | ||
98 | atomic_set(&ndev->credits_cnt, ndev->initial_num_credits); | ||
99 | |||
100 | pr_debug("nfcc_features 0x%x\n", | 94 | pr_debug("nfcc_features 0x%x\n", |
101 | ndev->nfcc_features); | 95 | ndev->nfcc_features); |
102 | pr_debug("num_supported_rf_interfaces %d\n", | 96 | pr_debug("num_supported_rf_interfaces %d\n", |
@@ -117,10 +111,6 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
117 | ndev->max_ctrl_pkt_payload_len); | 111 | ndev->max_ctrl_pkt_payload_len); |
118 | pr_debug("max_size_for_large_params %d\n", | 112 | pr_debug("max_size_for_large_params %d\n", |
119 | ndev->max_size_for_large_params); | 113 | ndev->max_size_for_large_params); |
120 | pr_debug("max_data_pkt_payload_size %d\n", | ||
121 | ndev->max_data_pkt_payload_size); | ||
122 | pr_debug("initial_num_credits %d\n", | ||
123 | ndev->initial_num_credits); | ||
124 | pr_debug("manufact_id 0x%x\n", | 114 | pr_debug("manufact_id 0x%x\n", |
125 | ndev->manufact_id); | 115 | ndev->manufact_id); |
126 | pr_debug("manufact_specific_info 0x%x\n", | 116 | pr_debug("manufact_specific_info 0x%x\n", |