blob: 61fed88cf1c56a9bf836c0a242d4a372e34790cd [file] [log] [blame]
Michael Krufky2e5c1ec82008-05-19 18:56:13 -03001#ifndef __smscoreapi_h__
2#define __smscoreapi_h__
3
Steven Toth955e9ca2008-05-22 15:46:32 -03004/* From sysksyms.h */
5
6#include <linux/version.h>
7#include <linux/device.h>
8#include <linux/list.h>
9#include <linux/mm.h>
10#include <asm/scatterlist.h>
11#include <asm/page.h>
12
13#include <linux/mutex.h>
14
15typedef struct mutex kmutex_t;
16
17#define kmutex_init(_p_) mutex_init(_p_)
18#define kmutex_lock(_p_) mutex_lock(_p_)
19#define kmutex_trylock(_p_) mutex_trylock(_p_)
20#define kmutex_unlock(_p_) mutex_unlock(_p_)
21
22
23/* End sysksyms.h */
24
Michael Krufky2e5c1ec82008-05-19 18:56:13 -030025#ifndef min
26#define min(a,b) (((a) < (b)) ? (a) : (b))
27#endif
28
29#define SMS_ALLOC_ALIGNMENT 128
30#define SMS_DMA_ALIGNMENT 16
31#define SMS_ALIGN_ADDRESS(addr) ((((u32)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
32
33#define SMS_DEVICE_FAMILY2 1
34#define SMS_ROM_NO_RESPONSE 2
35#define SMS_DEVICE_NOT_READY 0x8000000
36
37typedef struct _smscore_device smscore_device_t;
38typedef struct _smscore_client smscore_client_t;
39typedef struct _smscore_buffer smscore_buffer_t;
40
41typedef int (*hotplug_t)(smscore_device_t *coredev, struct device *device, int arrival);
42
43typedef int (*setmode_t)(void *context, int mode);
44typedef void (*detectmode_t)(void *context, int *mode);
45typedef int (*sendrequest_t)(void *context, void *buffer, size_t size);
46typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size);
47typedef int (*preload_t)(void *context);
48typedef int (*postload_t)(void *context);
49
50typedef int (*onresponse_t)(void *context, smscore_buffer_t *cb);
51typedef void (*onremove_t)(void *context);
52
53typedef struct _smscore_buffer
54{
55 // public members, once passed to clients can be changed freely
56 struct list_head entry;
57 int size;
58 int offset;
59
60 // private members, read-only for clients
61 void *p;
62 dma_addr_t phys;
63 unsigned long offset_in_common;
64} *psmscore_buffer_t;
65
66typedef struct _smsdevice_params
67{
68 struct device *device;
69
70 int buffer_size;
71 int num_buffers;
72
73 char devpath[32];
74 unsigned long flags;
75
76 setmode_t setmode_handler;
77 detectmode_t detectmode_handler;
78 sendrequest_t sendrequest_handler;
79 preload_t preload_handler;
80 postload_t postload_handler;
81
82 void *context;
83} smsdevice_params_t;
84
85typedef struct _smsclient_params
86{
87 int initial_id;
88 int data_type;
89 onresponse_t onresponse_handler;
90 onremove_t onremove_handler;
91
92 void *context;
93} smsclient_params_t;
94
Steven Toth9e4fb5e2008-05-22 15:48:54 -030095/* Begin types.h */
96
97// GPIO definitions for antenna frequency domain control (SMS8021)
98#define SMS_ANTENNA_GPIO_0 1
99#define SMS_ANTENNA_GPIO_1 0
100
101#define BW_8_MHZ 0
102#define BW_7_MHZ 1
103#define BW_6_MHZ 2
104#define BW_5_MHZ 3
105#define BW_ISDBT_1SEG 4
106#define BW_ISDBT_3SEG 5
107
108#define MSG_HDR_FLAG_SPLIT_MSG 4
109
110#define MAX_GPIO_PIN_NUMBER 31
111
112#define HIF_TASK 11
113#define SMS_HOST_LIB 150
114#define DVBT_BDA_CONTROL_MSG_ID 201
115
116#define SMS_MAX_PAYLOAD_SIZE 240
117#define SMS_TUNE_TIMEOUT 500
118
119#define MSG_SMS_GPIO_CONFIG_REQ 507
120#define MSG_SMS_GPIO_CONFIG_RES 508
121#define MSG_SMS_GPIO_SET_LEVEL_REQ 509
122#define MSG_SMS_GPIO_SET_LEVEL_RES 510
123#define MSG_SMS_GPIO_GET_LEVEL_REQ 511
124#define MSG_SMS_GPIO_GET_LEVEL_RES 512
125#define MSG_SMS_RF_TUNE_REQ 561
126#define MSG_SMS_RF_TUNE_RES 562
127#define MSG_SMS_INIT_DEVICE_REQ 578
128#define MSG_SMS_INIT_DEVICE_RES 579
129#define MSG_SMS_ADD_PID_FILTER_REQ 601
130#define MSG_SMS_ADD_PID_FILTER_RES 602
131#define MSG_SMS_REMOVE_PID_FILTER_REQ 603
132#define MSG_SMS_REMOVE_PID_FILTER_RES 604
133#define MSG_SMS_DAB_CHANNEL 607
134#define MSG_SMS_GET_PID_FILTER_LIST_REQ 608
135#define MSG_SMS_GET_PID_FILTER_LIST_RES 609
136#define MSG_SMS_GET_STATISTICS_REQ 615
137#define MSG_SMS_GET_STATISTICS_RES 616
138#define MSG_SMS_SET_ANTENNA_CONFIG_REQ 651
139#define MSG_SMS_SET_ANTENNA_CONFIG_RES 652
140#define MSG_SMS_GET_STATISTICS_EX_REQ 653
141#define MSG_SMS_GET_STATISTICS_EX_RES 654
142#define MSG_SMS_SLEEP_RESUME_COMP_IND 655
143#define MSG_SMS_DATA_DOWNLOAD_REQ 660
144#define MSG_SMS_DATA_DOWNLOAD_RES 661
145#define MSG_SMS_SWDOWNLOAD_TRIGGER_REQ 664
146#define MSG_SMS_SWDOWNLOAD_TRIGGER_RES 665
147#define MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ 666
148#define MSG_SMS_SWDOWNLOAD_BACKDOOR_RES 667
149#define MSG_SMS_GET_VERSION_EX_REQ 668
150#define MSG_SMS_GET_VERSION_EX_RES 669
151#define MSG_SMS_SET_CLOCK_OUTPUT_REQ 670
152#define MSG_SMS_I2C_SET_FREQ_REQ 685
153#define MSG_SMS_GENERIC_I2C_REQ 687
154#define MSG_SMS_GENERIC_I2C_RES 688
155#define MSG_SMS_DVBT_BDA_DATA 693
156#define MSG_SW_RELOAD_REQ 697
157#define MSG_SMS_DATA_MSG 699
158#define MSG_SW_RELOAD_START_REQ 702
159#define MSG_SW_RELOAD_START_RES 703
160#define MSG_SW_RELOAD_EXEC_REQ 704
161#define MSG_SW_RELOAD_EXEC_RES 705
162#define MSG_SMS_SPI_INT_LINE_SET_REQ 710
163#define MSG_SMS_ISDBT_TUNE_REQ 776
164#define MSG_SMS_ISDBT_TUNE_RES 777
165
166#define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \
167 (ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \
168 (ptr)->msgLength = len; (ptr)->msgFlags = 0; \
169} while (0)
170#define SMS_INIT_MSG(ptr, type, len) SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)
171
172typedef enum
173{
174 DEVICE_MODE_NONE = -1,
175 DEVICE_MODE_DVBT = 0,
176 DEVICE_MODE_DVBH,
177 DEVICE_MODE_DAB_TDMB,
178 DEVICE_MODE_DAB_TDMB_DABIP,
179 DEVICE_MODE_DVBT_BDA,
180 DEVICE_MODE_ISDBT,
181 DEVICE_MODE_ISDBT_BDA,
182 DEVICE_MODE_CMMB,
183 DEVICE_MODE_RAW_TUNER,
184 DEVICE_MODE_MAX,
185} SMS_DEVICE_MODE;
186
187typedef unsigned char UINT8;
188typedef unsigned short UINT16;
189typedef unsigned int UINT32;
190typedef int INT32;
191
192typedef struct SmsMsgHdr_S
193{
194 UINT16 msgType;
195 UINT8 msgSrcId;
196 UINT8 msgDstId;
197 UINT16 msgLength; // Length is of the entire message, including header
198 UINT16 msgFlags;
199} SmsMsgHdr_ST;
200
201typedef struct SmsMsgData_S
202{
203 SmsMsgHdr_ST xMsgHeader;
204 UINT32 msgData[1];
205} SmsMsgData_ST;
206
207typedef struct SmsDataDownload_S
208{
209 SmsMsgHdr_ST xMsgHeader;
210 UINT32 MemAddr;
211 UINT8 Payload[SMS_MAX_PAYLOAD_SIZE];
212} SmsDataDownload_ST;
213
214typedef struct SmsVersionRes_S
215{
216 SmsMsgHdr_ST xMsgHeader;
217
218 UINT16 ChipModel; // e.g. 0x1102 for SMS-1102 "Nova"
219 UINT8 Step; // 0 - Step A
220 UINT8 MetalFix; // 0 - Metal 0
221
222 UINT8 FirmwareId; // 0xFF � ROM, otherwise the value indicated by SMSHOSTLIB_DEVICE_MODES_E
223 UINT8 SupportedProtocols; // Bitwise OR combination of supported protocols
224
225 UINT8 VersionMajor;
226 UINT8 VersionMinor;
227 UINT8 VersionPatch;
228 UINT8 VersionFieldPatch;
229
230 UINT8 RomVersionMajor;
231 UINT8 RomVersionMinor;
232 UINT8 RomVersionPatch;
233 UINT8 RomVersionFieldPatch;
234
235 UINT8 TextLabel[34];
236} SmsVersionRes_ST;
237
238typedef struct SmsFirmware_S
239{
240 UINT32 CheckSum;
241 UINT32 Length;
242 UINT32 StartAddress;
243 UINT8 Payload[1];
244} SmsFirmware_ST;
245
246typedef struct SMSHOSTLIB_STATISTICS_S
247{
248 UINT32 Reserved; //!< Reserved
249
250 /// Common parameters
251 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
252 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
253 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
254
255 /// Reception quality
256 INT32 SNR; //!< dB
257 UINT32 BER; //!< Post Viterbi BER [1E-5]
258 UINT32 FIB_CRC; //!< CRC errors percentage, valid only for DAB
259 UINT32 TS_PER; //!< Transport stream PER, 0xFFFFFFFF indicate N/A, valid only for DVB-T/H
260 UINT32 MFER; //!< DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H
261 INT32 RSSI; //!< dBm
262 INT32 InBandPwr; //!< In band power in dBM
263 INT32 CarrierOffset; //!< Carrier Offset in bin/1024
264
265 /// Transmission parameters
266 UINT32 Frequency; //!< Frequency in Hz
267 UINT32 Bandwidth; //!< Bandwidth in MHz, valid only for DVB-T/H
268 UINT32 TransmissionMode; //!< Transmission Mode, for DAB modes 1-4, for DVB-T/H FFT mode carriers in Kilos
269 UINT32 ModemState; //!< from SMS_DvbModemState_ET , valid only for DVB-T/H
270 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value , valid only for DVB-T/H
271 UINT32 CodeRate; //!< Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
272 UINT32 LPCodeRate; //!< Low Priority Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
273 UINT32 Hierarchy; //!< Hierarchy from SMS_Hierarchy_ET, valid only for DVB-T/H
274 UINT32 Constellation; //!< Constellation from SMS_Constellation_ET, valid only for DVB-T/H
275
276 /// Burst parameters, valid only for DVB-H
277 UINT32 BurstSize; //!< Current burst size in bytes, valid only for DVB-H
278 UINT32 BurstDuration; //!< Current burst duration in mSec, valid only for DVB-H
279 UINT32 BurstCycleTime; //!< Current burst cycle time in mSec, valid only for DVB-H
280 UINT32 CalculatedBurstCycleTime;//!< Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H
281 UINT32 NumOfRows; //!< Number of rows in MPE table, valid only for DVB-H
282 UINT32 NumOfPaddCols; //!< Number of padding columns in MPE table, valid only for DVB-H
283 UINT32 NumOfPunctCols; //!< Number of puncturing columns in MPE table, valid only for DVB-H
284 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
285 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
286 UINT32 NumOfValidMpeTlbs; //!< Number of MPE tables which do not include errors after MPE RS decoding
287 UINT32 NumOfInvalidMpeTlbs; //!< Number of MPE tables which include errors after MPE RS decoding
288 UINT32 NumOfCorrectedMpeTlbs; //!< Number of MPE tables which were corrected by MPE RS decoding
289 /// Common params
290 UINT32 BERErrorCount; //!< Number of errornous SYNC bits.
291 UINT32 BERBitCount; //!< Total number of SYNC bits.
292
293 /// Interface information
294 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
295
296 /// DAB/T-DMB
297 UINT32 PreBER; //!< DAB/T-DMB only: Pre Viterbi BER [1E-5]
298
299 /// DVB-H TPS parameters
300 UINT32 CellId; //!< TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered
301
302} SMSHOSTLIB_STATISTICS_ST;
303
304typedef struct
305{
306 UINT32 RequestResult;
307
308 SMSHOSTLIB_STATISTICS_ST Stat;
309
310 // Split the calc of the SNR in DAB
311 UINT32 Signal; //!< dB
312 UINT32 Noise; //!< dB
313
314} SmsMsgStatisticsInfo_ST;
315
316typedef struct SMSHOSTLIB_ISDBT_LAYER_STAT_S
317{
318 // Per-layer information
319 UINT32 CodeRate; //!< Code Rate from SMSHOSTLIB_CODE_RATE_ET, 255 means layer does not exist
320 UINT32 Constellation; //!< Constellation from SMSHOSTLIB_CONSTELLATION_ET, 255 means layer does not exist
321 UINT32 BER; //!< Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A
322 UINT32 BERErrorCount; //!< Post Viterbi Error Bits Count
323 UINT32 BERBitCount; //!< Post Viterbi Total Bits Count
324 UINT32 PreBER; //!< Pre Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A
325 UINT32 TS_PER; //!< Transport stream PER [%], 0xFFFFFFFF indicate N/A
326 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
327 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
328 UINT32 TILdepthI; //!< Time interleaver depth I parameter, 255 means layer does not exist
329 UINT32 NumberOfSegments; //!< Number of segments in layer A, 255 means layer does not exist
330 UINT32 TMCCErrors; //!< TMCC errors
331} SMSHOSTLIB_ISDBT_LAYER_STAT_ST;
332
333typedef struct SMSHOSTLIB_STATISTICS_ISDBT_S
334{
335 UINT32 StatisticsType; //!< Enumerator identifying the type of the structure. Values are the same as SMSHOSTLIB_DEVICE_MODES_E
336 //!< This fiels MUST always first in any statistics structure
337
338 UINT32 FullSize; //!< Total size of the structure returned by the modem. If the size requested by
339 //!< the host is smaller than FullSize, the struct will be truncated
340
341 // Common parameters
342 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
343 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
344 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
345
346 // Reception quality
347 INT32 SNR; //!< dB
348 INT32 RSSI; //!< dBm
349 INT32 InBandPwr; //!< In band power in dBM
350 INT32 CarrierOffset; //!< Carrier Offset in Hz
351
352 // Transmission parameters
353 UINT32 Frequency; //!< Frequency in Hz
354 UINT32 Bandwidth; //!< Bandwidth in MHz
355 UINT32 TransmissionMode; //!< ISDB-T transmission mode
356 UINT32 ModemState; //!< 0 - Acquisition, 1 - Locked
357 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value
358 UINT32 SystemType; //!< ISDB-T system type (ISDB-T / ISDB-Tsb)
359 UINT32 PartialReception; //!< TRUE - partial reception, FALSE otherwise
360 UINT32 NumOfLayers; //!< Number of ISDB-T layers in the network
361
362 // Per-layer information
363 // Layers A, B and C
364 SMSHOSTLIB_ISDBT_LAYER_STAT_ST LayerInfo[3]; //!< Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST
365
366 // Interface information
367 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
368
369} SMSHOSTLIB_STATISTICS_ISDBT_ST;
370
371typedef struct SMSHOSTLIB_STATISTICS_DVB_S
372{
373 UINT32 StatisticsType; //!< Enumerator identifying the type of the structure. Values are the same as SMSHOSTLIB_DEVICE_MODES_E
374 //!< This fiels MUST always first in any statistics structure
375
376 UINT32 FullSize; //!< Total size of the structure returned by the modem. If the size requested by
377 //!< the host is smaller than FullSize, the struct will be truncated
378 // Common parameters
379 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
380 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
381 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
382
383 // Reception quality
384 INT32 SNR; //!< dB
385 UINT32 BER; //!< Post Viterbi BER [1E-5]
386 UINT32 BERErrorCount; //!< Number of errornous SYNC bits.
387 UINT32 BERBitCount; //!< Total number of SYNC bits.
388 UINT32 TS_PER; //!< Transport stream PER, 0xFFFFFFFF indicate N/A
389 UINT32 MFER; //!< DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H
390 INT32 RSSI; //!< dBm
391 INT32 InBandPwr; //!< In band power in dBM
392 INT32 CarrierOffset; //!< Carrier Offset in bin/1024
393
394 // Transmission parameters
395 UINT32 Frequency; //!< Frequency in Hz
396 UINT32 Bandwidth; //!< Bandwidth in MHz
397 UINT32 ModemState; //!< from SMSHOSTLIB_DVB_MODEM_STATE_ET
398 UINT32 TransmissionMode; //!< FFT mode carriers in Kilos
399 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value
400 UINT32 CodeRate; //!< Code Rate from SMSHOSTLIB_CODE_RATE_ET
401 UINT32 LPCodeRate; //!< Low Priority Code Rate from SMSHOSTLIB_CODE_RATE_ET
402 UINT32 Hierarchy; //!< Hierarchy from SMSHOSTLIB_HIERARCHY_ET
403 UINT32 Constellation; //!< Constellation from SMSHOSTLIB_CONSTELLATION_ET
404
405 // Burst parameters, valid only for DVB-H
406 UINT32 BurstSize; //!< Current burst size in bytes, valid only for DVB-H
407 UINT32 BurstDuration; //!< Current burst duration in mSec, valid only for DVB-H
408 UINT32 BurstCycleTime; //!< Current burst cycle time in mSec, valid only for DVB-H
409 UINT32 CalculatedBurstCycleTime;//!< Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H
410 UINT32 NumOfRows; //!< Number of rows in MPE table, valid only for DVB-H
411 UINT32 NumOfPaddCols; //!< Number of padding columns in MPE table, valid only for DVB-H
412 UINT32 NumOfPunctCols; //!< Number of puncturing columns in MPE table, valid only for DVB-H
413 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
414 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
415 UINT32 NumOfValidMpeTlbs; //!< Number of MPE tables which do not include errors after MPE RS decoding, valid only for DVB-H
416 UINT32 NumOfInvalidMpeTlbs; //!< Number of MPE tables which include errors after MPE RS decoding, valid only for DVB-H
417 UINT32 NumOfCorrectedMpeTlbs; //!< Number of MPE tables which were corrected by MPE RS decoding, valid only for DVB-H
418 UINT32 NumMPEReceived; //!< DVB-H, Num MPE section received
419
420 // DVB-H TPS parameters
421 UINT32 CellId; //!< TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered
422 UINT32 DvbhSrvIndHP; //!< DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator
423 UINT32 DvbhSrvIndLP; //!< DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator
424
425 // Interface information
426 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
427
428} SMSHOSTLIB_STATISTICS_DVB_ST;
429
430typedef struct SMSHOSTLIB_GPIO_CONFIG_S
431{
432 UINT8 Direction; //!< GPIO direction: Input - 0, Output - 1
433 UINT8 PullUpDown; //!< PullUp/PullDown: None - 0, PullDown - 1, PullUp - 2, Keeper - 3
434 UINT8 InputCharacteristics; //!< Input Characteristics: Normal - 0, Schmitt trigger - 1
435 UINT8 OutputSlewRate; //!< Output Slew Rate: Fast slew rate - 0, Slow slew rate - 1
436 UINT8 OutputDriving; //!< Output driving capability: 4mA - 0, 8mA - 1, 12mA - 2, 16mA - 3
437} SMSHOSTLIB_GPIO_CONFIG_ST;
438
439typedef struct SMSHOSTLIB_I2C_REQ_S
440{
441 UINT32 DeviceAddress; // I2c device address
442 UINT32 WriteCount; // number of bytes to write
443 UINT32 ReadCount; // number of bytes to read
444 UINT8 Data[1];
445} SMSHOSTLIB_I2C_REQ_ST;
446
447typedef struct SMSHOSTLIB_I2C_RES_S
448{
449 UINT32 Status; // non-zero value in case of failure
450 UINT32 ReadCount; // number of bytes read
451 UINT8 Data[1];
452} SMSHOSTLIB_I2C_RES_ST;
453
454/* End types.h */
455
Michael Krufky2e5c1ec82008-05-19 18:56:13 -0300456extern void smscore_registry_setmode(char *devpath, int mode);
457extern int smscore_registry_getmode(char *devpath);
458
459extern int smscore_register_hotplug(hotplug_t hotplug);
460extern void smscore_unregister_hotplug(hotplug_t hotplug);
461
462extern int smscore_register_device(smsdevice_params_t *params, smscore_device_t **coredev);
463extern void smscore_unregister_device(smscore_device_t *coredev);
464
465extern int smscore_start_device(smscore_device_t *coredev);
466extern int smscore_load_firmware(smscore_device_t *coredev, char* filename, loadfirmware_t loadfirmware_handler);
467
468extern int smscore_set_device_mode(smscore_device_t *coredev, int mode);
469extern int smscore_get_device_mode(smscore_device_t *coredev);
470
471extern int smscore_register_client(smscore_device_t *coredev, smsclient_params_t* params, smscore_client_t **client);
472extern void smscore_unregister_client(smscore_client_t *client);
473
474extern int smsclient_sendrequest(smscore_client_t *client, void *buffer, size_t size);
475extern void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb);
476
477extern int smscore_get_common_buffer_size(smscore_device_t *coredev);
478extern int smscore_map_common_buffer(smscore_device_t *coredev, struct vm_area_struct * vma);
479
480extern smscore_buffer_t *smscore_getbuffer(smscore_device_t *coredev);
481extern void smscore_putbuffer(smscore_device_t *coredev, smscore_buffer_t *cb);
482
483#endif // __smscoreapi_h__