2 * Copyright (C) 2010 NXP Semiconductors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * =========================================================================== *
21 * \file phHciNfc_Generic.h *
22 * \brief Common HCI Header for the Generic HCI Management. *
25 * Project: NFC-FRI-1.1 *
27 * $Date: Mon Mar 29 17:34:47 2010 $ *
28 * $Author: ing04880 $ *
30 * $Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
32 * =========================================================================== *
36 #ifndef PHHCINFC_GENERIC_H
37 #define PHHCINFC_GENERIC_H
45 * File: \ref phHciNfc_Generic.h
49 #define PHHCINFC_GENERIC_FILEREVISION "$Revision: 1.73 $" /**< \ingroup grp_file_attributes */
50 #define PHHCINFC_GENERIC_FILEALIASES "$Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $" /**< \ingroup grp_file_attributes */
54 ################################################################################
55 ***************************** Header File Inclusion ****************************
56 ################################################################################
58 #define LOG_TAG "NFC_PLUGIN_NXP_HCI"
59 #include <cutils/log.h>
60 #include <phNfcIoctlCode.h>
61 #include<phNfcInterface.h>
64 ################################################################################
65 ****************************** Macro Definitions *******************************
66 ################################################################################
69 #define Trace_buffer phOsalNfc_DbgTraceBuffer
71 /* HCI TRACE Macros */
72 #if defined(HCI_TRACE)&& !defined(SILENT_HCI)
73 #include <phOsalNfc.h>
75 extern char phOsalNfc_DbgTraceBuffer[];
76 #define MAX_TRACE_BUFFER 150
77 /* #define HCI_PRINT( str ) phOsalNfc_DbgTrace(str) */
78 #define HCI_PRINT( str ) phOsalNfc_DbgString(str)
79 #define HCI_DEBUG(...) LOGD(__VA_ARGS__)
84 #define HCI_PRINT_BUFFER(msg,buf,len) \
86 snprintf(Trace_buffer,MAX_TRACE_BUFFER,"\t %s:",msg); \
87 phOsalNfc_DbgString(Trace_buffer); \
88 phOsalNfc_DbgTrace(buf,len); \
89 phOsalNfc_DbgString("\r"); \
93 #include <phDbgTrace.h>
94 #if defined(PHDBG_TRACES) && !defined(HCI_TRACE)
95 #define HCI_PRINT( str ) PHDBG_INFO(str)
96 #define HCI_DEBUG(str, arg)
97 #define HCI_PRINT_BUFFER(msg,buf,len)
99 #define HCI_PRINT( str )
100 #define HCI_DEBUG(...)
101 #define HCI_PRINT_BUFFER(msg,buf,len)
102 #endif /* #if defined(PHDBG_TRACES) */
103 /* #if defined(PHDBG_INFO) && defined (PHDBG_CRITICAL_ERROR) */
105 #endif /* #if defined(HCI_TRACE) */
111 #define BYTE_SIZE 0x08U
113 /* HCI GET and SET BITS Macros */
114 #define MASK_BITS8(p,l) \
115 ( ( (((uint8_t)(p))+((uint8_t)(l)))<=BYTE_SIZE )? \
116 (~(0xFFU<<((p)+(l))) & (0xFFU<<(p))):(0U) )
118 #define GET_BITS8(num,p,l) \
119 ( ((((uint8_t)(p))+((uint8_t)(l)))<=BYTE_SIZE)? \
120 (((num)& (MASK_BITS8(p,l)))>>(p)):(0U) )
122 #define GET_BITS8(num,p,l) \
123 ( ((((p)+(l))<=BYTE_SIZE))? \
124 (((num)>>(p))& (~(0xFFU<<(l)))):(0U) )
126 #define SET_BITS8(num,p,l,val) \
127 ( ((((uint8_t)(p))+((uint8_t)(l)))<=BYTE_SIZE)? \
128 (((num)& (~MASK_BITS8(p,l)))|((val)<<(p))):(0U))
132 /** \ingroup grp_hci_retval
133 The Corresponding HCI Gate Not Supported.
135 #define NFCSTATUS_HCI_GATE_NOT_SUPPORTED (0x71U)
137 /** \ingroup grp_hci_retval
138 Invalid Command from the HCI Layer
140 #define NFCSTATUS_INVALID_HCI_COMMAND (0x72U)
142 /** \ingroup grp_hci_retval
143 HCI Command not supported . */
144 #define NFCSTATUS_COMMAND_NOT_SUPPORTED (0x73U)
146 /** \ingroup grp_hci_retval
147 Invalide Response from the HCI Layer
149 #define NFCSTATUS_INVALID_HCI_RESPONSE (0x74U)
151 /** \ingroup grp_hci_retval
152 The Invalid Instruction type (Neither Command/Response nor Event ).
154 #define NFCSTATUS_INVALID_HCI_INSTRUCTION (0x75U)
156 /** \ingroup grp_hci_retval
157 The Invalid Instruction type (Neither Command/Response nor Event ).
159 #define NFCSTATUS_INVALID_HCI_INFORMATION (0x76U)
161 /** \ingroup grp_hci_retval
162 The Invalid HCI Sequence.
164 #define NFCSTATUS_INVALID_HCI_SEQUENCE (0x78U)
167 /** \ingroup grp_hci_retval
168 The HCI Error Response with Response code.
170 #define NFCSTATUS_HCI_RESPONSE(code) (code)
173 /* Length of the HCP and the HCP Message Header in Bytes */
174 #define HCP_HEADER_LEN 0x02U
176 /* Length of the HCP Message Header in Bytes */
177 #define HCP_MESSAGE_LEN 0x01U
179 /* HCP Header Chaining Bit Offset */
180 #define HCP_CHAINBIT_OFFSET 0x07U
181 /* HCP Header Chaining Bit Length */
182 #define HCP_CHAINBIT_LEN 0x01U
184 /* Chaining Bit Values */
185 #define HCP_CHAINBIT_DEFAULT 0x01U
186 #define HCP_CHAINBIT_BEGIN 0x00U
187 #define HCP_CHAINBIT_END HCP_CHAINBIT_DEFAULT
189 /* HCP Header Pipe ID Offset */
190 #define HCP_PIPEID_OFFSET 0x00U
191 /* HCP Header Pipe ID Length */
192 #define HCP_PIPEID_LEN 0x07U
194 /* HCP Message Header Type Offset */
195 #define HCP_MSG_TYPE_OFFSET 0x06U
196 /* HCP Message Header Type Length */
197 #define HCP_MSG_TYPE_LEN 0x02U
199 /* HCP Message Type Values */
200 #define HCP_MSG_TYPE_COMMAND 0x00U
201 #define HCP_MSG_TYPE_EVENT 0x01U
202 #define HCP_MSG_TYPE_RESPONSE 0x02U
203 #define HCP_MSG_TYPE_RESERVED 0x03U
205 /* HCP Message Header Instruction Offset */
206 #define HCP_MSG_INSTRUCTION_OFFSET 0x00U
207 /* HCP Message Header Instruction Length */
208 #define HCP_MSG_INSTRUCTION_LEN 0x06U
209 /* HCP Invalid Message Instruction */
210 #define HCP_MSG_INSTRUCTION_INVALID 0x3FU
213 /* HCP Packet Zero Length */
214 #define HCP_ZERO_LEN 0x00U
218 /** \internal Generic HCI Commands for all the Gates */
219 #define ANY_SET_PARAMETER 0x01U
220 #define ANY_GET_PARAMETER 0x02U
221 #define ANY_OPEN_PIPE 0x03U
222 #define ANY_CLOSE_PIPE 0x04U
223 #define ANY_GENERIC_CMD_RFU_B 0x05U
224 #define ANY_GENERIC_CMD_RFU_E 0x0FU
227 * 0x05-0x0F is Reserved for Future Use
230 /** \internal HCI Administration Com mands for the Management of the Host Network */
232 #define ADM_CREATE_PIPE 0x10U
233 #define ADM_DELETE_PIPE 0x11U
234 #define ADM_NOTIFY_PIPE_CREATED 0x12U
235 #define ADM_NOTIFY_PIPE_DELETED 0x13U
236 #define ADM_CLEAR_ALL_PIPE 0x14U
237 #define ADM_NOTIFY_ALL_PIPE_CLEARED 0x15U
238 #define ADM_CMD_RFU_B 0x16U
239 #define ADM_CMD_RFU_E 0x3FU
241 #define MSG_INSTRUCTION_UNKNWON 0x3FU
244 * 0x16-0x3F is Reserved for Future Use
248 /** \internal HCI Generic Responses from the Gates */
250 #define ANY_E_NOT_CONNECTED 0x01U
251 #define ANY_E_CMD_PAR_UNKNOWN 0x02U
252 #define ANY_E_NOK 0x03U
253 #define ANY_E_PIPES_FULL 0x04U
254 #define ANY_E_REG_PAR_UNKNOWN 0x05U
255 #define ANY_E_PIPE_NOT_OPENED 0x06U
256 #define ANY_E_CMD_NOT_SUPPORTED 0x07U
257 #define ANY_E_INHIBITED 0x08U
258 #define ANY_E_TIMEOUT 0x09U
259 #define ANY_E_REG_ACCESS_DENIED 0x0AU
260 #define ANY_E_PIPE_ACCESS_DENIED 0x0BU
262 /* Response Error Code for RF Reader Gate */
263 #define WR_RF_ERROR 0x10U
266 * 0x08, 0x0B-0x3F is Reserved for Future Use
270 /** \internal HCI Generic Events from the Gates */
271 #define EVT_HCI_END_OF_OPERATION 0x01
272 #define EVT_POST_DATA 0x02
273 #define EVT_HOT_PLUG 0x03
276 /* Maximum Buffer Size for the HCI Data */
277 #define PHHCINFC_MAX_BUFFERSIZE (PHHAL_MAX_DATASIZE + 0x50U)
279 #define PHHCINFC_MAX_OPENPIPE 0x6FU
280 #define PHHCINFC_MAX_PIPE 0x6FU
281 #define PHHCINFC_MIN_PIPE 0x02U
284 /* Maximum Payload Length of HCI. */
285 #define PHHCINFC_MAX_PACKET_DATA 0x1CU
286 #define PHHCINFC_MAX_HCP_LEN PHHCINFC_MAX_PACKET_DATA + 1
290 /* Maximum Payload Length of HCI. */
294 ################################################################################
295 ******************** Enumeration and Structure Definition **********************
296 ################################################################################
299 typedef NFCSTATUS (*pphHciNfc_Pipe_Receive_t) (
311 typedef pphNfcIF_Transact_t pphHciNfc_Pipe_Receive_t;
315 /** \defgroup grp_hci_nfc HCI Component
320 typedef enum phHciNfc_HostID {
321 phHciNfc_HostControllerID = 0x00U,
322 phHciNfc_TerminalHostID = 0x01U,
323 phHciNfc_UICCHostID = 0x02U
325 phHciNfc_HostID_RFU_B = 0x03U,
326 phHciNfc_HostID_RFU_E = 0xBFU,
327 phHciNfc_HostIDProprietary_B = 0xC0U,
328 phHciNfc_HostIDProprietary_E = 0xFFU
333 typedef enum phHciNfc_GateID{
334 phHciNfc_AdminGate = 0x00U,
336 phHciNfc_evGateIDProprietary_B = 0x01U,
337 phHciNfc_evGateIDProprietary_E = 0x03U,
339 phHciNfc_LoopBackGate = 0x04U,
340 phHciNfc_IdentityMgmtGate = 0x05U,
341 phHciNfc_LinkMgmtGate = 0x06U,
343 phHciNfc_GateID_RFU_B = 0x07U,
344 phHciNfc_GateID_RFU_E = 0x0FU,
347 /* TODO: Fillin Other Gate Information */
348 /* ETSI HCI Specific RF Reader Gates */
349 phHciNfc_RFReaderAGate = 0x13,
350 phHciNfc_RFReaderBGate = 0x11,
352 /* Proprietary Reader Gate */
353 phHciNfc_ISO15693Gate = 0x12,
354 phHciNfc_RFReaderFGate = 0x14,
355 phHciNfc_JewelReaderGate = 0x15,
357 /* ETSI HCI Card RF Gates */
358 phHciNfc_CETypeBGate = 0x21,
359 phHciNfc_CETypeBPrimeGate = 0x22,
360 phHciNfc_CETypeAGate = 0x23,
361 phHciNfc_CETypeFGate = 0x24,
364 phHciNfc_NFCIP1InitRFGate = 0x30,
365 phHciNfc_NFCIP1TargetRFGate = 0x31,
367 /* ETSI HCI Connectivity Gate */
368 phHciNfc_ConnectivityGate = 0x41,
371 /* Device Configuration Gates */
372 phHciNfc_PN544MgmtGate = 0x90,
373 phHciNfc_HostCommGate = 0x91,
374 phHciNfc_GPIOGate = 0x92,
375 phHciNfc_RFMgmtGate = 0x93,
376 phHciNfc_PollingLoopGate = 0x94,
377 phHciNfc_DownloadMgmtGate = 0x95,
379 /* Card Emulation Managment Gates */
380 phHciNfc_SwpMgmtGate = 0xA0,
381 phHciNfc_NfcWIMgmtGate = 0xA1,
382 phHciNfc_UnknownGate = 0xFF
387 typedef enum phHciNfc_PipeID{
388 HCI_LINKMGMT_PIPE_ID = 0x00U,
389 HCI_ADMIN_PIPE_ID = 0x01U,
390 HCI_DYNAMIC_PIPE_ID = 0x02U,
391 HCI_RESERVED_PIPE_ID = 0x70U,
392 HCI_UNKNOWN_PIPE_ID = PHHCINFC_MAX_PIPE
394 phHciNfc_evOtherGatePipeID_B = 0x02U,
395 phHciNfc_evOtherGatePipeID_E = 0x6FU,
396 phHciNfc_evGatePipeID_RFU_B = 0x70U,
397 phHciNfc_evGatePipeID_RFU_E = 0x7FU,
402 typedef enum phHciNfc_eState {
403 hciState_Reset = 0x00U,
420 typedef enum phHciNfc_eMode {
421 hciMode_Reset = 0x00U,
429 typedef enum phHciNfc_eSeq{
430 /* HCI Admin Sequence */
431 ADMIN_INIT_SEQ = 0x00U,
435 ADMIN_EVT_HOTPLUG_SEQ,
437 /* HCI Link Management Sequence */
441 /* HCI Identity Management Sequence */
446 /* HCI Polling Loop Sequence */
455 /* HCI Device Management Sequence */
461 /* HCI Reader Management Sequence */
462 READER_MGMT_INIT_SEQ,
465 READER_REACTIVATE_SEQ,
467 READER_PRESENCE_CHK_SEQ,
468 READER_UICC_DISPATCH_SEQ,
474 /* HCI NFC-IP1 Sequence */
477 INITIATOR_GENERAL_SEQ,
482 /* HCI Emulation Management Sequence */
485 EMULATION_CONFIG_SEQ,
494 typedef enum phHciNfc_eSeqType{
502 } phHciNfc_eSeqType_t;
505 typedef enum phHciNfc_eConfigType{
517 } phHciNfc_eConfigType_t;
520 typedef struct phHciNfc_HCP_Message{
521 /** \internal Identifies the Type and Kind of Instruction */
523 /** \internal Host Controller Protocol (HCP) Packet Message Payload */
524 uint8_t payload[PHHCINFC_MAX_PACKET_DATA - 1];
525 }phHciNfc_HCP_Message_t;
528 typedef struct phHciNfc_HCP_Packet{
529 /** \internal Chaining Information and Pipe Identifier */
531 /** \internal Host Controller Protocol (HCP) Packet Message or Payload */
534 /** \internal Host Controller Protocol (HCP) Packet Message */
535 phHciNfc_HCP_Message_t message;
536 /** \internal Host Controller Protocol (HCP) Packet Payload */
537 uint8_t payload[PHHCINFC_MAX_PACKET_DATA];
539 }phHciNfc_HCP_Packet_t;
543 typedef struct phHciNfc_Gate_Info{
544 /** \internal HCI Host Identifier */
546 /** \internal HCI Gate Identifier */
548 }phHciNfc_Gate_Info_t;
551 typedef struct phHciNfc_Pipe_Params{
552 /** \internal HCI Source Gate Information for the pipe */
553 phHciNfc_Gate_Info_t source;
554 /** \internal HCI Destination Gate Information for the pipe */
555 phHciNfc_Gate_Info_t dest;
556 /** \internal HCI Pipe Identifier */
558 }phHciNfc_Pipe_Params_t;
561 typedef struct phHciNfc_Pipe_Info{
562 /** \internal Structure containing the created dynamic pipe information */
563 phHciNfc_Pipe_Params_t pipe;
564 /** \internal Status of the previous command sent to this pipe */
565 NFCSTATUS prev_status;
566 /** \internal previous message type Sent to this pipe */
567 uint8_t sent_msg_type;
568 /** \internal Message type Received in this pipe */
569 uint8_t recv_msg_type;
570 /** \internal previous message sent to this pipe */
572 /** \internal Index of the previous Set/Get Parameter command
573 * sent to this pipe */
575 /** \internal length of Parameter of the Set/Get Parameter
576 * command sent to this pipe */
577 uint16_t param_length;
578 /** \internal Parameter of the Set/Get Parameter command
579 * sent to this pipe */
581 /** \internal Pointer to a Pipe specific Receive Response function */
582 pphHciNfc_Pipe_Receive_t recv_resp;
583 /** \internal Pointer to a Pipe specific Receive Event function */
584 pphHciNfc_Pipe_Receive_t recv_event;
585 /** \internal Pointer to a Pipe specific Receive Command function */
586 pphHciNfc_Pipe_Receive_t recv_cmd;
587 }phHciNfc_Pipe_Info_t;
590 typedef struct phHciNfc_sContext{
591 /** \internal HCI Layer Pointer from the upper layer for
592 lower layer function registration */
593 phNfcLayer_sCfg_t *p_hci_layer;
594 /** \internal Pointer to the upper layer context */
595 void *p_upper_context;
596 /** \internal Pointer to the Hardware Reference Sturcture */
597 phHal_sHwReference_t *p_hw_ref;
598 /** \internal Pointer to the upper layer notification callback function */
599 pphNfcIF_Notification_CB_t p_upper_notify;
600 /** \internal Structure to store the lower interface operations */
601 phNfc_sLowerIF_t lower_interface;
602 /** \internal Execution Sequence using the HCI Context */
603 volatile phHciNfc_eSeq_t hci_seq;
605 /** \internal State of the HCI Context */
606 volatile phNfc_sState_t hci_state;
608 /** \internal Mode of HCI Initialisation */
609 phHciNfc_Init_t init_mode;
611 /** \internal Memory Information for HCI Initialisation */
612 uint8_t hal_mem_info[NXP_HAL_MEM_INFO_SIZE];
614 /** \internal HCI Configuration Type */
615 phHciNfc_eConfigType_t config_type;
616 /** \internal HCI SmartMX Mode Configuration */
617 phHal_eSmartMX_Mode_t smx_mode;
618 /** \internal HCI Configuration Information */
619 void *p_config_params;
621 /** \internal Current RF Reader/Emulation Gate in Use */
622 phHal_eRFDevType_t host_rf_type;
624 /** \internal Connected Target Information */
625 phHal_sRemoteDevInformation_t *p_target_info;
627 /** \internal Information of all the pipes created and opened */
628 phHciNfc_Pipe_Info_t *p_pipe_list[PHHCINFC_MAX_PIPE+1];
631 phHciNfc_XchgInfo_t *p_xchg_info;
633 /** \internal Information of the HCI Gates */
634 /** \internal HCI Admin Management Gate Information */
636 /** \internal HCI Link Management Gate Information */
637 void *p_link_mgmt_info;
638 /** \internal HCI Identity Management Gate Information */
639 void *p_identity_info;
640 /** \internal HCI Polling Loop Gate Information */
641 void *p_poll_loop_info;
642 /** \internal HCI NFC Device Management Information */
643 void *p_device_mgmt_info;
644 /** \internal HCI RF Reader Gates Management Information */
645 void *p_reader_mgmt_info;
646 /** \internal HCI Card Application Gates and Emulation
648 void *p_emulation_mgmt_info;
649 /** \internal HCI RF Reader A Gate Information */
650 void *p_reader_a_info;
652 /** \internal HCI RF Reader B Gate Information */
653 void *p_reader_b_info;
656 /** \internal HCI Felica Reader Gate Information */
660 /** \internal HCI Jewel Reader Gate Information */
664 /** \internal HCI ISO15693 Reader Gate Information */
665 void *p_iso_15693_info;
669 /** \internal HCI NFC-IP1 Peer to Peer Information */
672 /** \internal HCI Secure Element Management Information */
674 /** \internal HCI UICC Information */
676 /** \internal HCI SWP Information */
678 #ifdef HOST_EMULATION
679 /** \internal HCI Card Emulation A Gate Information */
681 /** \internal HCI Card Emulation B Gate Information */
685 /** \internal HCI Packet Data to be sent to the lower layer */
686 phHciNfc_HCP_Packet_t tx_packet;
687 /** \internal HCI Packet Data to be received from the lower layer */
688 phHciNfc_HCP_Packet_t rx_packet;
690 /** \internal Previous Status (To Store the Error Status ) */
691 NFCSTATUS error_status;
693 /** \internal Pointer to HCI Send Buffer */
694 uint8_t send_buffer[PHHCINFC_MAX_BUFFERSIZE];
695 /** \internal Pointer to HCI Receive Buffer */
696 uint8_t recv_buffer[PHHCINFC_MAX_BUFFERSIZE];
698 /** \internal Total Number of bytes to be Sent */
699 volatile uint16_t tx_total;
700 /** \internal Number of bytes Remaining to be Sent */
701 volatile uint16_t tx_remain;
702 /** \internal Number of bytes sent */
703 volatile uint16_t tx_sent;
705 volatile uint16_t rx_index;
707 /** \internal Total Number of bytes received */
708 volatile uint16_t rx_total;
709 /** \internal Number of bytes received */
710 volatile uint16_t rx_recvd;
711 /** \internal Index of the received data in the
715 /** \internal Send HCP Chaining Information */
716 volatile uint8_t tx_hcp_chaining;
717 /** \internal Send HCP Fragment Index */
718 volatile uint16_t tx_hcp_frgmnt_index;
720 /** \internal Receive HCP Chaining Information */
721 volatile uint8_t rx_hcp_chaining;
722 /** \internal Receive HCP Fragment Index */
723 volatile uint16_t rx_hcp_frgmnt_index;
725 /** \internal The Device under Test */
726 volatile uint8_t hci_mode;
727 /** \internal Wait for Response if Response is Pending */
728 volatile uint8_t response_pending;
729 /** \internal Notify the Event if Notifcation is Pending */
730 volatile uint8_t event_pending;
732 /** \internal Pending Release of the detected Target */
733 uint8_t target_release;
735 }phHciNfc_sContext_t;
738 ################################################################################
739 *********************** Function Prototype Declaration *************************
740 ################################################################################
746 * \ingroup grp_hci_nfc
748 * The phHciNfc_Receive function receives the HCI Events or Response from the
749 * corresponding peripheral device, described by the HCI Context Structure.
751 * \param[in] psContext psContext is the context of
753 * \param[in] pHwRef pHwRef is the Information of
754 * the Device Interface Link .
755 * \param[out] pdata Pointer to the response buffer that
756 * receives the response read.
757 * \param[in] length Variable that receives
758 * the number of bytes read.
760 * \retval NFCSTATUS_PENDING Data successfully read.
761 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
762 * could not be interpreted properly.
763 * \retval Other errors Other related errors
781 * \ingroup grp_hci_nfc
783 * The phHciNfc_Send_Complete function acknowledges the completion of the HCI
784 * Commands sent to the device.
786 * \param[in] psContext psContext is the context of
788 * \param[in] pHwRef pHwRef is the Information of
789 * the Device Interface Link .
790 * \param[in] pInfo Transaction information like
791 * status and length after the
792 * completion of the send.
800 phHciNfc_Send_Complete (
803 phNfc_sTransactionInfo_t *pInfo
807 * \ingroup grp_hci_nfc
809 * The phHciNfc_Receive_Complete function acknowledges the completion of the HCI
810 * Event Information or Response received from the device.
812 * \param[in] psContext psContext is the context of
814 * \param[in] pHwRef pHwRef is the Information of
815 * the Device Interface Link .
816 * \param[in] pInfo Transaction information like status
817 * data and length after the completely
818 * receiving the response .
826 phHciNfc_Receive_Complete (
829 phNfc_sTransactionInfo_t *pInfo
833 * \ingroup grp_hci_nfc
835 * The phHciNfc_Notify_Event function notifies the occurence of the HCI
836 * Event from the device.
838 * \param[in] psContext psContext is the context of
840 * \param[in] pHwRef pHwRef is the Information of
841 * the Device Interface Link .
842 * \param[in] type reason returned for the notification to
844 * \param[in] pInfo Notification information like status
845 * data,length etc from the lower layer
853 phHciNfc_Notify_Event(
861 * \ingroup grp_hci_nfc
863 * The phHciNfc_Tag_Notify function notifies the the upper layer
864 * with the Tag Specific Notifications .
866 * \param[in] psContext psContext is the context of
868 * \param[in] pHwRef pHwRef is the Information of
869 * the Device Interface Link .
870 * \param[in] type reason returned for the notification to
872 * \param[in] pInfo Notification information like status
873 * data,length etc from the lower layer
881 phHciNfc_sContext_t *psHciContext,
888 * \ingroup grp_hci_nfc
890 * The phHciNfc_Tag_Notify function notifies the the upper layer
891 * with the Tag Specific Notifications .
893 * \param[in] psContext psContext is the context of
895 * \param[in] pHwRef pHwRef is the Information of
896 * the Device Interface Link .
897 * \param[in] type reason returned for the notification to
899 * \param[in] pInfo Notification information like status
900 * data,length etc from the lower layer
908 phHciNfc_Target_Select_Notify(
909 phHciNfc_sContext_t *psHciContext,
917 * \ingroup grp_hci_nfc
919 * The phHciNfc_Transceive_Notify function notifies the the upper layer
920 * with the after the transceive operation.
922 * \param[in] psContext psContext is the context of
924 * \param[in] pHwRef pHwRef is the Information of
925 * the Device Interface Link .
926 * \param[in] type reason returned for the notification to
928 * \param[in] pInfo Notification information like status
929 * data,length etc from the lower layer
936 phHciNfc_Transceive_Notify(
937 phHciNfc_sContext_t *psHciContext,
944 * \ingroup grp_hci_nfc
946 * The phHciNfc_Notify function calls the upper layer notification callback.
948 * \param[in] pUpperNotify pUpperNotify is the notification
949 * callback of the upper HAL Layer.
950 * \param[in] pUpperContext pUpperContext is the context of
951 * the upper HAL Layer.
952 * \param[in] pHwRef pHwRef is the Information of
953 * the Device Interface Link .
954 * \param[in] type type of the notification to
955 * the upper HAL layer.
956 * \param[in] pInfo completion information returned
957 * to the Upper HAL Layer.
958 * NFCSTATUS_SUCCESS Notification successfully completed .
959 * NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
960 * could not be interpreted properly.
961 * Other errors Errors related to the HCI or lower layers
970 pphNfcIF_Notification_CB_t p_upper_notify,
971 void *p_upper_context,
978 * \ingroup grp_hci_nfc
980 * The phHciNfc_Release_Notify function Releases HCI and notifies
983 * \param[in] psHciContext psHciContext is the context of
985 * \param[in] pHwRef pHwRef is the Information of
986 * the Device Interface Link .
987 * \param[in] type reason returned for the notification to
989 * \param[in] pInfo Notification information like status
990 * data,length etc from the lower layer
997 phHciNfc_Release_Notify(
998 phHciNfc_sContext_t *psHciContext,
1007 * \ingroup grp_hci_nfc
1009 * The phHciNfc_Send_Generic_Cmd function sends the HCI Generic Commands
1012 * \param[in] psHciContext psHciContext is the context of
1014 * \param[in] pHwRef pHwRef is the Information of
1015 * the Device Interface Link .
1016 * \param[in] pipe_id The pipe to which the command
1018 * \param[in] cmd The HCI Generic command sent to a
1021 * \retval NFCSTATUS_PENDING HCI Generic Command send in progress .
1023 * NFCSTATUS_INSUFFICIENT_RESOURCES The memory could not be allocated
1024 * as required amount of memory
1025 * is not sufficient.
1031 phHciNfc_Send_Generic_Cmd (
1032 phHciNfc_sContext_t *psHciContext,
1039 * \ingroup grp_hci_nfc
1041 * The phHciNfc_Set_Param function configures the Gate specific register
1042 * with the provided value.
1044 * \param[in] psHciContext psHciContext is the context of
1046 * \param[in] pHwRef pHwRef is the Information of
1047 * the Device Interface Link .
1048 * \param[in] p_pipe_info Pointer to pipe specific information.
1049 * \param[in] reg_index Index of the register to be
1051 * \param[in] p_param Value to the configured in
1052 * particular register.
1053 * \param[in] param_length Length of the parameter provided
1054 * for the configuration.
1056 * \retval NFCSTATUS_PENDING HCI Set parameter in progress .
1058 * NFCSTATUS_INVALID_HCI_INFORMATION The Information like p_pipe_info,
1059 * p_param or param_length is invalid
1065 phHciNfc_Set_Param (
1066 phHciNfc_sContext_t *psHciContext,
1068 phHciNfc_Pipe_Info_t *p_pipe_info,
1071 uint16_t param_length
1075 * \ingroup grp_hci_nfc
1077 * The phHciNfc_Send_HCP function sends the HCI Host Control Packet
1078 * Frames to the device.
1080 * \param[in] psHciContext psHciContext is the context of
1082 * \param[in] pHwRef pHwRef is the Information of
1083 * the Device Interface Link .
1085 * \retval NFCSTATUS_PENDING HCP Frame send pending.
1086 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
1087 * could not be interpreted properly.
1088 * \retval Other errors Other related errors
1096 phHciNfc_sContext_t *psHciContext,
1102 * \ingroup grp_hci_nfc
1104 * The phHciNfc_Build_HCPFrame function initially builds the HCP Packet Frame
1105 * with the values passed in the arguments .
1107 * \param[in] hcp_packet hcp_packet is the frame packet structure
1108 * in which the frame is populated with the
1109 * appropriate fields.
1110 * \param[in] chainbit chainbit specifies whether the following
1111 * HCP frames are chained or the frame is a
1113 * \param[in] pipe_id pipe_id of the pipe to which the frame has
1115 * \param[in] msg_type type of message sent to the pipe.
1116 * \param[in] instruction type of message instruction send to the pipe.
1125 phHciNfc_Build_HCPFrame (
1126 phHciNfc_HCP_Packet_t *hcp_packet,
1134 * \ingroup grp_hci_nfc
1136 * The phHciNfc_Append_HCPFrame function Appends the HCP Packet Frame
1137 * with the values passed in the arguments .
1139 * \param[in] hcp_data hcp_data is the pointer to the HCP
1140 * payload to which the data is to be
1142 * \param[in] hcp_index hcp_index is the index from which
1143 * the data source needs to be appended.
1144 * \param[in] src_data src_data that is to be appended to the
1146 * \param[in] src_len The length of the data source that is
1154 phHciNfc_Append_HCPFrame (
1162 * \ingroup grp_hci_nfc
1164 * The phHciNfc_Allocate_Resource function allocates and initialises the
1165 * resource memory for the HCI layer.
1167 * \param[in] ppBuffer ppBuffer is the pointer to which the
1168 * resource memory is allocated.
1169 * \param[in] size Variable that specifies the size of
1170 * the memory that needs to be created.
1172 * \retval NFCSTATUS_SUCCESS The Resource Memory was allocated
1175 * NFCSTATUS_INSUFFICIENT_RESOURCES The memory could not be allocated
1176 * as required amount of memory
1183 phHciNfc_Allocate_Resource (
1188 * \ingroup grp_hci_nfc
1190 * The phHciNfc_Release_Resources function releases all the resources
1191 * allocated in the HCI Layer.
1193 * \param[in] psHciContext psHciContext is the context of
1202 phHciNfc_Release_Resources (
1203 phHciNfc_sContext_t **ppsHciContext
1207 * \ingroup grp_hci_nfc
1209 * The phHciNfc_Release_Lower function initiates the release of the
1212 * \param[in] psHciContext psHciContext is the context of
1214 * \param[in] pHwRef pHwRef is the Information of
1215 * the Device Interface Link .
1223 phHciNfc_Release_Lower(
1224 phHciNfc_sContext_t *psHciContext,