Initialize Tizen 2.3
[adaptation/devices/nfc-plugin-nxp.git] / src / phHciNfc_WI.h
1 /*
2  * Copyright (C) 2010 NXP Semiconductors
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /*!
18 * =========================================================================== *
19 *                                                                             *
20 *                                                                             *
21 * \file  phHciNfc_WI .h                                                       *
22 * \brief HCI wired interface gate Management Routines.                        *
23 *                                                                             *
24 *                                                                             *
25 * Project: NFC-FRI-1.1                                                        *
26 *                                                                             *
27 * $Date: Fri Jan 16 10:33:47 2009 $                                           *
28 * $Author: ravindrau $                                                         *
29 * $Revision: 1.11 $                                                            *
30 * $Aliases: NFC_FRI1.1_WK904_PREP1,NFC_FRI1.1_WK904_R17_1,NFC_FRI1.1_WK906_R18_1,NFC_FRI1.1_WK908_PREP1,NFC_FRI1.1_WK908_R19_1,NFC_FRI1.1_WK910_PREP1,NFC_FRI1.1_WK910_R20_1,NFC_FRI1.1_WK912_PREP1,NFC_FRI1.1_WK912_R21_1,NFC_FRI1.1_WK914_PREP1,NFC_FRI1.1_WK914_R22_1,NFC_FRI1.1_WK914_R22_2,NFC_FRI1.1_WK916_R23_1,NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,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 $                                                                *
31 *                                                                             *
32 * =========================================================================== *
33 */
34 #ifndef PHHCINFC_WI_H
35 #define PHHCINFC_WI_H
36 /*@}*/
37 /**
38  *  \name HCI
39  *
40  * File: \ref phHciNfc_WI.h
41  *
42  */
43 /*@{*/
44 #define PHHCINFC_WIRED_FILEREVISION "$Revision: 1.11 $" /**< \ingroup grp_file_attributes */
45 #define PHHCINFC_WIREDINTERFACE_FILEALIASES  "$Aliases: NFC_FRI1.1_WK904_PREP1,NFC_FRI1.1_WK904_R17_1,NFC_FRI1.1_WK906_R18_1,NFC_FRI1.1_WK908_PREP1,NFC_FRI1.1_WK908_R19_1,NFC_FRI1.1_WK910_PREP1,NFC_FRI1.1_WK910_R20_1,NFC_FRI1.1_WK912_PREP1,NFC_FRI1.1_WK912_R21_1,NFC_FRI1.1_WK914_PREP1,NFC_FRI1.1_WK914_R22_1,NFC_FRI1.1_WK914_R22_2,NFC_FRI1.1_WK916_R23_1,NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,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 */
46 /*@}*/
47
48 /****************************** Header File Inclusion *****************************/
49 #include <phHciNfc_Generic.h>
50 #include <phHciNfc_Emulation.h>
51
52 /******************************* Macro Definitions ********************************/
53
54 /******************** Enumeration and Structure Definition ***********************/
55
56
57 /* enable /disable notifications */
58 typedef enum phHciNfc_WI_Events{
59     eDisableEvents, 
60     eEnableEvents
61 } phHciNfc_WI_Events_t;
62
63 typedef enum phHciNfc_WI_Seq{
64     eWI_PipeOpen        = 0x00U,
65     eWI_SetDefaultMode,
66     eWI_PipeClose
67 } phHciNfc_WI_Seq_t;
68
69 /* Information structure for  WI  Gate */
70 typedef struct phHciNfc_WI_Info{
71
72     /* Pointer to WI gate pipe information */
73     phHciNfc_Pipe_Info_t            *p_pipe_info;
74     /*  WI gate pipe Identifier */
75     uint8_t                         pipe_id;
76     /*  Application ID of the Transaction performed */
77     uint8_t                         aid[MAX_AID_LEN];
78     /*  Default info */
79     uint8_t                         default_type;
80     /* Current WI gate Internal Sequence type   */
81     phHciNfc_WI_Seq_t               current_seq;
82     /*Current WI gate next Sequence ID          */
83     phHciNfc_WI_Seq_t               next_seq;
84     
85 } phHciNfc_WI_Info_t;
86
87 /************************ Function Prototype Declaration *************************/
88 /*!
89  * \brief Allocates the resources required for  WI gate management.
90  *
91  * This function Allocates necessary resources as requiered by WI gate management
92  *
93  * \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
94  *
95  * \retval NFCSTATUS_SUCCESS           Function execution is successful
96  *
97  * \retval NFCSTATUS_INVALID_PARAMETER One or more of the given inputs are not valid
98  */
99 extern
100 NFCSTATUS
101 phHciNfc_WI_Init_Resources(phHciNfc_sContext_t   *psHciContext);
102
103 /**
104 * \ingroup grp_hci_nfc
105 *
106 * \brief Allocates the resources required for  WI gate management.
107 *
108 * This function Allocates necessary resources as requiered by WI gate management
109 *
110 * \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
111 *
112 * \retval NFCSTATUS_SUCCESS           Function execution is successful
113 *
114 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the given inputs are not valid
115 */
116
117 extern
118 NFCSTATUS   
119 phHciNfc_WIMgmt_Initialise(
120                                 phHciNfc_sContext_t     *psHciContext,
121                                 void                    *pHwRef
122                          );
123 /**
124 * \ingroup grp_hci_nfc
125 *
126 * \brief Allocates the resources required for  WI gate management.
127 *
128 * This function Allocates necessary resources as requiered by WI gate management
129 *
130 * \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
131 *
132 * \retval NFCSTATUS_SUCCESS           Function execution is successful
133 *
134 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the given inputs are not valid
135 */
136 extern
137 NFCSTATUS
138 phHciNfc_WI_Update_PipeInfo(
139                                   phHciNfc_sContext_t     *psHciContext,
140                                   uint8_t                 pipeID,
141                                   phHciNfc_Pipe_Info_t    *pPipeInfo
142                                   );
143
144 /**
145 * \ingroup grp_hci_nfc
146 *
147 * \brief Allocates the resources required for  WI gate management.
148 *
149 * This function Allocates necessary resources as requiered by WI gate management
150 *
151 * \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
152 *
153 * \retval NFCSTATUS_SUCCESS           Function execution is successful
154 *
155 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the given inputs are not valid
156 */
157 extern
158 NFCSTATUS
159 phHciNfc_WI_Configure_Mode(
160                                   void                *psHciHandle,
161                                   void                *pHwRef,
162                                   phHal_eSmartMX_Mode_t   cfg_Mode
163                           );
164
165 extern
166 NFCSTATUS
167 phHciNfc_WI_Configure_Notifications(
168                                     void        *psHciHandle,
169                                     void        *pHwRef,
170                                     phHciNfc_WI_Events_t eNotification
171                                 );
172
173 extern
174 NFCSTATUS
175 phHciNfc_WI_Get_PipeID(
176                        phHciNfc_sContext_t        *psHciContext,
177                        uint8_t                    *ppipe_id
178                    );
179
180 extern 
181 NFCSTATUS
182 phHciNfc_WI_Configure_Default(
183                               void                  *psHciHandle,
184                               void                  *pHwRef,
185                               uint8_t               enable_type
186                           );
187
188 extern 
189 NFCSTATUS
190 phHciNfc_WI_Get_Default(
191                         void                  *psHciHandle,
192                         void                  *pHwRef
193                         );
194
195
196 #endif /* #ifndef PHHCINFC_WI_H */
197