summaryrefslogtreecommitdiff
path: root/net/nfc/nci/ntf.c
diff options
context:
space:
mode:
authorIlan Elias <ilane@ti.com>2011-12-20 18:57:40 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-01-04 23:30:39 +0400
commit637d85a7cdfe4240a56da7d70cf95cca65ea21d3 (patch)
tree955b49a8a27b871725c0f262f4d475cab59db01c /net/nfc/nci/ntf.c
parentcee0bec58a922976a5f4d70081a3b2fd73e108e9 (diff)
downloadlinux-637d85a7cdfe4240a56da7d70cf95cca65ea21d3.tar.xz
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>
Diffstat (limited to 'net/nfc/nci/ntf.c')
-rw-r--r--net/nfc/nci/ntf.c26
1 files changed, 18 insertions, 8 deletions
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,
/* update the credits */
for (i = 0; i < ntf->num_entries; i++) {
+ ntf->conn_entries[i].conn_id =
+ nci_conn_id(&ntf->conn_entries[i].conn_id);
+
pr_debug("entry[%d]: conn_id %d, credits %d\n",
i, ntf->conn_entries[i].conn_id,
ntf->conn_entries[i].credits);
@@ -147,6 +150,11 @@ static void nci_target_found(struct nci_dev *ndev,
nfc_tgt.supported_protocols);
ndev->target_available_prots = nfc_tgt.supported_protocols;
+ ndev->max_data_pkt_payload_size = ntf->max_data_pkt_payload_size;
+ ndev->initial_num_credits = ntf->initial_num_credits;
+
+ /* set the available credits to initial value */
+ atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1);
}
@@ -162,16 +170,21 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
set_bit(NCI_POLL_ACTIVE, &ndev->flags);
ntf.rf_discovery_id = *data++;
- ntf.rf_interface_type = *data++;
+ ntf.rf_interface = *data++;
ntf.rf_protocol = *data++;
ntf.activation_rf_tech_and_mode = *data++;
+ ntf.max_data_pkt_payload_size = *data++;
+ ntf.initial_num_credits = *data++;
ntf.rf_tech_specific_params_len = *data++;
pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id);
- pr_debug("rf_interface_type 0x%x\n", ntf.rf_interface_type);
+ pr_debug("rf_interface 0x%x\n", ntf.rf_interface);
pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol);
pr_debug("activation_rf_tech_and_mode 0x%x\n",
ntf.activation_rf_tech_and_mode);
+ pr_debug("max_data_pkt_payload_size 0x%x\n",
+ ntf.max_data_pkt_payload_size);
+ pr_debug("initial_num_credits 0x%x\n", ntf.initial_num_credits);
pr_debug("rf_tech_specific_params_len %d\n",
ntf.rf_tech_specific_params_len);
@@ -204,7 +217,7 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
ntf.activation_params_len);
if (ntf.activation_params_len > 0) {
- switch (ntf.rf_interface_type) {
+ switch (ntf.rf_interface) {
case NCI_RF_INTERFACE_ISO_DEP:
err = nci_extract_activation_params_iso_dep(ndev,
&ntf, data);
@@ -215,8 +228,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
break;
default:
- pr_err("unsupported rf_interface_type 0x%x\n",
- ntf.rf_interface_type);
+ pr_err("unsupported rf_interface 0x%x\n",
+ ntf.rf_interface);
return;
}
}
@@ -244,9 +257,6 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
ndev->rx_data_reassembly = 0;
}
- /* set the available credits to initial value */
- atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
-
/* complete the data exchange transaction, if exists */
if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
nci_data_exchange_complete(ndev, NULL, -EIO);