NFC CX Sequence handling

Most non-standard NCI features and extensions implemented by the NFCC firmware from different vendors relate to chipset configuration, firmware download, and hardware tuning. These non-standard extensions can be supported by the NFC client driver by registering for specific driver sequences exposed by the NFC CX. The client driver registers for specific sequence handlers through the NfcCxRegisterSequenceHandler function. It is typically done during initialization and should be invoked after NfcCxDeviceInitialize. These handlers are unregistered by calling NfcCxUnRegisterSequenceHandler during device shutdown. After the client driver's sequence handler callback is invoked, the NFC CX driver will not issue any NCI commands until the NFC client driver finishes its handling. These sequence handler callbacks are designed to be asynchronous, thereby allowing the client to issue any number of I/O requests to the controller before notifying the NFC CX of its completion. NFC CX uses a watchdog timer mechanism to determine hung states. If the watchdog timer expires before the completion of sequence handler by the client, a bug check is triggered and the UMDF host process is terminated by the UMDF framework.

The following are the requirements for the NFC client driver in implementing any additional logic as part of the sequence handler:

  • Any NCI commands sent by the NFC client when handling these sequences should ensure that the integrity of the current state as specified by the NFC CX is not violated. Therefore, NFC client must take care of this requirement to ensure proper functioning of the NFC device. As an example, when handling initialization complete sequence, the client driver should not issue NCI CORE_RESET_CMD to reset the chipset.
  • The NFC client driver needs to ensure that NCI responses and notifications that are generated by the NCI commands it sends down to the controller are not sent to the NFC CX's NfcCxNciReadNotification function. This is required because otherwise the NFC CX NCI state machine would get out of sync with the commands it exchanges with the NFCC.