* [PATCH 01/30] nfc: st-nci: Fix incorrect spi buffer size
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
@ 2015-10-20 21:47 ` Christophe Ricard
2015-10-20 21:47 ` [PATCH 02/30] nfc: nci: Fix incorrect data chaining when sending data Christophe Ricard
` (16 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:47 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
When sending data over SPI, the maximum expected length is the maximum
nci packet payload + data header size + the frame head room (1 for the
ndlc header) + the frame trail room (0).
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/spi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 598a58c..887d308 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -25,6 +25,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/nfc.h>
+#include <net/nfc/nci.h>
#include <linux/platform_data/st-nci.h>
#include "ndlc.h"
@@ -94,7 +95,8 @@ static int st_nci_spi_write(void *phy_id, struct sk_buff *skb)
struct st_nci_spi_phy *phy = phy_id;
struct spi_device *dev = phy->spi_dev;
struct sk_buff *skb_rx;
- u8 buf[ST_NCI_SPI_MAX_SIZE];
+ u8 buf[ST_NCI_SPI_MAX_SIZE + NCI_DATA_HDR_SIZE +
+ ST_NCI_FRAME_HEADROOM + ST_NCI_FRAME_TAILROOM];
struct spi_transfer spi_xfer = {
.tx_buf = skb->data,
.rx_buf = buf,
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 02/30] nfc: nci: Fix incorrect data chaining when sending data
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
2015-10-20 21:47 ` [PATCH 01/30] nfc: st-nci: Fix incorrect spi buffer size Christophe Ricard
@ 2015-10-20 21:47 ` Christophe Ricard
2015-10-20 21:47 ` [PATCH 03/30] nfc: nci: Fix improper management of HCI return code Christophe Ricard
` (15 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:47 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
When sending HCI data over NCI, cmd information should be present only on
the first packet. Each packet shall be specifically allocated and sent to
the NCI layer.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
net/nfc/nci/hci.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 609f922..bc6b9d5 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -146,18 +146,18 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
if (!conn_info)
return -EPROTO;
- skb = nci_skb_alloc(ndev, 2 + conn_info->max_pkt_payload_len +
+ i = 0;
+ skb = nci_skb_alloc(ndev, conn_info->max_pkt_payload_len +
NCI_DATA_HDR_SIZE, GFP_KERNEL);
if (!skb)
return -ENOMEM;
- skb_reserve(skb, 2 + NCI_DATA_HDR_SIZE);
+ skb_reserve(skb, NCI_DATA_HDR_SIZE + 2);
*skb_push(skb, 1) = data_type;
- i = 0;
- len = conn_info->max_pkt_payload_len;
-
do {
+ len = conn_info->max_pkt_payload_len;
+
/* If last packet add NCI_HFP_NO_CHAINING */
if (i + conn_info->max_pkt_payload_len -
(skb->len + 1) >= data_len) {
@@ -177,9 +177,14 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
return r;
i += len;
+
if (i < data_len) {
- skb_trim(skb, 0);
- skb_pull(skb, len);
+ skb = nci_skb_alloc(ndev, conn_info->max_pkt_payload_len +
+ NCI_DATA_HDR_SIZE, GFP_KERNEL);
+ if (!skb)
+ return -ENOMEM;
+
+ skb_reserve(skb, NCI_DATA_HDR_SIZE + 1);
}
} while (i < data_len);
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 03/30] nfc: nci: Fix improper management of HCI return code
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
2015-10-20 21:47 ` [PATCH 01/30] nfc: st-nci: Fix incorrect spi buffer size Christophe Ricard
2015-10-20 21:47 ` [PATCH 02/30] nfc: nci: Fix incorrect data chaining when sending data Christophe Ricard
@ 2015-10-20 21:47 ` Christophe Ricard
2015-10-20 21:47 ` [PATCH 04/30] nfc: nci: extract pipe value using NCI_HCP_MSG_GET_PIPE Christophe Ricard
` (14 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:47 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
When sending HCI data over NCI, HCI return code is part of the NCI data.
In order to get correctly the HCI return code, we assume the NCI
communication is successful and extract the return code for the nci_hci
functions return code.
This is done because nci_to_errno does not match hci return code value.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
net/nfc/nci/hci.c | 60 ++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 16 deletions(-)
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index bc6b9d5..73afb47 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -101,6 +101,20 @@ struct nci_hcp_packet {
#define NCI_HCP_MSG_GET_CMD(header) (header & 0x3f)
#define NCI_HCP_MSG_GET_PIPE(header) (header & 0x7f)
+static int nci_hci_result_to_errno(u8 result)
+{
+ switch (result) {
+ case NCI_HCI_ANY_OK:
+ return 0;
+ case NCI_HCI_ANY_E_REG_PAR_UNKNOWN:
+ return -EOPNOTSUPP;
+ case NCI_HCI_ANY_E_TIMEOUT:
+ return -ETIME;
+ default:
+ return -1;
+ }
+}
+
/* HCI core */
static void nci_hci_reset_pipes(struct nci_hci_dev *hdev)
{
@@ -217,7 +231,8 @@ int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, u8 cmd,
const u8 *param, size_t param_len,
struct sk_buff **skb)
{
- struct nci_conn_info *conn_info;
+ struct nci_hcp_message *message;
+ struct nci_conn_info *conn_info;
struct nci_data data;
int r;
u8 pipe = ndev->hci_dev->gate2pipe[gate];
@@ -237,9 +252,14 @@ int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, u8 cmd,
r = nci_request(ndev, nci_hci_send_data_req, (unsigned long)&data,
msecs_to_jiffies(NCI_DATA_TIMEOUT));
+ if (r == NCI_STATUS_OK) {
+ message = (struct nci_hcp_message *)conn_info->rx_skb->data;
+ r = nci_hci_result_to_errno(NCI_HCP_MSG_GET_CMD(message->header));
+ skb_pull(conn_info->rx_skb, NCI_HCI_HCP_MESSAGE_HEADER_LEN);
- if (r == NCI_STATUS_OK && skb)
- *skb = conn_info->rx_skb;
+ if (!r && skb)
+ *skb = conn_info->rx_skb;
+ }
return r;
}
@@ -333,9 +353,6 @@ static void nci_hci_resp_received(struct nci_dev *ndev, u8 pipe,
struct nci_conn_info *conn_info;
u8 status = result;
- if (result != NCI_HCI_ANY_OK)
- goto exit;
-
conn_info = ndev->hci_dev->conn_info;
if (!conn_info) {
status = NCI_STATUS_REJECTED;
@@ -345,7 +362,7 @@ static void nci_hci_resp_received(struct nci_dev *ndev, u8 pipe,
conn_info->rx_skb = skb;
exit:
- nci_req_complete(ndev, status);
+ nci_req_complete(ndev, NCI_STATUS_OK);
}
/* Receive hcp message for pipe, with type and cmd.
@@ -400,7 +417,7 @@ void nci_hci_data_received_cb(void *context,
{
struct nci_dev *ndev = (struct nci_dev *)context;
struct nci_hcp_packet *packet;
- u8 pipe, type, instruction;
+ u8 pipe, type;
struct sk_buff *hcp_skb;
struct sk_buff *frag_skb;
int msg_len;
@@ -439,7 +456,7 @@ void nci_hci_data_received_cb(void *context,
*skb_put(hcp_skb, NCI_HCI_HCP_PACKET_HEADER_LEN) = pipe;
skb_queue_walk(&ndev->hci_dev->rx_hcp_frags, frag_skb) {
- msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN;
+ msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN;
memcpy(skb_put(hcp_skb, msg_len), frag_skb->data +
NCI_HCI_HCP_PACKET_HEADER_LEN, msg_len);
}
@@ -457,11 +474,9 @@ void nci_hci_data_received_cb(void *context,
packet = (struct nci_hcp_packet *)hcp_skb->data;
type = NCI_HCP_MSG_GET_TYPE(packet->message.header);
if (type == NCI_HCI_HCP_RESPONSE) {
- pipe = packet->header;
- instruction = NCI_HCP_MSG_GET_CMD(packet->message.header);
- skb_pull(hcp_skb, NCI_HCI_HCP_PACKET_HEADER_LEN +
- NCI_HCI_HCP_MESSAGE_HEADER_LEN);
- nci_hci_hcp_message_rx(ndev, pipe, type, instruction, hcp_skb);
+ pipe = NCI_HCP_MSG_GET_PIPE(packet->header);
+ skb_pull(hcp_skb, NCI_HCI_HCP_PACKET_HEADER_LEN);
+ nci_hci_hcp_message_rx(ndev, pipe, type, NCI_STATUS_OK, hcp_skb);
} else {
skb_queue_tail(&ndev->hci_dev->msg_rx_queue, hcp_skb);
schedule_work(&ndev->hci_dev->msg_rx_work);
@@ -493,6 +508,7 @@ EXPORT_SYMBOL(nci_hci_open_pipe);
int nci_hci_set_param(struct nci_dev *ndev, u8 gate, u8 idx,
const u8 *param, size_t param_len)
{
+ struct nci_hcp_message *message;
struct nci_conn_info *conn_info;
struct nci_data data;
int r;
@@ -525,6 +541,11 @@ int nci_hci_set_param(struct nci_dev *ndev, u8 gate, u8 idx,
r = nci_request(ndev, nci_hci_send_data_req,
(unsigned long)&data,
msecs_to_jiffies(NCI_DATA_TIMEOUT));
+ if (r == NCI_STATUS_OK) {
+ message = (struct nci_hcp_message *)conn_info->rx_skb->data;
+ r = nci_hci_result_to_errno(NCI_HCP_MSG_GET_CMD(message->header));
+ skb_pull(conn_info->rx_skb, NCI_HCI_HCP_MESSAGE_HEADER_LEN);
+ }
kfree(tmp);
return r;
@@ -534,6 +555,7 @@ EXPORT_SYMBOL(nci_hci_set_param);
int nci_hci_get_param(struct nci_dev *ndev, u8 gate, u8 idx,
struct sk_buff **skb)
{
+ struct nci_hcp_message *message;
struct nci_conn_info *conn_info;
struct nci_data data;
int r;
@@ -558,8 +580,14 @@ int nci_hci_get_param(struct nci_dev *ndev, u8 gate, u8 idx,
r = nci_request(ndev, nci_hci_send_data_req, (unsigned long)&data,
msecs_to_jiffies(NCI_DATA_TIMEOUT));
- if (r == NCI_STATUS_OK)
- *skb = conn_info->rx_skb;
+ if (r == NCI_STATUS_OK) {
+ message = (struct nci_hcp_message *)conn_info->rx_skb->data;
+ r = nci_hci_result_to_errno(NCI_HCP_MSG_GET_CMD(message->header));
+ skb_pull(conn_info->rx_skb, NCI_HCI_HCP_MESSAGE_HEADER_LEN);
+
+ if (!r && skb)
+ *skb = conn_info->rx_skb;
+ }
return r;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 04/30] nfc: nci: extract pipe value using NCI_HCP_MSG_GET_PIPE
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (2 preceding siblings ...)
2015-10-20 21:47 ` [PATCH 03/30] nfc: nci: Fix improper management of HCI return code Christophe Ricard
@ 2015-10-20 21:47 ` Christophe Ricard
2015-10-20 21:47 ` [PATCH 08/30] nfc: st-nci: Remove ndev->hci_dev->init_data.gates initialization in load_session Christophe Ricard
` (13 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:47 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
When receiving data in nci_hci_msg_rx_work, extract pipe value using
NCI_HCP_MSG_GET_PIPE macro.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
net/nfc/nci/hci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 73afb47..abe0200 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -400,7 +400,7 @@ static void nci_hci_msg_rx_work(struct work_struct *work)
u8 pipe, type, instruction;
while ((skb = skb_dequeue(&hdev->msg_rx_queue)) != NULL) {
- pipe = skb->data[0];
+ pipe = NCI_HCP_MSG_GET_PIPE(skb->data[0]);
skb_pull(skb, NCI_HCI_HCP_PACKET_HEADER_LEN);
message = (struct nci_hcp_message *)skb->data;
type = NCI_HCP_MSG_GET_TYPE(message->header);
@@ -437,7 +437,7 @@ void nci_hci_data_received_cb(void *context,
/* it's the last fragment. Does it need re-aggregation? */
if (skb_queue_len(&ndev->hci_dev->rx_hcp_frags)) {
- pipe = packet->header & NCI_HCI_FRAGMENT;
+ pipe = NCI_HCP_MSG_GET_PIPE(packet->header);
skb_queue_tail(&ndev->hci_dev->rx_hcp_frags, skb);
msg_len = 0;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 08/30] nfc: st-nci: Remove ndev->hci_dev->init_data.gates initialization in load_session
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (3 preceding siblings ...)
2015-10-20 21:47 ` [PATCH 04/30] nfc: nci: extract pipe value using NCI_HCP_MSG_GET_PIPE Christophe Ricard
@ 2015-10-20 21:47 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 09/30] nfc: st21nfca: Remove hdev->init_data.gates " Christophe Ricard
` (12 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:47 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
ndev->hci_dev->init_data.gates is already initialized in st_nci_hci_network.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/st-nci_se.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index c742ef6..15fb0bb 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -245,9 +245,6 @@ int st_nci_hci_load_session(struct nci_dev *ndev)
kfree_skb(skb_pipe_info);
}
- memcpy(ndev->hci_dev->init_data.gates, st_nci_gates,
- sizeof(st_nci_gates));
-
kfree_skb(skb_pipe_list);
return r;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 09/30] nfc: st21nfca: Remove hdev->init_data.gates initialization in load_session
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (4 preceding siblings ...)
2015-10-20 21:47 ` [PATCH 08/30] nfc: st-nci: Remove ndev->hci_dev->init_data.gates initialization in load_session Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 11/30] nfc: st21nfca: Open NFC_HCI_LINK_MGMT_PIPE Christophe Ricard
` (11 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
hdev->init_data.gates is already initialized in st21nfca_hci_probe.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/st21nfca.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index 0512865..33e1e8f 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -220,7 +220,6 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
}
}
- memcpy(hdev->init_data.gates, st21nfca_gates, sizeof(st21nfca_gates));
free_list:
kfree_skb(skb_pipe_list);
return r;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 11/30] nfc: st21nfca: Open NFC_HCI_LINK_MGMT_PIPE
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (5 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 09/30] nfc: st21nfca: Remove hdev->init_data.gates " Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 12/30] nfc: st-nci: Keep st_nci_gates unchanged in load_session Christophe Ricard
` (10 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
NFC_HCI_LINK_MGMT_PIPE was never open in nfc_hci_load_session.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/st21nfca.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index 33e1e8f..5ff9b33 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -205,22 +205,13 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
}
/*
- * 3 gates have a well known pipe ID.
- * They will never appear in the pipe list
+ * 3 gates have a well known pipe ID. Only NFC_HCI_LINK_MGMT_GATE
+ * is not yet open at this stage.
*/
- if (skb_pipe_list->len + 3 < ARRAY_SIZE(st21nfca_gates)) {
- for (i = skb_pipe_list->len + 3;
- i < ARRAY_SIZE(st21nfca_gates) - 2; i++) {
- r = nfc_hci_connect_gate(hdev,
- NFC_HCI_HOST_CONTROLLER_ID,
- st21nfca_gates[i].gate,
- st21nfca_gates[i].pipe);
- if (r < 0)
- goto free_list;
- }
- }
+ r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID,
+ NFC_HCI_LINK_MGMT_GATE,
+ NFC_HCI_LINK_MGMT_PIPE);
-free_list:
kfree_skb(skb_pipe_list);
return r;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 12/30] nfc: st-nci: Keep st_nci_gates unchanged in load_session
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (6 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 11/30] nfc: st21nfca: Open NFC_HCI_LINK_MGMT_PIPE Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 13/30] nfc: st21nfca: Keep st21nfca_gates " Christophe Ricard
` (9 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
We need to keep initial st_nci_gates values in order for
nci_hci_dev_connect_gates to create and open pipe when necessary.
For example after a firmware update CLF pipes are cleared. Changing pipe
values in st_nci_gates was causing nci_hci_dev_connect_gates not using
accurate pipes value.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/st-nci_se.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index 3ea5384..2a475ce 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -233,13 +233,13 @@ int st_nci_hci_load_session(struct nci_dev *ndev)
if (j < ARRAY_SIZE(st_nci_gates) &&
st_nci_gates[j].gate == dm_pipe_info->dst_gate_id &&
ST_NCI_DM_IS_PIPE_OPEN(dm_pipe_info->pipe_state)) {
- st_nci_gates[j].pipe = pipe_info[2];
+ ndev->hci_dev->init_data.gates[j].pipe = pipe_info[2];
ndev->hci_dev->gate2pipe[st_nci_gates[j].gate] =
- st_nci_gates[j].pipe;
- ndev->hci_dev->pipes[st_nci_gates[j].pipe].gate =
+ pipe_info[2];
+ ndev->hci_dev->pipes[pipe_info[2]].gate =
st_nci_gates[j].gate;
- ndev->hci_dev->pipes[st_nci_gates[j].pipe].host =
+ ndev->hci_dev->pipes[pipe_info[2]].host =
dm_pipe_info->src_host_id;
}
kfree_skb(skb_pipe_info);
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 13/30] nfc: st21nfca: Keep st21nfca_gates unchanged in load_session
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (7 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 12/30] nfc: st-nci: Keep st_nci_gates unchanged in load_session Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 14/30] nfc: st-nci: initialize gate_count in st_nci_hci_network_init Christophe Ricard
` (8 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
We need to keep initial st_nci_gates values in order for
nfc_hci_dev_connect_gates to create and open pipe when necessary.
For example after a firmware update CLF pipes are cleared. Changing pipe
values in st21nfca_gates was causing nfc_hci_dev_connect_gates not using
accurate pipes value.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/st21nfca.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index 5ff9b33..fb0c0ac 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -192,14 +192,14 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
if (j < ARRAY_SIZE(st21nfca_gates) &&
st21nfca_gates[j].gate == info->dst_gate_id &&
ST21NFCA_DM_IS_PIPE_OPEN(info->pipe_state)) {
- st21nfca_gates[j].pipe = pipe_info[2];
+ hdev->init_data.gates[j].pipe = pipe_info[2];
hdev->gate2pipe[st21nfca_gates[j].gate] =
- st21nfca_gates[j].pipe;
- hdev->pipes[st21nfca_gates[j].pipe].gate =
- st21nfca_gates[j].gate;
- hdev->pipes[st21nfca_gates[j].pipe].dest_host =
- info->src_host_id;
+ pipe_info[2];
+ hdev->pipes[pipe_info[2]].gate =
+ st21nfca_gates[j].gate;
+ hdev->pipes[pipe_info[2]].dest_host =
+ info->src_host_id;
}
kfree_skb(skb_pipe_info);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 14/30] nfc: st-nci: initialize gate_count in st_nci_hci_network_init
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (8 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 13/30] nfc: st21nfca: Keep st21nfca_gates " Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 16/30] nfc: st-nci: Change st_nci_gates offset when looking for a pipe in the table Christophe Ricard
` (7 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
When initializing ndev->hci_dev->init_data, only gates field was set.
gate_count needs to be initialized as well.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/st-nci_se.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index 2a475ce..f5409ab 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -537,6 +537,7 @@ static int st_nci_hci_network_init(struct nci_dev *ndev)
if (!conn_info)
goto free_dest_params;
+ ndev->hci_dev->init_data.gate_count = ARRAY_SIZE(st_nci_gates);
memcpy(ndev->hci_dev->init_data.gates, st_nci_gates,
sizeof(st_nci_gates));
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 16/30] nfc: st-nci: Change st_nci_gates offset when looking for a pipe in the table
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (9 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 14/30] nfc: st-nci: initialize gate_count in st_nci_hci_network_init Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 17/30] nfc: st21nfca: Change st21nfca_gates " Christophe Ricard
` (6 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
It is useless to start from index 0 when looking for a gate because only
dynamic pipes are retrieved with ST_NCI_DM_GETINFO(ST_NCI_DM_GETINFO_PIPE_LIST).
The first dynamic pipe is present at index 3.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/st-nci_se.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index 7b94387..a8ae04e 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -229,7 +229,7 @@ int st_nci_hci_load_session(struct nci_dev *ndev)
continue;
}
- for (j = 0; (j < ARRAY_SIZE(st_nci_gates)) &&
+ for (j = 3; (j < ARRAY_SIZE(st_nci_gates)) &&
(st_nci_gates[j].gate != dm_pipe_info->dst_gate_id); j++)
;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 17/30] nfc: st21nfca: Change st21nfca_gates offset when looking for a pipe in the table
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (10 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 16/30] nfc: st-nci: Change st_nci_gates offset when looking for a pipe in the table Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments Christophe Ricard
` (5 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
It is useless to start from index 0 when looking for a gate because only
dynamic pipes are retrieved with ST21NFCA_DM_GETINFO(ST21NFCA_DM_GETINFO_PIPE_LIST).
The first dynamic pipe is present at index 3.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/st21nfca.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index fb0c0ac..0e84ce6 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -87,12 +87,13 @@ static DECLARE_BITMAP(dev_mask, ST21NFCA_NUM_DEVICES);
static struct nfc_hci_gate st21nfca_gates[] = {
{NFC_HCI_ADMIN_GATE, NFC_HCI_ADMIN_PIPE},
+ {NFC_HCI_LINK_MGMT_GATE, NFC_HCI_LINK_MGMT_PIPE},
+ {ST21NFCA_DEVICE_MGNT_GATE, ST21NFCA_DEVICE_MGNT_PIPE},
+
{NFC_HCI_LOOPBACK_GATE, NFC_HCI_INVALID_PIPE},
{NFC_HCI_ID_MGMT_GATE, NFC_HCI_INVALID_PIPE},
- {NFC_HCI_LINK_MGMT_GATE, NFC_HCI_LINK_MGMT_PIPE},
{NFC_HCI_RF_READER_B_GATE, NFC_HCI_INVALID_PIPE},
{NFC_HCI_RF_READER_A_GATE, NFC_HCI_INVALID_PIPE},
- {ST21NFCA_DEVICE_MGNT_GATE, ST21NFCA_DEVICE_MGNT_PIPE},
{ST21NFCA_RF_READER_F_GATE, NFC_HCI_INVALID_PIPE},
{ST21NFCA_RF_READER_14443_3_A_GATE, NFC_HCI_INVALID_PIPE},
{ST21NFCA_RF_READER_ISO15693_GATE, NFC_HCI_INVALID_PIPE},
@@ -185,7 +186,7 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
continue;
}
- for (j = 0; (j < ARRAY_SIZE(st21nfca_gates)) &&
+ for (j = 3; (j < ARRAY_SIZE(st21nfca_gates)) &&
(st21nfca_gates[j].gate != info->dst_gate_id) ; j++)
;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (11 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 17/30] nfc: st21nfca: Change st21nfca_gates " Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-24 6:48 ` Samuel Ortiz
2015-10-20 21:48 ` [PATCH 22/30] nfc: st-nci: Fix host_list verification after secure element activation Christophe Ricard
` (4 subsequent siblings)
17 siblings, 1 reply; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
NFC_CMD_ACTIVATE_TARGET and NFC_ATTR_SE_PARAMS comments are missing.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
include/uapi/linux/nfc.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index dd3f753..399f39f 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -86,6 +86,7 @@
* for this event is the application ID (AID).
* @NFC_CMD_GET_SE: Dump all discovered secure elements from an NFC controller.
* @NFC_CMD_SE_IO: Send/Receive APDUs to/from the selected secure element.
+ * @NFC_CMD_ACTIVATE_TARGET: Request NFC controller to reactivate target.
* @NFC_CMD_VENDOR: Vendor specific command, to be implemented directly
* from the driver in order to support hardware specific operations.
*/
@@ -156,6 +157,7 @@ enum nfc_commands {
* @NFC_ATTR_APDU: Secure element APDU
* @NFC_ATTR_TARGET_ISO15693_DSFID: ISO 15693 Data Storage Format Identifier
* @NFC_ATTR_TARGET_ISO15693_UID: ISO 15693 Unique Identifier
+ * @NFC_ATTR_SE_PARAMS: Parameters data from an evt_transaction
* @NFC_ATTR_VENDOR_ID: NFC manufacturer unique ID, typically an OUI
* @NFC_ATTR_VENDOR_SUBCMD: Vendor specific sub command
* @NFC_ATTR_VENDOR_DATA: Vendor specific data, to be optionally passed
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 22/30] nfc: st-nci: Fix host_list verification after secure element activation
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (12 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 23/30] nfc: st21nfca: " Christophe Ricard
` (3 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
A secure element can be activated in different order. The host_list is
updated keeping a fixed order: <terminal_host_id><uicc_id><ese_id>.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/st-nci_se.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index ee53fc0..8886072 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -419,7 +419,7 @@ static int st_nci_control_se(struct nci_dev *ndev, u8 se_idx,
u8 state)
{
struct st_nci_info *info = nci_get_drvdata(ndev);
- int r;
+ int r, i;
struct sk_buff *sk_host_list;
u8 host_id;
@@ -466,7 +466,10 @@ static int st_nci_control_se(struct nci_dev *ndev, u8 se_idx,
if (r != NCI_HCI_ANY_OK)
return r;
- host_id = sk_host_list->data[sk_host_list->len - 1];
+ for (i = 0; i < sk_host_list->len &&
+ sk_host_list->data[i] != se_idx; i++)
+ ;
+ host_id = sk_host_list->data[i];
kfree_skb(sk_host_list);
if (state == ST_NCI_SE_MODE_ON && host_id == se_idx)
return se_idx;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 23/30] nfc: st21nfca: Fix host_list verification after secure element activation
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (13 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 22/30] nfc: st-nci: Fix host_list verification after secure element activation Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 25/30] nfc: st-nci: Add few code style fixes Christophe Ricard
` (2 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
A secure element can be activated in different order. The host_list is
updated keeping a fixed order: <terminal_host_id><uicc_id><ese_id>.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/st21nfca_se.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/nfc/st21nfca/st21nfca_se.c b/drivers/nfc/st21nfca/st21nfca_se.c
index 3197e9b..0eb42ef 100644
--- a/drivers/nfc/st21nfca/st21nfca_se.c
+++ b/drivers/nfc/st21nfca/st21nfca_se.c
@@ -101,7 +101,7 @@ static int st21nfca_hci_control_se(struct nfc_hci_dev *hdev, u32 se_idx,
u8 state)
{
struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev);
- int r;
+ int r, i;
struct sk_buff *sk_host_list;
u8 se_event, host_id;
@@ -149,7 +149,10 @@ static int st21nfca_hci_control_se(struct nfc_hci_dev *hdev, u32 se_idx,
if (r < 0)
return r;
- host_id = sk_host_list->data[sk_host_list->len - 1];
+ for (i = 0; i < sk_host_list->len &&
+ sk_host_list->data[i] != se_idx; i++)
+ ;
+ host_id = sk_host_list->data[i];
kfree_skb(sk_host_list);
if (state == ST21NFCA_SE_MODE_ON && host_id == se_idx)
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 25/30] nfc: st-nci: Add few code style fixes
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (14 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 23/30] nfc: st21nfca: " Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 26/30] nfc: st21nfca: " Christophe Ricard
2015-10-20 21:48 ` [PATCH 29/30] nfc: st-nci: remove duplicated skb dump Christophe Ricard
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
Add some few code style fixes.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/i2c.c | 2 +-
drivers/nfc/st-nci/st-nci_se.c | 2 +-
net/nfc/nci/hci.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index a2700a6..8b53cdf 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -32,7 +32,7 @@
#define DRIVER_DESC "NCI NFC driver for ST_NCI"
/* ndlc header */
-#define ST_NCI_FRAME_HEADROOM 1
+#define ST_NCI_FRAME_HEADROOM 1
#define ST_NCI_FRAME_TAILROOM 0
#define ST_NCI_I2C_MIN_SIZE 4 /* PCB(1) + NCI Packet header(3) */
diff --git a/drivers/nfc/st-nci/st-nci_se.c b/drivers/nfc/st-nci/st-nci_se.c
index 8886072..3d874a0 100644
--- a/drivers/nfc/st-nci/st-nci_se.c
+++ b/drivers/nfc/st-nci/st-nci_se.c
@@ -64,7 +64,7 @@ struct st_nci_pipe_info {
#define ST_NCI_EVT_SE_HARD_RESET 0x20
#define ST_NCI_EVT_TRANSMIT_DATA 0x10
-#define ST_NCI_EVT_WTX_REQUEST 0x11
+#define ST_NCI_EVT_WTX_REQUEST 0x11
#define ST_NCI_EVT_SE_SOFT_RESET 0x11
#define ST_NCI_EVT_SE_END_OF_APDU_TRANSFER 0x21
#define ST_NCI_EVT_HOT_PLUG 0x03
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 5212ef2..d82fdef 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -405,7 +405,7 @@ static void nci_hci_hcp_message_rx(struct nci_dev *ndev, u8 pipe,
break;
}
- nci_req_complete(ndev, 0);
+ nci_req_complete(ndev, NCI_STATUS_OK);
}
static void nci_hci_msg_rx_work(struct work_struct *work)
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 26/30] nfc: st21nfca: Add few code style fixes
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (15 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 25/30] nfc: st-nci: Add few code style fixes Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
2015-10-20 21:48 ` [PATCH 29/30] nfc: st-nci: remove duplicated skb dump Christophe Ricard
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
Add a minor code style fixes
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st21nfca/i2c.c | 1 +
drivers/nfc/st21nfca/st21nfca.c | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index b2c914b..84c2cb0 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -94,6 +94,7 @@ struct st21nfca_i2c_phy {
int hard_fault;
struct mutex phy_lock;
};
+
static u8 len_seq[] = { 16, 24, 12, 29 };
static u16 wait_tab[] = { 2, 3, 5, 15, 20, 40};
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index 0e84ce6..76ef9cf 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -164,7 +164,6 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
r = nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE,
ST21NFCA_DM_GETINFO, pipe_info,
sizeof(pipe_info), &skb_pipe_info);
-
if (r)
continue;
@@ -984,7 +983,6 @@ int st21nfca_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops,
* persistent info to discriminate 2 identical chips
*/
dev_num = find_first_zero_bit(dev_mask, ST21NFCA_NUM_DEVICES);
-
if (dev_num >= ST21NFCA_NUM_DEVICES)
return -ENODEV;
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 29/30] nfc: st-nci: remove duplicated skb dump
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
` (16 preceding siblings ...)
2015-10-20 21:48 ` [PATCH 26/30] nfc: st21nfca: " Christophe Ricard
@ 2015-10-20 21:48 ` Christophe Ricard
17 siblings, 0 replies; 21+ messages in thread
From: Christophe Ricard @ 2015-10-20 21:48 UTC (permalink / raw)
To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, devicetree,
stable
Remove SPI_DUMP_SKB and I2C_DUMP_SKB as skb is already dumped in ndlc
layer.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
drivers/nfc/st-nci/i2c.c | 11 -----------
drivers/nfc/st-nci/spi.c | 11 -----------
2 files changed, 22 deletions(-)
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 13f5054..3c04f6b 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -58,13 +58,6 @@ struct st_nci_i2c_phy {
struct st_nci_se_status se_status;
};
-#define I2C_DUMP_SKB(info, skb) \
-do { \
- pr_debug("%s:\n", info); \
- print_hex_dump(KERN_DEBUG, "i2c: ", DUMP_PREFIX_OFFSET, \
- 16, 1, (skb)->data, (skb)->len, 0); \
-} while (0)
-
static int st_nci_i2c_enable(void *phy_id)
{
struct st_nci_i2c_phy *phy = phy_id;
@@ -101,8 +94,6 @@ static int st_nci_i2c_write(void *phy_id, struct sk_buff *skb)
struct st_nci_i2c_phy *phy = phy_id;
struct i2c_client *client = phy->i2c_dev;
- I2C_DUMP_SKB("st_nci_i2c_write", skb);
-
if (phy->ndlc->hard_fault != 0)
return phy->ndlc->hard_fault;
@@ -173,8 +164,6 @@ static int st_nci_i2c_read(struct st_nci_i2c_phy *phy,
skb_put(*skb, len);
memcpy((*skb)->data + ST_NCI_I2C_MIN_SIZE, buf, len);
- I2C_DUMP_SKB("i2c frame read", *skb);
-
return 0;
}
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 10404c9..4994f2a 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -59,13 +59,6 @@ struct st_nci_spi_phy {
struct st_nci_se_status se_status;
};
-#define SPI_DUMP_SKB(info, skb) \
-do { \
- pr_debug("%s:\n", info); \
- print_hex_dump(KERN_DEBUG, "spi: ", DUMP_PREFIX_OFFSET, \
- 16, 1, (skb)->data, (skb)->len, 0); \
-} while (0)
-
static int st_nci_spi_enable(void *phy_id)
{
struct st_nci_spi_phy *phy = phy_id;
@@ -110,8 +103,6 @@ static int st_nci_spi_write(void *phy_id, struct sk_buff *skb)
.len = skb->len,
};
- SPI_DUMP_SKB("st_nci_spi_write", skb);
-
if (phy->ndlc->hard_fault != 0)
return phy->ndlc->hard_fault;
@@ -188,8 +179,6 @@ static int st_nci_spi_read(struct st_nci_spi_phy *phy,
skb_put(*skb, len);
memcpy((*skb)->data + ST_NCI_SPI_MIN_SIZE, buf, len);
- SPI_DUMP_SKB("spi frame read", *skb);
-
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments
2015-10-20 21:48 ` [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments Christophe Ricard
@ 2015-10-24 6:48 ` Samuel Ortiz
2015-10-24 6:58 ` Willy Tarreau
0 siblings, 1 reply; 21+ messages in thread
From: Samuel Ortiz @ 2015-10-24 6:48 UTC (permalink / raw)
To: Christophe Ricard; +Cc: linux-nfc, christophe-h.ricard, devicetree, stable
Hi Christophe,
On Tue, Oct 20, 2015 at 11:48:10PM +0200, Christophe Ricard wrote:
> NFC_CMD_ACTIVATE_TARGET and NFC_ATTR_SE_PARAMS comments are missing.
>
> Cc: stable@vger.kernel.org
That's not a stable material.
Cheers,
Samuel.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments
2015-10-24 6:48 ` Samuel Ortiz
@ 2015-10-24 6:58 ` Willy Tarreau
2015-10-24 7:01 ` Willy Tarreau
0 siblings, 1 reply; 21+ messages in thread
From: Willy Tarreau @ 2015-10-24 6:58 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Christophe Ricard, linux-nfc, christophe-h.ricard, devicetree,
stable
Hi Samuel,
On Sat, Oct 24, 2015 at 08:48:41AM +0200, Samuel Ortiz wrote:
> Hi Christophe,
>
> On Tue, Oct 20, 2015 at 11:48:10PM +0200, Christophe Ricard wrote:
> > NFC_CMD_ACTIVATE_TARGET and NFC_ATTR_SE_PARAMS comments are missing.
> >
> > Cc: stable@vger.kernel.org
> That's not a stable material.
Well, if it can help backport fixes later, at least it cannot harm.
Regards,
Willy
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments
2015-10-24 6:58 ` Willy Tarreau
@ 2015-10-24 7:01 ` Willy Tarreau
0 siblings, 0 replies; 21+ messages in thread
From: Willy Tarreau @ 2015-10-24 7:01 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Christophe Ricard, linux-nfc, christophe-h.ricard, devicetree,
stable
On Sat, Oct 24, 2015 at 08:58:52AM +0200, Willy Tarreau wrote:
> Hi Samuel,
>
> On Sat, Oct 24, 2015 at 08:48:41AM +0200, Samuel Ortiz wrote:
> > Hi Christophe,
> >
> > On Tue, Oct 20, 2015 at 11:48:10PM +0200, Christophe Ricard wrote:
> > > NFC_CMD_ACTIVATE_TARGET and NFC_ATTR_SE_PARAMS comments are missing.
> > >
> > > Cc: stable@vger.kernel.org
> > That's not a stable material.
>
> Well, if it can help backport fixes later, at least it cannot harm.
Ah sorry I thought you were objecting against a patch being part of
a stable series under review. Then indeed that's not needed.
Willy
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2015-10-24 7:01 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1445377701-8353-1-git-send-email-christophe-h.ricard@st.com>
2015-10-20 21:47 ` [PATCH 01/30] nfc: st-nci: Fix incorrect spi buffer size Christophe Ricard
2015-10-20 21:47 ` [PATCH 02/30] nfc: nci: Fix incorrect data chaining when sending data Christophe Ricard
2015-10-20 21:47 ` [PATCH 03/30] nfc: nci: Fix improper management of HCI return code Christophe Ricard
2015-10-20 21:47 ` [PATCH 04/30] nfc: nci: extract pipe value using NCI_HCP_MSG_GET_PIPE Christophe Ricard
2015-10-20 21:47 ` [PATCH 08/30] nfc: st-nci: Remove ndev->hci_dev->init_data.gates initialization in load_session Christophe Ricard
2015-10-20 21:48 ` [PATCH 09/30] nfc: st21nfca: Remove hdev->init_data.gates " Christophe Ricard
2015-10-20 21:48 ` [PATCH 11/30] nfc: st21nfca: Open NFC_HCI_LINK_MGMT_PIPE Christophe Ricard
2015-10-20 21:48 ` [PATCH 12/30] nfc: st-nci: Keep st_nci_gates unchanged in load_session Christophe Ricard
2015-10-20 21:48 ` [PATCH 13/30] nfc: st21nfca: Keep st21nfca_gates " Christophe Ricard
2015-10-20 21:48 ` [PATCH 14/30] nfc: st-nci: initialize gate_count in st_nci_hci_network_init Christophe Ricard
2015-10-20 21:48 ` [PATCH 16/30] nfc: st-nci: Change st_nci_gates offset when looking for a pipe in the table Christophe Ricard
2015-10-20 21:48 ` [PATCH 17/30] nfc: st21nfca: Change st21nfca_gates " Christophe Ricard
2015-10-20 21:48 ` [PATCH 19/30] nfc: netlink: Add missing NFC_ATTR comments Christophe Ricard
2015-10-24 6:48 ` Samuel Ortiz
2015-10-24 6:58 ` Willy Tarreau
2015-10-24 7:01 ` Willy Tarreau
2015-10-20 21:48 ` [PATCH 22/30] nfc: st-nci: Fix host_list verification after secure element activation Christophe Ricard
2015-10-20 21:48 ` [PATCH 23/30] nfc: st21nfca: " Christophe Ricard
2015-10-20 21:48 ` [PATCH 25/30] nfc: st-nci: Add few code style fixes Christophe Ricard
2015-10-20 21:48 ` [PATCH 26/30] nfc: st21nfca: " Christophe Ricard
2015-10-20 21:48 ` [PATCH 29/30] nfc: st-nci: remove duplicated skb dump Christophe Ricard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).