summaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-03 13:48:04 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2015-02-04 03:09:53 -0500
commit12bdf27d46c9d5e490fa164551642e065105db78 (patch)
tree477d4c54873b2cb6b6b13afb286f004d95ad4c5f /net/nfc
parent26fc6c7f02cb26c39c4733de3dbc3c0646fc1074 (diff)
NFC: nci: Add reference to the RF logical connection
The NCI_STATIC_RF_CONN_ID logical connection is the most used connection. Keeping it directly accessible in the nci_dev structure will simplify and optimize the access. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c2
-rw-r--r--net/nfc/nci/ntf.c6
-rw-r--r--net/nfc/nci/rsp.c4
3 files changed, 5 insertions, 7 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index f74d420e2ead..17ff5f83393c 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -803,7 +803,7 @@ static int nci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
803 int rc; 803 int rc;
804 struct nci_conn_info *conn_info; 804 struct nci_conn_info *conn_info;
805 805
806 conn_info = nci_get_conn_info_by_conn_id(ndev, NCI_STATIC_RF_CONN_ID); 806 conn_info = ndev->rf_conn_info;
807 if (!conn_info) 807 if (!conn_info)
808 return -EPROTO; 808 return -EPROTO;
809 809
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 33f5f00ecf4c..6bbbf6fdacc0 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -625,8 +625,7 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
625 625
626exit: 626exit:
627 if (err == NCI_STATUS_OK) { 627 if (err == NCI_STATUS_OK) {
628 conn_info = nci_get_conn_info_by_conn_id(ndev, 628 conn_info = ndev->rf_conn_info;
629 NCI_STATIC_RF_CONN_ID);
630 if (!conn_info) 629 if (!conn_info)
631 return; 630 return;
632 631
@@ -684,8 +683,7 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
684 683
685 pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason); 684 pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason);
686 685
687 conn_info = 686 conn_info = ndev->rf_conn_info;
688 nci_get_conn_info_by_conn_id(ndev, NCI_STATIC_RF_CONN_ID);
689 if (!conn_info) 687 if (!conn_info)
690 return; 688 return;
691 689
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 31ccf7d05e82..05268eb473df 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -148,8 +148,7 @@ static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
148 if (status == NCI_STATUS_OK) { 148 if (status == NCI_STATUS_OK) {
149 atomic_set(&ndev->state, NCI_DISCOVERY); 149 atomic_set(&ndev->state, NCI_DISCOVERY);
150 150
151 conn_info = nci_get_conn_info_by_conn_id(ndev, 151 conn_info = ndev->rf_conn_info;
152 NCI_STATIC_RF_CONN_ID);
153 if (!conn_info) { 152 if (!conn_info) {
154 conn_info = devm_kzalloc(&ndev->nfc_dev->dev, 153 conn_info = devm_kzalloc(&ndev->nfc_dev->dev,
155 sizeof(struct nci_conn_info), 154 sizeof(struct nci_conn_info),
@@ -161,6 +160,7 @@ static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
161 conn_info->conn_id = NCI_STATIC_RF_CONN_ID; 160 conn_info->conn_id = NCI_STATIC_RF_CONN_ID;
162 INIT_LIST_HEAD(&conn_info->list); 161 INIT_LIST_HEAD(&conn_info->list);
163 list_add(&conn_info->list, &ndev->conn_info_list); 162 list_add(&conn_info->list, &ndev->conn_info_list);
163 ndev->rf_conn_info = conn_info;
164 } 164 }
165 } 165 }
166 166