summaryrefslogtreecommitdiff
path: root/net/nfc/nci/hci.c
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-03 19:48:07 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-02-04 09:14:09 +0100
commit15d4a8da0e440faf589a26346c8287e1ed0abe6c (patch)
treed6ddf14215118c72dff898f57b24535e68225878 /net/nfc/nci/hci.c
parent3ba5c8466b320c3fd5d5861b34aa8a31dd0cf6b3 (diff)
NFC: nci: Move logical connection structure allocation
conn_info is currently allocated only after nfcee_discovery_ntf which is not generic enough for logical connection other than NFCEE. The corresponding conn_info is now created in nci_core_conn_create_rsp(). Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci/hci.c')
-rw-r--r--net/nfc/nci/hci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index ecf253942606..ed54ec533836 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -615,12 +615,20 @@ static int nci_hci_dev_connect_gates(struct nci_dev *ndev,
int nci_hci_dev_session_init(struct nci_dev *ndev)
{
+ struct nci_conn_info *conn_info;
struct sk_buff *skb;
int r;
ndev->hci_dev->count_pipes = 0;
ndev->hci_dev->expected_pipes = 0;
+ conn_info = ndev->hci_dev->conn_info;
+ if (!conn_info)
+ return -EPROTO;
+
+ conn_info->data_exchange_cb = nci_hci_data_received_cb;
+ conn_info->data_exchange_cb_context = ndev;
+
nci_hci_reset_pipes(ndev->hci_dev);
if (ndev->hci_dev->init_data.gates[0].gate != NCI_HCI_ADMIN_GATE)