All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/34] Minor clean & Secure Element support for ST21NFCA/ST21NFCB
@ 2014-12-08 21:08 Christophe Ricard
       [not found] ` <1418072919-10535-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 45+ messages in thread
From: Christophe Ricard @ 2014-12-08 21:08 UTC (permalink / raw)
  To: sameo-VuQAYsv1563Yd54FQh9/CA
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w,
	christophe-h.ricard-qxv4g6HH51o,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Samuel,

I think it is time to drop the ongoing work for Secure Element support for
a first review.

I guess patches #1, #2, #3, #4, #13, #14, #16, #17, #18 and #34 are sanity patches.
May be they could target a second pull request for 3.19 (?)
Most likely:
- #1 and #2 are a resend from the previous patchset trying to not break an
ABI. If you believe they are not necessary, i will understand.
- #3 and #4 are taking into account feedbacks from Dan Carpenter & Julia Lawall.
- #13, #14, #16 and #18 are just sanity patches
- #17 and #34 remove a memory leaks

Secure Element support for HCI based NFC controller:
--------------------------------------------
I am changing a little bit the way pipes and gates are referenced because 1 gate
on the Terminal Host may connect severals differents Host (e.g: UICC, eSE...). 
I chose to reference a pipe with a tuple {gate, host}.
I chose also to keep the gate --> pipe reference with a little drawback:
- se_io will only be able to send data to an eSE (over SWP)... To my knowledge
the aren't any UICC with APDU Reader gate available in the field.

Overall patches:
- #5 to #12 are introducing this pipe referencing changes.
- #15 and #19 are introducing Secure Element complete support for ST21NFCA.

Secure Element support for NCI based NFC controller:
----------------------------------------------------
I have to introduce dynnamic conn_id management has described in the NCI
specification. Only RF static conn_id was supported so far. I have tried to 
do a minimun changeset in order to bring all the necessary NCI functions in
order to operate with a secure element with ST21NFCB NFC controller. Besides the
standard NCI commands, the HCI commands are sent following a proprietary
implementation.

Overall patches:
- #20 to #26 are introducing NCI core changes in order to be able to support
secure element communication.
- #27 is bringing support for HCI protocol allowing to send HCI data over NCI.
- #28 is introducing Secure Element support for ST21NFCB.


Miscellaneous
-------------
I am also routing the HCI event TRANSACTION up to user space. It may help to understand
the necessity to reference every pipe with a tuple {gate, host}. This for example allows 
to keep the host information generating this particular event.

Open Questions:
---------------
Both integration may have little gap in their card emulation behavior.
For example:
- ST21NFCA will have card emulation active as soon as we activate a secure element.
- ST21NFCB will have card emulation active according to the selected polling mode.
When do you expect to have card emulation to be active ?

When an application is running, it might be necessary to signals to the under layers
that it has finished to operate with a particular secure element. The goal here is to release
a secure element without deactivating it. For example to allow automatic sleep mode.
With my current implementation, 
- With ST21NFCB, enable_se/disable_se may fit this request as both secure element are kept activated.
- With ST21NFCA, enable_se/disable_se does not fit this requirement as i am completely deactivating 
the secure element.
I am not sure if the SE activation should not be done in the discovery_se without any deactivation 
until the device remove function(?).

Any feedback are welcome.

Best Regards
Christophe

Christophe Ricard (34):
  NFC: dts: st21nfca: Fix compatible string spelling to follow other
    drivers
  NFC: dts: st21nfcb: Fix compatible string spelling to follow other
    drivers
  NFC: st21nfcb: Fix "WARNING: invalid free of devm_ allocated data"
  NFC: st21nfca: Remove unreachable code
  NFC: hci: Change event_received handler gate parameter to pipe
  NFC: hci: Add pipes table to reference them with a tuple {gate, host}
  NFC: hci: Change nfc_hci_send_response gate parameter to pipe
  NFC: hci: Reference every pipe information according to notification
  NFC: hci: Add cmd_received handler
  NFC: pn544: Change event_received gate parameter to pipe
  NFC: microread: Change event_received gate parameter to pipe
  NFC: hci: Remove nfc_hci_pipe2gate function
  NFC: nfc_enable_se Remove useless blank line at beginning of function
  NFC: nfc_disable_se Remove useless blank line at beginning of function
  NFC: st21nfca: Adding support for secure element
  NFC: st21nfca: Remove useless ST21NFCA_SE_HOST_EVT_HOT_PLUG macro
  NFC: st21nfca: Remove skb_pipe_list and skb_pipe_info useless
    allocation
  NFC: st21nfca: Remove checkpatch.pl warning Possible unnecessary 'out
    of memory' message
  NFC: dts: st21nfca: Document ese-present & uicc-present DTS property
  NFC: nci: Add dynamic conn_id NCI concept.
  NFC: nci: Make nci_request available for nfc driver
  NFC: nci: Add NCI NFCEE constant
  NFC: nci: Add nci_nfcee_discover handler command/response/notification
  NFC: nci: Add nci_nfcee_mode_set handler command/response
  NFC: nci: Add nci_core_conn_create handler command/response
  NFC: nci: Add nci_core_conn_close handler command/response
  NFC: st21nfcb: Add HCI protocol over NCI protocol support
  NFC: st21nfcb: Adding support for secure element
  NFC: Forward NFC_EVT_TRANSACTION up to user space
  NFC: nci: Add support RF_NFCEE_ACTION_NTF
  NFC: nci: Change NCI state machine to LISTEN_ACTIVE and ignore
    parameters in rf_intf_activated_ntf
  NFC: st21nfcb: Add support for HCI event transaction
  NFC: st21nfca: Add support for HCI event transaction
  NFC: st21nfca: Fix some skb memory leaks

 .../devicetree/bindings/net/nfc/st21nfca.txt       |  11 +-
 .../devicetree/bindings/net/nfc/st21nfcb.txt       |   4 +-
 drivers/nfc/microread/microread.c                  |   3 +-
 drivers/nfc/pn544/pn544.c                          |   3 +-
 drivers/nfc/st21nfca/Makefile                      |   2 +-
 drivers/nfc/st21nfca/i2c.c                         |  23 +-
 drivers/nfc/st21nfca/st21nfca.c                    | 186 +++--
 drivers/nfc/st21nfca/st21nfca.h                    |  21 +-
 drivers/nfc/st21nfca/st21nfca_se.c                 | 411 +++++++++++
 drivers/nfc/st21nfca/st21nfca_se.h                 |  63 ++
 drivers/nfc/st21nfcb/Makefile                      |   2 +-
 drivers/nfc/st21nfcb/i2c.c                         |   1 +
 drivers/nfc/st21nfcb/ndlc.c                        |   1 -
 drivers/nfc/st21nfcb/st21nfcb.c                    |   8 +-
 drivers/nfc/st21nfcb/st21nfcb.h                    |   2 +
 drivers/nfc/st21nfcb/st21nfcb_hci_core.c           | 783 +++++++++++++++++++++
 drivers/nfc/st21nfcb/st21nfcb_hci_core.h           | 134 ++++
 drivers/nfc/st21nfcb/st21nfcb_se.c                 | 631 +++++++++++++++++
 drivers/nfc/st21nfcb/st21nfcb_se.h                 |  59 ++
 include/linux/platform_data/st21nfca.h             |   2 +
 include/net/nfc/hci.h                              |  27 +-
 include/net/nfc/nci.h                              |  95 +++
 include/net/nfc/nci_core.h                         |  40 +-
 include/net/nfc/nfc.h                              |  27 +
 include/uapi/linux/nfc.h                           |   1 +
 net/nfc/core.c                                     |  23 +-
 net/nfc/hci/command.c                              |  13 +-
 net/nfc/hci/core.c                                 |  96 ++-
 net/nfc/hci/hci.h                                  |  10 +-
 net/nfc/hci/hcp.c                                  |  11 -
 net/nfc/nci/core.c                                 | 112 ++-
 net/nfc/nci/data.c                                 |  57 +-
 net/nfc/nci/ntf.c                                  |  82 ++-
 net/nfc/nci/rsp.c                                  |  94 ++-
 net/nfc/netlink.c                                  |  47 ++
 net/nfc/nfc.h                                      |   2 +
 36 files changed, 2926 insertions(+), 161 deletions(-)
 create mode 100644 drivers/nfc/st21nfca/st21nfca_se.c
 create mode 100644 drivers/nfc/st21nfca/st21nfca_se.h
 create mode 100644 drivers/nfc/st21nfcb/st21nfcb_hci_core.c
 create mode 100644 drivers/nfc/st21nfcb/st21nfcb_hci_core.h
 create mode 100644 drivers/nfc/st21nfcb/st21nfcb_se.c
 create mode 100644 drivers/nfc/st21nfcb/st21nfcb_se.h

-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2015-01-28  0:04 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 21:08 [PATCH v1 00/34] Minor clean & Secure Element support for ST21NFCA/ST21NFCB Christophe Ricard
     [not found] ` <1418072919-10535-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2014-12-08 21:08   ` [PATCH v1 01/34] NFC: dts: st21nfca: Fix compatible string spelling to follow other drivers Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 02/34] NFC: dts: st21nfcb: " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 03/34] NFC: st21nfcb: Fix "WARNING: invalid free of devm_ allocated data" Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 04/34] NFC: st21nfca: Remove unreachable code Christophe Ricard
     [not found]     ` <1418072919-10535-5-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26  1:10       ` Samuel Ortiz
     [not found]         ` <20150126011001.GB28592-41CF7WKNp/FoDWY/xQGDymt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2015-01-26 23:07           ` christophe.ricard
2014-12-08 21:08   ` [PATCH v1 05/34] NFC: hci: Change event_received handler gate parameter to pipe Christophe Ricard
     [not found]     ` <1418072919-10535-6-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26  1:10       ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 06/34] NFC: hci: Add pipes table to reference them with a tuple {gate, host} Christophe Ricard
     [not found]     ` <1418072919-10535-7-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26  1:11       ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 07/34] NFC: hci: Change nfc_hci_send_response gate parameter to pipe Christophe Ricard
     [not found]     ` <1418072919-10535-8-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26  1:11       ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 08/34] NFC: hci: Reference every pipe information according to notification Christophe Ricard
     [not found]     ` <1418072919-10535-9-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26  1:11       ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 09/34] NFC: hci: Add cmd_received handler Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 10/34] NFC: pn544: Change event_received gate parameter to pipe Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 11/34] NFC: microread: " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 12/34] NFC: hci: Remove nfc_hci_pipe2gate function Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 13/34] NFC: nfc_enable_se Remove useless blank line at beginning of function Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 14/34] NFC: nfc_disable_se " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 15/34] NFC: st21nfca: Adding support for secure element Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 16/34] NFC: st21nfca: Remove useless ST21NFCA_SE_HOST_EVT_HOT_PLUG macro Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 17/34] NFC: st21nfca: Remove skb_pipe_list and skb_pipe_info useless allocation Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 18/34] NFC: st21nfca: Remove checkpatch.pl warning Possible unnecessary 'out of memory' message Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 19/34] NFC: dts: st21nfca: Document ese-present & uicc-present DTS property Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 20/34] NFC: nci: Add dynamic conn_id NCI concept Christophe Ricard
     [not found]     ` <1418072919-10535-21-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-27  0:44       ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 21/34] NFC: nci: Make nci_request available for nfc driver Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 22/34] NFC: nci: Add NCI NFCEE constant Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 23/34] NFC: nci: Add nci_nfcee_discover handler command/response/notification Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 24/34] NFC: nci: Add nci_nfcee_mode_set handler command/response Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 25/34] NFC: nci: Add nci_core_conn_create " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 26/34] NFC: nci: Add nci_core_conn_close " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 27/34] NFC: st21nfcb: Add HCI protocol over NCI protocol support Christophe Ricard
     [not found]     ` <1418072919-10535-28-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-27  0:49       ` Samuel Ortiz
     [not found]         ` <20150127004958.GB31396-41CF7WKNp/FoDWY/xQGDymt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2015-01-27 22:16           ` christophe.ricard
     [not found]             ` <54C80E40.7020707-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-28  0:04               ` Samuel Ortiz
2014-12-08 21:08   ` [PATCH v1 28/34] NFC: st21nfcb: Adding support for secure element Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 29/34] NFC: Forward NFC_EVT_TRANSACTION up to user space Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 30/34] NFC: nci: Add support RF_NFCEE_ACTION_NTF Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 31/34] NFC: nci: Change NCI state machine to LISTEN_ACTIVE and ignore parameters in rf_intf_activated_ntf Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 32/34] NFC: st21nfcb: Add support for HCI event transaction Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 33/34] NFC: st21nfca: " Christophe Ricard
2014-12-08 21:08   ` [PATCH v1 34/34] NFC: st21nfca: Fix some skb memory leaks Christophe Ricard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.