66 *
77 * author: young jin Park (lucky29.park@samsung.com)
88 * data : 20100129
9- */
9+ */
1010
1111#ifndef __OEM_RIL_SAP_H__
1212#define __OEM_RIL_SAP_H__
1616
1717typedef struct _OemReqDataHdr
1818{
19- char func_id;
20- char sub_func_id;
21- char len;
19+ char func_id;
20+ char sub_func_id;
21+ char len;
2222} __attribute__((packed)) OemReqDataHdr;
2323
2424
2525 * OEM request data(for RIL_REQUEST_OEM_HOOK_RAW)
2626
2727typedef struct _OemReqData
2828{
29- OemReqDataHdr hdr;
30- char *payload;
29+ OemReqDataHdr hdr;
30+ char *payload;
3131} __attribute__((packed)) OemReqData;
3232
3333**/
3434
3535/* -- OEM RIL SAP Main Cmd --*/
36- #define OEM_FUNCTION_ID_SAP 0x14
36+ #define OEM_FUNCTION_ID_SAP 0x14
3737
3838/* -- OEM RIL SAP SUB FUNCTION ID -- */
3939
40- #define OEM_SAP_CONNECT 0x01
40+ #define OEM_SAP_CONNECT 0x01
4141/** OEM_SAP_CONNECT
4242 Req - Format info
4343 1. MSG ID (1 byte)
@@ -51,7 +51,7 @@ typedef struct _OemReqData
5151 1. DISCONNECT TYPE (1 byte)
5252**/
5353
54- #define OEM_SAP_STATUS 0x02
54+ #define OEM_SAP_STATUS 0x02
5555/** OEM_SAP_STATUS
5656 Req - Format info
5757 non.
@@ -63,7 +63,7 @@ typedef struct _OemReqData
6363 1. Card Status (1 byte)
6464**/
6565
66- #define OEM_SAP_READER_STATUS 0x03
66+ #define OEM_SAP_READER_STATUS 0x03
6767/** OEM_SAP_READER_STATUS
6868 Req - Format info
6969 non.
@@ -76,7 +76,7 @@ typedef struct _OemReqData
7676 non.
7777**/
7878
79- #define OEM_SAP_SIM_POWER 0x04
79+ #define OEM_SAP_SIM_POWER 0x04
8080/** OEM_SAP_SIM_POWER
8181 Req - Format info
8282 1. MSG ID (1 byte)
@@ -89,7 +89,7 @@ typedef struct _OemReqData
8989 non.
9090**/
9191
92- #define OEM_SAP_TRANSFER_ATR 0x05
92+ #define OEM_SAP_TRANSFER_ATR 0x05
9393/** OEM_SAP_TRANSFER_ATR
9494 Req - Format info
9595 non.
@@ -103,7 +103,7 @@ typedef struct _OemReqData
103103 non.
104104**/
105105
106- #define OEM_SAP_TRANSFER_APDU 0x06
106+ #define OEM_SAP_TRANSFER_APDU 0x06
107107/** OEM_SAP_TRANSFER_APDU
108108 Req - Format info
109109 1. APDU length(2 byte)
@@ -118,7 +118,7 @@ typedef struct _OemReqData
118118 non.
119119**/
120120
121- #define OEM_SAP_SET_PROTOCOL 0x07
121+ #define OEM_SAP_SET_PROTOCOL 0x07
122122/** OEM_SAP_SET_PROTOCOL
123123 Req - Format info
124124 1. Transport protocol (1 byte)
@@ -130,154 +130,146 @@ typedef struct _OemReqData
130130 non.
131131**/
132132
133-
134133/*MAX_MSG_SIZE */
135- #define MAX_MSG_SIZE 512 // 256->512
134+ #define MAX_MSG_SIZE 512 // 256->512
136135
137136/* MSG_ID Table */
138- #define OEM_SAP_CONNECT_REQ 0x00 /*Client -> Server*/
139- #define OEM_SAP_CONNECT_RESP 0x01 /*Server -> Client */
140- #define OEM_SAP_DISCONNECT_REQ 0x02 /*Client -> Server*/
141- #define OEM_SAP_DISCONNECT_RESP 0x03 /*Server -> Client */
142- #define OEM_SAP_DISCONNECT_IND 0x04 /*Server -> Client */
143- #define OEM_SAP_TRANSFER_APDU_REQ 0x05 /*Client -> Server*/
144- #define OEM_SAP_TRANSFER_APDU_RESP 0x06 /*Server -> Client */
145- #define OEM_SAP_TRANSFER_ATR_REQ 0x07 /*Client -> Server*/
146- #define OEM_SAP_TRANSFER_ATR_RESP 0x08 /*Server -> Client */
147- #define OEM_SAP_POWER_SIM_OFF_REQ 0x09 /*Client -> Server*/
148- #define OEM_SAP_POWER_SIM_OFF_RESP 0x0A /*Server -> Client */
149- #define OEM_SAP_POWER_SIM_ON_REQ 0x0B /*Client -> Server*/
150- #define OEM_SAP_POWER_SIM_ON_RESP 0x0C /*Server -> Client */
151- #define OEM_SAP_RESET_SIM_REQ 0x0D /*Client -> Server*/
152- #define OEM_SAP_RESET_SIM_RESP 0x0E /*Server -> Client */
153- #define OEM_SAP_TRANSFER_CARD_READER_STATUS_REQ 0x0F /*Client -> Server*/
154- #define OEM_SAP_TRANSFER_CARD_READER_STATUS_RESP 0x10 /*Server -> Client */
155- #define OEM_SAP_STATUS_IND 0x11 /*Client -> Server*/
156- #define OEM_SAP_ERROR_RESP 0x12 /*Server -> Client */
157- #define OEM_SAP_SET_TRANSPORT_PROTOCOL_REQ 0x13 /*Client -> Server*/
158- #define OEM_SAP_SET_TRANSPORT_PROTOCOL_RESP 0x14 /*Server -> Client */
137+ #define OEM_SAP_CONNECT_REQ 0x00 /*Client -> Server*/
138+ #define OEM_SAP_CONNECT_RESP 0x01 /*Server -> Client */
139+ #define OEM_SAP_DISCONNECT_REQ 0x02 /*Client -> Server*/
140+ #define OEM_SAP_DISCONNECT_RESP 0x03 /*Server -> Client */
141+ #define OEM_SAP_DISCONNECT_IND 0x04 /*Server -> Client */
142+ #define OEM_SAP_TRANSFER_APDU_REQ 0x05 /*Client -> Server*/
143+ #define OEM_SAP_TRANSFER_APDU_RESP 0x06 /*Server -> Client */
144+ #define OEM_SAP_TRANSFER_ATR_REQ 0x07 /*Client -> Server*/
145+ #define OEM_SAP_TRANSFER_ATR_RESP 0x08 /*Server -> Client */
146+ #define OEM_SAP_POWER_SIM_OFF_REQ 0x09 /*Client -> Server*/
147+ #define OEM_SAP_POWER_SIM_OFF_RESP 0x0A /*Server -> Client */
148+ #define OEM_SAP_POWER_SIM_ON_REQ 0x0B /*Client -> Server*/
149+ #define OEM_SAP_POWER_SIM_ON_RESP 0x0C /*Server -> Client */
150+ #define OEM_SAP_RESET_SIM_REQ 0x0D /*Client -> Server*/
151+ #define OEM_SAP_RESET_SIM_RESP 0x0E /*Server -> Client */
152+ #define OEM_SAP_TRANSFER_CARD_READER_STATUS_REQ 0x0F /*Client -> Server*/
153+ #define OEM_SAP_TRANSFER_CARD_READER_STATUS_RESP 0x10 /*Server -> Client */
154+ #define OEM_SAP_STATUS_IND 0x11 /*Client -> Server*/
155+ #define OEM_SAP_ERROR_RESP 0x12 /*Server -> Client */
156+ #define OEM_SAP_SET_TRANSPORT_PROTOCOL_REQ 0x13 /*Client -> Server*/
157+ #define OEM_SAP_SET_TRANSPORT_PROTOCOL_RESP 0x14 /*Server -> Client */
159158
160159/*CONNECTIN STATUS */
161- #define OEM_SAP_CONNECT_OK 0x00
162- #define OEM_SAP_CONNECT_UNABLE_ESTABLISH 0x01
163- #define OEM_SAP_CONNECT_NOT_SUPPORT_MAX_SIZE 0x02
164- #define OEM_SAP_CONNECT_TOO_SMALL_MAX_SIZE 0x03
160+ #define OEM_SAP_CONNECT_OK 0x00
161+ #define OEM_SAP_CONNECT_UNABLE_ESTABLISH 0x01
162+ #define OEM_SAP_CONNECT_NOT_SUPPORT_MAX_SIZE 0x02
163+ #define OEM_SAP_CONNECT_TOO_SMALL_MAX_SIZE 0x03
165164
166165/*DISCONNECT TYPE */
167- #define OEM_SAP_DISCONNECT_TYPE_GRACEFUL 0x00
168- #define OEM_SAP_DISCONNECT_TYPE_IMMEDIATE 0x01
166+ #define OEM_SAP_DISCONNECT_TYPE_GRACEFUL 0x00
167+ #define OEM_SAP_DISCONNECT_TYPE_IMMEDIATE 0x01
169168
170169/*SAP STATUS */
171- #define OEM_SAP_STATUS_UNKNOWN 0x00
172- #define OEM_SAP_STATUS_NO_SIM 0x01
173- #define OEM_SAP_STATUS_NOT_READY 0x02
174- #define OEM_SAP_STATUS_READY 0x03
175- #define OEM_SAP_STATUS_CONNECTED 0x04
170+ #define OEM_SAP_STATUS_UNKNOWN 0x00
171+ #define OEM_SAP_STATUS_NO_SIM 0x01
172+ #define OEM_SAP_STATUS_NOT_READY 0x02
173+ #define OEM_SAP_STATUS_READY 0x03
174+ #define OEM_SAP_STATUS_CONNECTED 0x04
176175
177176/*CARD STATUS */
178- #define OEM_SAP_CARD_STATUS_UNKNOWN 0x00
179- #define OEM_SAP_CARD_STATUS_RESET 0x01
180- #define OEM_SAP_CARD_STATUS_NOT_ACCESSIBLE 0x02
181- #define OEM_SAP_CARD_STATUS_REMOVED 0x03
182- #define OEM_SAP_CARD_STATUS_INSERTED 0x04
183- #define OEM_SAP_CARD_STATUS_RECOVERED 0x05
177+ #define OEM_SAP_CARD_STATUS_UNKNOWN 0x00
178+ #define OEM_SAP_CARD_STATUS_RESET 0x01
179+ #define OEM_SAP_CARD_STATUS_NOT_ACCESSIBLE 0x02
180+ #define OEM_SAP_CARD_STATUS_REMOVED 0x03
181+ #define OEM_SAP_CARD_STATUS_INSERTED 0x04
182+ #define OEM_SAP_CARD_STATUS_RECOVERED 0x05
184183
185184/*RESULT CODE */
186- #define OEM_SAP_RESULT_OK 0x00
187- #define OEM_SAP_RESULT_NO_REASON 0x01
188- #define OEM_SAP_RESULT_CARD_NOT_ACCESSIBLE 0x02
189- #define OEM_SAP_RESULT_CARD_ALREADY_POWER_OFF 0x03
190- #define OEM_SAP_RESULT_REMOVED 0x04
191- #define OEM_SAP_RESULT_ALREADY_POWER_ON 0x05
192- #define OEM_SAP_RESULT_DATA_NOT_AVAILABLE 0x06
193- #define OEM_SAP_RESULT_NOT_SUPPORT 0x07
185+ #define OEM_SAP_RESULT_OK 0x00
186+ #define OEM_SAP_RESULT_NO_REASON 0x01
187+ #define OEM_SAP_RESULT_CARD_NOT_ACCESSIBLE 0x02
188+ #define OEM_SAP_RESULT_CARD_ALREADY_POWER_OFF 0x03
189+ #define OEM_SAP_RESULT_REMOVED 0x04
190+ #define OEM_SAP_RESULT_ALREADY_POWER_ON 0x05
191+ #define OEM_SAP_RESULT_DATA_NOT_AVAILABLE 0x06
192+ #define OEM_SAP_RESULT_NOT_SUPPORT 0x07
194193
195194/*TRANSPORT PROTOCOL*/
196- #define OEM_SAP_TRANSPORT_PROTOCOL_T_ZERO 0x00
197- #define OEM_SAP_TRANSPORT_PROTOCOL_T_ONE 0x01
198-
195+ #define OEM_SAP_TRANSPORT_PROTOCOL_T_ZERO 0x00
196+ #define OEM_SAP_TRANSPORT_PROTOCOL_T_ONE 0x01
199197
200198typedef struct {
201- uint8_t func_id ;
202- uint8_t cmd ;
203- uint16_t len ;
199+ uint8_t func_id ;
200+ uint8_t cmd ;
201+ uint16_t len ;
204202} __attribute__((packed )) oem_ril_sap_hdr ;
205203
206204typedef struct {
207- uint8_t msg_id ;
205+ uint8_t msg_id ;
208206} __attribute__((packed )) ril_sap_req_sap_connect ;
209207
210-
211208typedef struct {
212- uint16_t apdu_len ;
213- uint8_t apdu [MAX_MSG_SIZE ];
209+ uint16_t apdu_len ;
210+ uint8_t apdu [MAX_MSG_SIZE ];
214211} __attribute__((packed )) ril_sap_req_transfer_apdu ;
215212
216213typedef struct {
217- uint8_t transport_protocol ;
214+ uint8_t transport_protocol ;
218215} __attribute__((packed )) ril_sap_req_transport_protocol ;
219216
220-
221217typedef struct {
222- uint8_t msg_id ;
218+ uint8_t msg_id ;
223219} __attribute__((packed )) ril_sap_req_sim_power ;
224220
225-
226221typedef struct {
227- uint8_t msg_id ;
228- uint8_t connection_status ;
229- uint16_t max_msg_size ;
222+ uint8_t msg_id ;
223+ uint8_t connection_status ;
224+ uint16_t max_msg_size ;
230225} __attribute__((packed )) ril_sap_res_connect ;
231226
232227typedef struct {
233- uint8_t sap_status ;
228+ uint8_t sap_status ;
234229} __attribute__((packed )) ril_sap_res_sap_status ;
235230
236231typedef struct {
237- uint8_t result_code ;
238- uint16_t atr_len ;
239- uint8_t atr [MAX_MSG_SIZE ];
232+ uint8_t result_code ;
233+ uint16_t atr_len ;
234+ uint8_t atr [MAX_MSG_SIZE ];
240235} __attribute__((packed )) ril_sap_res_transfer_atr ;
241236
242237typedef struct {
243- uint8_t result_code ;
244- uint16_t res_apdu_len ;
245- uint8_t res_apdu [MAX_MSG_SIZE ];
238+ uint8_t result_code ;
239+ uint16_t res_apdu_len ;
240+ uint8_t res_apdu [MAX_MSG_SIZE ];
246241} __attribute__((packed )) ril_sap_res_transfer_apdu ;
247242
248243typedef struct {
249- uint8_t result_code ;
244+ uint8_t result_code ;
250245} __attribute__((packed )) ril_sap_res_transport_protocol ;
251246
252247typedef struct {
253- uint8_t msg_id ;
254- uint8_t result_code ;
248+ uint8_t msg_id ;
249+ uint8_t result_code ;
255250} __attribute__((packed )) ril_sap_res_sim_power ;
256251
257252typedef struct {
258- uint8_t result_code ;
259- uint8_t card_reader_status ;
253+ uint8_t result_code ;
254+ uint8_t card_reader_status ;
260255} __attribute__((packed )) ril_sap_res_card_reader_status ;
261256
262257typedef struct {
263- uint8_t disconnect_type ;
258+ uint8_t disconnect_type ;
264259} __attribute__((packed )) unsol_sap_connect ;
265260
266261typedef struct {
267- uint8_t card_status ;
262+ uint8_t card_status ;
268263} __attribute__((packed )) unsol_sap_status ;
269264
270265typedef union {
271- unsol_sap_connect connect ;
272- unsol_sap_status status ;
266+ unsol_sap_connect connect ;
267+ unsol_sap_status status ;
273268} __attribute__((packed )) unsol_sap_parameters ;
274269
275270typedef struct {
276- uint8_t sub_id ;
277- unsol_sap_parameters param ;
271+ uint8_t sub_id ;
272+ unsol_sap_parameters param ;
278273} __attribute__((packed )) unsol_sap_notification ;
279274
280-
281-
282-
283275#endif
0 commit comments