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>
This commit is contained in:
Christophe Ricard
2015-02-03 19:48:07 +01:00
committed by Samuel Ortiz
parent 3ba5c8466b
commit 15d4a8da0e
5 changed files with 36 additions and 27 deletions

View File

@@ -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)