2019-05-29 00:57:14 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2008-05-23 05:05:26 +08:00
|
|
|
/*
|
2008-05-23 05:29:20 +08:00
|
|
|
* Siano core API module
|
|
|
|
*
|
|
|
|
* This file contains implementation for the interface to sms core component
|
|
|
|
*
|
V4L/DVB (10750): import changes from Siano
Import the following changes from Uri Shkolnik
* Two-ways merge with Siano internal repository
* Continuing with DVB sub-system separation
* kconfig and makefile updates
* Code cleanup
This is a work-in-progress sync with Siano's internal repository.
Some changes had to be altered or dropped in order not to break the build.
This breaks normal operation for the current driver, but it is being committed
now for tracking purposes.
These changes introduce the following checkpatch.pl violations:
ERROR: do not use C99 // comments
156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373:
+//#ifdef DVB_CORE
ERROR: do not use C99 // comments
157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374:
+// smsdvb_unregister();
ERROR: do not use C99 // comments
158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375:
+//#endif
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380:
+EXPORT_SYMBOL(smscore_onresponse);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381:
+EXPORT_SYMBOL(sms_get_board);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382:
+EXPORT_SYMBOL(sms_debug);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383:
+EXPORT_SYMBOL(smscore_putbuffer);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384:
+EXPORT_SYMBOL(smscore_registry_getmode);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385:
+EXPORT_SYMBOL(smscore_register_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386:
+EXPORT_SYMBOL(smscore_set_board_id);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387:
+EXPORT_SYMBOL(smscore_start_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388:
+EXPORT_SYMBOL(smsusb_id_table);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389:
+EXPORT_SYMBOL(smscore_unregister_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390:
+EXPORT_SYMBOL(smscore_getbuffer);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391:
+EXPORT_SYMBOL(smscore_get_device_mode);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392:
+EXPORT_SYMBOL(smscore_register_client);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393:
+EXPORT_SYMBOL(smscore_unregister_hotplug);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394:
+EXPORT_SYMBOL(smsclient_sendrequest);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395:
+EXPORT_SYMBOL(smscore_unregister_client);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396:
+EXPORT_SYMBOL(smscore_get_board_id);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397:
+EXPORT_SYMBOL(smscore_register_hotplug);
WARNING: line over 80 characters
391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
ERROR: "foo* bar" should be "foo *bar"
391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
WARNING: line over 80 characters
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
ERROR: "foo* bar" should be "foo *bar"
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
ERROR: space required after that ',' (ctx:VxV)
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
^
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443:
+ printk(KERN_INFO"%s Entering status %d.\n", __FUNCTION__, msg.event);
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455:
+ printk(KERN_INFO "%s Entering.\n", __FUNCTION__);
ERROR: space prohibited before that '++' (ctx:WxB)
505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459:
+ for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++)
^
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471:
+ __FUNCTION__, rc);
total: 7 errors, 23 warnings, 524 lines checked
Signed-off-by: Uri Shkolnik <uris@siano-ms.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-31 11:44:04 +08:00
|
|
|
* author: Uri Shkolnik
|
2008-05-23 05:05:26 +08:00
|
|
|
*
|
2008-05-23 05:29:20 +08:00
|
|
|
* Copyright (c), 2005-2008 Siano Mobile Silicon, Inc.
|
2008-05-23 05:05:26 +08:00
|
|
|
*/
|
|
|
|
|
2015-02-22 21:46:56 +08:00
|
|
|
#include "smscoreapi.h"
|
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/moduleparam.h>
|
|
|
|
#include <linux/dma-mapping.h>
|
|
|
|
#include <linux/delay.h>
|
2008-07-12 11:37:08 +08:00
|
|
|
#include <linux/io.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
#include <linux/firmware.h>
|
2009-05-17 16:59:37 +08:00
|
|
|
#include <linux/wait.h>
|
2009-05-17 17:01:03 +08:00
|
|
|
#include <asm/byteorder.h>
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-26 15:58:30 +08:00
|
|
|
#include "sms-cards.h"
|
2009-05-15 03:29:35 +08:00
|
|
|
#include "smsir.h"
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_notifyee_t {
|
2008-05-20 05:56:13 +08:00
|
|
|
struct list_head entry;
|
|
|
|
hotplug_t hotplug;
|
2008-06-16 04:52:24 +08:00
|
|
|
};
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_idlist_t {
|
2008-06-14 11:43:26 +08:00
|
|
|
struct list_head entry;
|
|
|
|
int id;
|
|
|
|
int data_type;
|
2008-06-16 04:52:24 +08:00
|
|
|
};
|
2008-06-14 11:43:26 +08:00
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_client_t {
|
2008-05-20 05:56:13 +08:00
|
|
|
struct list_head entry;
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_t *coredev;
|
2008-05-20 05:56:13 +08:00
|
|
|
void *context;
|
2013-03-21 20:40:22 +08:00
|
|
|
struct list_head idlist;
|
|
|
|
onresponse_t onresponse_handler;
|
2008-05-20 05:56:13 +08:00
|
|
|
onremove_t onremove_handler;
|
2008-06-16 04:52:24 +08:00
|
|
|
};
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-09 20:27:39 +08:00
|
|
|
static char *siano_msgs[] = {
|
|
|
|
[MSG_TYPE_BASE_VAL - MSG_TYPE_BASE_VAL] = "MSG_TYPE_BASE_VAL",
|
|
|
|
[MSG_SMS_GET_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_REQ",
|
|
|
|
[MSG_SMS_GET_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_RES",
|
|
|
|
[MSG_SMS_MULTI_BRIDGE_CFG - MSG_TYPE_BASE_VAL] = "MSG_SMS_MULTI_BRIDGE_CFG",
|
|
|
|
[MSG_SMS_GPIO_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_REQ",
|
|
|
|
[MSG_SMS_GPIO_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_RES",
|
|
|
|
[MSG_SMS_GPIO_SET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_REQ",
|
|
|
|
[MSG_SMS_GPIO_SET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_SET_LEVEL_RES",
|
|
|
|
[MSG_SMS_GPIO_GET_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_REQ",
|
|
|
|
[MSG_SMS_GPIO_GET_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_GET_LEVEL_RES",
|
|
|
|
[MSG_SMS_EEPROM_BURN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_BURN_IND",
|
|
|
|
[MSG_SMS_LOG_ENABLE_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_REQ",
|
|
|
|
[MSG_SMS_LOG_ENABLE_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ENABLE_CHANGE_RES",
|
|
|
|
[MSG_SMS_SET_MAX_TX_MSG_LEN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_REQ",
|
|
|
|
[MSG_SMS_SET_MAX_TX_MSG_LEN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_MAX_TX_MSG_LEN_RES",
|
|
|
|
[MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_HOST_TO_DEVICE",
|
|
|
|
[MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_HALFDUPLEX_TOKEN_DEVICE_TO_HOST",
|
|
|
|
[MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_REQ",
|
|
|
|
[MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_FLAG_CHANGE_RES",
|
|
|
|
[MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_SIGNAL_DETECTED_IND",
|
|
|
|
[MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_BACKGROUND_SCAN_NO_SIGNAL_IND",
|
|
|
|
[MSG_SMS_CONFIGURE_RF_SWITCH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_REQ",
|
|
|
|
[MSG_SMS_CONFIGURE_RF_SWITCH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIGURE_RF_SWITCH_RES",
|
|
|
|
[MSG_SMS_MRC_PATH_DISCONNECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_REQ",
|
|
|
|
[MSG_SMS_MRC_PATH_DISCONNECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_PATH_DISCONNECT_RES",
|
|
|
|
[MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_REQ",
|
|
|
|
[MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_1SEG_THROUGH_FULLSEG_RES",
|
|
|
|
[MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_REQ",
|
|
|
|
[MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RECEIVE_VHF_VIA_VHF_INPUT_RES",
|
|
|
|
[MSG_WR_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_REQ",
|
|
|
|
[MSG_WR_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_WR_REG_RFT_RES",
|
|
|
|
[MSG_RD_REG_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_REQ",
|
|
|
|
[MSG_RD_REG_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_RFT_RES",
|
|
|
|
[MSG_RD_REG_ALL_RFT_REQ - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_REQ",
|
|
|
|
[MSG_RD_REG_ALL_RFT_RES - MSG_TYPE_BASE_VAL] = "MSG_RD_REG_ALL_RFT_RES",
|
|
|
|
[MSG_HELP_INT - MSG_TYPE_BASE_VAL] = "MSG_HELP_INT",
|
|
|
|
[MSG_RUN_SCRIPT_INT - MSG_TYPE_BASE_VAL] = "MSG_RUN_SCRIPT_INT",
|
|
|
|
[MSG_SMS_EWS_INBAND_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_REQ",
|
|
|
|
[MSG_SMS_EWS_INBAND_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EWS_INBAND_RES",
|
|
|
|
[MSG_SMS_RFS_SELECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_REQ",
|
|
|
|
[MSG_SMS_RFS_SELECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RFS_SELECT_RES",
|
|
|
|
[MSG_SMS_MB_GET_VER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_REQ",
|
|
|
|
[MSG_SMS_MB_GET_VER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_GET_VER_RES",
|
|
|
|
[MSG_SMS_MB_WRITE_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_REQ",
|
|
|
|
[MSG_SMS_MB_WRITE_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_WRITE_CFGFILE_RES",
|
|
|
|
[MSG_SMS_MB_READ_CFGFILE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_REQ",
|
|
|
|
[MSG_SMS_MB_READ_CFGFILE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_READ_CFGFILE_RES",
|
|
|
|
[MSG_SMS_RD_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_REQ",
|
|
|
|
[MSG_SMS_RD_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RD_MEM_RES",
|
|
|
|
[MSG_SMS_WR_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_REQ",
|
|
|
|
[MSG_SMS_WR_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WR_MEM_RES",
|
|
|
|
[MSG_SMS_UPDATE_MEM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_REQ",
|
|
|
|
[MSG_SMS_UPDATE_MEM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_UPDATE_MEM_RES",
|
|
|
|
[MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_REQ",
|
|
|
|
[MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_FULL_PARAMS_SET_RES",
|
|
|
|
[MSG_SMS_RF_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_REQ",
|
|
|
|
[MSG_SMS_RF_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RF_TUNE_RES",
|
|
|
|
[MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_REQ",
|
|
|
|
[MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_ENABLE_HIGH_MOBILITY_RES",
|
|
|
|
[MSG_SMS_ISDBT_SB_RECEPTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_REQ",
|
|
|
|
[MSG_SMS_ISDBT_SB_RECEPTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_SB_RECEPTION_RES",
|
|
|
|
[MSG_SMS_GENERIC_EPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_REQ",
|
|
|
|
[MSG_SMS_GENERIC_EPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_WRITE_RES",
|
|
|
|
[MSG_SMS_GENERIC_EPROM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_REQ",
|
|
|
|
[MSG_SMS_GENERIC_EPROM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_EPROM_READ_RES",
|
|
|
|
[MSG_SMS_EEPROM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_REQ",
|
|
|
|
[MSG_SMS_EEPROM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EEPROM_WRITE_RES",
|
|
|
|
[MSG_SMS_CUSTOM_READ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_REQ",
|
|
|
|
[MSG_SMS_CUSTOM_READ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_READ_RES",
|
|
|
|
[MSG_SMS_CUSTOM_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_REQ",
|
|
|
|
[MSG_SMS_CUSTOM_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CUSTOM_WRITE_RES",
|
|
|
|
[MSG_SMS_INIT_DEVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_REQ",
|
|
|
|
[MSG_SMS_INIT_DEVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_INIT_DEVICE_RES",
|
|
|
|
[MSG_SMS_ATSC_SET_ALL_IP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_REQ",
|
|
|
|
[MSG_SMS_ATSC_SET_ALL_IP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SET_ALL_IP_RES",
|
|
|
|
[MSG_SMS_ATSC_START_ENSEMBLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_REQ",
|
|
|
|
[MSG_SMS_ATSC_START_ENSEMBLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_START_ENSEMBLE_RES",
|
|
|
|
[MSG_SMS_SET_OUTPUT_MODE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_REQ",
|
|
|
|
[MSG_SMS_SET_OUTPUT_MODE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_OUTPUT_MODE_RES",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_REQ",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_GET_LIST_RES",
|
|
|
|
[MSG_SMS_SUB_CHANNEL_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_REQ",
|
|
|
|
[MSG_SMS_SUB_CHANNEL_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_START_RES",
|
|
|
|
[MSG_SMS_SUB_CHANNEL_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_REQ",
|
|
|
|
[MSG_SMS_SUB_CHANNEL_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SUB_CHANNEL_STOP_RES",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_ADD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_REQ",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_ADD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_ADD_RES",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_REQ",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_REMOVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_RES",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_REQ",
|
|
|
|
[MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_IP_FILTER_REMOVE_ALL_RES",
|
|
|
|
[MSG_SMS_WAIT_CMD - MSG_TYPE_BASE_VAL] = "MSG_SMS_WAIT_CMD",
|
|
|
|
[MSG_SMS_ADD_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_REQ",
|
|
|
|
[MSG_SMS_ADD_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ADD_PID_FILTER_RES",
|
|
|
|
[MSG_SMS_REMOVE_PID_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_REQ",
|
|
|
|
[MSG_SMS_REMOVE_PID_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_REMOVE_PID_FILTER_RES",
|
|
|
|
[MSG_SMS_FAST_INFORMATION_CHANNEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_REQ",
|
|
|
|
[MSG_SMS_FAST_INFORMATION_CHANNEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_FAST_INFORMATION_CHANNEL_RES",
|
|
|
|
[MSG_SMS_DAB_CHANNEL - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_CHANNEL",
|
|
|
|
[MSG_SMS_GET_PID_FILTER_LIST_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_REQ",
|
|
|
|
[MSG_SMS_GET_PID_FILTER_LIST_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_PID_FILTER_LIST_RES",
|
|
|
|
[MSG_SMS_POWER_DOWN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_REQ",
|
|
|
|
[MSG_SMS_POWER_DOWN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_RES",
|
|
|
|
[MSG_SMS_ATSC_SLT_EXIST_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_SLT_EXIST_IND",
|
|
|
|
[MSG_SMS_ATSC_NO_SLT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_ATSC_NO_SLT_IND",
|
|
|
|
[MSG_SMS_GET_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_REQ",
|
|
|
|
[MSG_SMS_GET_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_RES",
|
|
|
|
[MSG_SMS_SEND_DUMP - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_DUMP",
|
|
|
|
[MSG_SMS_SCAN_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_REQ",
|
|
|
|
[MSG_SMS_SCAN_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_START_RES",
|
|
|
|
[MSG_SMS_SCAN_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_REQ",
|
|
|
|
[MSG_SMS_SCAN_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_STOP_RES",
|
|
|
|
[MSG_SMS_SCAN_PROGRESS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_PROGRESS_IND",
|
|
|
|
[MSG_SMS_SCAN_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SCAN_COMPLETE_IND",
|
|
|
|
[MSG_SMS_LOG_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_ITEM",
|
|
|
|
[MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_REQ",
|
|
|
|
[MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DAB_SUBCHANNEL_RECONFIG_RES",
|
|
|
|
[MSG_SMS_HO_PER_SLICES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PER_SLICES_IND",
|
|
|
|
[MSG_SMS_HO_INBAND_POWER_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_INBAND_POWER_IND",
|
|
|
|
[MSG_SMS_MANUAL_DEMOD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MANUAL_DEMOD_REQ",
|
|
|
|
[MSG_SMS_HO_TUNE_ON_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_REQ",
|
|
|
|
[MSG_SMS_HO_TUNE_ON_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_ON_RES",
|
|
|
|
[MSG_SMS_HO_TUNE_OFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_REQ",
|
|
|
|
[MSG_SMS_HO_TUNE_OFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_TUNE_OFF_RES",
|
|
|
|
[MSG_SMS_HO_PEEK_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_REQ",
|
|
|
|
[MSG_SMS_HO_PEEK_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_RES",
|
|
|
|
[MSG_SMS_HO_PEEK_FREQ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HO_PEEK_FREQ_IND",
|
|
|
|
[MSG_SMS_MB_ATTEN_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_REQ",
|
|
|
|
[MSG_SMS_MB_ATTEN_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MB_ATTEN_SET_RES",
|
|
|
|
[MSG_SMS_ENABLE_STAT_IN_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_REQ",
|
|
|
|
[MSG_SMS_ENABLE_STAT_IN_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_STAT_IN_I2C_RES",
|
|
|
|
[MSG_SMS_SET_ANTENNA_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_REQ",
|
|
|
|
[MSG_SMS_SET_ANTENNA_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_ANTENNA_CONFIG_RES",
|
|
|
|
[MSG_SMS_GET_STATISTICS_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_REQ",
|
|
|
|
[MSG_SMS_GET_STATISTICS_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_STATISTICS_EX_RES",
|
|
|
|
[MSG_SMS_SLEEP_RESUME_COMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLEEP_RESUME_COMP_IND",
|
|
|
|
[MSG_SMS_SWITCH_HOST_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_REQ",
|
|
|
|
[MSG_SMS_SWITCH_HOST_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWITCH_HOST_INTERFACE_RES",
|
|
|
|
[MSG_SMS_DATA_DOWNLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_REQ",
|
|
|
|
[MSG_SMS_DATA_DOWNLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_DOWNLOAD_RES",
|
|
|
|
[MSG_SMS_DATA_VALIDITY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_REQ",
|
|
|
|
[MSG_SMS_DATA_VALIDITY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_VALIDITY_RES",
|
|
|
|
[MSG_SMS_SWDOWNLOAD_TRIGGER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_REQ",
|
|
|
|
[MSG_SMS_SWDOWNLOAD_TRIGGER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_TRIGGER_RES",
|
|
|
|
[MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ",
|
|
|
|
[MSG_SMS_SWDOWNLOAD_BACKDOOR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SWDOWNLOAD_BACKDOOR_RES",
|
|
|
|
[MSG_SMS_GET_VERSION_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_REQ",
|
|
|
|
[MSG_SMS_GET_VERSION_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_VERSION_EX_RES",
|
|
|
|
[MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_REQ",
|
|
|
|
[MSG_SMS_CLOCK_OUTPUT_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CLOCK_OUTPUT_CONFIG_RES",
|
|
|
|
[MSG_SMS_I2C_SET_FREQ_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_REQ",
|
|
|
|
[MSG_SMS_I2C_SET_FREQ_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SET_FREQ_RES",
|
|
|
|
[MSG_SMS_GENERIC_I2C_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_REQ",
|
|
|
|
[MSG_SMS_GENERIC_I2C_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GENERIC_I2C_RES",
|
|
|
|
[MSG_SMS_DVBT_BDA_DATA - MSG_TYPE_BASE_VAL] = "MSG_SMS_DVBT_BDA_DATA",
|
|
|
|
[MSG_SW_RELOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_REQ",
|
|
|
|
[MSG_SMS_DATA_MSG - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_MSG",
|
|
|
|
[MSG_TABLE_UPLOAD_REQ - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_REQ",
|
|
|
|
[MSG_TABLE_UPLOAD_RES - MSG_TYPE_BASE_VAL] = "MSG_TABLE_UPLOAD_RES",
|
|
|
|
[MSG_SW_RELOAD_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_REQ",
|
|
|
|
[MSG_SW_RELOAD_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_START_RES",
|
|
|
|
[MSG_SW_RELOAD_EXEC_REQ - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_REQ",
|
|
|
|
[MSG_SW_RELOAD_EXEC_RES - MSG_TYPE_BASE_VAL] = "MSG_SW_RELOAD_EXEC_RES",
|
|
|
|
[MSG_SMS_SPI_INT_LINE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_REQ",
|
|
|
|
[MSG_SMS_SPI_INT_LINE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_INT_LINE_SET_RES",
|
|
|
|
[MSG_SMS_GPIO_CONFIG_EX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_REQ",
|
|
|
|
[MSG_SMS_GPIO_CONFIG_EX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GPIO_CONFIG_EX_RES",
|
|
|
|
[MSG_SMS_WATCHDOG_ACT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_REQ",
|
|
|
|
[MSG_SMS_WATCHDOG_ACT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_WATCHDOG_ACT_RES",
|
|
|
|
[MSG_SMS_LOOPBACK_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_REQ",
|
|
|
|
[MSG_SMS_LOOPBACK_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOOPBACK_RES",
|
|
|
|
[MSG_SMS_RAW_CAPTURE_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_REQ",
|
|
|
|
[MSG_SMS_RAW_CAPTURE_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_START_RES",
|
|
|
|
[MSG_SMS_RAW_CAPTURE_ABORT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_REQ",
|
|
|
|
[MSG_SMS_RAW_CAPTURE_ABORT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_ABORT_RES",
|
|
|
|
[MSG_SMS_RAW_CAPTURE_COMPLETE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_RAW_CAPTURE_COMPLETE_IND",
|
|
|
|
[MSG_SMS_DATA_PUMP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_IND",
|
|
|
|
[MSG_SMS_DATA_PUMP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_REQ",
|
|
|
|
[MSG_SMS_DATA_PUMP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DATA_PUMP_RES",
|
|
|
|
[MSG_SMS_FLASH_DL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_FLASH_DL_REQ",
|
|
|
|
[MSG_SMS_EXEC_TEST_1_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_REQ",
|
|
|
|
[MSG_SMS_EXEC_TEST_1_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXEC_TEST_1_RES",
|
2019-11-03 21:07:20 +08:00
|
|
|
[MSG_SMS_ENABLE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_TS_INTERFACE_REQ",
|
|
|
|
[MSG_SMS_ENABLE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ENABLE_TS_INTERFACE_RES",
|
2013-03-09 20:27:39 +08:00
|
|
|
[MSG_SMS_SPI_SET_BUS_WIDTH_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_REQ",
|
|
|
|
[MSG_SMS_SPI_SET_BUS_WIDTH_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SPI_SET_BUS_WIDTH_RES",
|
|
|
|
[MSG_SMS_SEND_EMM_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_REQ",
|
|
|
|
[MSG_SMS_SEND_EMM_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_EMM_RES",
|
|
|
|
[MSG_SMS_DISABLE_TS_INTERFACE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_REQ",
|
|
|
|
[MSG_SMS_DISABLE_TS_INTERFACE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DISABLE_TS_INTERFACE_RES",
|
|
|
|
[MSG_SMS_IS_BUF_FREE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_REQ",
|
|
|
|
[MSG_SMS_IS_BUF_FREE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IS_BUF_FREE_RES",
|
|
|
|
[MSG_SMS_EXT_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_REQ",
|
|
|
|
[MSG_SMS_EXT_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXT_ANTENNA_RES",
|
|
|
|
[MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_REQ_OBSOLETE",
|
|
|
|
[MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NET_OF_FREQ_RES_OBSOLETE",
|
|
|
|
[MSG_SMS_BATTERY_LEVEL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_REQ",
|
|
|
|
[MSG_SMS_BATTERY_LEVEL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_BATTERY_LEVEL_RES",
|
|
|
|
[MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_REQ_OBSOLETE",
|
|
|
|
[MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_INJECT_TABLE_RES_OBSOLETE",
|
|
|
|
[MSG_SMS_FM_RADIO_BLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_FM_RADIO_BLOCK_IND",
|
|
|
|
[MSG_SMS_HOST_NOTIFICATION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_HOST_NOTIFICATION_IND",
|
|
|
|
[MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_REQ_OBSOLETE",
|
|
|
|
[MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_CONTROL_TABLE_RES_OBSOLETE",
|
|
|
|
[MSG_SMS_CMMB_GET_NETWORKS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_REQ",
|
|
|
|
[MSG_SMS_CMMB_GET_NETWORKS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_NETWORKS_RES",
|
|
|
|
[MSG_SMS_CMMB_START_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_REQ",
|
|
|
|
[MSG_SMS_CMMB_START_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_SERVICE_RES",
|
|
|
|
[MSG_SMS_CMMB_STOP_SERVICE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_REQ",
|
|
|
|
[MSG_SMS_CMMB_STOP_SERVICE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_SERVICE_RES",
|
|
|
|
[MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_REQ",
|
|
|
|
[MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_ADD_CHANNEL_FILTER_RES",
|
|
|
|
[MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_REQ",
|
|
|
|
[MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_REMOVE_CHANNEL_FILTER_RES",
|
|
|
|
[MSG_SMS_CMMB_START_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_REQ",
|
|
|
|
[MSG_SMS_CMMB_START_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_START_CONTROL_INFO_RES",
|
|
|
|
[MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_REQ",
|
|
|
|
[MSG_SMS_CMMB_STOP_CONTROL_INFO_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_STOP_CONTROL_INFO_RES",
|
|
|
|
[MSG_SMS_ISDBT_TUNE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_REQ",
|
|
|
|
[MSG_SMS_ISDBT_TUNE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_ISDBT_TUNE_RES",
|
|
|
|
[MSG_SMS_TRANSMISSION_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_TRANSMISSION_IND",
|
|
|
|
[MSG_SMS_PID_STATISTICS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_PID_STATISTICS_IND",
|
|
|
|
[MSG_SMS_POWER_DOWN_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_IND",
|
|
|
|
[MSG_SMS_POWER_DOWN_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_DOWN_CONF",
|
|
|
|
[MSG_SMS_POWER_UP_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_IND",
|
|
|
|
[MSG_SMS_POWER_UP_CONF - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_UP_CONF",
|
|
|
|
[MSG_SMS_POWER_MODE_SET_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_REQ",
|
|
|
|
[MSG_SMS_POWER_MODE_SET_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_POWER_MODE_SET_RES",
|
|
|
|
[MSG_SMS_DEBUG_HOST_EVENT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_REQ",
|
|
|
|
[MSG_SMS_DEBUG_HOST_EVENT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEBUG_HOST_EVENT_RES",
|
|
|
|
[MSG_SMS_NEW_CRYSTAL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_REQ",
|
|
|
|
[MSG_SMS_NEW_CRYSTAL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NEW_CRYSTAL_RES",
|
|
|
|
[MSG_SMS_CONFIG_SPI_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_REQ",
|
|
|
|
[MSG_SMS_CONFIG_SPI_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CONFIG_SPI_RES",
|
|
|
|
[MSG_SMS_I2C_SHORT_STAT_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_I2C_SHORT_STAT_IND",
|
|
|
|
[MSG_SMS_START_IR_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_REQ",
|
|
|
|
[MSG_SMS_START_IR_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_START_IR_RES",
|
|
|
|
[MSG_SMS_IR_SAMPLES_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_IR_SAMPLES_IND",
|
|
|
|
[MSG_SMS_CMMB_CA_SERVICE_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_CA_SERVICE_IND",
|
|
|
|
[MSG_SMS_SLAVE_DEVICE_DETECTED - MSG_TYPE_BASE_VAL] = "MSG_SMS_SLAVE_DEVICE_DETECTED",
|
|
|
|
[MSG_SMS_INTERFACE_LOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_LOCK_IND",
|
|
|
|
[MSG_SMS_INTERFACE_UNLOCK_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_INTERFACE_UNLOCK_IND",
|
|
|
|
[MSG_SMS_SEND_ROSUM_BUFF_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_REQ",
|
|
|
|
[MSG_SMS_SEND_ROSUM_BUFF_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_ROSUM_BUFF_RES",
|
|
|
|
[MSG_SMS_ROSUM_BUFF - MSG_TYPE_BASE_VAL] = "MSG_SMS_ROSUM_BUFF",
|
|
|
|
[MSG_SMS_SET_AES128_KEY_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_REQ",
|
|
|
|
[MSG_SMS_SET_AES128_KEY_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_AES128_KEY_RES",
|
|
|
|
[MSG_SMS_MBBMS_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_REQ",
|
|
|
|
[MSG_SMS_MBBMS_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_WRITE_RES",
|
|
|
|
[MSG_SMS_MBBMS_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MBBMS_READ_IND",
|
|
|
|
[MSG_SMS_IQ_STREAM_START_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_REQ",
|
|
|
|
[MSG_SMS_IQ_STREAM_START_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_START_RES",
|
|
|
|
[MSG_SMS_IQ_STREAM_STOP_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_REQ",
|
|
|
|
[MSG_SMS_IQ_STREAM_STOP_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_STOP_RES",
|
|
|
|
[MSG_SMS_IQ_STREAM_DATA_BLOCK - MSG_TYPE_BASE_VAL] = "MSG_SMS_IQ_STREAM_DATA_BLOCK",
|
|
|
|
[MSG_SMS_GET_EEPROM_VERSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_REQ",
|
|
|
|
[MSG_SMS_GET_EEPROM_VERSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_GET_EEPROM_VERSION_RES",
|
|
|
|
[MSG_SMS_SIGNAL_DETECTED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SIGNAL_DETECTED_IND",
|
|
|
|
[MSG_SMS_NO_SIGNAL_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_NO_SIGNAL_IND",
|
|
|
|
[MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_REQ",
|
|
|
|
[MSG_SMS_MRC_SHUTDOWN_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_SHUTDOWN_SLAVE_RES",
|
|
|
|
[MSG_SMS_MRC_BRINGUP_SLAVE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_REQ",
|
|
|
|
[MSG_SMS_MRC_BRINGUP_SLAVE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_BRINGUP_SLAVE_RES",
|
|
|
|
[MSG_SMS_EXTERNAL_LNA_CTRL_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_REQ",
|
|
|
|
[MSG_SMS_EXTERNAL_LNA_CTRL_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_EXTERNAL_LNA_CTRL_RES",
|
|
|
|
[MSG_SMS_SET_PERIODIC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_REQ",
|
|
|
|
[MSG_SMS_SET_PERIODIC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SET_PERIODIC_STATISTICS_RES",
|
|
|
|
[MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_REQ",
|
|
|
|
[MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_AUTO_OUTPUT_TS0_RES",
|
|
|
|
[LOCAL_TUNE - MSG_TYPE_BASE_VAL] = "LOCAL_TUNE",
|
|
|
|
[LOCAL_IFFT_H_ICI - MSG_TYPE_BASE_VAL] = "LOCAL_IFFT_H_ICI",
|
|
|
|
[MSG_RESYNC_REQ - MSG_TYPE_BASE_VAL] = "MSG_RESYNC_REQ",
|
|
|
|
[MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_REQ",
|
|
|
|
[MSG_SMS_CMMB_GET_MRC_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_MRC_STATISTICS_RES",
|
|
|
|
[MSG_SMS_LOG_EX_ITEM - MSG_TYPE_BASE_VAL] = "MSG_SMS_LOG_EX_ITEM",
|
|
|
|
[MSG_SMS_DEVICE_DATA_LOSS_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_DEVICE_DATA_LOSS_IND",
|
|
|
|
[MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_MRC_WATCHDOG_TRIGGERED_IND",
|
|
|
|
[MSG_SMS_USER_MSG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_REQ",
|
|
|
|
[MSG_SMS_USER_MSG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_USER_MSG_RES",
|
|
|
|
[MSG_SMS_SMART_CARD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_REQ",
|
|
|
|
[MSG_SMS_SMART_CARD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_INIT_RES",
|
|
|
|
[MSG_SMS_SMART_CARD_WRITE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_REQ",
|
|
|
|
[MSG_SMS_SMART_CARD_WRITE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_WRITE_RES",
|
|
|
|
[MSG_SMS_SMART_CARD_READ_IND - MSG_TYPE_BASE_VAL] = "MSG_SMS_SMART_CARD_READ_IND",
|
|
|
|
[MSG_SMS_TSE_ENABLE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_REQ",
|
|
|
|
[MSG_SMS_TSE_ENABLE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_TSE_ENABLE_RES",
|
|
|
|
[MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_REQ",
|
|
|
|
[MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_GET_SHORT_STATISTICS_RES",
|
|
|
|
[MSG_SMS_LED_CONFIG_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_REQ",
|
|
|
|
[MSG_SMS_LED_CONFIG_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_LED_CONFIG_RES",
|
|
|
|
[MSG_PWM_ANTENNA_REQ - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_REQ",
|
|
|
|
[MSG_PWM_ANTENNA_RES - MSG_TYPE_BASE_VAL] = "MSG_PWM_ANTENNA_RES",
|
|
|
|
[MSG_SMS_CMMB_SMD_SN_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_REQ",
|
|
|
|
[MSG_SMS_CMMB_SMD_SN_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SMD_SN_RES",
|
|
|
|
[MSG_SMS_CMMB_SET_CA_CW_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_REQ",
|
|
|
|
[MSG_SMS_CMMB_SET_CA_CW_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_CW_RES",
|
|
|
|
[MSG_SMS_CMMB_SET_CA_SALT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_REQ",
|
|
|
|
[MSG_SMS_CMMB_SET_CA_SALT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_CMMB_SET_CA_SALT_RES",
|
|
|
|
[MSG_SMS_NSCD_INIT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_REQ",
|
|
|
|
[MSG_SMS_NSCD_INIT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_INIT_RES",
|
|
|
|
[MSG_SMS_NSCD_PROCESS_SECTION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_REQ",
|
|
|
|
[MSG_SMS_NSCD_PROCESS_SECTION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_PROCESS_SECTION_RES",
|
|
|
|
[MSG_SMS_DBD_CREATE_OBJECT_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_REQ",
|
|
|
|
[MSG_SMS_DBD_CREATE_OBJECT_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CREATE_OBJECT_RES",
|
|
|
|
[MSG_SMS_DBD_CONFIGURE_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_REQ",
|
|
|
|
[MSG_SMS_DBD_CONFIGURE_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_CONFIGURE_RES",
|
|
|
|
[MSG_SMS_DBD_SET_KEYS_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_REQ",
|
|
|
|
[MSG_SMS_DBD_SET_KEYS_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_SET_KEYS_RES",
|
|
|
|
[MSG_SMS_DBD_PROCESS_HEADER_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_REQ",
|
|
|
|
[MSG_SMS_DBD_PROCESS_HEADER_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_HEADER_RES",
|
|
|
|
[MSG_SMS_DBD_PROCESS_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_REQ",
|
|
|
|
[MSG_SMS_DBD_PROCESS_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_DATA_RES",
|
|
|
|
[MSG_SMS_DBD_PROCESS_GET_DATA_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_REQ",
|
|
|
|
[MSG_SMS_DBD_PROCESS_GET_DATA_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_DBD_PROCESS_GET_DATA_RES",
|
|
|
|
[MSG_SMS_NSCD_OPEN_SESSION_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_REQ",
|
|
|
|
[MSG_SMS_NSCD_OPEN_SESSION_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_NSCD_OPEN_SESSION_RES",
|
|
|
|
[MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_REQ",
|
|
|
|
[MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES - MSG_TYPE_BASE_VAL] = "MSG_SMS_SEND_HOST_DATA_TO_DEMUX_RES",
|
|
|
|
[MSG_LAST_MSG_TYPE - MSG_TYPE_BASE_VAL] = "MSG_LAST_MSG_TYPE",
|
|
|
|
};
|
|
|
|
|
|
|
|
char *smscore_translate_msg(enum msg_types msgtype)
|
|
|
|
{
|
|
|
|
int i = msgtype - MSG_TYPE_BASE_VAL;
|
|
|
|
char *msg;
|
|
|
|
|
2013-04-01 22:46:52 +08:00
|
|
|
if (i < 0 || i >= ARRAY_SIZE(siano_msgs))
|
2013-03-09 20:27:39 +08:00
|
|
|
return "Unknown msg type";
|
|
|
|
|
|
|
|
msg = siano_msgs[i];
|
|
|
|
|
|
|
|
if (!*msg)
|
|
|
|
return "Unknown msg type";
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(smscore_translate_msg);
|
|
|
|
|
2008-06-19 09:09:55 +08:00
|
|
|
void smscore_set_board_id(struct smscore_device_t *core, int id)
|
|
|
|
{
|
|
|
|
core->board_id = id;
|
|
|
|
}
|
|
|
|
|
2008-11-23 02:32:19 +08:00
|
|
|
int smscore_led_state(struct smscore_device_t *core, int led)
|
|
|
|
{
|
|
|
|
if (led >= 0)
|
|
|
|
core->led_state = led;
|
|
|
|
return core->led_state;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_set_board_id);
|
2008-11-23 02:32:19 +08:00
|
|
|
|
2008-06-19 09:09:55 +08:00
|
|
|
int smscore_get_board_id(struct smscore_device_t *core)
|
|
|
|
{
|
|
|
|
return core->board_id;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_get_board_id);
|
2008-06-19 09:09:55 +08:00
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t {
|
2008-05-20 05:56:13 +08:00
|
|
|
struct list_head entry;
|
2018-04-23 21:14:30 +08:00
|
|
|
char devpath[32];
|
|
|
|
int mode;
|
2008-06-16 04:52:24 +08:00
|
|
|
enum sms_device_type_st type;
|
|
|
|
};
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-07-22 10:17:36 +08:00
|
|
|
static struct list_head g_smscore_notifyees;
|
|
|
|
static struct list_head g_smscore_devices;
|
|
|
|
static struct mutex g_smscore_deviceslock;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-07-22 10:17:36 +08:00
|
|
|
static struct list_head g_smscore_registry;
|
|
|
|
static struct mutex g_smscore_registrylock;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-07 22:40:45 +08:00
|
|
|
static int default_mode = DEVICE_MODE_NONE;
|
2008-06-14 11:43:26 +08:00
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
module_param(default_mode, int, 0644);
|
|
|
|
MODULE_PARM_DESC(default_mode, "default firmware id (device mode)");
|
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry;
|
2008-05-20 05:56:13 +08:00
|
|
|
struct list_head *next;
|
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_registrylock);
|
2008-06-16 02:14:13 +08:00
|
|
|
for (next = g_smscore_registry.next;
|
|
|
|
next != &g_smscore_registry;
|
|
|
|
next = next->next) {
|
2008-06-16 04:52:24 +08:00
|
|
|
entry = (struct smscore_registry_entry_t *) next;
|
2018-04-23 21:14:30 +08:00
|
|
|
if (!strncmp(entry->devpath, devpath, sizeof(entry->devpath))) {
|
2008-05-20 05:56:13 +08:00
|
|
|
kmutex_unlock(&g_smscore_registrylock);
|
2008-06-14 11:43:26 +08:00
|
|
|
return entry;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
}
|
2017-08-28 17:55:16 +08:00
|
|
|
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (entry) {
|
2008-05-20 05:56:13 +08:00
|
|
|
entry->mode = default_mode;
|
2018-09-10 20:19:14 +08:00
|
|
|
strscpy(entry->devpath, devpath, sizeof(entry->devpath));
|
2008-05-20 05:56:13 +08:00
|
|
|
list_add(&entry->entry, &g_smscore_registry);
|
2008-06-16 02:14:13 +08:00
|
|
|
} else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("failed to create smscore_registry.\n");
|
2008-05-20 05:56:13 +08:00
|
|
|
kmutex_unlock(&g_smscore_registrylock);
|
2008-06-14 11:43:26 +08:00
|
|
|
return entry;
|
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
int smscore_registry_getmode(char *devpath)
|
2008-06-14 11:43:26 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry;
|
2008-06-14 11:43:26 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
entry = smscore_find_registry(devpath);
|
|
|
|
if (entry)
|
2008-06-14 11:43:26 +08:00
|
|
|
return entry->mode;
|
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("No registry found.\n");
|
2008-06-16 02:14:13 +08:00
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
return default_mode;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_registry_getmode);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static enum sms_device_type_st smscore_registry_gettype(char *devpath)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
entry = smscore_find_registry(devpath);
|
|
|
|
if (entry)
|
2008-06-14 11:43:26 +08:00
|
|
|
return entry->type;
|
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("No registry found.\n");
|
2008-06-16 02:14:13 +08:00
|
|
|
|
2013-03-07 22:38:57 +08:00
|
|
|
return -EINVAL;
|
2008-06-14 11:43:26 +08:00
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-07 22:38:57 +08:00
|
|
|
static void smscore_registry_setmode(char *devpath, int mode)
|
2008-06-16 02:14:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
entry = smscore_find_registry(devpath);
|
|
|
|
if (entry)
|
|
|
|
entry->mode = mode;
|
2008-06-14 11:43:26 +08:00
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("No registry found.\n");
|
2008-06-16 02:14:13 +08:00
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static void smscore_registry_settype(char *devpath,
|
|
|
|
enum sms_device_type_st type)
|
2008-06-14 11:43:26 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry;
|
2008-06-14 11:43:26 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
entry = smscore_find_registry(devpath);
|
|
|
|
if (entry)
|
2008-06-14 11:43:26 +08:00
|
|
|
entry->type = type;
|
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("No registry found.\n");
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static void list_add_locked(struct list_head *new, struct list_head *head,
|
|
|
|
spinlock_t *lock)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
spin_lock_irqsave(lock, flags);
|
|
|
|
|
|
|
|
list_add(new, head);
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(lock, flags);
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* register a client callback that called when device plugged in/unplugged
|
|
|
|
* NOTE: if devices exist callback is called immediately for each device
|
|
|
|
*
|
|
|
|
* @param hotplug callback
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
|
|
|
int smscore_register_hotplug(hotplug_t hotplug)
|
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_notifyee_t *notifyee;
|
2008-05-20 05:56:13 +08:00
|
|
|
struct list_head *next, *first;
|
|
|
|
int rc = 0;
|
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
2017-08-28 17:55:16 +08:00
|
|
|
notifyee = kmalloc(sizeof(*notifyee), GFP_KERNEL);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (notifyee) {
|
|
|
|
/* now notify callback about existing devices */
|
2008-05-20 05:56:13 +08:00
|
|
|
first = &g_smscore_devices;
|
2008-06-16 02:14:13 +08:00
|
|
|
for (next = first->next;
|
|
|
|
next != first && !rc;
|
|
|
|
next = next->next) {
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_t *coredev =
|
|
|
|
(struct smscore_device_t *) next;
|
2008-05-20 05:56:13 +08:00
|
|
|
rc = hotplug(coredev, coredev->device, 1);
|
|
|
|
}
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc >= 0) {
|
2008-05-20 05:56:13 +08:00
|
|
|
notifyee->hotplug = hotplug;
|
|
|
|
list_add(¬ifyee->entry, &g_smscore_notifyees);
|
2008-06-16 02:14:13 +08:00
|
|
|
} else
|
2008-05-20 05:56:13 +08:00
|
|
|
kfree(notifyee);
|
2008-06-16 02:14:13 +08:00
|
|
|
} else
|
2008-05-20 05:56:13 +08:00
|
|
|
rc = -ENOMEM;
|
|
|
|
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_register_hotplug);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* unregister a client callback that called when device plugged in/unplugged
|
|
|
|
*
|
|
|
|
* @param hotplug callback
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void smscore_unregister_hotplug(hotplug_t hotplug)
|
|
|
|
{
|
|
|
|
struct list_head *next, *first;
|
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
first = &g_smscore_notifyees;
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
for (next = first->next; next != first;) {
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_notifyee_t *notifyee =
|
|
|
|
(struct smscore_device_notifyee_t *) next;
|
2008-05-20 05:56:13 +08:00
|
|
|
next = next->next;
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (notifyee->hotplug == hotplug) {
|
2008-05-20 05:56:13 +08:00
|
|
|
list_del(¬ifyee->entry);
|
|
|
|
kfree(notifyee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_unregister_hotplug);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static void smscore_notify_clients(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_client_t *client;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* the client must call smscore_unregister_client from remove handler */
|
|
|
|
while (!list_empty(&coredev->clients)) {
|
2008-06-16 04:52:24 +08:00
|
|
|
client = (struct smscore_client_t *) coredev->clients.next;
|
2008-05-20 05:56:13 +08:00
|
|
|
client->onremove_handler(client->context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static int smscore_notify_callbacks(struct smscore_device_t *coredev,
|
|
|
|
struct device *device, int arrival)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2012-07-15 16:25:22 +08:00
|
|
|
struct smscore_device_notifyee_t *elem;
|
2008-05-20 05:56:13 +08:00
|
|
|
int rc = 0;
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* note: must be called under g_deviceslock */
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2012-07-15 16:25:22 +08:00
|
|
|
list_for_each_entry(elem, &g_smscore_notifyees, entry) {
|
|
|
|
rc = elem->hotplug(coredev, device, arrival);
|
2008-05-20 05:56:13 +08:00
|
|
|
if (rc < 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static struct
|
|
|
|
smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer,
|
2008-05-06 14:11:51 +08:00
|
|
|
dma_addr_t common_buffer_phys)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2013-03-07 22:38:57 +08:00
|
|
|
struct smscore_buffer_t *cb;
|
|
|
|
|
2017-08-28 17:55:16 +08:00
|
|
|
cb = kzalloc(sizeof(*cb), GFP_KERNEL);
|
2015-02-22 22:49:28 +08:00
|
|
|
if (!cb)
|
2008-05-20 05:56:13 +08:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
cb->p = buffer;
|
2008-06-14 18:40:41 +08:00
|
|
|
cb->offset_in_common = buffer - (u8 *) common_buffer;
|
2018-03-04 02:20:56 +08:00
|
|
|
if (common_buffer_phys)
|
|
|
|
cb->phys = common_buffer_phys + cb->offset_in_common;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
return cb;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-06-16 02:14:13 +08:00
|
|
|
* creates coredev object for a device, prepares buffers,
|
|
|
|
* creates buffer mappings, notifies registered hotplugs about new device.
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param params device pointer to struct with device specific parameters
|
|
|
|
* and handlers
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param coredev pointer to a value that receives created coredev object
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smscore_register_device(struct smsdevice_params_t *params,
|
2015-02-22 23:29:23 +08:00
|
|
|
struct smscore_device_t **coredev,
|
2018-05-06 17:21:47 +08:00
|
|
|
gfp_t gfp_buf_flags,
|
2015-02-22 23:29:23 +08:00
|
|
|
void *mdev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_t *dev;
|
2008-05-20 05:56:13 +08:00
|
|
|
u8 *buffer;
|
|
|
|
|
2017-08-28 17:55:16 +08:00
|
|
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
2015-02-22 22:49:28 +08:00
|
|
|
if (!dev)
|
2008-05-20 05:56:13 +08:00
|
|
|
return -ENOMEM;
|
|
|
|
|
2015-02-22 23:29:23 +08:00
|
|
|
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
|
|
|
|
dev->media_dev = mdev;
|
|
|
|
#endif
|
2018-05-06 17:21:47 +08:00
|
|
|
dev->gfp_buf_flags = gfp_buf_flags;
|
2015-02-22 23:29:23 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* init list entry so it could be safe in smscore_unregister_device */
|
2008-05-20 05:56:13 +08:00
|
|
|
INIT_LIST_HEAD(&dev->entry);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* init queues */
|
2008-05-20 05:56:13 +08:00
|
|
|
INIT_LIST_HEAD(&dev->clients);
|
|
|
|
INIT_LIST_HEAD(&dev->buffers);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* init locks */
|
2008-05-20 05:56:13 +08:00
|
|
|
spin_lock_init(&dev->clientslock);
|
|
|
|
spin_lock_init(&dev->bufferslock);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* init completion events */
|
2008-05-20 05:56:13 +08:00
|
|
|
init_completion(&dev->version_ex_done);
|
|
|
|
init_completion(&dev->data_download_done);
|
2013-03-06 23:15:08 +08:00
|
|
|
init_completion(&dev->data_validity_done);
|
2008-05-20 05:56:13 +08:00
|
|
|
init_completion(&dev->trigger_done);
|
|
|
|
init_completion(&dev->init_device_done);
|
|
|
|
init_completion(&dev->reload_start_done);
|
|
|
|
init_completion(&dev->resume_done);
|
2009-05-19 23:52:58 +08:00
|
|
|
init_completion(&dev->gpio_configuration_done);
|
|
|
|
init_completion(&dev->gpio_set_level_done);
|
|
|
|
init_completion(&dev->gpio_get_level_done);
|
2009-05-15 03:29:35 +08:00
|
|
|
init_completion(&dev->ir_init_done);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2009-05-17 16:59:37 +08:00
|
|
|
/* Buffer management */
|
|
|
|
init_waitqueue_head(&dev->buffer_mng_waitq);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* alloc common buffer */
|
2008-05-20 05:56:13 +08:00
|
|
|
dev->common_buffer_size = params->buffer_size * params->num_buffers;
|
2018-03-04 02:20:56 +08:00
|
|
|
if (params->usb_device)
|
|
|
|
buffer = kzalloc(dev->common_buffer_size, GFP_KERNEL);
|
|
|
|
else
|
|
|
|
buffer = dma_alloc_coherent(params->device,
|
|
|
|
dev->common_buffer_size,
|
|
|
|
&dev->common_buffer_phys,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | dev->gfp_buf_flags);
|
2018-03-04 02:20:56 +08:00
|
|
|
if (!buffer) {
|
2008-05-20 05:56:13 +08:00
|
|
|
smscore_unregister_device(dev);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
2018-03-04 02:20:56 +08:00
|
|
|
dev->common_buffer = buffer;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* prepare dma buffers */
|
2018-03-04 02:20:56 +08:00
|
|
|
for (; dev->num_buffers < params->num_buffers;
|
2008-06-16 02:52:43 +08:00
|
|
|
dev->num_buffers++, buffer += params->buffer_size) {
|
2013-03-07 22:38:57 +08:00
|
|
|
struct smscore_buffer_t *cb;
|
|
|
|
|
|
|
|
cb = smscore_createbuffer(buffer, dev->common_buffer,
|
|
|
|
dev->common_buffer_phys);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (!cb) {
|
2008-05-20 05:56:13 +08:00
|
|
|
smscore_unregister_device(dev);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
smscore_putbuffer(dev, cb);
|
|
|
|
}
|
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("allocated %d buffers\n", dev->num_buffers);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
dev->mode = DEVICE_MODE_NONE;
|
2013-03-06 19:42:47 +08:00
|
|
|
dev->board_id = SMS_BOARD_UNKNOWN;
|
2008-05-20 05:56:13 +08:00
|
|
|
dev->context = params->context;
|
|
|
|
dev->device = params->device;
|
2018-03-04 02:20:56 +08:00
|
|
|
dev->usb_device = params->usb_device;
|
2008-05-20 05:56:13 +08:00
|
|
|
dev->setmode_handler = params->setmode_handler;
|
|
|
|
dev->detectmode_handler = params->detectmode_handler;
|
|
|
|
dev->sendrequest_handler = params->sendrequest_handler;
|
|
|
|
dev->preload_handler = params->preload_handler;
|
|
|
|
dev->postload_handler = params->postload_handler;
|
|
|
|
|
|
|
|
dev->device_flags = params->flags;
|
2018-09-10 20:19:14 +08:00
|
|
|
strscpy(dev->devpath, params->devpath, sizeof(dev->devpath));
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
smscore_registry_settype(dev->devpath, params->device_type);
|
2008-06-14 11:43:26 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* add device to devices list */
|
2008-05-20 05:56:13 +08:00
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
|
|
|
list_add(&dev->entry, &g_smscore_devices);
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
*coredev = dev;
|
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("device %p created\n", dev);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_register_device);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2009-05-15 03:29:35 +08:00
|
|
|
|
|
|
|
static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev,
|
|
|
|
void *buffer, size_t size, struct completion *completion) {
|
2013-03-06 23:15:08 +08:00
|
|
|
int rc;
|
|
|
|
|
2017-08-28 18:50:28 +08:00
|
|
|
if (!completion)
|
2013-03-06 23:15:08 +08:00
|
|
|
return -EINVAL;
|
|
|
|
init_completion(completion);
|
|
|
|
|
|
|
|
rc = coredev->sendrequest_handler(coredev->context, buffer, size);
|
2009-05-15 03:29:35 +08:00
|
|
|
if (rc < 0) {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_info("sendrequest returned error %d\n", rc);
|
2009-05-15 03:29:35 +08:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
return wait_for_completion_timeout(completion,
|
|
|
|
msecs_to_jiffies(SMS_PROTOCOL_MAX_RAOUNDTRIP_MS)) ?
|
|
|
|
0 : -ETIME;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2009-05-15 03:29:35 +08:00
|
|
|
* Starts & enables IR operations
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, < 0 on error.
|
2009-05-15 03:29:35 +08:00
|
|
|
*/
|
|
|
|
static int smscore_init_ir(struct smscore_device_t *coredev)
|
|
|
|
{
|
|
|
|
int ir_io;
|
|
|
|
int rc;
|
|
|
|
void *buffer;
|
|
|
|
|
2010-10-30 03:08:23 +08:00
|
|
|
coredev->ir.dev = NULL;
|
2009-05-15 03:29:35 +08:00
|
|
|
ir_io = sms_get_board(smscore_get_board_id(coredev))->board_cfg.ir;
|
|
|
|
if (ir_io) {/* only if IR port exist we use IR sub-module */
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("IR loading\n");
|
2009-05-15 03:29:35 +08:00
|
|
|
rc = sms_ir_init(coredev);
|
|
|
|
|
|
|
|
if (rc != 0)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("Error initialization DTV IR sub-module\n");
|
2009-05-15 03:29:35 +08:00
|
|
|
else {
|
2013-03-21 19:49:43 +08:00
|
|
|
buffer = kmalloc(sizeof(struct sms_msg_data2) +
|
2009-05-15 03:29:35 +08:00
|
|
|
SMS_DMA_ALIGNMENT,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | coredev->gfp_buf_flags);
|
2009-05-15 03:29:35 +08:00
|
|
|
if (buffer) {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_data2 *msg =
|
|
|
|
(struct sms_msg_data2 *)
|
2009-05-15 03:29:35 +08:00
|
|
|
SMS_ALIGN_ADDRESS(buffer);
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header,
|
2009-05-15 03:29:35 +08:00
|
|
|
MSG_SMS_START_IR_REQ,
|
2013-03-21 19:49:43 +08:00
|
|
|
sizeof(struct sms_msg_data2));
|
2013-03-21 20:27:37 +08:00
|
|
|
msg->msg_data[0] = coredev->ir.controller;
|
|
|
|
msg->msg_data[1] = coredev->ir.timeout;
|
2009-05-15 03:29:35 +08:00
|
|
|
|
|
|
|
rc = smscore_sendrequest_and_wait(coredev, msg,
|
2013-03-21 19:49:43 +08:00
|
|
|
msg->x_msg_header. msg_length,
|
2009-05-15 03:29:35 +08:00
|
|
|
&coredev->ir_init_done);
|
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
} else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("Sending IR initialization message failed\n");
|
2009-05-15 03:29:35 +08:00
|
|
|
}
|
|
|
|
} else
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_info("IR port has not been detected\n");
|
2009-05-15 03:29:35 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2013-03-09 07:48:42 +08:00
|
|
|
* configures device features according to board configuration structure.
|
|
|
|
*
|
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2013-03-09 07:48:42 +08:00
|
|
|
*/
|
2013-03-21 21:01:47 +08:00
|
|
|
static int smscore_configure_board(struct smscore_device_t *coredev)
|
2013-03-09 07:48:42 +08:00
|
|
|
{
|
|
|
|
struct sms_board *board;
|
|
|
|
|
|
|
|
board = sms_get_board(coredev->board_id);
|
|
|
|
if (!board) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("no board configuration exist.\n");
|
2013-03-09 07:48:42 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (board->mtu) {
|
2013-03-21 20:27:37 +08:00
|
|
|
struct sms_msg_data mtu_msg;
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("set max transmit unit %d\n", board->mtu);
|
2013-03-09 07:48:42 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
mtu_msg.x_msg_header.msg_src_id = 0;
|
|
|
|
mtu_msg.x_msg_header.msg_dst_id = HIF_TASK;
|
|
|
|
mtu_msg.x_msg_header.msg_flags = 0;
|
|
|
|
mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
|
|
|
|
mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg);
|
|
|
|
mtu_msg.msg_data[0] = board->mtu;
|
2013-03-09 07:48:42 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
coredev->sendrequest_handler(coredev->context, &mtu_msg,
|
|
|
|
sizeof(mtu_msg));
|
2013-03-09 07:48:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (board->crystal) {
|
2013-03-21 20:27:37 +08:00
|
|
|
struct sms_msg_data crys_msg;
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("set crystal value %d\n", board->crystal);
|
2013-03-09 07:48:42 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
SMS_INIT_MSG(&crys_msg.x_msg_header,
|
2013-03-09 07:48:42 +08:00
|
|
|
MSG_SMS_NEW_CRYSTAL_REQ,
|
2013-03-21 20:27:37 +08:00
|
|
|
sizeof(crys_msg));
|
|
|
|
crys_msg.msg_data[0] = board->crystal;
|
2013-03-09 07:48:42 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
coredev->sendrequest_handler(coredev->context, &crys_msg,
|
|
|
|
sizeof(crys_msg));
|
2013-03-09 07:48:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* sets initial device mode and notifies client hotplugs that device is ready
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
2013-03-21 20:40:22 +08:00
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smscore_start_device(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2013-03-07 22:40:45 +08:00
|
|
|
int rc;
|
|
|
|
int board_id = smscore_get_board_id(coredev);
|
|
|
|
int mode = smscore_registry_getmode(coredev->devpath);
|
|
|
|
|
|
|
|
/* Device is initialized as DEVICE_MODE_NONE */
|
|
|
|
if (board_id != SMS_BOARD_UNKNOWN && mode == DEVICE_MODE_NONE)
|
|
|
|
mode = sms_get_board(board_id)->default_mode;
|
|
|
|
|
|
|
|
rc = smscore_set_device_mode(coredev, mode);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc < 0) {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_info("set device mode failed , rc %d\n", rc);
|
2008-05-20 05:56:13 +08:00
|
|
|
return rc;
|
2008-06-14 11:43:26 +08:00
|
|
|
}
|
2013-03-09 07:48:42 +08:00
|
|
|
rc = smscore_configure_board(coredev);
|
|
|
|
if (rc < 0) {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_info("configure board failed , rc %d\n", rc);
|
2013-03-09 07:48:42 +08:00
|
|
|
return rc;
|
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
rc = smscore_notify_callbacks(coredev, coredev->device, 1);
|
2009-05-15 03:29:35 +08:00
|
|
|
smscore_init_ir(coredev);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("device %p started, rc %d\n", coredev, rc);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_start_device);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
|
|
|
|
void *buffer, size_t size)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_firmware *firmware = (struct sms_firmware *) buffer;
|
|
|
|
struct sms_msg_data4 *msg;
|
2013-03-06 23:15:08 +08:00
|
|
|
u32 mem_address, calc_checksum = 0;
|
|
|
|
u32 i, *ptr;
|
2013-03-21 19:49:43 +08:00
|
|
|
u8 *payload = firmware->payload;
|
2008-05-20 05:56:13 +08:00
|
|
|
int rc = 0;
|
2013-10-04 22:01:52 +08:00
|
|
|
firmware->start_address = le32_to_cpup((__le32 *)&firmware->start_address);
|
|
|
|
firmware->length = le32_to_cpup((__le32 *)&firmware->length);
|
2009-05-17 17:01:03 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
mem_address = firmware->start_address;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("loading FW to addr 0x%x size %d\n",
|
2013-03-21 19:49:43 +08:00
|
|
|
mem_address, firmware->length);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (coredev->preload_handler) {
|
2008-05-20 05:56:13 +08:00
|
|
|
rc = coredev->preload_handler(coredev->context);
|
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* PAGE_SIZE buffer shall be enough and dma aligned */
|
2018-05-06 17:21:47 +08:00
|
|
|
msg = kmalloc(PAGE_SIZE, GFP_KERNEL | coredev->gfp_buf_flags);
|
2008-05-20 05:56:13 +08:00
|
|
|
if (!msg)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (coredev->mode != DEVICE_MODE_NONE) {
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("sending reload command.\n");
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_START_REQ,
|
|
|
|
sizeof(struct sms_msg_hdr));
|
2008-06-16 02:14:13 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, msg,
|
2013-03-21 19:49:43 +08:00
|
|
|
msg->x_msg_header.msg_length,
|
2008-06-16 02:14:13 +08:00
|
|
|
&coredev->reload_start_done);
|
2013-03-06 23:15:08 +08:00
|
|
|
if (rc < 0) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("device reload failed, rc %d\n", rc);
|
2013-03-06 23:15:08 +08:00
|
|
|
goto exit_fw_download;
|
|
|
|
}
|
2008-06-16 02:32:00 +08:00
|
|
|
mem_address = *(u32 *) &payload[20];
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
for (i = 0, ptr = (u32 *)firmware->payload; i < firmware->length/4 ;
|
2013-03-06 23:15:08 +08:00
|
|
|
i++, ptr++)
|
|
|
|
calc_checksum += *ptr;
|
|
|
|
|
2008-06-16 02:52:43 +08:00
|
|
|
while (size && rc >= 0) {
|
2013-03-21 20:27:37 +08:00
|
|
|
struct sms_data_download *data_msg =
|
2013-03-21 19:49:43 +08:00
|
|
|
(struct sms_data_download *) msg;
|
2013-03-21 20:40:22 +08:00
|
|
|
int payload_size = min_t(int, size, SMS_MAX_PAYLOAD_SIZE);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_DOWNLOAD_REQ,
|
|
|
|
(u16)(sizeof(struct sms_msg_hdr) +
|
2008-06-16 02:32:00 +08:00
|
|
|
sizeof(u32) + payload_size));
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
data_msg->mem_addr = mem_address;
|
|
|
|
memcpy(data_msg->payload, payload, payload_size);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, data_msg,
|
|
|
|
data_msg->x_msg_header.msg_length,
|
2008-06-16 03:50:11 +08:00
|
|
|
&coredev->data_download_done);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
payload += payload_size;
|
|
|
|
size -= payload_size;
|
|
|
|
mem_address += payload_size;
|
|
|
|
}
|
|
|
|
|
2013-03-06 23:15:08 +08:00
|
|
|
if (rc < 0)
|
|
|
|
goto exit_fw_download;
|
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x\n",
|
2013-03-06 23:15:08 +08:00
|
|
|
calc_checksum);
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_VALIDITY_REQ,
|
|
|
|
sizeof(msg->x_msg_header) +
|
2013-03-06 23:15:08 +08:00
|
|
|
sizeof(u32) * 3);
|
2013-03-21 20:27:37 +08:00
|
|
|
msg->msg_data[0] = firmware->start_address;
|
2013-03-06 23:15:08 +08:00
|
|
|
/* Entry point */
|
2013-03-21 20:27:37 +08:00
|
|
|
msg->msg_data[1] = firmware->length;
|
|
|
|
msg->msg_data[2] = 0; /* Regular checksum*/
|
2013-03-06 23:15:08 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, msg,
|
2013-03-21 19:49:43 +08:00
|
|
|
msg->x_msg_header.msg_length,
|
2013-03-06 23:15:08 +08:00
|
|
|
&coredev->data_validity_done);
|
|
|
|
if (rc < 0)
|
|
|
|
goto exit_fw_download;
|
|
|
|
|
|
|
|
if (coredev->mode == DEVICE_MODE_NONE) {
|
2013-03-21 20:27:37 +08:00
|
|
|
struct sms_msg_data *trigger_msg =
|
2013-03-21 19:49:43 +08:00
|
|
|
(struct sms_msg_data *) msg;
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("sending MSG_SMS_SWDOWNLOAD_TRIGGER_REQ\n");
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header,
|
2013-03-06 23:15:08 +08:00
|
|
|
MSG_SMS_SWDOWNLOAD_TRIGGER_REQ,
|
2013-03-21 19:49:43 +08:00
|
|
|
sizeof(struct sms_msg_hdr) +
|
2013-03-06 23:15:08 +08:00
|
|
|
sizeof(u32) * 5);
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
trigger_msg->msg_data[0] = firmware->start_address;
|
2013-03-06 23:15:08 +08:00
|
|
|
/* Entry point */
|
2013-03-21 20:27:37 +08:00
|
|
|
trigger_msg->msg_data[1] = 6; /* Priority */
|
|
|
|
trigger_msg->msg_data[2] = 0x200; /* Stack size */
|
|
|
|
trigger_msg->msg_data[3] = 0; /* Parameter */
|
|
|
|
trigger_msg->msg_data[4] = 4; /* Task ID */
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, trigger_msg,
|
|
|
|
trigger_msg->x_msg_header.msg_length,
|
2008-06-16 03:50:11 +08:00
|
|
|
&coredev->trigger_done);
|
2013-03-06 23:15:08 +08:00
|
|
|
} else {
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SW_RELOAD_EXEC_REQ,
|
|
|
|
sizeof(struct sms_msg_hdr));
|
2013-03-06 23:15:08 +08:00
|
|
|
rc = coredev->sendrequest_handler(coredev->context, msg,
|
2013-03-21 19:49:43 +08:00
|
|
|
msg->x_msg_header.msg_length);
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2013-03-06 23:15:08 +08:00
|
|
|
if (rc < 0)
|
|
|
|
goto exit_fw_download;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* backward compatibility - wait to device_ready_done for
|
|
|
|
* not more than 400 ms
|
|
|
|
*/
|
|
|
|
msleep(400);
|
|
|
|
|
|
|
|
exit_fw_download:
|
2008-05-20 05:56:13 +08:00
|
|
|
kfree(msg);
|
|
|
|
|
2013-03-07 18:32:47 +08:00
|
|
|
if (coredev->postload_handler) {
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("rc=%d, postload=0x%p\n",
|
|
|
|
rc, coredev->postload_handler);
|
2013-03-07 18:32:47 +08:00
|
|
|
if (rc >= 0)
|
|
|
|
return coredev->postload_handler(coredev->context);
|
|
|
|
}
|
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("rc=%d\n", rc);
|
2013-03-07 18:32:47 +08:00
|
|
|
return rc;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2013-03-19 23:06:08 +08:00
|
|
|
static char *smscore_fw_lkup[][DEVICE_MODE_MAX] = {
|
|
|
|
[SMS_NOVA_A0] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ,
|
|
|
|
[DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ,
|
|
|
|
[DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ,
|
|
|
|
[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ,
|
|
|
|
[DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ,
|
|
|
|
[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_NOVA_B0] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_DVBT] = SMS_FW_DVB_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_DVBH] = SMS_FW_DVB_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_NOVA_12MHZ_B0,
|
|
|
|
[DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO,
|
|
|
|
[DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_VEGA] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_CMMB] = SMS_FW_CMMB_VEGA_12MHZ,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_VENICE] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_CMMB] = SMS_FW_CMMB_VENICE_12MHZ,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_MING] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_CMMB] = SMS_FW_CMMB_MING_APP,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_PELE] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_PELE,
|
|
|
|
[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_PELE,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_RIO] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_DVBT] = SMS_FW_DVB_RIO,
|
|
|
|
[DEVICE_MODE_DVBH] = SMS_FW_DVBH_RIO,
|
|
|
|
[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVB_RIO,
|
|
|
|
[DEVICE_MODE_ISDBT] = SMS_FW_ISDBT_RIO,
|
|
|
|
[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_RIO,
|
|
|
|
[DEVICE_MODE_FM_RADIO] = SMS_FW_FM_RADIO_RIO,
|
|
|
|
[DEVICE_MODE_FM_RADIO_BDA] = SMS_FW_FM_RADIO_RIO,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_DENVER_1530] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_ATSC] = SMS_FW_ATSC_DENVER,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
[SMS_DENVER_2160] = {
|
2013-03-20 04:02:54 +08:00
|
|
|
[DEVICE_MODE_DAB_TDMB] = SMS_FW_TDMB_DENVER,
|
2013-03-19 23:06:08 +08:00
|
|
|
},
|
|
|
|
};
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2013-03-19 23:06:08 +08:00
|
|
|
* get firmware file name from one of the two mechanisms : sms_boards or
|
|
|
|
* smscore_fw_lkup.
|
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
|
|
|
* @param mode requested mode of operation
|
|
|
|
* @param lookup if 1, always get the fw filename from smscore_fw_lkup
|
|
|
|
* table. if 0, try first to get from sms_boards
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2013-03-19 23:06:08 +08:00
|
|
|
*/
|
2013-03-06 23:15:08 +08:00
|
|
|
static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
|
2013-03-19 23:06:08 +08:00
|
|
|
int mode)
|
|
|
|
{
|
|
|
|
char **fw;
|
|
|
|
int board_id = smscore_get_board_id(coredev);
|
|
|
|
enum sms_device_type_st type;
|
|
|
|
|
|
|
|
type = smscore_registry_gettype(coredev->devpath);
|
|
|
|
|
|
|
|
/* Prevent looking outside the smscore_fw_lkup table */
|
|
|
|
if (type <= SMS_UNKNOWN_TYPE || type >= SMS_NUM_OF_DEVICE_TYPES)
|
|
|
|
return NULL;
|
|
|
|
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX)
|
|
|
|
return NULL;
|
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("trying to get fw name from sms_boards board_id %d mode %d\n",
|
2013-03-19 23:06:08 +08:00
|
|
|
board_id, mode);
|
|
|
|
fw = sms_get_board(board_id)->fw;
|
|
|
|
if (!fw || !fw[mode]) {
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("cannot find fw name in sms_boards, getting from lookup table mode %d type %d\n",
|
2013-03-19 23:06:08 +08:00
|
|
|
mode, type);
|
|
|
|
return smscore_fw_lkup[type][mode];
|
|
|
|
}
|
|
|
|
|
|
|
|
return fw[mode];
|
|
|
|
}
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* loads specified firmware into a buffer and calls device loadfirmware_handler
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param filename null-terminated string specifies firmware file name
|
|
|
|
* @param loadfirmware_handler device handler that loads firmware
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-21 13:44:02 +08:00
|
|
|
static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
|
2013-03-19 23:00:23 +08:00
|
|
|
int mode,
|
2008-06-21 13:44:02 +08:00
|
|
|
loadfirmware_t loadfirmware_handler)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
int rc = -ENOENT;
|
2013-03-06 23:15:08 +08:00
|
|
|
u8 *fw_buf;
|
|
|
|
u32 fw_buf_size;
|
2008-05-20 05:56:13 +08:00
|
|
|
const struct firmware *fw;
|
|
|
|
|
2013-03-19 23:00:23 +08:00
|
|
|
char *fw_filename = smscore_get_fw_filename(coredev, mode);
|
2013-03-19 20:50:17 +08:00
|
|
|
if (!fw_filename) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("mode %d not supported on this device\n", mode);
|
2013-03-06 23:15:08 +08:00
|
|
|
return -ENOENT;
|
2013-03-19 20:50:17 +08:00
|
|
|
}
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("Firmware name: %s\n", fw_filename);
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2017-08-28 18:50:28 +08:00
|
|
|
if (!loadfirmware_handler &&
|
|
|
|
!(coredev->device_flags & SMS_DEVICE_FAMILY2))
|
2008-05-20 05:56:13 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2013-03-06 23:15:08 +08:00
|
|
|
rc = request_firmware(&fw, fw_filename, coredev->device);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc < 0) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("failed to open firmware file '%s'\n", fw_filename);
|
2008-05-20 05:56:13 +08:00
|
|
|
return rc;
|
|
|
|
}
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("read fw %s, buffer size=0x%zx\n", fw_filename, fw->size);
|
2016-02-15 23:56:26 +08:00
|
|
|
fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware),
|
2018-05-06 17:21:47 +08:00
|
|
|
SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags);
|
2013-03-06 23:15:08 +08:00
|
|
|
if (!fw_buf) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("failed to allocate firmware buffer\n");
|
2013-05-22 03:32:30 +08:00
|
|
|
rc = -ENOMEM;
|
|
|
|
} else {
|
|
|
|
memcpy(fw_buf, fw->data, fw->size);
|
|
|
|
fw_buf_size = fw->size;
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2013-05-22 03:32:30 +08:00
|
|
|
rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ?
|
|
|
|
smscore_load_firmware_family2(coredev, fw_buf, fw_buf_size)
|
|
|
|
: loadfirmware_handler(coredev->context, fw_buf,
|
|
|
|
fw_buf_size);
|
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-06 23:15:08 +08:00
|
|
|
kfree(fw_buf);
|
2008-05-20 05:56:13 +08:00
|
|
|
release_firmware(fw);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-06-16 03:50:11 +08:00
|
|
|
* notifies all clients registered with the device, notifies hotplugs,
|
|
|
|
* frees all buffers and coredev object
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
void smscore_unregister_device(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_buffer_t *cb;
|
2008-05-20 05:56:13 +08:00
|
|
|
int num_buffers = 0;
|
2008-06-14 11:43:26 +08:00
|
|
|
int retry = 0;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
|
|
|
|
2009-05-15 03:29:35 +08:00
|
|
|
/* Release input device (IR) resources */
|
|
|
|
sms_ir_exit(coredev);
|
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
smscore_notify_clients(coredev);
|
|
|
|
smscore_notify_callbacks(coredev, NULL, 0);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* at this point all buffers should be back
|
|
|
|
* onresponse must no longer be called */
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
while (1) {
|
2009-05-17 16:59:37 +08:00
|
|
|
while (!list_empty(&coredev->buffers)) {
|
|
|
|
cb = (struct smscore_buffer_t *) coredev->buffers.next;
|
|
|
|
list_del(&cb->entry);
|
2008-05-20 05:56:13 +08:00
|
|
|
kfree(cb);
|
2008-06-16 02:52:43 +08:00
|
|
|
num_buffers++;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
if (num_buffers == coredev->num_buffers)
|
|
|
|
break;
|
2008-06-16 02:14:13 +08:00
|
|
|
if (++retry > 10) {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_info("exiting although not all buffers released.\n");
|
2008-06-14 11:43:26 +08:00
|
|
|
break;
|
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("waiting for %d buffer(s)\n",
|
2008-06-19 12:15:46 +08:00
|
|
|
coredev->num_buffers - num_buffers);
|
2013-03-06 23:15:08 +08:00
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
2008-05-20 05:56:13 +08:00
|
|
|
msleep(100);
|
2013-03-06 23:15:08 +08:00
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("freed %d buffers\n", num_buffers);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2018-03-04 02:20:56 +08:00
|
|
|
if (coredev->common_buffer) {
|
|
|
|
if (coredev->usb_device)
|
|
|
|
kfree(coredev->common_buffer);
|
|
|
|
else
|
|
|
|
dma_free_coherent(coredev->device,
|
|
|
|
coredev->common_buffer_size,
|
|
|
|
coredev->common_buffer,
|
|
|
|
coredev->common_buffer_phys);
|
|
|
|
}
|
2013-02-27 02:24:56 +08:00
|
|
|
kfree(coredev->fw_buf);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
list_del(&coredev->entry);
|
|
|
|
kfree(coredev);
|
|
|
|
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("device %p destroyed\n", coredev);
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_unregister_device);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static int smscore_detect_mode(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2013-03-21 19:49:43 +08:00
|
|
|
void *buffer = kmalloc(sizeof(struct sms_msg_hdr) + SMS_DMA_ALIGNMENT,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | coredev->gfp_buf_flags);
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr *msg =
|
|
|
|
(struct sms_msg_hdr *) SMS_ALIGN_ADDRESS(buffer);
|
2008-05-20 05:56:13 +08:00
|
|
|
int rc;
|
|
|
|
|
|
|
|
if (!buffer)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2008-06-16 04:52:24 +08:00
|
|
|
SMS_INIT_MSG(msg, MSG_SMS_GET_VERSION_EX_REQ,
|
2013-03-21 19:49:43 +08:00
|
|
|
sizeof(struct sms_msg_hdr));
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, msg, msg->msg_length,
|
2008-06-16 02:14:13 +08:00
|
|
|
&coredev->version_ex_done);
|
|
|
|
if (rc == -ETIME) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("MSG_SMS_GET_VERSION_EX_REQ failed first try\n");
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (wait_for_completion_timeout(&coredev->resume_done,
|
|
|
|
msecs_to_jiffies(5000))) {
|
2008-06-16 03:50:11 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(
|
2013-03-21 19:49:43 +08:00
|
|
|
coredev, msg, msg->msg_length,
|
2008-06-16 03:50:11 +08:00
|
|
|
&coredev->version_ex_done);
|
2008-05-20 05:56:13 +08:00
|
|
|
if (rc < 0)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d\n",
|
2013-03-21 20:40:22 +08:00
|
|
|
rc);
|
2008-06-16 02:14:13 +08:00
|
|
|
} else
|
2008-05-20 05:56:13 +08:00
|
|
|
rc = -ETIME;
|
|
|
|
}
|
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2013-03-09 21:24:38 +08:00
|
|
|
* send init device request and wait for response
|
|
|
|
*
|
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
|
|
|
* @param mode requested mode of operation
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2013-03-09 21:24:38 +08:00
|
|
|
*/
|
2013-03-21 21:01:47 +08:00
|
|
|
static int smscore_init_device(struct smscore_device_t *coredev, int mode)
|
2013-03-09 21:24:38 +08:00
|
|
|
{
|
|
|
|
void *buffer;
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_data *msg;
|
2013-03-09 21:24:38 +08:00
|
|
|
int rc = 0;
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
buffer = kmalloc(sizeof(struct sms_msg_data) +
|
2018-05-06 17:21:47 +08:00
|
|
|
SMS_DMA_ALIGNMENT, GFP_KERNEL | coredev->gfp_buf_flags);
|
2017-08-28 17:46:57 +08:00
|
|
|
if (!buffer)
|
2013-03-09 21:24:38 +08:00
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer);
|
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ,
|
|
|
|
sizeof(struct sms_msg_data));
|
2013-03-21 20:27:37 +08:00
|
|
|
msg->msg_data[0] = mode;
|
2013-03-09 21:24:38 +08:00
|
|
|
|
|
|
|
rc = smscore_sendrequest_and_wait(coredev, msg,
|
2013-03-21 19:49:43 +08:00
|
|
|
msg->x_msg_header. msg_length,
|
2013-03-09 21:24:38 +08:00
|
|
|
&coredev->init_device_done);
|
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* calls device handler to change mode of operation
|
|
|
|
* NOTE: stellar/usb may disconnect when changing mode
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param mode requested mode of operation
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
int rc = 0;
|
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("set device mode to %d\n", mode);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
|
2013-03-07 22:40:45 +08:00
|
|
|
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("invalid mode specified %d\n", mode);
|
2008-05-20 05:56:13 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2008-06-14 11:43:26 +08:00
|
|
|
smscore_registry_setmode(coredev->devpath, mode);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) {
|
2008-05-20 05:56:13 +08:00
|
|
|
rc = smscore_detect_mode(coredev);
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc < 0) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("mode detect failed %d\n", rc);
|
2008-05-20 05:56:13 +08:00
|
|
|
return rc;
|
2008-06-16 02:14:13 +08:00
|
|
|
}
|
2008-06-14 11:43:26 +08:00
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (coredev->mode == mode) {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("device mode %d already set\n", mode);
|
2008-05-20 05:56:13 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (!(coredev->modes_supported & (1 << mode))) {
|
2008-06-26 15:58:30 +08:00
|
|
|
rc = smscore_load_firmware_from_file(coredev,
|
2013-03-19 23:00:23 +08:00
|
|
|
mode, NULL);
|
2013-03-06 23:15:08 +08:00
|
|
|
if (rc >= 0)
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("firmware download success\n");
|
2008-06-16 02:14:13 +08:00
|
|
|
} else {
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("mode %d is already supported by running firmware\n",
|
2013-03-06 23:15:08 +08:00
|
|
|
mode);
|
2008-06-16 02:14:13 +08:00
|
|
|
}
|
2013-03-09 21:24:38 +08:00
|
|
|
if (coredev->fw_version >= 0x800) {
|
|
|
|
rc = smscore_init_device(coredev, mode);
|
|
|
|
if (rc < 0)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("device init failed, rc %d.\n", rc);
|
2013-03-09 21:24:38 +08:00
|
|
|
}
|
2008-06-16 02:14:13 +08:00
|
|
|
} else {
|
2013-03-07 22:40:45 +08:00
|
|
|
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("invalid mode specified %d\n", mode);
|
2008-06-14 11:43:26 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
smscore_registry_setmode(coredev->devpath, mode);
|
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
if (coredev->detectmode_handler)
|
2008-06-16 02:14:13 +08:00
|
|
|
coredev->detectmode_handler(coredev->context,
|
|
|
|
&coredev->mode);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
if (coredev->mode != mode && coredev->setmode_handler)
|
|
|
|
rc = coredev->setmode_handler(coredev->context, mode);
|
|
|
|
}
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc >= 0) {
|
2013-03-06 23:15:08 +08:00
|
|
|
char *buffer;
|
2008-05-20 05:56:13 +08:00
|
|
|
coredev->mode = mode;
|
|
|
|
coredev->device_flags &= ~SMS_DEVICE_NOT_READY;
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
buffer = kmalloc(sizeof(struct sms_msg_data) +
|
2018-05-06 17:21:47 +08:00
|
|
|
SMS_DMA_ALIGNMENT, GFP_KERNEL | coredev->gfp_buf_flags);
|
2013-03-06 23:15:08 +08:00
|
|
|
if (buffer) {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_data *msg = (struct sms_msg_data *) SMS_ALIGN_ADDRESS(buffer);
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ,
|
|
|
|
sizeof(struct sms_msg_data));
|
2013-03-21 20:27:37 +08:00
|
|
|
msg->msg_data[0] = mode;
|
2013-03-06 23:15:08 +08:00
|
|
|
|
|
|
|
rc = smscore_sendrequest_and_wait(
|
2013-03-21 19:49:43 +08:00
|
|
|
coredev, msg, msg->x_msg_header.msg_length,
|
2013-03-06 23:15:08 +08:00
|
|
|
&coredev->init_device_done);
|
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2009-05-17 17:02:46 +08:00
|
|
|
if (rc < 0)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("return error code %d.\n", rc);
|
2013-03-07 22:38:57 +08:00
|
|
|
else
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("Success setting device mode.\n");
|
2013-03-07 22:38:57 +08:00
|
|
|
|
2008-05-20 05:56:13 +08:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* calls device handler to get current mode of operation
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: current mode
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smscore_get_device_mode(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
return coredev->mode;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_get_device_mode);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-06-14 11:43:26 +08:00
|
|
|
* find client by response id & type within the clients list.
|
|
|
|
* return client handle or NULL.
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-06-14 11:43:26 +08:00
|
|
|
* @param data_type client data type (SMS_DONT_CARE for all types)
|
2008-06-16 02:14:13 +08:00
|
|
|
* @param id client id (SMS_DONT_CARE for all id)
|
2008-06-14 11:43:26 +08:00
|
|
|
*
|
|
|
|
*/
|
2008-06-21 13:44:02 +08:00
|
|
|
static struct
|
|
|
|
smscore_client_t *smscore_find_client(struct smscore_device_t *coredev,
|
2008-06-16 03:50:11 +08:00
|
|
|
int data_type, int id)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2012-07-15 16:25:22 +08:00
|
|
|
struct list_head *first;
|
|
|
|
struct smscore_client_t *client;
|
2008-05-20 05:56:13 +08:00
|
|
|
unsigned long flags;
|
2012-07-15 16:25:22 +08:00
|
|
|
struct list_head *firstid;
|
|
|
|
struct smscore_idlist_t *client_id;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
spin_lock_irqsave(&coredev->clientslock, flags);
|
|
|
|
first = &coredev->clients;
|
2012-07-15 16:25:22 +08:00
|
|
|
list_for_each_entry(client, first, entry) {
|
|
|
|
firstid = &client->idlist;
|
|
|
|
list_for_each_entry(client_id, firstid, entry) {
|
|
|
|
if ((client_id->id == id) &&
|
|
|
|
(client_id->data_type == data_type ||
|
|
|
|
(client_id->data_type == 0)))
|
|
|
|
goto found;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
}
|
2012-07-15 16:25:22 +08:00
|
|
|
client = NULL;
|
|
|
|
found:
|
2008-05-20 05:56:13 +08:00
|
|
|
spin_unlock_irqrestore(&coredev->clientslock, flags);
|
|
|
|
return client;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* find client by response id/type, call clients onresponse handler
|
|
|
|
* return buffer to pool on error
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param cb pointer to response buffer descriptor
|
|
|
|
*
|
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
void smscore_onresponse(struct smscore_device_t *coredev,
|
2009-05-12 23:28:46 +08:00
|
|
|
struct smscore_buffer_t *cb) {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) ((u8 *) cb->p
|
2009-05-12 23:28:46 +08:00
|
|
|
+ cb->offset);
|
|
|
|
struct smscore_client_t *client;
|
2008-05-20 05:56:13 +08:00
|
|
|
int rc = -EBUSY;
|
2008-06-16 06:27:35 +08:00
|
|
|
static unsigned long last_sample_time; /* = 0; */
|
|
|
|
static int data_total; /* = 0; */
|
2008-05-20 05:56:13 +08:00
|
|
|
unsigned long time_now = jiffies_to_msecs(jiffies);
|
|
|
|
|
|
|
|
if (!last_sample_time)
|
|
|
|
last_sample_time = time_now;
|
|
|
|
|
2008-06-16 02:52:43 +08:00
|
|
|
if (time_now - last_sample_time > 10000) {
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("data rate %d bytes/secs\n",
|
2008-06-19 12:15:46 +08:00
|
|
|
(int)((data_total * 1000) /
|
|
|
|
(time_now - last_sample_time)));
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
last_sample_time = time_now;
|
|
|
|
data_total = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
data_total += cb->size;
|
2009-05-12 23:28:46 +08:00
|
|
|
/* Do we need to re-route? */
|
2013-03-21 19:49:43 +08:00
|
|
|
if ((phdr->msg_type == MSG_SMS_HO_PER_SLICES_IND) ||
|
|
|
|
(phdr->msg_type == MSG_SMS_TRANSMISSION_IND)) {
|
2009-05-12 23:28:46 +08:00
|
|
|
if (coredev->mode == DEVICE_MODE_DVBT_BDA)
|
2013-03-21 19:49:43 +08:00
|
|
|
phdr->msg_dst_id = DVBT_BDA_CONTROL_MSG_ID;
|
2009-05-12 23:28:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
client = smscore_find_client(coredev, phdr->msg_type, phdr->msg_dst_id);
|
2009-05-12 23:28:46 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* If no client registered for type & id,
|
|
|
|
* check for control client where type is not registered */
|
2008-05-20 05:56:13 +08:00
|
|
|
if (client)
|
|
|
|
rc = client->onresponse_handler(client->context, cb);
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (rc < 0) {
|
2013-03-21 19:49:43 +08:00
|
|
|
switch (phdr->msg_type) {
|
2013-03-07 22:53:46 +08:00
|
|
|
case MSG_SMS_ISDBT_TUNE_RES:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_RF_TUNE_RES:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_SIGNAL_DETECTED_IND:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_NO_SIGNAL_IND:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_SPI_INT_LINE_SET_RES:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_INTERFACE_LOCK_IND:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_INTERFACE_UNLOCK_IND:
|
|
|
|
break;
|
2008-06-16 02:14:13 +08:00
|
|
|
case MSG_SMS_GET_VERSION_EX_RES:
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_version_res *ver =
|
|
|
|
(struct sms_version_res *) phdr;
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("Firmware id %d prots 0x%x ver %d.%d\n",
|
2013-03-21 19:49:43 +08:00
|
|
|
ver->firmware_id, ver->supported_protocols,
|
|
|
|
ver->rom_ver_major, ver->rom_ver_minor);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
coredev->mode = ver->firmware_id == 255 ?
|
|
|
|
DEVICE_MODE_NONE : ver->firmware_id;
|
|
|
|
coredev->modes_supported = ver->supported_protocols;
|
|
|
|
coredev->fw_version = ver->rom_ver_major << 8 |
|
|
|
|
ver->rom_ver_minor;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
complete(&coredev->version_ex_done);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MSG_SMS_INIT_DEVICE_RES:
|
|
|
|
complete(&coredev->init_device_done);
|
|
|
|
break;
|
|
|
|
case MSG_SW_RELOAD_START_RES:
|
|
|
|
complete(&coredev->reload_start_done);
|
|
|
|
break;
|
2013-03-06 23:15:08 +08:00
|
|
|
case MSG_SMS_DATA_VALIDITY_RES:
|
|
|
|
{
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_data *validity = (struct sms_msg_data *) phdr;
|
2013-03-06 23:15:08 +08:00
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x\n",
|
2013-03-21 20:27:37 +08:00
|
|
|
validity->msg_data[0]);
|
2013-03-06 23:15:08 +08:00
|
|
|
complete(&coredev->data_validity_done);
|
|
|
|
break;
|
|
|
|
}
|
2008-06-16 02:14:13 +08:00
|
|
|
case MSG_SMS_DATA_DOWNLOAD_RES:
|
|
|
|
complete(&coredev->data_download_done);
|
|
|
|
break;
|
|
|
|
case MSG_SW_RELOAD_EXEC_RES:
|
|
|
|
break;
|
|
|
|
case MSG_SMS_SWDOWNLOAD_TRIGGER_RES:
|
|
|
|
complete(&coredev->trigger_done);
|
|
|
|
break;
|
|
|
|
case MSG_SMS_SLEEP_RESUME_COMP_IND:
|
|
|
|
complete(&coredev->resume_done);
|
|
|
|
break;
|
2009-05-19 23:52:58 +08:00
|
|
|
case MSG_SMS_GPIO_CONFIG_EX_RES:
|
|
|
|
complete(&coredev->gpio_configuration_done);
|
|
|
|
break;
|
|
|
|
case MSG_SMS_GPIO_SET_LEVEL_RES:
|
|
|
|
complete(&coredev->gpio_set_level_done);
|
|
|
|
break;
|
|
|
|
case MSG_SMS_GPIO_GET_LEVEL_RES:
|
|
|
|
{
|
|
|
|
u32 *msgdata = (u32 *) phdr;
|
|
|
|
coredev->gpio_get_res = msgdata[1];
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("gpio level %d\n",
|
2009-05-19 23:52:58 +08:00
|
|
|
coredev->gpio_get_res);
|
|
|
|
complete(&coredev->gpio_get_level_done);
|
|
|
|
break;
|
|
|
|
}
|
2009-05-15 03:29:35 +08:00
|
|
|
case MSG_SMS_START_IR_RES:
|
|
|
|
complete(&coredev->ir_init_done);
|
|
|
|
break;
|
|
|
|
case MSG_SMS_IR_SAMPLES_IND:
|
|
|
|
sms_ir_event(coredev,
|
|
|
|
(const char *)
|
|
|
|
((char *)phdr
|
2013-03-21 19:49:43 +08:00
|
|
|
+ sizeof(struct sms_msg_hdr)),
|
|
|
|
(int)phdr->msg_length
|
|
|
|
- sizeof(struct sms_msg_hdr));
|
2009-05-15 03:29:35 +08:00
|
|
|
break;
|
|
|
|
|
2013-03-20 00:12:29 +08:00
|
|
|
case MSG_SMS_DVBT_BDA_DATA:
|
|
|
|
/*
|
|
|
|
* It can be received here, if the frontend is
|
|
|
|
* tuned into a valid channel and the proper firmware
|
|
|
|
* is loaded. That happens when the module got removed
|
|
|
|
* and re-inserted, without powering the device off
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
default:
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("message %s(%d) not handled.\n",
|
2013-03-21 19:49:43 +08:00
|
|
|
smscore_translate_msg(phdr->msg_type),
|
|
|
|
phdr->msg_type);
|
2008-06-16 02:14:13 +08:00
|
|
|
break;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
smscore_putbuffer(coredev, cb);
|
|
|
|
}
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_onresponse);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* return pointer to next free buffer descriptor from core pool
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: pointer to descriptor on success, NULL on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2010-08-24 20:52:36 +08:00
|
|
|
|
2012-10-27 22:23:04 +08:00
|
|
|
static struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_buffer_t *cb = NULL;
|
2008-05-20 05:56:13 +08:00
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
spin_lock_irqsave(&coredev->bufferslock, flags);
|
2010-08-24 20:52:36 +08:00
|
|
|
if (!list_empty(&coredev->buffers)) {
|
|
|
|
cb = (struct smscore_buffer_t *) coredev->buffers.next;
|
|
|
|
list_del(&cb->entry);
|
2010-07-28 02:42:40 +08:00
|
|
|
}
|
2010-08-24 20:52:36 +08:00
|
|
|
spin_unlock_irqrestore(&coredev->bufferslock, flags);
|
|
|
|
return cb;
|
|
|
|
}
|
2009-05-17 16:59:37 +08:00
|
|
|
|
2010-08-24 20:52:36 +08:00
|
|
|
struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev)
|
|
|
|
{
|
|
|
|
struct smscore_buffer_t *cb = NULL;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2010-08-24 20:52:36 +08:00
|
|
|
wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev)));
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
return cb;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_getbuffer);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* return buffer descriptor to a pool
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param coredev pointer to a coredev object returned by
|
|
|
|
* smscore_register_device
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param cb pointer buffer descriptor
|
|
|
|
*
|
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
void smscore_putbuffer(struct smscore_device_t *coredev,
|
2009-05-17 16:59:37 +08:00
|
|
|
struct smscore_buffer_t *cb) {
|
|
|
|
wake_up_interruptible(&coredev->buffer_mng_waitq);
|
2008-05-20 05:56:13 +08:00
|
|
|
list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock);
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_putbuffer);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-21 13:44:02 +08:00
|
|
|
static int smscore_validate_client(struct smscore_device_t *coredev,
|
|
|
|
struct smscore_client_t *client,
|
|
|
|
int data_type, int id)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_idlist_t *listentry;
|
|
|
|
struct smscore_client_t *registered_client;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (!client) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("bad parameter.\n");
|
2011-07-06 23:55:29 +08:00
|
|
|
return -EINVAL;
|
2008-06-14 11:43:26 +08:00
|
|
|
}
|
|
|
|
registered_client = smscore_find_client(coredev, data_type, id);
|
2008-06-16 02:52:43 +08:00
|
|
|
if (registered_client == client)
|
2008-05-20 05:56:13 +08:00
|
|
|
return 0;
|
2008-06-16 02:52:43 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
if (registered_client) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("The msg ID already registered to another client.\n");
|
2008-06-14 11:43:26 +08:00
|
|
|
return -EEXIST;
|
|
|
|
}
|
2017-08-28 17:55:16 +08:00
|
|
|
listentry = kzalloc(sizeof(*listentry), GFP_KERNEL);
|
2017-08-28 17:46:57 +08:00
|
|
|
if (!listentry)
|
2008-05-20 05:56:13 +08:00
|
|
|
return -ENOMEM;
|
2017-08-28 17:46:57 +08:00
|
|
|
|
2008-06-14 11:43:26 +08:00
|
|
|
listentry->id = id;
|
|
|
|
listentry->data_type = data_type;
|
2008-06-16 02:14:13 +08:00
|
|
|
list_add_locked(&listentry->entry, &client->idlist,
|
|
|
|
&coredev->clientslock);
|
2008-05-20 05:56:13 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* creates smsclient object, check that id is taken by another client
|
|
|
|
*
|
|
|
|
* @param coredev pointer to a coredev object from clients hotplug
|
|
|
|
* @param initial_id all messages with this id would be sent to this client
|
|
|
|
* @param data_type all messages of this type would be sent to this client
|
2008-06-16 04:36:00 +08:00
|
|
|
* @param onresponse_handler client handler that is called to
|
|
|
|
* process incoming messages
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param onremove_handler client handler that is called when device is removed
|
|
|
|
* @param context client-specific context
|
|
|
|
* @param client pointer to a value that receives created smsclient object
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smscore_register_client(struct smscore_device_t *coredev,
|
|
|
|
struct smsclient_params_t *params,
|
|
|
|
struct smscore_client_t **client)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_client_t *newclient;
|
2008-06-16 02:14:13 +08:00
|
|
|
/* check that no other channel with same parameters exists */
|
|
|
|
if (smscore_find_client(coredev, params->data_type,
|
|
|
|
params->initial_id)) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("Client already exist.\n");
|
2008-05-20 05:56:13 +08:00
|
|
|
return -EEXIST;
|
2008-06-14 11:43:26 +08:00
|
|
|
}
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-08-28 17:55:16 +08:00
|
|
|
newclient = kzalloc(sizeof(*newclient), GFP_KERNEL);
|
2017-08-28 17:46:57 +08:00
|
|
|
if (!newclient)
|
2008-06-14 11:43:26 +08:00
|
|
|
return -ENOMEM;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
INIT_LIST_HEAD(&newclient->idlist);
|
2008-05-20 05:56:13 +08:00
|
|
|
newclient->coredev = coredev;
|
|
|
|
newclient->onresponse_handler = params->onresponse_handler;
|
|
|
|
newclient->onremove_handler = params->onremove_handler;
|
|
|
|
newclient->context = params->context;
|
2008-06-16 02:14:13 +08:00
|
|
|
list_add_locked(&newclient->entry, &coredev->clients,
|
|
|
|
&coredev->clientslock);
|
|
|
|
smscore_validate_client(coredev, newclient, params->data_type,
|
|
|
|
params->initial_id);
|
2008-05-20 05:56:13 +08:00
|
|
|
*client = newclient;
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("%p %d %d\n", params->context, params->data_type,
|
2008-06-20 09:15:38 +08:00
|
|
|
params->initial_id);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_register_client);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* frees smsclient object and all subclients associated with it
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param client pointer to smsclient object returned by
|
|
|
|
* smscore_register_client
|
2008-05-20 05:56:13 +08:00
|
|
|
*
|
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
void smscore_unregister_client(struct smscore_client_t *client)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_t *coredev = client->coredev;
|
2008-05-20 05:56:13 +08:00
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
spin_lock_irqsave(&coredev->clientslock, flags);
|
|
|
|
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
while (!list_empty(&client->idlist)) {
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_idlist_t *identry =
|
|
|
|
(struct smscore_idlist_t *) client->idlist.next;
|
2008-06-16 02:14:13 +08:00
|
|
|
list_del(&identry->entry);
|
|
|
|
kfree(identry);
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2015-02-22 22:49:28 +08:00
|
|
|
pr_debug("%p\n", client->context);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
list_del(&client->entry);
|
|
|
|
kfree(client);
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(&coredev->clientslock, flags);
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smscore_unregister_client);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2017-11-27 21:38:30 +08:00
|
|
|
/*
|
2008-05-20 05:56:13 +08:00
|
|
|
* verifies that source id is not taken by another client,
|
|
|
|
* calls device handler to send requests to the device
|
|
|
|
*
|
2008-06-16 03:50:11 +08:00
|
|
|
* @param client pointer to smsclient object returned by
|
|
|
|
* smscore_register_client
|
2008-05-20 05:56:13 +08:00
|
|
|
* @param buffer pointer to a request buffer
|
|
|
|
* @param size size (in bytes) of request buffer
|
|
|
|
*
|
2017-11-27 21:38:30 +08:00
|
|
|
* return: 0 on success, <0 on error.
|
2008-05-20 05:56:13 +08:00
|
|
|
*/
|
2008-06-16 04:52:24 +08:00
|
|
|
int smsclient_sendrequest(struct smscore_client_t *client,
|
|
|
|
void *buffer, size_t size)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_t *coredev;
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
|
2008-06-14 11:43:26 +08:00
|
|
|
int rc;
|
|
|
|
|
2017-08-28 18:50:28 +08:00
|
|
|
if (!client) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("Got NULL client\n");
|
2008-06-14 11:43:26 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
coredev = client->coredev;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
/* check that no other channel with same id exists */
|
2017-08-28 18:50:28 +08:00
|
|
|
if (!coredev) {
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("Got NULL coredev\n");
|
2008-06-14 11:43:26 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2008-06-16 02:14:13 +08:00
|
|
|
rc = smscore_validate_client(client->coredev, client, 0,
|
2013-03-21 19:49:43 +08:00
|
|
|
phdr->msg_src_id);
|
2008-05-20 05:56:13 +08:00
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
return coredev->sendrequest_handler(coredev->context, buffer, size);
|
|
|
|
}
|
2009-02-27 05:32:36 +08:00
|
|
|
EXPORT_SYMBOL_GPL(smsclient_sendrequest);
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
|
2010-06-11 18:17:01 +08:00
|
|
|
/* old GPIO managements implementation */
|
2008-11-17 05:01:58 +08:00
|
|
|
int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin,
|
2009-05-19 22:49:19 +08:00
|
|
|
struct smscore_config_gpio *pinconfig)
|
2008-11-17 05:01:58 +08:00
|
|
|
{
|
|
|
|
struct {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr hdr;
|
2008-11-17 05:01:58 +08:00
|
|
|
u32 data[6];
|
|
|
|
} msg;
|
|
|
|
|
|
|
|
if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
|
2013-03-21 19:49:43 +08:00
|
|
|
msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID;
|
|
|
|
msg.hdr.msg_dst_id = HIF_TASK;
|
|
|
|
msg.hdr.msg_flags = 0;
|
|
|
|
msg.hdr.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ;
|
|
|
|
msg.hdr.msg_length = sizeof(msg);
|
2008-11-17 05:01:58 +08:00
|
|
|
|
|
|
|
msg.data[0] = pin;
|
|
|
|
msg.data[1] = pinconfig->pullupdown;
|
|
|
|
|
|
|
|
/* Convert slew rate for Nova: Fast(0) = 3 / Slow(1) = 0; */
|
|
|
|
msg.data[2] = pinconfig->outputslewrate == 0 ? 3 : 0;
|
|
|
|
|
|
|
|
switch (pinconfig->outputdriving) {
|
2013-03-06 18:09:54 +08:00
|
|
|
case SMS_GPIO_OUTPUTDRIVING_S_16mA:
|
2008-11-17 05:01:58 +08:00
|
|
|
msg.data[3] = 7; /* Nova - 16mA */
|
|
|
|
break;
|
2013-03-06 18:09:54 +08:00
|
|
|
case SMS_GPIO_OUTPUTDRIVING_S_12mA:
|
2008-11-17 05:01:58 +08:00
|
|
|
msg.data[3] = 5; /* Nova - 11mA */
|
|
|
|
break;
|
2013-03-06 18:09:54 +08:00
|
|
|
case SMS_GPIO_OUTPUTDRIVING_S_8mA:
|
2008-11-17 05:01:58 +08:00
|
|
|
msg.data[3] = 3; /* Nova - 7mA */
|
|
|
|
break;
|
2013-03-06 18:09:54 +08:00
|
|
|
case SMS_GPIO_OUTPUTDRIVING_S_4mA:
|
2008-11-17 05:01:58 +08:00
|
|
|
default:
|
|
|
|
msg.data[3] = 2; /* Nova - 4mA */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
msg.data[4] = pinconfig->direction;
|
|
|
|
msg.data[5] = 0;
|
|
|
|
} else /* TODO: SMS_DEVICE_FAMILY1 */
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
return coredev->sendrequest_handler(coredev->context,
|
|
|
|
&msg, sizeof(msg));
|
|
|
|
}
|
|
|
|
|
|
|
|
int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level)
|
|
|
|
{
|
|
|
|
struct {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr hdr;
|
2008-11-17 05:01:58 +08:00
|
|
|
u32 data[3];
|
|
|
|
} msg;
|
|
|
|
|
|
|
|
if (pin > MAX_GPIO_PIN_NUMBER)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
msg.hdr.msg_src_id = DVBT_BDA_CONTROL_MSG_ID;
|
|
|
|
msg.hdr.msg_dst_id = HIF_TASK;
|
|
|
|
msg.hdr.msg_flags = 0;
|
|
|
|
msg.hdr.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ;
|
|
|
|
msg.hdr.msg_length = sizeof(msg);
|
2008-11-17 05:01:58 +08:00
|
|
|
|
|
|
|
msg.data[0] = pin;
|
|
|
|
msg.data[1] = level ? 1 : 0;
|
|
|
|
msg.data[2] = 0;
|
|
|
|
|
|
|
|
return coredev->sendrequest_handler(coredev->context,
|
|
|
|
&msg, sizeof(msg));
|
|
|
|
}
|
|
|
|
|
2009-07-23 14:31:31 +08:00
|
|
|
/* new GPIO management implementation */
|
2013-03-21 20:27:37 +08:00
|
|
|
static int get_gpio_pin_params(u32 pin_num, u32 *p_translatedpin_num,
|
|
|
|
u32 *p_group_num, u32 *p_group_cfg) {
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_group_cfg = 1;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
if (pin_num <= 1) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 0;
|
|
|
|
*p_group_num = 9;
|
|
|
|
*p_group_cfg = 2;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num >= 2 && pin_num <= 6) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 2;
|
|
|
|
*p_group_num = 0;
|
|
|
|
*p_group_cfg = 2;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num >= 7 && pin_num <= 11) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 7;
|
|
|
|
*p_group_num = 1;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num >= 12 && pin_num <= 15) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 12;
|
|
|
|
*p_group_num = 2;
|
|
|
|
*p_group_cfg = 3;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num == 16) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 16;
|
|
|
|
*p_group_num = 23;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num >= 17 && pin_num <= 24) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 17;
|
|
|
|
*p_group_num = 3;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num == 25) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 25;
|
|
|
|
*p_group_num = 6;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num >= 26 && pin_num <= 28) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 26;
|
|
|
|
*p_group_num = 4;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num == 29) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 29;
|
|
|
|
*p_group_num = 5;
|
|
|
|
*p_group_cfg = 2;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num == 30) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 30;
|
|
|
|
*p_group_num = 8;
|
2013-03-21 19:49:43 +08:00
|
|
|
} else if (pin_num == 31) {
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_translatedpin_num = 31;
|
|
|
|
*p_group_num = 17;
|
2009-05-19 22:49:19 +08:00
|
|
|
} else
|
|
|
|
return -1;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
*p_group_cfg <<= 24;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num,
|
|
|
|
struct smscore_config_gpio *p_gpio_config) {
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 total_len;
|
|
|
|
u32 translatedpin_num = 0;
|
|
|
|
u32 group_num = 0;
|
|
|
|
u32 electric_char;
|
|
|
|
u32 group_cfg;
|
2009-05-19 22:49:19 +08:00
|
|
|
void *buffer;
|
|
|
|
int rc;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
struct set_gpio_msg {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr x_msg_header;
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 msg_data[6];
|
|
|
|
} *p_msg;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
if (pin_num > MAX_GPIO_PIN_NUMBER)
|
2009-05-19 22:49:19 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2017-08-28 18:50:28 +08:00
|
|
|
if (!p_gpio_config)
|
2009-05-19 22:49:19 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
total_len = sizeof(struct sms_msg_hdr) + (sizeof(u32) * 6);
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | coredev->gfp_buf_flags);
|
2009-05-19 22:49:19 +08:00
|
|
|
if (!buffer)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer);
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID;
|
|
|
|
p_msg->x_msg_header.msg_dst_id = HIF_TASK;
|
|
|
|
p_msg->x_msg_header.msg_flags = 0;
|
|
|
|
p_msg->x_msg_header.msg_length = (u16) total_len;
|
|
|
|
p_msg->msg_data[0] = pin_num;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) {
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_REQ;
|
|
|
|
if (get_gpio_pin_params(pin_num, &translatedpin_num, &group_num,
|
|
|
|
&group_cfg) != 0) {
|
2010-01-07 00:45:27 +08:00
|
|
|
rc = -EINVAL;
|
|
|
|
goto free;
|
|
|
|
}
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->msg_data[1] = translatedpin_num;
|
|
|
|
p_msg->msg_data[2] = group_num;
|
|
|
|
electric_char = (p_gpio_config->pullupdown)
|
2013-03-21 19:49:43 +08:00
|
|
|
| (p_gpio_config->inputcharacteristics << 2)
|
|
|
|
| (p_gpio_config->outputslewrate << 3)
|
|
|
|
| (p_gpio_config->outputdriving << 4);
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->msg_data[3] = electric_char;
|
|
|
|
p_msg->msg_data[4] = p_gpio_config->direction;
|
|
|
|
p_msg->msg_data[5] = group_cfg;
|
2009-05-19 22:49:19 +08:00
|
|
|
} else {
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_CONFIG_EX_REQ;
|
|
|
|
p_msg->msg_data[1] = p_gpio_config->pullupdown;
|
|
|
|
p_msg->msg_data[2] = p_gpio_config->outputslewrate;
|
|
|
|
p_msg->msg_data[3] = p_gpio_config->outputdriving;
|
|
|
|
p_msg->msg_data[4] = p_gpio_config->direction;
|
|
|
|
p_msg->msg_data[5] = 0;
|
2009-05-19 22:49:19 +08:00
|
|
|
}
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len,
|
2009-05-19 22:49:19 +08:00
|
|
|
&coredev->gpio_configuration_done);
|
|
|
|
|
|
|
|
if (rc != 0) {
|
|
|
|
if (rc == -ETIME)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_configure timeout\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_configure error\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
}
|
2010-01-07 00:45:27 +08:00
|
|
|
free:
|
2009-05-19 22:49:19 +08:00
|
|
|
kfree(buffer);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num,
|
|
|
|
u8 new_level) {
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 total_len;
|
2009-05-19 22:49:19 +08:00
|
|
|
int rc;
|
|
|
|
void *buffer;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
struct set_gpio_msg {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr x_msg_header;
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 msg_data[3]; /* keep it 3 ! */
|
|
|
|
} *p_msg;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
if ((new_level > 1) || (pin_num > MAX_GPIO_PIN_NUMBER))
|
2009-05-19 22:49:19 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
total_len = sizeof(struct sms_msg_hdr) +
|
2009-05-19 22:49:19 +08:00
|
|
|
(3 * sizeof(u32)); /* keep it 3 ! */
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | coredev->gfp_buf_flags);
|
2009-05-19 22:49:19 +08:00
|
|
|
if (!buffer)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer);
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID;
|
|
|
|
p_msg->x_msg_header.msg_dst_id = HIF_TASK;
|
|
|
|
p_msg->x_msg_header.msg_flags = 0;
|
|
|
|
p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_SET_LEVEL_REQ;
|
|
|
|
p_msg->x_msg_header.msg_length = (u16) total_len;
|
|
|
|
p_msg->msg_data[0] = pin_num;
|
|
|
|
p_msg->msg_data[1] = new_level;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
/* Send message to SMS */
|
2013-03-21 20:27:37 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len,
|
2009-05-19 22:49:19 +08:00
|
|
|
&coredev->gpio_set_level_done);
|
|
|
|
|
|
|
|
if (rc != 0) {
|
|
|
|
if (rc == -ETIME)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_set_level timeout\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_set_level error\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
}
|
|
|
|
kfree(buffer);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num,
|
2009-05-19 22:49:19 +08:00
|
|
|
u8 *level) {
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 total_len;
|
2009-05-19 22:49:19 +08:00
|
|
|
int rc;
|
|
|
|
void *buffer;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
struct set_gpio_msg {
|
2013-03-21 19:49:43 +08:00
|
|
|
struct sms_msg_hdr x_msg_header;
|
2013-03-21 20:27:37 +08:00
|
|
|
u32 msg_data[2];
|
|
|
|
} *p_msg;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
|
2013-03-21 19:49:43 +08:00
|
|
|
if (pin_num > MAX_GPIO_PIN_NUMBER)
|
2009-05-19 22:49:19 +08:00
|
|
|
return -EINVAL;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
total_len = sizeof(struct sms_msg_hdr) + (2 * sizeof(u32));
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
buffer = kmalloc(total_len + SMS_DMA_ALIGNMENT,
|
2018-05-06 17:21:47 +08:00
|
|
|
GFP_KERNEL | coredev->gfp_buf_flags);
|
2009-05-19 22:49:19 +08:00
|
|
|
if (!buffer)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg = (struct set_gpio_msg *) SMS_ALIGN_ADDRESS(buffer);
|
2009-05-19 22:49:19 +08:00
|
|
|
|
2013-03-21 20:27:37 +08:00
|
|
|
p_msg->x_msg_header.msg_src_id = DVBT_BDA_CONTROL_MSG_ID;
|
|
|
|
p_msg->x_msg_header.msg_dst_id = HIF_TASK;
|
|
|
|
p_msg->x_msg_header.msg_flags = 0;
|
|
|
|
p_msg->x_msg_header.msg_type = MSG_SMS_GPIO_GET_LEVEL_REQ;
|
|
|
|
p_msg->x_msg_header.msg_length = (u16) total_len;
|
|
|
|
p_msg->msg_data[0] = pin_num;
|
|
|
|
p_msg->msg_data[1] = 0;
|
2009-05-19 22:49:19 +08:00
|
|
|
|
|
|
|
/* Send message to SMS */
|
2013-03-21 20:27:37 +08:00
|
|
|
rc = smscore_sendrequest_and_wait(coredev, p_msg, total_len,
|
2009-05-19 22:49:19 +08:00
|
|
|
&coredev->gpio_get_level_done);
|
|
|
|
|
|
|
|
if (rc != 0) {
|
|
|
|
if (rc == -ETIME)
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_get_level timeout\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
else
|
2015-02-22 22:04:35 +08:00
|
|
|
pr_err("smscore_gpio_get_level error\n");
|
2009-05-19 22:49:19 +08:00
|
|
|
}
|
|
|
|
kfree(buffer);
|
|
|
|
|
|
|
|
/* Its a race between other gpio_get_level() and the copy of the single
|
|
|
|
* global 'coredev->gpio_get_res' to the function's variable 'level'
|
|
|
|
*/
|
|
|
|
*level = coredev->gpio_get_res;
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2008-07-22 10:17:36 +08:00
|
|
|
static int __init smscore_module_init(void)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
INIT_LIST_HEAD(&g_smscore_notifyees);
|
|
|
|
INIT_LIST_HEAD(&g_smscore_devices);
|
|
|
|
kmutex_init(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
INIT_LIST_HEAD(&g_smscore_registry);
|
|
|
|
kmutex_init(&g_smscore_registrylock);
|
|
|
|
|
2014-09-04 02:02:55 +08:00
|
|
|
return 0;
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
2008-07-22 10:17:36 +08:00
|
|
|
static void __exit smscore_module_exit(void)
|
2008-05-20 05:56:13 +08:00
|
|
|
{
|
|
|
|
kmutex_lock(&g_smscore_deviceslock);
|
2008-06-16 02:14:13 +08:00
|
|
|
while (!list_empty(&g_smscore_notifyees)) {
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_device_notifyee_t *notifyee =
|
|
|
|
(struct smscore_device_notifyee_t *)
|
|
|
|
g_smscore_notifyees.next;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
list_del(¬ifyee->entry);
|
|
|
|
kfree(notifyee);
|
|
|
|
}
|
|
|
|
kmutex_unlock(&g_smscore_deviceslock);
|
|
|
|
|
|
|
|
kmutex_lock(&g_smscore_registrylock);
|
2008-06-16 02:14:13 +08:00
|
|
|
while (!list_empty(&g_smscore_registry)) {
|
2008-06-16 04:52:24 +08:00
|
|
|
struct smscore_registry_entry_t *entry =
|
|
|
|
(struct smscore_registry_entry_t *)
|
|
|
|
g_smscore_registry.next;
|
2008-05-20 05:56:13 +08:00
|
|
|
|
|
|
|
list_del(&entry->entry);
|
|
|
|
kfree(entry);
|
|
|
|
}
|
|
|
|
kmutex_unlock(&g_smscore_registrylock);
|
|
|
|
|
2015-02-22 22:33:37 +08:00
|
|
|
pr_debug("\n");
|
2008-05-20 05:56:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module_init(smscore_module_init);
|
|
|
|
module_exit(smscore_module_exit);
|
|
|
|
|
V4L/DVB (10750): import changes from Siano
Import the following changes from Uri Shkolnik
* Two-ways merge with Siano internal repository
* Continuing with DVB sub-system separation
* kconfig and makefile updates
* Code cleanup
This is a work-in-progress sync with Siano's internal repository.
Some changes had to be altered or dropped in order not to break the build.
This breaks normal operation for the current driver, but it is being committed
now for tracking purposes.
These changes introduce the following checkpatch.pl violations:
ERROR: do not use C99 // comments
156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373:
+//#ifdef DVB_CORE
ERROR: do not use C99 // comments
157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374:
+// smsdvb_unregister();
ERROR: do not use C99 // comments
158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375:
+//#endif
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380:
+EXPORT_SYMBOL(smscore_onresponse);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381:
+EXPORT_SYMBOL(sms_get_board);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382:
+EXPORT_SYMBOL(sms_debug);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383:
+EXPORT_SYMBOL(smscore_putbuffer);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384:
+EXPORT_SYMBOL(smscore_registry_getmode);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385:
+EXPORT_SYMBOL(smscore_register_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386:
+EXPORT_SYMBOL(smscore_set_board_id);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387:
+EXPORT_SYMBOL(smscore_start_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388:
+EXPORT_SYMBOL(smsusb_id_table);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389:
+EXPORT_SYMBOL(smscore_unregister_device);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390:
+EXPORT_SYMBOL(smscore_getbuffer);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391:
+EXPORT_SYMBOL(smscore_get_device_mode);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392:
+EXPORT_SYMBOL(smscore_register_client);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393:
+EXPORT_SYMBOL(smscore_unregister_hotplug);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394:
+EXPORT_SYMBOL(smsclient_sendrequest);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395:
+EXPORT_SYMBOL(smscore_unregister_client);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396:
+EXPORT_SYMBOL(smscore_get_board_id);
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397:
+EXPORT_SYMBOL(smscore_register_hotplug);
WARNING: line over 80 characters
391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
ERROR: "foo* bar" should be "foo *bar"
391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
WARNING: line over 80 characters
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
ERROR: "foo* bar" should be "foo *bar"
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
ERROR: space required after that ',' (ctx:VxV)
392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
^
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443:
+ printk(KERN_INFO"%s Entering status %d.\n", __FUNCTION__, msg.event);
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455:
+ printk(KERN_INFO "%s Entering.\n", __FUNCTION__);
ERROR: space prohibited before that '++' (ctx:WxB)
505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459:
+ for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++)
^
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471:
+ __FUNCTION__, rc);
total: 7 errors, 23 warnings, 524 lines checked
Signed-off-by: Uri Shkolnik <uris@siano-ms.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-31 11:44:04 +08:00
|
|
|
MODULE_DESCRIPTION("Siano MDTV Core module");
|
|
|
|
MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)");
|
2008-05-20 05:56:13 +08:00
|
|
|
MODULE_LICENSE("GPL");
|
2013-03-20 04:46:53 +08:00
|
|
|
|
|
|
|
/* This should match what's defined at smscoreapi.h */
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ATSC_DENVER);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_CMMB_MING_APP);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_CMMB_VEGA_12MHZ);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_CMMB_VENICE_12MHZ);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVBH_RIO);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ_B0);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVB_NOVA_12MHZ);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVB_RIO);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_FM_RADIO);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_FM_RADIO_RIO);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVBT_HCW_55XXX);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ISDBT_HCW_55XXX);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ_B0);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ISDBT_NOVA_12MHZ);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ISDBT_PELE);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_ISDBT_RIO);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_A);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVBT_NOVA_B);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_DVBT_STELLAR);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_TDMB_DENVER);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ_B0);
|
|
|
|
MODULE_FIRMWARE(SMS_FW_TDMB_NOVA_12MHZ);
|