xref: /openbmc/linux/drivers/media/common/siano/smscoreapi.h (revision 762f99f4f3cb41a775b5157dd761217beba65873)
11ccea77eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
20013ca8cSMauro Carvalho Chehab /****************************************************************
30013ca8cSMauro Carvalho Chehab 
40013ca8cSMauro Carvalho Chehab Siano Mobile Silicon, Inc.
50013ca8cSMauro Carvalho Chehab MDTV receiver kernel modules.
60013ca8cSMauro Carvalho Chehab Copyright (C) 2006-2008, Uri Shkolnik, Anatoly Greenblat
70013ca8cSMauro Carvalho Chehab 
80013ca8cSMauro Carvalho Chehab 
90013ca8cSMauro Carvalho Chehab ****************************************************************/
100013ca8cSMauro Carvalho Chehab 
110013ca8cSMauro Carvalho Chehab #ifndef __SMS_CORE_API_H__
120013ca8cSMauro Carvalho Chehab #define __SMS_CORE_API_H__
130013ca8cSMauro Carvalho Chehab 
145e022d1aSMauro Carvalho Chehab #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
155e022d1aSMauro Carvalho Chehab 
160013ca8cSMauro Carvalho Chehab #include <linux/device.h>
170013ca8cSMauro Carvalho Chehab #include <linux/list.h>
180013ca8cSMauro Carvalho Chehab #include <linux/mm.h>
190013ca8cSMauro Carvalho Chehab #include <linux/scatterlist.h>
200013ca8cSMauro Carvalho Chehab #include <linux/types.h>
210013ca8cSMauro Carvalho Chehab #include <linux/mutex.h>
220013ca8cSMauro Carvalho Chehab #include <linux/wait.h>
230013ca8cSMauro Carvalho Chehab #include <linux/timer.h>
240013ca8cSMauro Carvalho Chehab 
2546b1e21fSMauro Carvalho Chehab #include <media/media-device.h>
2646b1e21fSMauro Carvalho Chehab 
270013ca8cSMauro Carvalho Chehab #include <asm/page.h>
280013ca8cSMauro Carvalho Chehab 
290013ca8cSMauro Carvalho Chehab #include "smsir.h"
300013ca8cSMauro Carvalho Chehab 
31c8b8fdb3SMauro Carvalho Chehab /*
32c8b8fdb3SMauro Carvalho Chehab  * Define the firmware names used by the driver.
33c8b8fdb3SMauro Carvalho Chehab  * Those should match what's used at smscoreapi.c and sms-cards.c
34c8b8fdb3SMauro Carvalho Chehab  * including the MODULE_FIRMWARE() macros at the end of smscoreapi.c
35c8b8fdb3SMauro Carvalho Chehab  */
3611ad03a5SMauro Carvalho Chehab #define SMS_FW_ATSC_DENVER         "atsc_denver.inp"
3711ad03a5SMauro Carvalho Chehab #define SMS_FW_CMMB_MING_APP       "cmmb_ming_app.inp"
3811ad03a5SMauro Carvalho Chehab #define SMS_FW_CMMB_VEGA_12MHZ     "cmmb_vega_12mhz.inp"
3911ad03a5SMauro Carvalho Chehab #define SMS_FW_CMMB_VENICE_12MHZ   "cmmb_venice_12mhz.inp"
4011ad03a5SMauro Carvalho Chehab #define SMS_FW_DVBH_RIO            "dvbh_rio.inp"
4111ad03a5SMauro Carvalho Chehab #define SMS_FW_DVB_NOVA_12MHZ_B0   "dvb_nova_12mhz_b0.inp"
4211ad03a5SMauro Carvalho Chehab #define SMS_FW_DVB_NOVA_12MHZ      "dvb_nova_12mhz.inp"
4311ad03a5SMauro Carvalho Chehab #define SMS_FW_DVB_RIO             "dvb_rio.inp"
4411ad03a5SMauro Carvalho Chehab #define SMS_FW_FM_RADIO            "fm_radio.inp"
4511ad03a5SMauro Carvalho Chehab #define SMS_FW_FM_RADIO_RIO        "fm_radio_rio.inp"
4611ad03a5SMauro Carvalho Chehab #define SMS_FW_DVBT_HCW_55XXX      "sms1xxx-hcw-55xxx-dvbt-02.fw"
4711ad03a5SMauro Carvalho Chehab #define SMS_FW_ISDBT_HCW_55XXX     "sms1xxx-hcw-55xxx-isdbt-02.fw"
4811ad03a5SMauro Carvalho Chehab #define SMS_FW_ISDBT_NOVA_12MHZ_B0 "isdbt_nova_12mhz_b0.inp"
4911ad03a5SMauro Carvalho Chehab #define SMS_FW_ISDBT_NOVA_12MHZ    "isdbt_nova_12mhz.inp"
5011ad03a5SMauro Carvalho Chehab #define SMS_FW_ISDBT_PELE          "isdbt_pele.inp"
5111ad03a5SMauro Carvalho Chehab #define SMS_FW_ISDBT_RIO           "isdbt_rio.inp"
5211ad03a5SMauro Carvalho Chehab #define SMS_FW_DVBT_NOVA_A         "sms1xxx-nova-a-dvbt-01.fw"
5311ad03a5SMauro Carvalho Chehab #define SMS_FW_DVBT_NOVA_B         "sms1xxx-nova-b-dvbt-01.fw"
5411ad03a5SMauro Carvalho Chehab #define SMS_FW_DVBT_STELLAR        "sms1xxx-stellar-dvbt-01.fw"
5511ad03a5SMauro Carvalho Chehab #define SMS_FW_TDMB_DENVER         "tdmb_denver.inp"
5611ad03a5SMauro Carvalho Chehab #define SMS_FW_TDMB_NOVA_12MHZ_B0  "tdmb_nova_12mhz_b0.inp"
5711ad03a5SMauro Carvalho Chehab #define SMS_FW_TDMB_NOVA_12MHZ     "tdmb_nova_12mhz.inp"
5811ad03a5SMauro Carvalho Chehab 
590013ca8cSMauro Carvalho Chehab #define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS			(10000)
600013ca8cSMauro Carvalho Chehab #define SMS_ALLOC_ALIGNMENT				128
610013ca8cSMauro Carvalho Chehab #define SMS_DMA_ALIGNMENT				16
620013ca8cSMauro Carvalho Chehab #define SMS_ALIGN_ADDRESS(addr) \
630013ca8cSMauro Carvalho Chehab 	((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
640013ca8cSMauro Carvalho Chehab 
65ab2b599eSMauro Carvalho Chehab #define SMS_DEVICE_FAMILY1				0
660013ca8cSMauro Carvalho Chehab #define SMS_DEVICE_FAMILY2				1
670013ca8cSMauro Carvalho Chehab #define SMS_ROM_NO_RESPONSE				2
680013ca8cSMauro Carvalho Chehab #define SMS_DEVICE_NOT_READY				0x8000000
690013ca8cSMauro Carvalho Chehab 
700013ca8cSMauro Carvalho Chehab enum sms_device_type_st {
71ab2b599eSMauro Carvalho Chehab 	SMS_UNKNOWN_TYPE = -1,
720013ca8cSMauro Carvalho Chehab 	SMS_STELLAR = 0,
730013ca8cSMauro Carvalho Chehab 	SMS_NOVA_A0,
740013ca8cSMauro Carvalho Chehab 	SMS_NOVA_B0,
750013ca8cSMauro Carvalho Chehab 	SMS_VEGA,
76ab2b599eSMauro Carvalho Chehab 	SMS_VENICE,
77ab2b599eSMauro Carvalho Chehab 	SMS_MING,
78ab2b599eSMauro Carvalho Chehab 	SMS_PELE,
79ab2b599eSMauro Carvalho Chehab 	SMS_RIO,
80ab2b599eSMauro Carvalho Chehab 	SMS_DENVER_1530,
81ab2b599eSMauro Carvalho Chehab 	SMS_DENVER_2160,
820013ca8cSMauro Carvalho Chehab 	SMS_NUM_OF_DEVICE_TYPES
830013ca8cSMauro Carvalho Chehab };
840013ca8cSMauro Carvalho Chehab 
85ab2b599eSMauro Carvalho Chehab enum sms_power_mode_st {
86ab2b599eSMauro Carvalho Chehab 	SMS_POWER_MODE_ACTIVE,
87ab2b599eSMauro Carvalho Chehab 	SMS_POWER_MODE_SUSPENDED
88ab2b599eSMauro Carvalho Chehab };
89ab2b599eSMauro Carvalho Chehab 
900013ca8cSMauro Carvalho Chehab struct smscore_device_t;
910013ca8cSMauro Carvalho Chehab struct smscore_client_t;
920013ca8cSMauro Carvalho Chehab struct smscore_buffer_t;
930013ca8cSMauro Carvalho Chehab 
940013ca8cSMauro Carvalho Chehab typedef int (*hotplug_t)(struct smscore_device_t *coredev,
950013ca8cSMauro Carvalho Chehab 			 struct device *device, int arrival);
960013ca8cSMauro Carvalho Chehab 
970013ca8cSMauro Carvalho Chehab typedef int (*setmode_t)(void *context, int mode);
980013ca8cSMauro Carvalho Chehab typedef void (*detectmode_t)(void *context, int *mode);
990013ca8cSMauro Carvalho Chehab typedef int (*sendrequest_t)(void *context, void *buffer, size_t size);
1000013ca8cSMauro Carvalho Chehab typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size);
1010013ca8cSMauro Carvalho Chehab typedef int (*preload_t)(void *context);
1020013ca8cSMauro Carvalho Chehab typedef int (*postload_t)(void *context);
1030013ca8cSMauro Carvalho Chehab 
1040013ca8cSMauro Carvalho Chehab typedef int (*onresponse_t)(void *context, struct smscore_buffer_t *cb);
1050013ca8cSMauro Carvalho Chehab typedef void (*onremove_t)(void *context);
1060013ca8cSMauro Carvalho Chehab 
1070013ca8cSMauro Carvalho Chehab struct smscore_buffer_t {
1080013ca8cSMauro Carvalho Chehab 	/* public members, once passed to clients can be changed freely */
1090013ca8cSMauro Carvalho Chehab 	struct list_head entry;
1100013ca8cSMauro Carvalho Chehab 	int size;
1110013ca8cSMauro Carvalho Chehab 	int offset;
1120013ca8cSMauro Carvalho Chehab 
1130013ca8cSMauro Carvalho Chehab 	/* private members, read-only for clients */
1140013ca8cSMauro Carvalho Chehab 	void *p;
1150013ca8cSMauro Carvalho Chehab 	dma_addr_t phys;
1160013ca8cSMauro Carvalho Chehab 	unsigned long offset_in_common;
1170013ca8cSMauro Carvalho Chehab };
1180013ca8cSMauro Carvalho Chehab 
1190013ca8cSMauro Carvalho Chehab struct smsdevice_params_t {
1200013ca8cSMauro Carvalho Chehab 	struct device	*device;
121564246fdSTomoki Sekiyama 	struct usb_device	*usb_device;
1220013ca8cSMauro Carvalho Chehab 
1230013ca8cSMauro Carvalho Chehab 	int				buffer_size;
1240013ca8cSMauro Carvalho Chehab 	int				num_buffers;
1250013ca8cSMauro Carvalho Chehab 
1260013ca8cSMauro Carvalho Chehab 	char			devpath[32];
1270013ca8cSMauro Carvalho Chehab 	unsigned long	flags;
1280013ca8cSMauro Carvalho Chehab 
1290013ca8cSMauro Carvalho Chehab 	setmode_t		setmode_handler;
1300013ca8cSMauro Carvalho Chehab 	detectmode_t	detectmode_handler;
1310013ca8cSMauro Carvalho Chehab 	sendrequest_t	sendrequest_handler;
1320013ca8cSMauro Carvalho Chehab 	preload_t		preload_handler;
1330013ca8cSMauro Carvalho Chehab 	postload_t		postload_handler;
1340013ca8cSMauro Carvalho Chehab 
1350013ca8cSMauro Carvalho Chehab 	void			*context;
1360013ca8cSMauro Carvalho Chehab 	enum sms_device_type_st device_type;
1370013ca8cSMauro Carvalho Chehab };
1380013ca8cSMauro Carvalho Chehab 
1390013ca8cSMauro Carvalho Chehab struct smsclient_params_t {
1400013ca8cSMauro Carvalho Chehab 	int				initial_id;
1410013ca8cSMauro Carvalho Chehab 	int				data_type;
1420013ca8cSMauro Carvalho Chehab 	onresponse_t	onresponse_handler;
1430013ca8cSMauro Carvalho Chehab 	onremove_t		onremove_handler;
1440013ca8cSMauro Carvalho Chehab 	void			*context;
1450013ca8cSMauro Carvalho Chehab };
1460013ca8cSMauro Carvalho Chehab 
1470013ca8cSMauro Carvalho Chehab struct smscore_device_t {
1480013ca8cSMauro Carvalho Chehab 	struct list_head entry;
1490013ca8cSMauro Carvalho Chehab 
1500013ca8cSMauro Carvalho Chehab 	struct list_head clients;
1510013ca8cSMauro Carvalho Chehab 	struct list_head subclients;
1520013ca8cSMauro Carvalho Chehab 	spinlock_t clientslock;
1530013ca8cSMauro Carvalho Chehab 
1540013ca8cSMauro Carvalho Chehab 	struct list_head buffers;
1550013ca8cSMauro Carvalho Chehab 	spinlock_t bufferslock;
1560013ca8cSMauro Carvalho Chehab 	int num_buffers;
1570013ca8cSMauro Carvalho Chehab 
1580013ca8cSMauro Carvalho Chehab 	void *common_buffer;
1590013ca8cSMauro Carvalho Chehab 	int common_buffer_size;
1600013ca8cSMauro Carvalho Chehab 	dma_addr_t common_buffer_phys;
1610013ca8cSMauro Carvalho Chehab 
1620013ca8cSMauro Carvalho Chehab 	void *context;
1630013ca8cSMauro Carvalho Chehab 	struct device *device;
164564246fdSTomoki Sekiyama 	struct usb_device *usb_device;
1650013ca8cSMauro Carvalho Chehab 
1660013ca8cSMauro Carvalho Chehab 	char devpath[32];
1670013ca8cSMauro Carvalho Chehab 	unsigned long device_flags;
1680013ca8cSMauro Carvalho Chehab 
1690013ca8cSMauro Carvalho Chehab 	setmode_t setmode_handler;
1700013ca8cSMauro Carvalho Chehab 	detectmode_t detectmode_handler;
1710013ca8cSMauro Carvalho Chehab 	sendrequest_t sendrequest_handler;
1720013ca8cSMauro Carvalho Chehab 	preload_t preload_handler;
1730013ca8cSMauro Carvalho Chehab 	postload_t postload_handler;
1740013ca8cSMauro Carvalho Chehab 
1750013ca8cSMauro Carvalho Chehab 	int mode, modes_supported;
1760013ca8cSMauro Carvalho Chehab 
177782b9d20SMauro Carvalho Chehab 	gfp_t gfp_buf_flags;
178782b9d20SMauro Carvalho Chehab 
1790013ca8cSMauro Carvalho Chehab 	/* host <--> device messages */
1800013ca8cSMauro Carvalho Chehab 	struct completion version_ex_done, data_download_done, trigger_done;
181018b0c6fSMauro Carvalho Chehab 	struct completion data_validity_done, device_ready_done;
1820013ca8cSMauro Carvalho Chehab 	struct completion init_device_done, reload_start_done, resume_done;
1830013ca8cSMauro Carvalho Chehab 	struct completion gpio_configuration_done, gpio_set_level_done;
1840013ca8cSMauro Carvalho Chehab 	struct completion gpio_get_level_done, ir_init_done;
1850013ca8cSMauro Carvalho Chehab 
1860013ca8cSMauro Carvalho Chehab 	/* Buffer management */
1870013ca8cSMauro Carvalho Chehab 	wait_queue_head_t buffer_mng_waitq;
1880013ca8cSMauro Carvalho Chehab 
1890013ca8cSMauro Carvalho Chehab 	/* GPIO */
1900013ca8cSMauro Carvalho Chehab 	int gpio_get_res;
1910013ca8cSMauro Carvalho Chehab 
1920013ca8cSMauro Carvalho Chehab 	/* Target hardware board */
1930013ca8cSMauro Carvalho Chehab 	int board_id;
1940013ca8cSMauro Carvalho Chehab 
1950013ca8cSMauro Carvalho Chehab 	/* Firmware */
1960013ca8cSMauro Carvalho Chehab 	u8 *fw_buf;
1970013ca8cSMauro Carvalho Chehab 	u32 fw_buf_size;
19873338395SMauro Carvalho Chehab 	u16 fw_version;
1990013ca8cSMauro Carvalho Chehab 
2000013ca8cSMauro Carvalho Chehab 	/* Infrared (IR) */
2010013ca8cSMauro Carvalho Chehab 	struct ir_t ir;
2020013ca8cSMauro Carvalho Chehab 
203503efe5cSMauro Carvalho Chehab 	/*
204503efe5cSMauro Carvalho Chehab 	 * Identify if device is USB or not.
205503efe5cSMauro Carvalho Chehab 	 * Used by smsdvb-sysfs to know the root node for debugfs
206503efe5cSMauro Carvalho Chehab 	 */
207503efe5cSMauro Carvalho Chehab 	bool is_usb_device;
208503efe5cSMauro Carvalho Chehab 
2090013ca8cSMauro Carvalho Chehab 	int led_state;
21046b1e21fSMauro Carvalho Chehab 
21146b1e21fSMauro Carvalho Chehab #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
21246b1e21fSMauro Carvalho Chehab 	struct media_device *media_dev;
21346b1e21fSMauro Carvalho Chehab #endif
2140013ca8cSMauro Carvalho Chehab };
2150013ca8cSMauro Carvalho Chehab 
2160013ca8cSMauro Carvalho Chehab /* GPIO definitions for antenna frequency domain control (SMS8021) */
2170013ca8cSMauro Carvalho Chehab #define SMS_ANTENNA_GPIO_0					1
2180013ca8cSMauro Carvalho Chehab #define SMS_ANTENNA_GPIO_1					0
2190013ca8cSMauro Carvalho Chehab 
220ab2b599eSMauro Carvalho Chehab enum sms_bandwidth_mode {
221ab2b599eSMauro Carvalho Chehab 	BW_8_MHZ = 0,
222ab2b599eSMauro Carvalho Chehab 	BW_7_MHZ = 1,
223ab2b599eSMauro Carvalho Chehab 	BW_6_MHZ = 2,
224ab2b599eSMauro Carvalho Chehab 	BW_5_MHZ = 3,
225ab2b599eSMauro Carvalho Chehab 	BW_ISDBT_1SEG = 4,
226ab2b599eSMauro Carvalho Chehab 	BW_ISDBT_3SEG = 5,
227ab2b599eSMauro Carvalho Chehab 	BW_2_MHZ = 6,
228ab2b599eSMauro Carvalho Chehab 	BW_FM_RADIO = 7,
229ab2b599eSMauro Carvalho Chehab 	BW_ISDBT_13SEG = 8,
230ab2b599eSMauro Carvalho Chehab 	BW_1_5_MHZ = 15,
231ab2b599eSMauro Carvalho Chehab 	BW_UNKNOWN = 0xffff
232ab2b599eSMauro Carvalho Chehab };
233ab2b599eSMauro Carvalho Chehab 
2340013ca8cSMauro Carvalho Chehab 
2350013ca8cSMauro Carvalho Chehab #define MSG_HDR_FLAG_SPLIT_MSG				4
2360013ca8cSMauro Carvalho Chehab 
2370013ca8cSMauro Carvalho Chehab #define MAX_GPIO_PIN_NUMBER					31
2380013ca8cSMauro Carvalho Chehab 
2390013ca8cSMauro Carvalho Chehab #define HIF_TASK							11
240ab2b599eSMauro Carvalho Chehab #define HIF_TASK_SLAVE					22
241ab2b599eSMauro Carvalho Chehab #define HIF_TASK_SLAVE2					33
242ab2b599eSMauro Carvalho Chehab #define HIF_TASK_SLAVE3					44
2430013ca8cSMauro Carvalho Chehab #define SMS_HOST_LIB						150
2440013ca8cSMauro Carvalho Chehab #define DVBT_BDA_CONTROL_MSG_ID				201
2450013ca8cSMauro Carvalho Chehab 
2460013ca8cSMauro Carvalho Chehab #define SMS_MAX_PAYLOAD_SIZE				240
2470013ca8cSMauro Carvalho Chehab #define SMS_TUNE_TIMEOUT					500
2480013ca8cSMauro Carvalho Chehab 
249f251001cSMauro Carvalho Chehab enum msg_types {
250f251001cSMauro Carvalho Chehab 	MSG_TYPE_BASE_VAL = 500,
251f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_VERSION_REQ = 503,
252f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_VERSION_RES = 504,
253f251001cSMauro Carvalho Chehab 	MSG_SMS_MULTI_BRIDGE_CFG = 505,
254f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_CONFIG_REQ = 507,
255f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_CONFIG_RES = 508,
256f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_SET_LEVEL_REQ = 509,
257f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_SET_LEVEL_RES = 510,
258f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_GET_LEVEL_REQ = 511,
259f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_GET_LEVEL_RES = 512,
260f251001cSMauro Carvalho Chehab 	MSG_SMS_EEPROM_BURN_IND = 513,
261f251001cSMauro Carvalho Chehab 	MSG_SMS_LOG_ENABLE_CHANGE_REQ = 514,
262f251001cSMauro Carvalho Chehab 	MSG_SMS_LOG_ENABLE_CHANGE_RES = 515,
263f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_MAX_TX_MSG_LEN_REQ = 516,
264f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_MAX_TX_MSG_LEN_RES = 517,
265f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE = 518,
266f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST = 519,
267f251001cSMauro Carvalho Chehab 	MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ = 520,
268f251001cSMauro Carvalho Chehab 	MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES = 521,
269f251001cSMauro Carvalho Chehab 	MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND = 522,
270f251001cSMauro Carvalho Chehab 	MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND = 523,
271f251001cSMauro Carvalho Chehab 	MSG_SMS_CONFIGURE_RF_SWITCH_REQ = 524,
272f251001cSMauro Carvalho Chehab 	MSG_SMS_CONFIGURE_RF_SWITCH_RES = 525,
273f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_PATH_DISCONNECT_REQ = 526,
274f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_PATH_DISCONNECT_RES = 527,
275f251001cSMauro Carvalho Chehab 	MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ = 528,
276f251001cSMauro Carvalho Chehab 	MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES = 529,
277f251001cSMauro Carvalho Chehab 	MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ = 530,
278f251001cSMauro Carvalho Chehab 	MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES = 531,
279f251001cSMauro Carvalho Chehab 	MSG_WR_REG_RFT_REQ = 533,
280f251001cSMauro Carvalho Chehab 	MSG_WR_REG_RFT_RES = 534,
281f251001cSMauro Carvalho Chehab 	MSG_RD_REG_RFT_REQ = 535,
282f251001cSMauro Carvalho Chehab 	MSG_RD_REG_RFT_RES = 536,
283f251001cSMauro Carvalho Chehab 	MSG_RD_REG_ALL_RFT_REQ = 537,
284f251001cSMauro Carvalho Chehab 	MSG_RD_REG_ALL_RFT_RES = 538,
285f251001cSMauro Carvalho Chehab 	MSG_HELP_INT = 539,
286f251001cSMauro Carvalho Chehab 	MSG_RUN_SCRIPT_INT = 540,
287f251001cSMauro Carvalho Chehab 	MSG_SMS_EWS_INBAND_REQ = 541,
288f251001cSMauro Carvalho Chehab 	MSG_SMS_EWS_INBAND_RES = 542,
289f251001cSMauro Carvalho Chehab 	MSG_SMS_RFS_SELECT_REQ = 543,
290f251001cSMauro Carvalho Chehab 	MSG_SMS_RFS_SELECT_RES = 544,
291f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_GET_VER_REQ = 545,
292f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_GET_VER_RES = 546,
293f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_WRITE_CFGFILE_REQ = 547,
294f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_WRITE_CFGFILE_RES = 548,
295f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_READ_CFGFILE_REQ = 549,
296f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_READ_CFGFILE_RES = 550,
297f251001cSMauro Carvalho Chehab 	MSG_SMS_RD_MEM_REQ = 552,
298f251001cSMauro Carvalho Chehab 	MSG_SMS_RD_MEM_RES = 553,
299f251001cSMauro Carvalho Chehab 	MSG_SMS_WR_MEM_REQ = 554,
300f251001cSMauro Carvalho Chehab 	MSG_SMS_WR_MEM_RES = 555,
301f251001cSMauro Carvalho Chehab 	MSG_SMS_UPDATE_MEM_REQ = 556,
302f251001cSMauro Carvalho Chehab 	MSG_SMS_UPDATE_MEM_RES = 557,
303f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ = 558,
304f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES = 559,
305f251001cSMauro Carvalho Chehab 	MSG_SMS_RF_TUNE_REQ = 561,
306f251001cSMauro Carvalho Chehab 	MSG_SMS_RF_TUNE_RES = 562,
307f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ = 563,
308f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES = 564,
309f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_SB_RECEPTION_REQ = 565,
310f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_SB_RECEPTION_RES = 566,
311f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_EPROM_WRITE_REQ = 567,
312f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_EPROM_WRITE_RES = 568,
313f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_EPROM_READ_REQ = 569,
314f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_EPROM_READ_RES = 570,
315f251001cSMauro Carvalho Chehab 	MSG_SMS_EEPROM_WRITE_REQ = 571,
316f251001cSMauro Carvalho Chehab 	MSG_SMS_EEPROM_WRITE_RES = 572,
317f251001cSMauro Carvalho Chehab 	MSG_SMS_CUSTOM_READ_REQ = 574,
318f251001cSMauro Carvalho Chehab 	MSG_SMS_CUSTOM_READ_RES = 575,
319f251001cSMauro Carvalho Chehab 	MSG_SMS_CUSTOM_WRITE_REQ = 576,
320f251001cSMauro Carvalho Chehab 	MSG_SMS_CUSTOM_WRITE_RES = 577,
321f251001cSMauro Carvalho Chehab 	MSG_SMS_INIT_DEVICE_REQ = 578,
322f251001cSMauro Carvalho Chehab 	MSG_SMS_INIT_DEVICE_RES = 579,
323f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_SET_ALL_IP_REQ = 580,
324f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_SET_ALL_IP_RES = 581,
325f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_START_ENSEMBLE_REQ = 582,
326f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_START_ENSEMBLE_RES = 583,
327f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_OUTPUT_MODE_REQ = 584,
328f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_OUTPUT_MODE_RES = 585,
329f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ = 586,
330f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES = 587,
331f251001cSMauro Carvalho Chehab 	MSG_SMS_SUB_CHANNEL_START_REQ = 589,
332f251001cSMauro Carvalho Chehab 	MSG_SMS_SUB_CHANNEL_START_RES = 590,
333f251001cSMauro Carvalho Chehab 	MSG_SMS_SUB_CHANNEL_STOP_REQ = 591,
334f251001cSMauro Carvalho Chehab 	MSG_SMS_SUB_CHANNEL_STOP_RES = 592,
335f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_ADD_REQ = 593,
336f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_ADD_RES = 594,
337f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ = 595,
338f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_REMOVE_RES = 596,
339f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ = 597,
340f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES = 598,
341f251001cSMauro Carvalho Chehab 	MSG_SMS_WAIT_CMD = 599,
342f251001cSMauro Carvalho Chehab 	MSG_SMS_ADD_PID_FILTER_REQ = 601,
343f251001cSMauro Carvalho Chehab 	MSG_SMS_ADD_PID_FILTER_RES = 602,
344f251001cSMauro Carvalho Chehab 	MSG_SMS_REMOVE_PID_FILTER_REQ = 603,
345f251001cSMauro Carvalho Chehab 	MSG_SMS_REMOVE_PID_FILTER_RES = 604,
346f251001cSMauro Carvalho Chehab 	MSG_SMS_FAST_INFORMATION_CHANNEL_REQ = 605,
347f251001cSMauro Carvalho Chehab 	MSG_SMS_FAST_INFORMATION_CHANNEL_RES = 606,
348f251001cSMauro Carvalho Chehab 	MSG_SMS_DAB_CHANNEL = 607,
349f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_PID_FILTER_LIST_REQ = 608,
350f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_PID_FILTER_LIST_RES = 609,
351f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_DOWN_REQ = 610,
352f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_DOWN_RES = 611,
353f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_SLT_EXIST_IND = 612,
354f251001cSMauro Carvalho Chehab 	MSG_SMS_ATSC_NO_SLT_IND = 613,
355f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_STATISTICS_REQ = 615,
356f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_STATISTICS_RES = 616,
357f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_DUMP = 617,
358f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_START_REQ = 618,
359f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_START_RES = 619,
360f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_STOP_REQ = 620,
361f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_STOP_RES = 621,
362f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_PROGRESS_IND = 622,
363f251001cSMauro Carvalho Chehab 	MSG_SMS_SCAN_COMPLETE_IND = 623,
364f251001cSMauro Carvalho Chehab 	MSG_SMS_LOG_ITEM = 624,
365f251001cSMauro Carvalho Chehab 	MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ = 628,
366f251001cSMauro Carvalho Chehab 	MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES = 629,
367f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_PER_SLICES_IND = 630,
368f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_INBAND_POWER_IND = 631,
369f251001cSMauro Carvalho Chehab 	MSG_SMS_MANUAL_DEMOD_REQ = 632,
370f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_TUNE_ON_REQ = 636,
371f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_TUNE_ON_RES = 637,
372f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_TUNE_OFF_REQ = 638,
373f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_TUNE_OFF_RES = 639,
374f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_PEEK_FREQ_REQ = 640,
375f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_PEEK_FREQ_RES = 641,
376f251001cSMauro Carvalho Chehab 	MSG_SMS_HO_PEEK_FREQ_IND = 642,
377f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_ATTEN_SET_REQ = 643,
378f251001cSMauro Carvalho Chehab 	MSG_SMS_MB_ATTEN_SET_RES = 644,
379f251001cSMauro Carvalho Chehab 	MSG_SMS_ENABLE_STAT_IN_I2C_REQ = 649,
380f251001cSMauro Carvalho Chehab 	MSG_SMS_ENABLE_STAT_IN_I2C_RES = 650,
381f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_ANTENNA_CONFIG_REQ = 651,
382f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_ANTENNA_CONFIG_RES = 652,
383f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_STATISTICS_EX_REQ = 653,
384f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_STATISTICS_EX_RES = 654,
385f251001cSMauro Carvalho Chehab 	MSG_SMS_SLEEP_RESUME_COMP_IND = 655,
386f251001cSMauro Carvalho Chehab 	MSG_SMS_SWITCH_HOST_INTERFACE_REQ = 656,
387f251001cSMauro Carvalho Chehab 	MSG_SMS_SWITCH_HOST_INTERFACE_RES = 657,
388f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_DOWNLOAD_REQ = 660,
389f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_DOWNLOAD_RES = 661,
390f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_VALIDITY_REQ = 662,
391f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_VALIDITY_RES = 663,
392f251001cSMauro Carvalho Chehab 	MSG_SMS_SWDOWNLOAD_TRIGGER_REQ = 664,
393f251001cSMauro Carvalho Chehab 	MSG_SMS_SWDOWNLOAD_TRIGGER_RES = 665,
394f251001cSMauro Carvalho Chehab 	MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ = 666,
395f251001cSMauro Carvalho Chehab 	MSG_SMS_SWDOWNLOAD_BACKDOOR_RES = 667,
396f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_VERSION_EX_REQ = 668,
397f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_VERSION_EX_RES = 669,
398f251001cSMauro Carvalho Chehab 	MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ = 670,
399f251001cSMauro Carvalho Chehab 	MSG_SMS_CLOCK_OUTPUT_CONFIG_RES = 671,
400f251001cSMauro Carvalho Chehab 	MSG_SMS_I2C_SET_FREQ_REQ = 685,
401f251001cSMauro Carvalho Chehab 	MSG_SMS_I2C_SET_FREQ_RES = 686,
402f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_I2C_REQ = 687,
403f251001cSMauro Carvalho Chehab 	MSG_SMS_GENERIC_I2C_RES = 688,
404f251001cSMauro Carvalho Chehab 	MSG_SMS_DVBT_BDA_DATA = 693,
405f251001cSMauro Carvalho Chehab 	MSG_SW_RELOAD_REQ = 697,
406f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_MSG = 699,
407f251001cSMauro Carvalho Chehab 	MSG_TABLE_UPLOAD_REQ = 700,
408f251001cSMauro Carvalho Chehab 	MSG_TABLE_UPLOAD_RES = 701,
409f251001cSMauro Carvalho Chehab 	MSG_SW_RELOAD_START_REQ = 702,
410f251001cSMauro Carvalho Chehab 	MSG_SW_RELOAD_START_RES = 703,
411f251001cSMauro Carvalho Chehab 	MSG_SW_RELOAD_EXEC_REQ = 704,
412f251001cSMauro Carvalho Chehab 	MSG_SW_RELOAD_EXEC_RES = 705,
413f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_INT_LINE_SET_REQ = 710,
414f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_INT_LINE_SET_RES = 711,
415f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_CONFIG_EX_REQ = 712,
416f251001cSMauro Carvalho Chehab 	MSG_SMS_GPIO_CONFIG_EX_RES = 713,
417f251001cSMauro Carvalho Chehab 	MSG_SMS_WATCHDOG_ACT_REQ = 716,
418f251001cSMauro Carvalho Chehab 	MSG_SMS_WATCHDOG_ACT_RES = 717,
419f251001cSMauro Carvalho Chehab 	MSG_SMS_LOOPBACK_REQ = 718,
420f251001cSMauro Carvalho Chehab 	MSG_SMS_LOOPBACK_RES = 719,
421f251001cSMauro Carvalho Chehab 	MSG_SMS_RAW_CAPTURE_START_REQ = 720,
422f251001cSMauro Carvalho Chehab 	MSG_SMS_RAW_CAPTURE_START_RES = 721,
423f251001cSMauro Carvalho Chehab 	MSG_SMS_RAW_CAPTURE_ABORT_REQ = 722,
424f251001cSMauro Carvalho Chehab 	MSG_SMS_RAW_CAPTURE_ABORT_RES = 723,
425f251001cSMauro Carvalho Chehab 	MSG_SMS_RAW_CAPTURE_COMPLETE_IND = 728,
426f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_PUMP_IND = 729,
427f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_PUMP_REQ = 730,
428f251001cSMauro Carvalho Chehab 	MSG_SMS_DATA_PUMP_RES = 731,
429f251001cSMauro Carvalho Chehab 	MSG_SMS_FLASH_DL_REQ = 732,
430f251001cSMauro Carvalho Chehab 	MSG_SMS_EXEC_TEST_1_REQ = 734,
431f251001cSMauro Carvalho Chehab 	MSG_SMS_EXEC_TEST_1_RES = 735,
43213183724SColin Ian King 	MSG_SMS_ENABLE_TS_INTERFACE_REQ = 736,
43313183724SColin Ian King 	MSG_SMS_ENABLE_TS_INTERFACE_RES = 737,
434f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_SET_BUS_WIDTH_REQ = 738,
435f251001cSMauro Carvalho Chehab 	MSG_SMS_SPI_SET_BUS_WIDTH_RES = 739,
436f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_EMM_REQ = 740,
437f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_EMM_RES = 741,
438f251001cSMauro Carvalho Chehab 	MSG_SMS_DISABLE_TS_INTERFACE_REQ = 742,
439f251001cSMauro Carvalho Chehab 	MSG_SMS_DISABLE_TS_INTERFACE_RES = 743,
440f251001cSMauro Carvalho Chehab 	MSG_SMS_IS_BUF_FREE_REQ = 744,
441f251001cSMauro Carvalho Chehab 	MSG_SMS_IS_BUF_FREE_RES = 745,
442f251001cSMauro Carvalho Chehab 	MSG_SMS_EXT_ANTENNA_REQ = 746,
443f251001cSMauro Carvalho Chehab 	MSG_SMS_EXT_ANTENNA_RES = 747,
444f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE = 748,
445f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE = 749,
446f251001cSMauro Carvalho Chehab 	MSG_SMS_BATTERY_LEVEL_REQ = 750,
447f251001cSMauro Carvalho Chehab 	MSG_SMS_BATTERY_LEVEL_RES = 751,
448f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE = 752,
449f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE = 753,
450f251001cSMauro Carvalho Chehab 	MSG_SMS_FM_RADIO_BLOCK_IND = 754,
451f251001cSMauro Carvalho Chehab 	MSG_SMS_HOST_NOTIFICATION_IND = 755,
452f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE = 756,
453f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE = 757,
454f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_NETWORKS_REQ = 760,
455f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_NETWORKS_RES = 761,
456f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_START_SERVICE_REQ = 762,
457f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_START_SERVICE_RES = 763,
458f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_STOP_SERVICE_REQ = 764,
459f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_STOP_SERVICE_RES = 765,
460f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ = 768,
461f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES = 769,
462f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ = 770,
463f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES = 771,
464f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_START_CONTROL_INFO_REQ = 772,
465f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_START_CONTROL_INFO_RES = 773,
466f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ = 774,
467f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_STOP_CONTROL_INFO_RES = 775,
468f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_TUNE_REQ = 776,
469f251001cSMauro Carvalho Chehab 	MSG_SMS_ISDBT_TUNE_RES = 777,
470f251001cSMauro Carvalho Chehab 	MSG_SMS_TRANSMISSION_IND = 782,
471f251001cSMauro Carvalho Chehab 	MSG_SMS_PID_STATISTICS_IND = 783,
472f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_DOWN_IND = 784,
473f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_DOWN_CONF = 785,
474f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_UP_IND = 786,
475f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_UP_CONF = 787,
476f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_MODE_SET_REQ = 790,
477f251001cSMauro Carvalho Chehab 	MSG_SMS_POWER_MODE_SET_RES = 791,
478f251001cSMauro Carvalho Chehab 	MSG_SMS_DEBUG_HOST_EVENT_REQ = 792,
479f251001cSMauro Carvalho Chehab 	MSG_SMS_DEBUG_HOST_EVENT_RES = 793,
480f251001cSMauro Carvalho Chehab 	MSG_SMS_NEW_CRYSTAL_REQ = 794,
481f251001cSMauro Carvalho Chehab 	MSG_SMS_NEW_CRYSTAL_RES = 795,
482f251001cSMauro Carvalho Chehab 	MSG_SMS_CONFIG_SPI_REQ = 796,
483f251001cSMauro Carvalho Chehab 	MSG_SMS_CONFIG_SPI_RES = 797,
484f251001cSMauro Carvalho Chehab 	MSG_SMS_I2C_SHORT_STAT_IND = 798,
485f251001cSMauro Carvalho Chehab 	MSG_SMS_START_IR_REQ = 800,
486f251001cSMauro Carvalho Chehab 	MSG_SMS_START_IR_RES = 801,
487f251001cSMauro Carvalho Chehab 	MSG_SMS_IR_SAMPLES_IND = 802,
488f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_CA_SERVICE_IND = 803,
489f251001cSMauro Carvalho Chehab 	MSG_SMS_SLAVE_DEVICE_DETECTED = 804,
490f251001cSMauro Carvalho Chehab 	MSG_SMS_INTERFACE_LOCK_IND = 805,
491f251001cSMauro Carvalho Chehab 	MSG_SMS_INTERFACE_UNLOCK_IND = 806,
492f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_ROSUM_BUFF_REQ = 810,
493f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_ROSUM_BUFF_RES = 811,
494f251001cSMauro Carvalho Chehab 	MSG_SMS_ROSUM_BUFF = 812,
495f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_AES128_KEY_REQ = 815,
496f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_AES128_KEY_RES = 816,
497f251001cSMauro Carvalho Chehab 	MSG_SMS_MBBMS_WRITE_REQ = 817,
498f251001cSMauro Carvalho Chehab 	MSG_SMS_MBBMS_WRITE_RES = 818,
499f251001cSMauro Carvalho Chehab 	MSG_SMS_MBBMS_READ_IND = 819,
500f251001cSMauro Carvalho Chehab 	MSG_SMS_IQ_STREAM_START_REQ = 820,
501f251001cSMauro Carvalho Chehab 	MSG_SMS_IQ_STREAM_START_RES = 821,
502f251001cSMauro Carvalho Chehab 	MSG_SMS_IQ_STREAM_STOP_REQ = 822,
503f251001cSMauro Carvalho Chehab 	MSG_SMS_IQ_STREAM_STOP_RES = 823,
504f251001cSMauro Carvalho Chehab 	MSG_SMS_IQ_STREAM_DATA_BLOCK = 824,
505f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_EEPROM_VERSION_REQ = 825,
506f251001cSMauro Carvalho Chehab 	MSG_SMS_GET_EEPROM_VERSION_RES = 826,
507f251001cSMauro Carvalho Chehab 	MSG_SMS_SIGNAL_DETECTED_IND = 827,
508f251001cSMauro Carvalho Chehab 	MSG_SMS_NO_SIGNAL_IND = 828,
509f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ = 830,
510f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_SHUTDOWN_SLAVE_RES = 831,
511f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_BRINGUP_SLAVE_REQ = 832,
512f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_BRINGUP_SLAVE_RES = 833,
513f251001cSMauro Carvalho Chehab 	MSG_SMS_EXTERNAL_LNA_CTRL_REQ = 834,
514f251001cSMauro Carvalho Chehab 	MSG_SMS_EXTERNAL_LNA_CTRL_RES = 835,
515f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_PERIODIC_STATISTICS_REQ = 836,
516f251001cSMauro Carvalho Chehab 	MSG_SMS_SET_PERIODIC_STATISTICS_RES = 837,
517f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ = 838,
518f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES = 839,
519f251001cSMauro Carvalho Chehab 	LOCAL_TUNE = 850,
520f251001cSMauro Carvalho Chehab 	LOCAL_IFFT_H_ICI = 851,
521f251001cSMauro Carvalho Chehab 	MSG_RESYNC_REQ = 852,
522f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ = 853,
523f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_MRC_STATISTICS_RES = 854,
524f251001cSMauro Carvalho Chehab 	MSG_SMS_LOG_EX_ITEM = 855,
525f251001cSMauro Carvalho Chehab 	MSG_SMS_DEVICE_DATA_LOSS_IND = 856,
526f251001cSMauro Carvalho Chehab 	MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND = 857,
527f251001cSMauro Carvalho Chehab 	MSG_SMS_USER_MSG_REQ = 858,
528f251001cSMauro Carvalho Chehab 	MSG_SMS_USER_MSG_RES = 859,
529f251001cSMauro Carvalho Chehab 	MSG_SMS_SMART_CARD_INIT_REQ = 860,
530f251001cSMauro Carvalho Chehab 	MSG_SMS_SMART_CARD_INIT_RES = 861,
531f251001cSMauro Carvalho Chehab 	MSG_SMS_SMART_CARD_WRITE_REQ = 862,
532f251001cSMauro Carvalho Chehab 	MSG_SMS_SMART_CARD_WRITE_RES = 863,
533f251001cSMauro Carvalho Chehab 	MSG_SMS_SMART_CARD_READ_IND = 864,
534f251001cSMauro Carvalho Chehab 	MSG_SMS_TSE_ENABLE_REQ = 866,
535f251001cSMauro Carvalho Chehab 	MSG_SMS_TSE_ENABLE_RES = 867,
536f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ = 868,
537f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES = 869,
538f251001cSMauro Carvalho Chehab 	MSG_SMS_LED_CONFIG_REQ = 870,
539f251001cSMauro Carvalho Chehab 	MSG_SMS_LED_CONFIG_RES = 871,
540f251001cSMauro Carvalho Chehab 	MSG_PWM_ANTENNA_REQ = 872,
541f251001cSMauro Carvalho Chehab 	MSG_PWM_ANTENNA_RES = 873,
542f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SMD_SN_REQ = 874,
543f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SMD_SN_RES = 875,
544f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_CA_CW_REQ = 876,
545f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_CA_CW_RES = 877,
546f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_CA_SALT_REQ = 878,
547f251001cSMauro Carvalho Chehab 	MSG_SMS_CMMB_SET_CA_SALT_RES = 879,
548f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_INIT_REQ = 880,
549f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_INIT_RES = 881,
550f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_PROCESS_SECTION_REQ = 882,
551f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_PROCESS_SECTION_RES = 883,
552f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_CREATE_OBJECT_REQ = 884,
553f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_CREATE_OBJECT_RES = 885,
554f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_CONFIGURE_REQ = 886,
555f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_CONFIGURE_RES = 887,
556f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_SET_KEYS_REQ = 888,
557f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_SET_KEYS_RES = 889,
558f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_HEADER_REQ = 890,
559f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_HEADER_RES = 891,
560f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_DATA_REQ = 892,
561f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_DATA_RES = 893,
562f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_GET_DATA_REQ = 894,
563f251001cSMauro Carvalho Chehab 	MSG_SMS_DBD_PROCESS_GET_DATA_RES = 895,
564f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_OPEN_SESSION_REQ = 896,
565f251001cSMauro Carvalho Chehab 	MSG_SMS_NSCD_OPEN_SESSION_RES = 897,
566f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ = 898,
567f251001cSMauro Carvalho Chehab 	MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES = 899,
568f251001cSMauro Carvalho Chehab 	MSG_LAST_MSG_TYPE = 900,
569f251001cSMauro Carvalho Chehab };
5700013ca8cSMauro Carvalho Chehab 
5710013ca8cSMauro Carvalho Chehab #define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \
57290414248SMauro Carvalho Chehab 	(ptr)->msg_type = type; \
57390414248SMauro Carvalho Chehab 	(ptr)->msg_src_id = src; \
57490414248SMauro Carvalho Chehab 	(ptr)->msg_dst_id = dst; \
57590414248SMauro Carvalho Chehab 	(ptr)->msg_length = len; \
57690414248SMauro Carvalho Chehab 	(ptr)->msg_flags = 0; \
5770013ca8cSMauro Carvalho Chehab } while (0)
5780013ca8cSMauro Carvalho Chehab 
5790013ca8cSMauro Carvalho Chehab #define SMS_INIT_MSG(ptr, type, len) \
5800013ca8cSMauro Carvalho Chehab 	SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)
5810013ca8cSMauro Carvalho Chehab 
5820013ca8cSMauro Carvalho Chehab enum SMS_DVB3_EVENTS {
5830013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_INIT = 0,
5840013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_SLEEP,
5850013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_HOTPLUG,
5860013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_FE_LOCK,
5870013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_FE_UNLOCK,
5880013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_UNC_OK,
5890013ca8cSMauro Carvalho Chehab 	DVB3_EVENT_UNC_ERR
5900013ca8cSMauro Carvalho Chehab };
5910013ca8cSMauro Carvalho Chehab 
5920013ca8cSMauro Carvalho Chehab enum SMS_DEVICE_MODE {
5930013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_NONE = -1,
5940013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_DVBT = 0,
5950013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_DVBH,
5960013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_DAB_TDMB,
5970013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_DAB_TDMB_DABIP,
5980013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_DVBT_BDA,
5990013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_ISDBT,
6000013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_ISDBT_BDA,
6010013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_CMMB,
6020013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_RAW_TUNER,
603ab2b599eSMauro Carvalho Chehab 	DEVICE_MODE_FM_RADIO,
604ab2b599eSMauro Carvalho Chehab 	DEVICE_MODE_FM_RADIO_BDA,
605ab2b599eSMauro Carvalho Chehab 	DEVICE_MODE_ATSC,
6060013ca8cSMauro Carvalho Chehab 	DEVICE_MODE_MAX,
6070013ca8cSMauro Carvalho Chehab };
6080013ca8cSMauro Carvalho Chehab 
609dfef84fcSMauro Carvalho Chehab struct sms_msg_hdr {
610dfef84fcSMauro Carvalho Chehab 	u16	msg_type;
611dfef84fcSMauro Carvalho Chehab 	u8	msg_src_id;
612dfef84fcSMauro Carvalho Chehab 	u8	msg_dst_id;
613dfef84fcSMauro Carvalho Chehab 	u16	msg_length; /* length of entire message, including header */
614dfef84fcSMauro Carvalho Chehab 	u16	msg_flags;
6150013ca8cSMauro Carvalho Chehab };
6160013ca8cSMauro Carvalho Chehab 
617dfef84fcSMauro Carvalho Chehab struct sms_msg_data {
618dfef84fcSMauro Carvalho Chehab 	struct sms_msg_hdr x_msg_header;
61928a59df4SMauro Carvalho Chehab 	u32 msg_data[1];
6200013ca8cSMauro Carvalho Chehab };
6210013ca8cSMauro Carvalho Chehab 
622dfef84fcSMauro Carvalho Chehab struct sms_msg_data2 {
623dfef84fcSMauro Carvalho Chehab 	struct sms_msg_hdr x_msg_header;
62428a59df4SMauro Carvalho Chehab 	u32 msg_data[2];
6250013ca8cSMauro Carvalho Chehab };
6260013ca8cSMauro Carvalho Chehab 
627*13dfead4SGustavo A. R. Silva struct sms_msg_data5 {
628dfef84fcSMauro Carvalho Chehab 	struct sms_msg_hdr x_msg_header;
629*13dfead4SGustavo A. R. Silva 	u32 msg_data[5];
630018b0c6fSMauro Carvalho Chehab };
631018b0c6fSMauro Carvalho Chehab 
632dfef84fcSMauro Carvalho Chehab struct sms_data_download {
633dfef84fcSMauro Carvalho Chehab 	struct sms_msg_hdr	x_msg_header;
634dfef84fcSMauro Carvalho Chehab 	u32			mem_addr;
635dfef84fcSMauro Carvalho Chehab 	u8			payload[SMS_MAX_PAYLOAD_SIZE];
6360013ca8cSMauro Carvalho Chehab };
6370013ca8cSMauro Carvalho Chehab 
638dfef84fcSMauro Carvalho Chehab struct sms_version_res {
639dfef84fcSMauro Carvalho Chehab 	struct sms_msg_hdr	x_msg_header;
6400013ca8cSMauro Carvalho Chehab 
641dfef84fcSMauro Carvalho Chehab 	u16		chip_model; /* e.g. 0x1102 for SMS-1102 "Nova" */
642dfef84fcSMauro Carvalho Chehab 	u8		step; /* 0 - step A */
643dfef84fcSMauro Carvalho Chehab 	u8		metal_fix; /* 0 - Metal 0 */
6440013ca8cSMauro Carvalho Chehab 
645dfef84fcSMauro Carvalho Chehab 	/* firmware_id 0xFF if ROM, otherwise the
6460013ca8cSMauro Carvalho Chehab 	 * value indicated by SMSHOSTLIB_DEVICE_MODES_E */
647dfef84fcSMauro Carvalho Chehab 	u8 firmware_id;
648dfef84fcSMauro Carvalho Chehab 	/* supported_protocols Bitwise OR combination of
6490013ca8cSMauro Carvalho Chehab 					     * supported protocols */
650dfef84fcSMauro Carvalho Chehab 	u8 supported_protocols;
6510013ca8cSMauro Carvalho Chehab 
652dfef84fcSMauro Carvalho Chehab 	u8		version_major;
653dfef84fcSMauro Carvalho Chehab 	u8		version_minor;
654dfef84fcSMauro Carvalho Chehab 	u8		version_patch;
655dfef84fcSMauro Carvalho Chehab 	u8		version_field_patch;
6560013ca8cSMauro Carvalho Chehab 
657dfef84fcSMauro Carvalho Chehab 	u8		rom_ver_major;
658dfef84fcSMauro Carvalho Chehab 	u8		rom_ver_minor;
659dfef84fcSMauro Carvalho Chehab 	u8		rom_ver_patch;
660dfef84fcSMauro Carvalho Chehab 	u8		rom_ver_field_patch;
6610013ca8cSMauro Carvalho Chehab 
6620013ca8cSMauro Carvalho Chehab 	u8		TextLabel[34];
6630013ca8cSMauro Carvalho Chehab };
6640013ca8cSMauro Carvalho Chehab 
665dfef84fcSMauro Carvalho Chehab struct sms_firmware {
666dfef84fcSMauro Carvalho Chehab 	u32			check_sum;
667dfef84fcSMauro Carvalho Chehab 	u32			length;
668dfef84fcSMauro Carvalho Chehab 	u32			start_address;
669dfef84fcSMauro Carvalho Chehab 	u8			payload[1];
6700013ca8cSMauro Carvalho Chehab };
6710013ca8cSMauro Carvalho Chehab 
672dfef84fcSMauro Carvalho Chehab /* statistics information returned as response for
673dfef84fcSMauro Carvalho Chehab  * SmsHostApiGetstatistics_Req */
674cf0e9cfcSMauro Carvalho Chehab struct sms_stats {
675dfef84fcSMauro Carvalho Chehab 	u32 reserved;		/* reserved */
6760013ca8cSMauro Carvalho Chehab 
6770013ca8cSMauro Carvalho Chehab 	/* Common parameters */
678dfef84fcSMauro Carvalho Chehab 	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
679dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
680dfef84fcSMauro Carvalho Chehab 	u32 is_external_lna_on;	/* 0 - external LNA off, 1 - external LNA on */
6810013ca8cSMauro Carvalho Chehab 
6820013ca8cSMauro Carvalho Chehab 	/* Reception quality */
6830013ca8cSMauro Carvalho Chehab 	s32 SNR;		/* dB */
68428a59df4SMauro Carvalho Chehab 	u32 ber;		/* Post Viterbi ber [1E-5] */
6850013ca8cSMauro Carvalho Chehab 	u32 FIB_CRC;		/* CRC errors percentage, valid only for DAB */
68628a59df4SMauro Carvalho Chehab 	u32 ts_per;		/* Transport stream PER,
6870013ca8cSMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A, valid only for DVB-T/H */
6880013ca8cSMauro Carvalho Chehab 	u32 MFER;		/* DVB-H frame error rate in percentage,
6890013ca8cSMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
6900013ca8cSMauro Carvalho Chehab 	s32 RSSI;		/* dBm */
691dfef84fcSMauro Carvalho Chehab 	s32 in_band_pwr;		/* In band power in dBM */
692dfef84fcSMauro Carvalho Chehab 	s32 carrier_offset;	/* Carrier Offset in bin/1024 */
6930013ca8cSMauro Carvalho Chehab 
6940013ca8cSMauro Carvalho Chehab 	/* Transmission parameters */
695dfef84fcSMauro Carvalho Chehab 	u32 frequency;		/* frequency in Hz */
696dfef84fcSMauro Carvalho Chehab 	u32 bandwidth;		/* bandwidth in MHz, valid only for DVB-T/H */
697dfef84fcSMauro Carvalho Chehab 	u32 transmission_mode;	/* Transmission Mode, for DAB modes 1-4,
6980013ca8cSMauro Carvalho Chehab 	for DVB-T/H FFT mode carriers in Kilos */
699dfef84fcSMauro Carvalho Chehab 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET,
7000013ca8cSMauro Carvalho Chehab 	valid only for DVB-T/H */
701dfef84fcSMauro Carvalho Chehab 	u32 guard_interval;	/* Guard Interval from
7020013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_GUARD_INTERVALS_ET,	valid only for DVB-T/H */
703dfef84fcSMauro Carvalho Chehab 	u32 code_rate;		/* Code Rate from SMSHOSTLIB_CODE_RATE_ET,
7040013ca8cSMauro Carvalho Chehab 	valid only for DVB-T/H */
705dfef84fcSMauro Carvalho Chehab 	u32 lp_code_rate;		/* Low Priority Code Rate from
7060013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_CODE_RATE_ET, valid only for DVB-T/H */
707dfef84fcSMauro Carvalho Chehab 	u32 hierarchy;		/* hierarchy from SMSHOSTLIB_HIERARCHY_ET,
7080013ca8cSMauro Carvalho Chehab 	valid only for DVB-T/H */
709dfef84fcSMauro Carvalho Chehab 	u32 constellation;	/* constellation from
7100013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_CONSTELLATION_ET, valid only for DVB-T/H */
7110013ca8cSMauro Carvalho Chehab 
7120013ca8cSMauro Carvalho Chehab 	/* Burst parameters, valid only for DVB-H */
713dfef84fcSMauro Carvalho Chehab 	u32 burst_size;		/* Current burst size in bytes,
7140013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
715dfef84fcSMauro Carvalho Chehab 	u32 burst_duration;	/* Current burst duration in mSec,
7160013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
717dfef84fcSMauro Carvalho Chehab 	u32 burst_cycle_time;	/* Current burst cycle time in mSec,
7180013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
719dfef84fcSMauro Carvalho Chehab 	u32 calc_burst_cycle_time;/* Current burst cycle time in mSec,
7200013ca8cSMauro Carvalho Chehab 	as calculated by demodulator, valid only for DVB-H */
721dfef84fcSMauro Carvalho Chehab 	u32 num_of_rows;		/* Number of rows in MPE table,
7220013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
723dfef84fcSMauro Carvalho Chehab 	u32 num_of_padd_cols;	/* Number of padding columns in MPE table,
7240013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
725dfef84fcSMauro Carvalho Chehab 	u32 num_of_punct_cols;	/* Number of puncturing columns in MPE table,
7260013ca8cSMauro Carvalho Chehab 	valid only for DVB-H */
727dfef84fcSMauro Carvalho Chehab 	u32 error_ts_packets;	/* Number of erroneous
7280013ca8cSMauro Carvalho Chehab 	transport-stream packets */
729dfef84fcSMauro Carvalho Chehab 	u32 total_ts_packets;	/* Total number of transport-stream packets */
730dfef84fcSMauro Carvalho Chehab 	u32 num_of_valid_mpe_tlbs;	/* Number of MPE tables which do not include
7310013ca8cSMauro Carvalho Chehab 	errors after MPE RS decoding */
732dfef84fcSMauro Carvalho Chehab 	u32 num_of_invalid_mpe_tlbs;/* Number of MPE tables which include errors
7330013ca8cSMauro Carvalho Chehab 	after MPE RS decoding */
734dfef84fcSMauro Carvalho Chehab 	u32 num_of_corrected_mpe_tlbs;/* Number of MPE tables which were
7350013ca8cSMauro Carvalho Chehab 	corrected by MPE RS decoding */
7360013ca8cSMauro Carvalho Chehab 	/* Common params */
7374b129dc9SMauro Carvalho Chehab 	u32 ber_error_count;	/* Number of erroneous SYNC bits. */
738dfef84fcSMauro Carvalho Chehab 	u32 ber_bit_count;	/* Total number of SYNC bits. */
7390013ca8cSMauro Carvalho Chehab 
7400013ca8cSMauro Carvalho Chehab 	/* Interface information */
741dfef84fcSMauro Carvalho Chehab 	u32 sms_to_host_tx_errors;	/* Total number of transmission errors. */
7420013ca8cSMauro Carvalho Chehab 
7430013ca8cSMauro Carvalho Chehab 	/* DAB/T-DMB */
74428a59df4SMauro Carvalho Chehab 	u32 pre_ber;		/* DAB/T-DMB only: Pre Viterbi ber [1E-5] */
7450013ca8cSMauro Carvalho Chehab 
7460013ca8cSMauro Carvalho Chehab 	/* DVB-H TPS parameters */
747dfef84fcSMauro Carvalho Chehab 	u32 cell_id;		/* TPS Cell ID in bits 15..0, bits 31..16 zero;
7480013ca8cSMauro Carvalho Chehab 	 if set to 0xFFFFFFFF cell_id not yet recovered */
749dfef84fcSMauro Carvalho Chehab 	u32 dvbh_srv_ind_hp;	/* DVB-H service indication info, bit 1 -
7500013ca8cSMauro Carvalho Chehab 	Time Slicing indicator, bit 0 - MPE-FEC indicator */
751dfef84fcSMauro Carvalho Chehab 	u32 dvbh_srv_ind_lp;	/* DVB-H service indication info, bit 1 -
7520013ca8cSMauro Carvalho Chehab 	Time Slicing indicator, bit 0 - MPE-FEC indicator */
7530013ca8cSMauro Carvalho Chehab 
754dfef84fcSMauro Carvalho Chehab 	u32 num_mpe_received;	/* DVB-H, Num MPE section received */
7550013ca8cSMauro Carvalho Chehab 
756dfef84fcSMauro Carvalho Chehab 	u32 reservedFields[10];	/* reserved */
7570013ca8cSMauro Carvalho Chehab };
7580013ca8cSMauro Carvalho Chehab 
759dfef84fcSMauro Carvalho Chehab struct sms_msg_statistics_info {
760dfef84fcSMauro Carvalho Chehab 	u32 request_result;
7610013ca8cSMauro Carvalho Chehab 
762cf0e9cfcSMauro Carvalho Chehab 	struct sms_stats stat;
7630013ca8cSMauro Carvalho Chehab 
7640013ca8cSMauro Carvalho Chehab 	/* Split the calc of the SNR in DAB */
765dfef84fcSMauro Carvalho Chehab 	u32 signal; /* dB */
766dfef84fcSMauro Carvalho Chehab 	u32 noise; /* dB */
7670013ca8cSMauro Carvalho Chehab 
7680013ca8cSMauro Carvalho Chehab };
7690013ca8cSMauro Carvalho Chehab 
770cf0e9cfcSMauro Carvalho Chehab struct sms_isdbt_layer_stats {
7710013ca8cSMauro Carvalho Chehab 	/* Per-layer information */
772dfef84fcSMauro Carvalho Chehab 	u32 code_rate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET,
7730013ca8cSMauro Carvalho Chehab 		       * 255 means layer does not exist */
774dfef84fcSMauro Carvalho Chehab 	u32 constellation; /* constellation from SMSHOSTLIB_CONSTELLATION_ET,
7750013ca8cSMauro Carvalho Chehab 			    * 255 means layer does not exist */
77628a59df4SMauro Carvalho Chehab 	u32 ber; /* Post Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */
777dfef84fcSMauro Carvalho Chehab 	u32 ber_error_count; /* Post Viterbi Error Bits Count */
778dfef84fcSMauro Carvalho Chehab 	u32 ber_bit_count; /* Post Viterbi Total Bits Count */
77928a59df4SMauro Carvalho Chehab 	u32 pre_ber; /* Pre Viterbi ber [1E-5], 0xFFFFFFFF indicate N/A */
78028a59df4SMauro Carvalho Chehab 	u32 ts_per; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */
781dfef84fcSMauro Carvalho Chehab 	u32 error_ts_packets; /* Number of erroneous transport-stream packets */
782dfef84fcSMauro Carvalho Chehab 	u32 total_ts_packets; /* Total number of transport-stream packets */
783dfef84fcSMauro Carvalho Chehab 	u32 ti_ldepth_i; /* Time interleaver depth I parameter,
7840013ca8cSMauro Carvalho Chehab 			* 255 means layer does not exist */
785dfef84fcSMauro Carvalho Chehab 	u32 number_of_segments; /* Number of segments in layer A,
7860013ca8cSMauro Carvalho Chehab 			       * 255 means layer does not exist */
787dfef84fcSMauro Carvalho Chehab 	u32 tmcc_errors; /* TMCC errors */
7880013ca8cSMauro Carvalho Chehab };
7890013ca8cSMauro Carvalho Chehab 
790cf0e9cfcSMauro Carvalho Chehab struct sms_isdbt_stats {
791dfef84fcSMauro Carvalho Chehab 	u32 statistics_type; /* Enumerator identifying the type of the
7920013ca8cSMauro Carvalho Chehab 				* structure.  Values are the same as
7930013ca8cSMauro Carvalho Chehab 				* SMSHOSTLIB_DEVICE_MODES_E
7940013ca8cSMauro Carvalho Chehab 				*
7950013ca8cSMauro Carvalho Chehab 				* This field MUST always be first in any
7960013ca8cSMauro Carvalho Chehab 				* statistics structure */
7970013ca8cSMauro Carvalho Chehab 
798dfef84fcSMauro Carvalho Chehab 	u32 full_size; /* Total size of the structure returned by the modem.
7990013ca8cSMauro Carvalho Chehab 		       * If the size requested by the host is smaller than
800dfef84fcSMauro Carvalho Chehab 		       * full_size, the struct will be truncated */
8010013ca8cSMauro Carvalho Chehab 
8020013ca8cSMauro Carvalho Chehab 	/* Common parameters */
803dfef84fcSMauro Carvalho Chehab 	u32 is_rf_locked; /* 0 - not locked, 1 - locked */
804dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked; /* 0 - not locked, 1 - locked */
805dfef84fcSMauro Carvalho Chehab 	u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */
8060013ca8cSMauro Carvalho Chehab 
8070013ca8cSMauro Carvalho Chehab 	/* Reception quality */
8080013ca8cSMauro Carvalho Chehab 	s32  SNR; /* dB */
8090013ca8cSMauro Carvalho Chehab 	s32  RSSI; /* dBm */
810dfef84fcSMauro Carvalho Chehab 	s32  in_band_pwr; /* In band power in dBM */
811dfef84fcSMauro Carvalho Chehab 	s32  carrier_offset; /* Carrier Offset in Hz */
8120013ca8cSMauro Carvalho Chehab 
8130013ca8cSMauro Carvalho Chehab 	/* Transmission parameters */
814dfef84fcSMauro Carvalho Chehab 	u32 frequency; /* frequency in Hz */
815dfef84fcSMauro Carvalho Chehab 	u32 bandwidth; /* bandwidth in MHz */
816dfef84fcSMauro Carvalho Chehab 	u32 transmission_mode; /* ISDB-T transmission mode */
817dfef84fcSMauro Carvalho Chehab 	u32 modem_state; /* 0 - Acquisition, 1 - Locked */
818dfef84fcSMauro Carvalho Chehab 	u32 guard_interval; /* Guard Interval, 1 divided by value */
819dfef84fcSMauro Carvalho Chehab 	u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */
820dfef84fcSMauro Carvalho Chehab 	u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */
821dfef84fcSMauro Carvalho Chehab 	u32 num_of_layers; /* Number of ISDB-T layers in the network */
8220013ca8cSMauro Carvalho Chehab 
8230013ca8cSMauro Carvalho Chehab 	/* Per-layer information */
8240013ca8cSMauro Carvalho Chehab 	/* Layers A, B and C */
82528a59df4SMauro Carvalho Chehab 	struct sms_isdbt_layer_stats	layer_info[3];
826cf0e9cfcSMauro Carvalho Chehab 	/* Per-layer statistics, see sms_isdbt_layer_stats */
8270013ca8cSMauro Carvalho Chehab 
8280013ca8cSMauro Carvalho Chehab 	/* Interface information */
829dfef84fcSMauro Carvalho Chehab 	u32 sms_to_host_tx_errors; /* Total number of transmission errors. */
8300013ca8cSMauro Carvalho Chehab };
8310013ca8cSMauro Carvalho Chehab 
832cf0e9cfcSMauro Carvalho Chehab struct sms_isdbt_stats_ex {
833dfef84fcSMauro Carvalho Chehab 	u32 statistics_type; /* Enumerator identifying the type of the
834b4059095SMauro Carvalho Chehab 				* structure.  Values are the same as
835b4059095SMauro Carvalho Chehab 				* SMSHOSTLIB_DEVICE_MODES_E
836b4059095SMauro Carvalho Chehab 				*
837b4059095SMauro Carvalho Chehab 				* This field MUST always be first in any
838b4059095SMauro Carvalho Chehab 				* statistics structure */
839b4059095SMauro Carvalho Chehab 
840dfef84fcSMauro Carvalho Chehab 	u32 full_size; /* Total size of the structure returned by the modem.
841b4059095SMauro Carvalho Chehab 		       * If the size requested by the host is smaller than
842dfef84fcSMauro Carvalho Chehab 		       * full_size, the struct will be truncated */
843b4059095SMauro Carvalho Chehab 
844b4059095SMauro Carvalho Chehab 	/* Common parameters */
845dfef84fcSMauro Carvalho Chehab 	u32 is_rf_locked; /* 0 - not locked, 1 - locked */
846dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked; /* 0 - not locked, 1 - locked */
847dfef84fcSMauro Carvalho Chehab 	u32 is_external_lna_on; /* 0 - external LNA off, 1 - external LNA on */
848b4059095SMauro Carvalho Chehab 
849b4059095SMauro Carvalho Chehab 	/* Reception quality */
850b4059095SMauro Carvalho Chehab 	s32  SNR; /* dB */
851b4059095SMauro Carvalho Chehab 	s32  RSSI; /* dBm */
852dfef84fcSMauro Carvalho Chehab 	s32  in_band_pwr; /* In band power in dBM */
853dfef84fcSMauro Carvalho Chehab 	s32  carrier_offset; /* Carrier Offset in Hz */
854b4059095SMauro Carvalho Chehab 
855b4059095SMauro Carvalho Chehab 	/* Transmission parameters */
856dfef84fcSMauro Carvalho Chehab 	u32 frequency; /* frequency in Hz */
857dfef84fcSMauro Carvalho Chehab 	u32 bandwidth; /* bandwidth in MHz */
858dfef84fcSMauro Carvalho Chehab 	u32 transmission_mode; /* ISDB-T transmission mode */
859dfef84fcSMauro Carvalho Chehab 	u32 modem_state; /* 0 - Acquisition, 1 - Locked */
860dfef84fcSMauro Carvalho Chehab 	u32 guard_interval; /* Guard Interval, 1 divided by value */
861dfef84fcSMauro Carvalho Chehab 	u32 system_type; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */
862dfef84fcSMauro Carvalho Chehab 	u32 partial_reception; /* TRUE - partial reception, FALSE otherwise */
863dfef84fcSMauro Carvalho Chehab 	u32 num_of_layers; /* Number of ISDB-T layers in the network */
864b4059095SMauro Carvalho Chehab 
865dfef84fcSMauro Carvalho Chehab 	u32 segment_number; /* Segment number for ISDB-Tsb */
866dfef84fcSMauro Carvalho Chehab 	u32 tune_bw;	   /* Tuned bandwidth - BW_ISDBT_1SEG / BW_ISDBT_3SEG */
867b4059095SMauro Carvalho Chehab 
868b4059095SMauro Carvalho Chehab 	/* Per-layer information */
869b4059095SMauro Carvalho Chehab 	/* Layers A, B and C */
87028a59df4SMauro Carvalho Chehab 	struct sms_isdbt_layer_stats	layer_info[3];
871cf0e9cfcSMauro Carvalho Chehab 	/* Per-layer statistics, see sms_isdbt_layer_stats */
872b4059095SMauro Carvalho Chehab 
873b4059095SMauro Carvalho Chehab 	/* Interface information */
874dfef84fcSMauro Carvalho Chehab 	u32 reserved1;    /* Was sms_to_host_tx_errors - obsolete . */
875b4059095SMauro Carvalho Chehab  /* Proprietary information */
876dfef84fcSMauro Carvalho Chehab 	u32 ext_antenna;    /* Obsolete field. */
877dfef84fcSMauro Carvalho Chehab 	u32 reception_quality;
878dfef84fcSMauro Carvalho Chehab 	u32 ews_alert_active;   /* signals if EWS alert is currently on */
879dfef84fcSMauro Carvalho Chehab 	u32 lna_on_off;	/* Internal LNA state: 0: OFF, 1: ON */
880b4059095SMauro Carvalho Chehab 
881dfef84fcSMauro Carvalho Chehab 	u32 rf_agc_level;	 /* RF AGC Level [linear units], full gain = 65535 (20dB) */
882dfef84fcSMauro Carvalho Chehab 	u32 bb_agc_level;    /* Baseband AGC level [linear units], full gain = 65535 (71.5dB) */
883dfef84fcSMauro Carvalho Chehab 	u32 fw_errors_counter;   /* Application errors - should be always zero */
884b4059095SMauro Carvalho Chehab 	u8 FwErrorsHistoryArr[8]; /* Last FW errors IDs - first is most recent, last is oldest */
885b4059095SMauro Carvalho Chehab 
886b4059095SMauro Carvalho Chehab 	s32  MRC_SNR;     /* dB */
887dfef84fcSMauro Carvalho Chehab 	u32 snr_full_res;    /* dB x 65536 */
888dfef84fcSMauro Carvalho Chehab 	u32 reserved4[4];
889b4059095SMauro Carvalho Chehab };
890b4059095SMauro Carvalho Chehab 
891b4059095SMauro Carvalho Chehab 
892cf0e9cfcSMauro Carvalho Chehab struct sms_pid_stats_data {
8930013ca8cSMauro Carvalho Chehab 	struct PID_BURST_S {
8940013ca8cSMauro Carvalho Chehab 		u32 size;
8950013ca8cSMauro Carvalho Chehab 		u32 padding_cols;
8960013ca8cSMauro Carvalho Chehab 		u32 punct_cols;
8970013ca8cSMauro Carvalho Chehab 		u32 duration;
8980013ca8cSMauro Carvalho Chehab 		u32 cycle;
8990013ca8cSMauro Carvalho Chehab 		u32 calc_cycle;
9000013ca8cSMauro Carvalho Chehab 	} burst;
9010013ca8cSMauro Carvalho Chehab 
9020013ca8cSMauro Carvalho Chehab 	u32 tot_tbl_cnt;
9030013ca8cSMauro Carvalho Chehab 	u32 invalid_tbl_cnt;
9040013ca8cSMauro Carvalho Chehab 	u32 tot_cor_tbl;
9050013ca8cSMauro Carvalho Chehab };
9060013ca8cSMauro Carvalho Chehab 
907cf0e9cfcSMauro Carvalho Chehab struct sms_pid_data {
9080013ca8cSMauro Carvalho Chehab 	u32 pid;
9090013ca8cSMauro Carvalho Chehab 	u32 num_rows;
910cf0e9cfcSMauro Carvalho Chehab 	struct sms_pid_stats_data pid_statistics;
9110013ca8cSMauro Carvalho Chehab };
9120013ca8cSMauro Carvalho Chehab 
9130013ca8cSMauro Carvalho Chehab #define CORRECT_STAT_RSSI(_stat) ((_stat).RSSI *= -1)
914dfef84fcSMauro Carvalho Chehab #define CORRECT_STAT_BANDWIDTH(_stat) (_stat.bandwidth = 8 - _stat.bandwidth)
9150013ca8cSMauro Carvalho Chehab #define CORRECT_STAT_TRANSMISSON_MODE(_stat) \
916dfef84fcSMauro Carvalho Chehab 	if (_stat.transmission_mode == 0) \
917dfef84fcSMauro Carvalho Chehab 		_stat.transmission_mode = 2; \
918dfef84fcSMauro Carvalho Chehab 	else if (_stat.transmission_mode == 1) \
919dfef84fcSMauro Carvalho Chehab 		_stat.transmission_mode = 8; \
9200013ca8cSMauro Carvalho Chehab 		else \
921dfef84fcSMauro Carvalho Chehab 			_stat.transmission_mode = 4;
9220013ca8cSMauro Carvalho Chehab 
923cf0e9cfcSMauro Carvalho Chehab struct sms_tx_stats {
924dfef84fcSMauro Carvalho Chehab 	u32 frequency;		/* frequency in Hz */
925dfef84fcSMauro Carvalho Chehab 	u32 bandwidth;		/* bandwidth in MHz */
926dfef84fcSMauro Carvalho Chehab 	u32 transmission_mode;	/* FFT mode carriers in Kilos */
927dfef84fcSMauro Carvalho Chehab 	u32 guard_interval;	/* Guard Interval from
9280013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_GUARD_INTERVALS_ET */
929dfef84fcSMauro Carvalho Chehab 	u32 code_rate;		/* Code Rate from SMSHOSTLIB_CODE_RATE_ET */
930dfef84fcSMauro Carvalho Chehab 	u32 lp_code_rate;		/* Low Priority Code Rate from
9310013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_CODE_RATE_ET */
932dfef84fcSMauro Carvalho Chehab 	u32 hierarchy;		/* hierarchy from SMSHOSTLIB_HIERARCHY_ET */
933dfef84fcSMauro Carvalho Chehab 	u32 constellation;	/* constellation from
9340013ca8cSMauro Carvalho Chehab 	SMSHOSTLIB_CONSTELLATION_ET */
9350013ca8cSMauro Carvalho Chehab 
9360013ca8cSMauro Carvalho Chehab 	/* DVB-H TPS parameters */
937dfef84fcSMauro Carvalho Chehab 	u32 cell_id;		/* TPS Cell ID in bits 15..0, bits 31..16 zero;
9380013ca8cSMauro Carvalho Chehab 	 if set to 0xFFFFFFFF cell_id not yet recovered */
939dfef84fcSMauro Carvalho Chehab 	u32 dvbh_srv_ind_hp;	/* DVB-H service indication info, bit 1 -
9400013ca8cSMauro Carvalho Chehab 	 Time Slicing indicator, bit 0 - MPE-FEC indicator */
941dfef84fcSMauro Carvalho Chehab 	u32 dvbh_srv_ind_lp;	/* DVB-H service indication info, bit 1 -
9420013ca8cSMauro Carvalho Chehab 	 Time Slicing indicator, bit 0 - MPE-FEC indicator */
943dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
9440013ca8cSMauro Carvalho Chehab };
9450013ca8cSMauro Carvalho Chehab 
946cf0e9cfcSMauro Carvalho Chehab struct sms_rx_stats {
947dfef84fcSMauro Carvalho Chehab 	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
948dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
949dfef84fcSMauro Carvalho Chehab 	u32 is_external_lna_on;	/* 0 - external LNA off, 1 - external LNA on */
9500013ca8cSMauro Carvalho Chehab 
951dfef84fcSMauro Carvalho Chehab 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
9520013ca8cSMauro Carvalho Chehab 	s32 SNR;		/* dB */
95328a59df4SMauro Carvalho Chehab 	u32 ber;		/* Post Viterbi ber [1E-5] */
954f58c91ceSJonathan McCrohan 	u32 ber_error_count;	/* Number of erroneous SYNC bits. */
955dfef84fcSMauro Carvalho Chehab 	u32 ber_bit_count;	/* Total number of SYNC bits. */
95628a59df4SMauro Carvalho Chehab 	u32 ts_per;		/* Transport stream PER,
9570013ca8cSMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A */
9580013ca8cSMauro Carvalho Chehab 	u32 MFER;		/* DVB-H frame error rate in percentage,
9590013ca8cSMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
9600013ca8cSMauro Carvalho Chehab 	s32 RSSI;		/* dBm */
961dfef84fcSMauro Carvalho Chehab 	s32 in_band_pwr;		/* In band power in dBM */
962dfef84fcSMauro Carvalho Chehab 	s32 carrier_offset;	/* Carrier Offset in bin/1024 */
963dfef84fcSMauro Carvalho Chehab 	u32 error_ts_packets;	/* Number of erroneous
9640013ca8cSMauro Carvalho Chehab 	transport-stream packets */
965dfef84fcSMauro Carvalho Chehab 	u32 total_ts_packets;	/* Total number of transport-stream packets */
9660013ca8cSMauro Carvalho Chehab 
9670013ca8cSMauro Carvalho Chehab 	s32 MRC_SNR;		/* dB */
9680013ca8cSMauro Carvalho Chehab 	s32 MRC_RSSI;		/* dBm */
969dfef84fcSMauro Carvalho Chehab 	s32 mrc_in_band_pwr;	/* In band power in dBM */
9700013ca8cSMauro Carvalho Chehab };
9710013ca8cSMauro Carvalho Chehab 
972cf0e9cfcSMauro Carvalho Chehab struct sms_rx_stats_ex {
973dfef84fcSMauro Carvalho Chehab 	u32 is_rf_locked;		/* 0 - not locked, 1 - locked */
974dfef84fcSMauro Carvalho Chehab 	u32 is_demod_locked;	/* 0 - not locked, 1 - locked */
975dfef84fcSMauro Carvalho Chehab 	u32 is_external_lna_on;	/* 0 - external LNA off, 1 - external LNA on */
976b4059095SMauro Carvalho Chehab 
977dfef84fcSMauro Carvalho Chehab 	u32 modem_state;		/* from SMSHOSTLIB_DVB_MODEM_STATE_ET */
978b4059095SMauro Carvalho Chehab 	s32 SNR;		/* dB */
97928a59df4SMauro Carvalho Chehab 	u32 ber;		/* Post Viterbi ber [1E-5] */
980f58c91ceSJonathan McCrohan 	u32 ber_error_count;	/* Number of erroneous SYNC bits. */
981dfef84fcSMauro Carvalho Chehab 	u32 ber_bit_count;	/* Total number of SYNC bits. */
98228a59df4SMauro Carvalho Chehab 	u32 ts_per;		/* Transport stream PER,
983b4059095SMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A */
984b4059095SMauro Carvalho Chehab 	u32 MFER;		/* DVB-H frame error rate in percentage,
985b4059095SMauro Carvalho Chehab 	0xFFFFFFFF indicate N/A, valid only for DVB-H */
986b4059095SMauro Carvalho Chehab 	s32 RSSI;		/* dBm */
987dfef84fcSMauro Carvalho Chehab 	s32 in_band_pwr;		/* In band power in dBM */
988dfef84fcSMauro Carvalho Chehab 	s32 carrier_offset;	/* Carrier Offset in bin/1024 */
989dfef84fcSMauro Carvalho Chehab 	u32 error_ts_packets;	/* Number of erroneous
990b4059095SMauro Carvalho Chehab 	transport-stream packets */
991dfef84fcSMauro Carvalho Chehab 	u32 total_ts_packets;	/* Total number of transport-stream packets */
992b4059095SMauro Carvalho Chehab 
993dfef84fcSMauro Carvalho Chehab 	s32  ref_dev_ppm;
994dfef84fcSMauro Carvalho Chehab 	s32  freq_dev_hz;
995b4059095SMauro Carvalho Chehab 
996b4059095SMauro Carvalho Chehab 	s32 MRC_SNR;		/* dB */
997b4059095SMauro Carvalho Chehab 	s32 MRC_RSSI;		/* dBm */
998dfef84fcSMauro Carvalho Chehab 	s32 mrc_in_band_pwr;	/* In band power in dBM */
999b4059095SMauro Carvalho Chehab };
1000b4059095SMauro Carvalho Chehab 
1001f5d39078SFabian Frederick #define	SRVM_MAX_PID_FILTERS 8
10020013ca8cSMauro Carvalho Chehab 
1003dfef84fcSMauro Carvalho Chehab /* statistics information returned as response for
1004dfef84fcSMauro Carvalho Chehab  * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */
1005cf0e9cfcSMauro Carvalho Chehab struct sms_stats_dvb {
10060013ca8cSMauro Carvalho Chehab 	/* Reception */
1007cf0e9cfcSMauro Carvalho Chehab 	struct sms_rx_stats reception_data;
10080013ca8cSMauro Carvalho Chehab 
10090013ca8cSMauro Carvalho Chehab 	/* Transmission parameters */
1010cf0e9cfcSMauro Carvalho Chehab 	struct sms_tx_stats transmission_data;
10110013ca8cSMauro Carvalho Chehab 
10120013ca8cSMauro Carvalho Chehab 	/* Burst parameters, valid only for DVB-H */
1013cf0e9cfcSMauro Carvalho Chehab 	struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
10140013ca8cSMauro Carvalho Chehab };
10150013ca8cSMauro Carvalho Chehab 
1016dfef84fcSMauro Carvalho Chehab /* statistics information returned as response for
1017dfef84fcSMauro Carvalho Chehab  * SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */
1018cf0e9cfcSMauro Carvalho Chehab struct sms_stats_dvb_ex {
1019b4059095SMauro Carvalho Chehab 	/* Reception */
1020cf0e9cfcSMauro Carvalho Chehab 	struct sms_rx_stats_ex reception_data;
1021b4059095SMauro Carvalho Chehab 
1022b4059095SMauro Carvalho Chehab 	/* Transmission parameters */
1023cf0e9cfcSMauro Carvalho Chehab 	struct sms_tx_stats transmission_data;
1024b4059095SMauro Carvalho Chehab 
1025b4059095SMauro Carvalho Chehab 	/* Burst parameters, valid only for DVB-H */
1026cf0e9cfcSMauro Carvalho Chehab 	struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
1027b4059095SMauro Carvalho Chehab };
1028b4059095SMauro Carvalho Chehab 
1029cf0e9cfcSMauro Carvalho Chehab struct sms_srvm_signal_status {
10300013ca8cSMauro Carvalho Chehab 	u32 result;
10310013ca8cSMauro Carvalho Chehab 	u32 snr;
1032dfef84fcSMauro Carvalho Chehab 	u32 ts_packets;
1033dfef84fcSMauro Carvalho Chehab 	u32 ets_packets;
10340013ca8cSMauro Carvalho Chehab 	u32 constellation;
1035dfef84fcSMauro Carvalho Chehab 	u32 hp_code;
1036dfef84fcSMauro Carvalho Chehab 	u32 tps_srv_ind_lp;
1037dfef84fcSMauro Carvalho Chehab 	u32 tps_srv_ind_hp;
1038dfef84fcSMauro Carvalho Chehab 	u32 cell_id;
10390013ca8cSMauro Carvalho Chehab 	u32 reason;
10400013ca8cSMauro Carvalho Chehab 
1041dfef84fcSMauro Carvalho Chehab 	s32 in_band_power;
1042dfef84fcSMauro Carvalho Chehab 	u32 request_id;
10430013ca8cSMauro Carvalho Chehab };
10440013ca8cSMauro Carvalho Chehab 
1045cf0e9cfcSMauro Carvalho Chehab struct sms_i2c_req {
1046dfef84fcSMauro Carvalho Chehab 	u32	device_address; /* I2c device address */
1047dfef84fcSMauro Carvalho Chehab 	u32	write_count; /* number of bytes to write */
1048dfef84fcSMauro Carvalho Chehab 	u32	read_count; /* number of bytes to read */
10490013ca8cSMauro Carvalho Chehab 	u8	Data[1];
10500013ca8cSMauro Carvalho Chehab };
10510013ca8cSMauro Carvalho Chehab 
1052cf0e9cfcSMauro Carvalho Chehab struct sms_i2c_res {
1053dfef84fcSMauro Carvalho Chehab 	u32	status; /* non-zero value in case of failure */
1054dfef84fcSMauro Carvalho Chehab 	u32	read_count; /* number of bytes read */
10550013ca8cSMauro Carvalho Chehab 	u8	Data[1];
10560013ca8cSMauro Carvalho Chehab };
10570013ca8cSMauro Carvalho Chehab 
10580013ca8cSMauro Carvalho Chehab 
10590013ca8cSMauro Carvalho Chehab struct smscore_config_gpio {
10600013ca8cSMauro Carvalho Chehab #define SMS_GPIO_DIRECTION_INPUT  0
10610013ca8cSMauro Carvalho Chehab #define SMS_GPIO_DIRECTION_OUTPUT 1
10620013ca8cSMauro Carvalho Chehab 	u8 direction;
10630013ca8cSMauro Carvalho Chehab 
10640013ca8cSMauro Carvalho Chehab #define SMS_GPIO_PULLUPDOWN_NONE     0
10650013ca8cSMauro Carvalho Chehab #define SMS_GPIO_PULLUPDOWN_PULLDOWN 1
10660013ca8cSMauro Carvalho Chehab #define SMS_GPIO_PULLUPDOWN_PULLUP   2
10670013ca8cSMauro Carvalho Chehab #define SMS_GPIO_PULLUPDOWN_KEEPER   3
10680013ca8cSMauro Carvalho Chehab 	u8 pullupdown;
10690013ca8cSMauro Carvalho Chehab 
10700013ca8cSMauro Carvalho Chehab #define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL  0
10710013ca8cSMauro Carvalho Chehab #define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1
10720013ca8cSMauro Carvalho Chehab 	u8 inputcharacteristics;
10730013ca8cSMauro Carvalho Chehab 
1074c31b9fb2SMauro Carvalho Chehab 	/* 10xx */
1075c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0
1076c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_WRATE_SLOW 1
1077c31b9fb2SMauro Carvalho Chehab 
1078c31b9fb2SMauro Carvalho Chehab 	/* 11xx */
1079c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS	0
1080c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS	1
1081c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS	2
1082c31b9fb2SMauro Carvalho Chehab #define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS	3
1083c31b9fb2SMauro Carvalho Chehab 
10840013ca8cSMauro Carvalho Chehab 	u8 outputslewrate;
10850013ca8cSMauro Carvalho Chehab 
1086739a8c91SMauro Carvalho Chehab 	/* 10xx */
1087f82757d9SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_S_4mA  0
1088f82757d9SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_S_8mA  1
1089f82757d9SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_S_12mA 2
1090f82757d9SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_S_16mA 3
1091739a8c91SMauro Carvalho Chehab 
1092739a8c91SMauro Carvalho Chehab 	/* 11xx*/
1093739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_1_5mA	0
1094739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_2_8mA	1
1095739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_4mA	2
1096739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_7mA	3
1097739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_10mA	4
1098739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_11mA	5
1099739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_14mA	6
1100739a8c91SMauro Carvalho Chehab #define SMS_GPIO_OUTPUTDRIVING_16mA	7
1101739a8c91SMauro Carvalho Chehab 
11020013ca8cSMauro Carvalho Chehab 	u8 outputdriving;
11030013ca8cSMauro Carvalho Chehab };
11040013ca8cSMauro Carvalho Chehab 
11054c3bdb5eSMauro Carvalho Chehab char *smscore_translate_msg(enum msg_types msgtype);
11064c3bdb5eSMauro Carvalho Chehab 
11070013ca8cSMauro Carvalho Chehab extern int smscore_registry_getmode(char *devpath);
11080013ca8cSMauro Carvalho Chehab 
11090013ca8cSMauro Carvalho Chehab extern int smscore_register_hotplug(hotplug_t hotplug);
11100013ca8cSMauro Carvalho Chehab extern void smscore_unregister_hotplug(hotplug_t hotplug);
11110013ca8cSMauro Carvalho Chehab 
11120013ca8cSMauro Carvalho Chehab extern int smscore_register_device(struct smsdevice_params_t *params,
11134b208f8bSMauro Carvalho Chehab 				   struct smscore_device_t **coredev,
1114782b9d20SMauro Carvalho Chehab 				   gfp_t gfp_buf_flags,
11154b208f8bSMauro Carvalho Chehab 				   void *mdev);
11160013ca8cSMauro Carvalho Chehab extern void smscore_unregister_device(struct smscore_device_t *coredev);
11170013ca8cSMauro Carvalho Chehab 
11180013ca8cSMauro Carvalho Chehab extern int smscore_start_device(struct smscore_device_t *coredev);
11190013ca8cSMauro Carvalho Chehab extern int smscore_load_firmware(struct smscore_device_t *coredev,
11200013ca8cSMauro Carvalho Chehab 				 char *filename,
11210013ca8cSMauro Carvalho Chehab 				 loadfirmware_t loadfirmware_handler);
11220013ca8cSMauro Carvalho Chehab 
11230013ca8cSMauro Carvalho Chehab extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode);
11240013ca8cSMauro Carvalho Chehab extern int smscore_get_device_mode(struct smscore_device_t *coredev);
11250013ca8cSMauro Carvalho Chehab 
11260013ca8cSMauro Carvalho Chehab extern int smscore_register_client(struct smscore_device_t *coredev,
11270013ca8cSMauro Carvalho Chehab 				    struct smsclient_params_t *params,
11280013ca8cSMauro Carvalho Chehab 				    struct smscore_client_t **client);
11290013ca8cSMauro Carvalho Chehab extern void smscore_unregister_client(struct smscore_client_t *client);
11300013ca8cSMauro Carvalho Chehab 
11310013ca8cSMauro Carvalho Chehab extern int smsclient_sendrequest(struct smscore_client_t *client,
11320013ca8cSMauro Carvalho Chehab 				 void *buffer, size_t size);
11330013ca8cSMauro Carvalho Chehab extern void smscore_onresponse(struct smscore_device_t *coredev,
11340013ca8cSMauro Carvalho Chehab 			       struct smscore_buffer_t *cb);
11350013ca8cSMauro Carvalho Chehab 
11360013ca8cSMauro Carvalho Chehab extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev);
11370013ca8cSMauro Carvalho Chehab extern int smscore_map_common_buffer(struct smscore_device_t *coredev,
11380013ca8cSMauro Carvalho Chehab 				      struct vm_area_struct *vma);
11390013ca8cSMauro Carvalho Chehab extern int smscore_send_fw_file(struct smscore_device_t *coredev,
11400013ca8cSMauro Carvalho Chehab 				u8 *ufwbuf, int size);
11410013ca8cSMauro Carvalho Chehab 
11420013ca8cSMauro Carvalho Chehab extern
11430013ca8cSMauro Carvalho Chehab struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev);
11440013ca8cSMauro Carvalho Chehab extern void smscore_putbuffer(struct smscore_device_t *coredev,
11450013ca8cSMauro Carvalho Chehab 			      struct smscore_buffer_t *cb);
11460013ca8cSMauro Carvalho Chehab 
11470013ca8cSMauro Carvalho Chehab /* old GPIO management */
11480013ca8cSMauro Carvalho Chehab int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin,
11490013ca8cSMauro Carvalho Chehab 			   struct smscore_config_gpio *pinconfig);
11500013ca8cSMauro Carvalho Chehab int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level);
11510013ca8cSMauro Carvalho Chehab 
11520013ca8cSMauro Carvalho Chehab /* new GPIO management */
1153dfef84fcSMauro Carvalho Chehab extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num,
1154dfef84fcSMauro Carvalho Chehab 		struct smscore_config_gpio *p_gpio_config);
1155dfef84fcSMauro Carvalho Chehab extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num,
1156dfef84fcSMauro Carvalho Chehab 		u8 new_level);
1157dfef84fcSMauro Carvalho Chehab extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num,
11580013ca8cSMauro Carvalho Chehab 		u8 *level);
11590013ca8cSMauro Carvalho Chehab 
11600013ca8cSMauro Carvalho Chehab void smscore_set_board_id(struct smscore_device_t *core, int id);
11610013ca8cSMauro Carvalho Chehab int smscore_get_board_id(struct smscore_device_t *core);
11620013ca8cSMauro Carvalho Chehab 
11630013ca8cSMauro Carvalho Chehab int smscore_led_state(struct smscore_device_t *core, int led);
11640013ca8cSMauro Carvalho Chehab 
11650013ca8cSMauro Carvalho Chehab 
11660013ca8cSMauro Carvalho Chehab /* ------------------------------------------------------------------------ */
11670013ca8cSMauro Carvalho Chehab 
11680013ca8cSMauro Carvalho Chehab #endif /* __SMS_CORE_API_H__ */
1169