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