Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
smscoreapi.h File Reference
#include <linux/device.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/wait.h>
#include <linux/timer.h>
#include <asm/page.h>
#include "smsir.h"

Go to the source code of this file.

Data Structures

struct  smscore_buffer_t
 
struct  smsdevice_params_t
 
struct  smsclient_params_t
 
struct  smscore_device_t
 
struct  SmsMsgHdr_ST
 
struct  SmsMsgData_ST
 
struct  SmsMsgData_ST2
 
struct  SmsDataDownload_ST
 
struct  SmsVersionRes_ST
 
struct  SmsFirmware_ST
 
struct  SMSHOSTLIB_STATISTICS_ST
 
struct  SmsMsgStatisticsInfo_ST
 
struct  SMSHOSTLIB_ISDBT_LAYER_STAT_ST
 
struct  SMSHOSTLIB_STATISTICS_ISDBT_ST
 
struct  PID_STATISTICS_DATA_S
 
struct  PID_STATISTICS_DATA_S::PID_BURST_S
 
struct  PID_DATA_S
 
struct  TRANSMISSION_STATISTICS_S
 
struct  RECEPTION_STATISTICS_S
 
struct  SMSHOSTLIB_STATISTICS_DVB_S
 
struct  SRVM_SIGNAL_STATUS_S
 
struct  SMSHOSTLIB_I2C_REQ_ST
 
struct  SMSHOSTLIB_I2C_RES_ST
 
struct  smscore_config_gpio
 
struct  smscore_gpio_config
 

Macros

#define kmutex_init(_p_)   mutex_init(_p_)
 
#define kmutex_lock(_p_)   mutex_lock(_p_)
 
#define kmutex_trylock(_p_)   mutex_trylock(_p_)
 
#define kmutex_unlock(_p_)   mutex_unlock(_p_)
 
#define min(a, b)   (((a) < (b)) ? (a) : (b))
 
#define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS   (10000)
 
#define SMS_ALLOC_ALIGNMENT   128
 
#define SMS_DMA_ALIGNMENT   16
 
#define SMS_ALIGN_ADDRESS(addr)   ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
 
#define SMS_DEVICE_FAMILY2   1
 
#define SMS_ROM_NO_RESPONSE   2
 
#define SMS_DEVICE_NOT_READY   0x8000000
 
#define SMS_ANTENNA_GPIO_0   1
 
#define SMS_ANTENNA_GPIO_1   0
 
#define BW_8_MHZ   0
 
#define BW_7_MHZ   1
 
#define BW_6_MHZ   2
 
#define BW_5_MHZ   3
 
#define BW_ISDBT_1SEG   4
 
#define BW_ISDBT_3SEG   5
 
#define MSG_HDR_FLAG_SPLIT_MSG   4
 
#define MAX_GPIO_PIN_NUMBER   31
 
#define HIF_TASK   11
 
#define SMS_HOST_LIB   150
 
#define DVBT_BDA_CONTROL_MSG_ID   201
 
#define SMS_MAX_PAYLOAD_SIZE   240
 
#define SMS_TUNE_TIMEOUT   500
 
#define MSG_SMS_GPIO_CONFIG_REQ   507
 
#define MSG_SMS_GPIO_CONFIG_RES   508
 
#define MSG_SMS_GPIO_SET_LEVEL_REQ   509
 
#define MSG_SMS_GPIO_SET_LEVEL_RES   510
 
#define MSG_SMS_GPIO_GET_LEVEL_REQ   511
 
#define MSG_SMS_GPIO_GET_LEVEL_RES   512
 
#define MSG_SMS_RF_TUNE_REQ   561
 
#define MSG_SMS_RF_TUNE_RES   562
 
#define MSG_SMS_INIT_DEVICE_REQ   578
 
#define MSG_SMS_INIT_DEVICE_RES   579
 
#define MSG_SMS_ADD_PID_FILTER_REQ   601
 
#define MSG_SMS_ADD_PID_FILTER_RES   602
 
#define MSG_SMS_REMOVE_PID_FILTER_REQ   603
 
#define MSG_SMS_REMOVE_PID_FILTER_RES   604
 
#define MSG_SMS_DAB_CHANNEL   607
 
#define MSG_SMS_GET_PID_FILTER_LIST_REQ   608
 
#define MSG_SMS_GET_PID_FILTER_LIST_RES   609
 
#define MSG_SMS_GET_STATISTICS_RES   616
 
#define MSG_SMS_GET_STATISTICS_REQ   615
 
#define MSG_SMS_HO_PER_SLICES_IND   630
 
#define MSG_SMS_SET_ANTENNA_CONFIG_REQ   651
 
#define MSG_SMS_SET_ANTENNA_CONFIG_RES   652
 
#define MSG_SMS_SLEEP_RESUME_COMP_IND   655
 
#define MSG_SMS_DATA_DOWNLOAD_REQ   660
 
#define MSG_SMS_DATA_DOWNLOAD_RES   661
 
#define MSG_SMS_SWDOWNLOAD_TRIGGER_REQ   664
 
#define MSG_SMS_SWDOWNLOAD_TRIGGER_RES   665
 
#define MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ   666
 
#define MSG_SMS_SWDOWNLOAD_BACKDOOR_RES   667
 
#define MSG_SMS_GET_VERSION_EX_REQ   668
 
#define MSG_SMS_GET_VERSION_EX_RES   669
 
#define MSG_SMS_SET_CLOCK_OUTPUT_REQ   670
 
#define MSG_SMS_I2C_SET_FREQ_REQ   685
 
#define MSG_SMS_GENERIC_I2C_REQ   687
 
#define MSG_SMS_GENERIC_I2C_RES   688
 
#define MSG_SMS_DVBT_BDA_DATA   693
 
#define MSG_SW_RELOAD_REQ   697
 
#define MSG_SMS_DATA_MSG   699
 
#define MSG_SW_RELOAD_START_REQ   702
 
#define MSG_SW_RELOAD_START_RES   703
 
#define MSG_SW_RELOAD_EXEC_REQ   704
 
#define MSG_SW_RELOAD_EXEC_RES   705
 
#define MSG_SMS_SPI_INT_LINE_SET_REQ   710
 
#define MSG_SMS_GPIO_CONFIG_EX_REQ   712
 
#define MSG_SMS_GPIO_CONFIG_EX_RES   713
 
#define MSG_SMS_ISDBT_TUNE_REQ   776
 
#define MSG_SMS_ISDBT_TUNE_RES   777
 
#define MSG_SMS_TRANSMISSION_IND   782
 
#define MSG_SMS_START_IR_REQ   800
 
#define MSG_SMS_START_IR_RES   801
 
#define MSG_SMS_IR_SAMPLES_IND   802
 
#define MSG_SMS_SIGNAL_DETECTED_IND   827
 
#define MSG_SMS_NO_SIGNAL_IND   828
 
#define SMS_INIT_MSG_EX(ptr, type, src, dst, len)
 
#define SMS_INIT_MSG(ptr, type, len)   SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)
 
#define CORRECT_STAT_RSSI(_stat)   ((_stat).RSSI *= -1)
 
#define CORRECT_STAT_BANDWIDTH(_stat)   (_stat.Bandwidth = 8 - _stat.Bandwidth)
 
#define CORRECT_STAT_TRANSMISSON_MODE(_stat)
 
#define SRVM_MAX_PID_FILTERS   8
 
#define SMS_GPIO_DIRECTION_INPUT   0
 
#define SMS_GPIO_DIRECTION_OUTPUT   1
 
#define SMS_GPIO_PULLUPDOWN_NONE   0
 
#define SMS_GPIO_PULLUPDOWN_PULLDOWN   1
 
#define SMS_GPIO_PULLUPDOWN_PULLUP   2
 
#define SMS_GPIO_PULLUPDOWN_KEEPER   3
 
#define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL   0
 
#define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT   1
 
#define SMS_GPIO_OUTPUTSLEWRATE_FAST   0
 
#define SMS_GPIO_OUTPUTSLEWRATE_SLOW   1
 
#define SMS_GPIO_OUTPUTDRIVING_4mA   0
 
#define SMS_GPIO_OUTPUTDRIVING_8mA   1
 
#define SMS_GPIO_OUTPUTDRIVING_12mA   2
 
#define SMS_GPIO_OUTPUTDRIVING_16mA   3
 
#define SMS_GPIO_DIRECTION_INPUT   0
 
#define SMS_GPIO_DIRECTION_OUTPUT   1
 
#define SMS_GPIO_PULL_UP_DOWN_NONE   0
 
#define SMS_GPIO_PULL_UP_DOWN_PULLDOWN   1
 
#define SMS_GPIO_PULL_UP_DOWN_PULLUP   2
 
#define SMS_GPIO_PULL_UP_DOWN_KEEPER   3
 
#define SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL   0
 
#define SMS_GPIO_INPUT_CHARACTERISTICS_SCHMITT   1
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_SLOW   1 /* 10xx */
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_FAST   0 /* 10xx */
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS   0 /* 11xx */
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS   1 /* 11xx */
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS   2 /* 11xx */
 
#define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS   3 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_S_4mA   0 /* 10xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_S_8mA   1 /* 10xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_S_12mA   2 /* 10xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_S_16mA   3 /* 10xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_1_5mA   0 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_2_8mA   1 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_4mA   2 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_7mA   3 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_10mA   4 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_11mA   5 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_14mA   6 /* 11xx */
 
#define SMS_GPIO_OUTPUT_DRIVING_16mA   7 /* 11xx */
 
#define DBG_INFO   1
 
#define DBG_ADV   2
 
#define sms_printk(kern, fmt, arg...)   printk(kern "%s: " fmt "\n", __func__, ##arg)
 
#define dprintk(kern, lvl, fmt, arg...)
 
#define sms_log(fmt, arg...)   sms_printk(KERN_INFO, fmt, ##arg)
 
#define sms_err(fmt, arg...)   sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg)
 
#define sms_warn(fmt, arg...)   sms_printk(KERN_WARNING, fmt, ##arg)
 
#define sms_info(fmt, arg...)   dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)
 
#define sms_debug(fmt, arg...)   dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)
 

Typedefs

typedef int(* hotplug_t )(struct smscore_device_t *coredev, struct device *device, int arrival)
 
typedef int(* setmode_t )(void *context, int mode)
 
typedef void(* detectmode_t )(void *context, int *mode)
 
typedef int(* sendrequest_t )(void *context, void *buffer, size_t size)
 
typedef int(* loadfirmware_t )(void *context, void *buffer, size_t size)
 
typedef int(* preload_t )(void *context)
 
typedef int(* postload_t )(void *context)
 
typedef int(* onresponse_t )(void *context, struct smscore_buffer_t *cb)
 
typedef void(* onremove_t )(void *context)
 

Enumerations

enum  sms_device_type_st {
  SMS_STELLAR = 0, SMS_NOVA_A0, SMS_NOVA_B0, SMS_VEGA,
  SMS_NUM_OF_DEVICE_TYPES
}
 
enum  SMS_DVB3_EVENTS {
  DVB3_EVENT_INIT = 0, DVB3_EVENT_SLEEP, DVB3_EVENT_HOTPLUG, DVB3_EVENT_FE_LOCK,
  DVB3_EVENT_FE_UNLOCK, DVB3_EVENT_UNC_OK, DVB3_EVENT_UNC_ERR
}
 
enum  SMS_DEVICE_MODE {
  DEVICE_MODE_NONE = -1, DEVICE_MODE_DVBT = 0, DEVICE_MODE_DVBH, DEVICE_MODE_DAB_TDMB,
  DEVICE_MODE_DAB_TDMB_DABIP, DEVICE_MODE_DVBT_BDA, DEVICE_MODE_ISDBT, DEVICE_MODE_ISDBT_BDA,
  DEVICE_MODE_CMMB, DEVICE_MODE_RAW_TUNER, DEVICE_MODE_MAX
}
 

Functions

void smscore_registry_setmode (char *devpath, int mode)
 
int smscore_registry_getmode (char *devpath)
 
int smscore_register_hotplug (hotplug_t hotplug)
 
void smscore_unregister_hotplug (hotplug_t hotplug)
 
int smscore_register_device (struct smsdevice_params_t *params, struct smscore_device_t **coredev)
 
void smscore_unregister_device (struct smscore_device_t *coredev)
 
int smscore_start_device (struct smscore_device_t *coredev)
 
int smscore_load_firmware (struct smscore_device_t *coredev, char *filename, loadfirmware_t loadfirmware_handler)
 
int smscore_set_device_mode (struct smscore_device_t *coredev, int mode)
 
int smscore_get_device_mode (struct smscore_device_t *coredev)
 
int smscore_register_client (struct smscore_device_t *coredev, struct smsclient_params_t *params, struct smscore_client_t **client)
 
void smscore_unregister_client (struct smscore_client_t *client)
 
int smsclient_sendrequest (struct smscore_client_t *client, void *buffer, size_t size)
 
void smscore_onresponse (struct smscore_device_t *coredev, struct smscore_buffer_t *cb)
 
int smscore_get_common_buffer_size (struct smscore_device_t *coredev)
 
int smscore_map_common_buffer (struct smscore_device_t *coredev, struct vm_area_struct *vma)
 
int smscore_get_fw_filename (struct smscore_device_t *coredev, int mode, char *filename)
 
int smscore_send_fw_file (struct smscore_device_t *coredev, u8 *ufwbuf, int size)
 
struct smscore_buffer_tsmscore_getbuffer (struct smscore_device_t *coredev)
 
void smscore_putbuffer (struct smscore_device_t *coredev, struct smscore_buffer_t *cb)
 
int smscore_configure_gpio (struct smscore_device_t *coredev, u32 pin, struct smscore_config_gpio *pinconfig)
 
int smscore_set_gpio (struct smscore_device_t *coredev, u32 pin, int level)
 
int smscore_gpio_configure (struct smscore_device_t *coredev, u8 PinNum, struct smscore_gpio_config *pGpioConfig)
 
int smscore_gpio_set_level (struct smscore_device_t *coredev, u8 PinNum, u8 NewLevel)
 
int smscore_gpio_get_level (struct smscore_device_t *coredev, u8 PinNum, u8 *level)
 
void smscore_set_board_id (struct smscore_device_t *core, int id)
 
int smscore_get_board_id (struct smscore_device_t *core)
 
int smscore_led_state (struct smscore_device_t *core, int led)
 

Macro Definition Documentation

#define BW_5_MHZ   3

Definition at line 182 of file smscoreapi.h.

#define BW_6_MHZ   2

Definition at line 181 of file smscoreapi.h.

#define BW_7_MHZ   1

Definition at line 180 of file smscoreapi.h.

#define BW_8_MHZ   0

Definition at line 179 of file smscoreapi.h.

#define BW_ISDBT_1SEG   4

Definition at line 183 of file smscoreapi.h.

#define BW_ISDBT_3SEG   5

Definition at line 184 of file smscoreapi.h.

#define CORRECT_STAT_BANDWIDTH (   _stat)    (_stat.Bandwidth = 8 - _stat.Bandwidth)

Definition at line 523 of file smscoreapi.h.

#define CORRECT_STAT_RSSI (   _stat)    ((_stat).RSSI *= -1)

Definition at line 522 of file smscoreapi.h.

#define CORRECT_STAT_TRANSMISSON_MODE (   _stat)
Value:
if (_stat.TransmissionMode == 0) \
_stat.TransmissionMode = 2; \
else if (_stat.TransmissionMode == 1) \
_stat.TransmissionMode = 8; \
else \
_stat.TransmissionMode = 4;

Definition at line 524 of file smscoreapi.h.

#define DBG_ADV   2

Definition at line 756 of file smscoreapi.h.

#define DBG_INFO   1

Definition at line 755 of file smscoreapi.h.

#define dprintk (   kern,
  lvl,
  fmt,
  arg... 
)
Value:
do {\
if (sms_dbg & lvl) \
sms_printk(kern, fmt, ##arg); } while (0)

Definition at line 761 of file smscoreapi.h.

#define DVBT_BDA_CONTROL_MSG_ID   201

Definition at line 192 of file smscoreapi.h.

#define HIF_TASK   11

Definition at line 190 of file smscoreapi.h.

#define kmutex_init (   _p_)    mutex_init(_p_)

Definition at line 38 of file smscoreapi.h.

#define kmutex_lock (   _p_)    mutex_lock(_p_)

Definition at line 39 of file smscoreapi.h.

#define kmutex_trylock (   _p_)    mutex_trylock(_p_)

Definition at line 40 of file smscoreapi.h.

#define kmutex_unlock (   _p_)    mutex_unlock(_p_)

Definition at line 41 of file smscoreapi.h.

#define MAX_GPIO_PIN_NUMBER   31

Definition at line 188 of file smscoreapi.h.

#define min (   a,
  b 
)    (((a) < (b)) ? (a) : (b))

Definition at line 44 of file smscoreapi.h.

#define MSG_HDR_FLAG_SPLIT_MSG   4

Definition at line 186 of file smscoreapi.h.

#define MSG_SMS_ADD_PID_FILTER_REQ   601

Definition at line 207 of file smscoreapi.h.

#define MSG_SMS_ADD_PID_FILTER_RES   602

Definition at line 208 of file smscoreapi.h.

#define MSG_SMS_DAB_CHANNEL   607

Definition at line 211 of file smscoreapi.h.

#define MSG_SMS_DATA_DOWNLOAD_REQ   660

Definition at line 220 of file smscoreapi.h.

#define MSG_SMS_DATA_DOWNLOAD_RES   661

Definition at line 221 of file smscoreapi.h.

#define MSG_SMS_DATA_MSG   699

Definition at line 234 of file smscoreapi.h.

#define MSG_SMS_DVBT_BDA_DATA   693

Definition at line 232 of file smscoreapi.h.

#define MSG_SMS_GENERIC_I2C_REQ   687

Definition at line 230 of file smscoreapi.h.

#define MSG_SMS_GENERIC_I2C_RES   688

Definition at line 231 of file smscoreapi.h.

#define MSG_SMS_GET_PID_FILTER_LIST_REQ   608

Definition at line 212 of file smscoreapi.h.

#define MSG_SMS_GET_PID_FILTER_LIST_RES   609

Definition at line 213 of file smscoreapi.h.

#define MSG_SMS_GET_STATISTICS_REQ   615

Definition at line 215 of file smscoreapi.h.

#define MSG_SMS_GET_STATISTICS_RES   616

Definition at line 214 of file smscoreapi.h.

#define MSG_SMS_GET_VERSION_EX_REQ   668

Definition at line 226 of file smscoreapi.h.

#define MSG_SMS_GET_VERSION_EX_RES   669

Definition at line 227 of file smscoreapi.h.

#define MSG_SMS_GPIO_CONFIG_EX_REQ   712

Definition at line 240 of file smscoreapi.h.

#define MSG_SMS_GPIO_CONFIG_EX_RES   713

Definition at line 241 of file smscoreapi.h.

#define MSG_SMS_GPIO_CONFIG_REQ   507

Definition at line 197 of file smscoreapi.h.

#define MSG_SMS_GPIO_CONFIG_RES   508

Definition at line 198 of file smscoreapi.h.

#define MSG_SMS_GPIO_GET_LEVEL_REQ   511

Definition at line 201 of file smscoreapi.h.

#define MSG_SMS_GPIO_GET_LEVEL_RES   512

Definition at line 202 of file smscoreapi.h.

#define MSG_SMS_GPIO_SET_LEVEL_REQ   509

Definition at line 199 of file smscoreapi.h.

#define MSG_SMS_GPIO_SET_LEVEL_RES   510

Definition at line 200 of file smscoreapi.h.

#define MSG_SMS_HO_PER_SLICES_IND   630

Definition at line 216 of file smscoreapi.h.

#define MSG_SMS_I2C_SET_FREQ_REQ   685

Definition at line 229 of file smscoreapi.h.

#define MSG_SMS_INIT_DEVICE_REQ   578

Definition at line 205 of file smscoreapi.h.

#define MSG_SMS_INIT_DEVICE_RES   579

Definition at line 206 of file smscoreapi.h.

#define MSG_SMS_IR_SAMPLES_IND   802

Definition at line 247 of file smscoreapi.h.

#define MSG_SMS_ISDBT_TUNE_REQ   776

Definition at line 242 of file smscoreapi.h.

#define MSG_SMS_ISDBT_TUNE_RES   777

Definition at line 243 of file smscoreapi.h.

#define MSG_SMS_NO_SIGNAL_IND   828

Definition at line 249 of file smscoreapi.h.

#define MSG_SMS_REMOVE_PID_FILTER_REQ   603

Definition at line 209 of file smscoreapi.h.

#define MSG_SMS_REMOVE_PID_FILTER_RES   604

Definition at line 210 of file smscoreapi.h.

#define MSG_SMS_RF_TUNE_REQ   561

Definition at line 203 of file smscoreapi.h.

#define MSG_SMS_RF_TUNE_RES   562

Definition at line 204 of file smscoreapi.h.

#define MSG_SMS_SET_ANTENNA_CONFIG_REQ   651

Definition at line 217 of file smscoreapi.h.

#define MSG_SMS_SET_ANTENNA_CONFIG_RES   652

Definition at line 218 of file smscoreapi.h.

#define MSG_SMS_SET_CLOCK_OUTPUT_REQ   670

Definition at line 228 of file smscoreapi.h.

#define MSG_SMS_SIGNAL_DETECTED_IND   827

Definition at line 248 of file smscoreapi.h.

#define MSG_SMS_SLEEP_RESUME_COMP_IND   655

Definition at line 219 of file smscoreapi.h.

#define MSG_SMS_SPI_INT_LINE_SET_REQ   710

Definition at line 239 of file smscoreapi.h.

#define MSG_SMS_START_IR_REQ   800

Definition at line 245 of file smscoreapi.h.

#define MSG_SMS_START_IR_RES   801

Definition at line 246 of file smscoreapi.h.

#define MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ   666

Definition at line 224 of file smscoreapi.h.

#define MSG_SMS_SWDOWNLOAD_BACKDOOR_RES   667

Definition at line 225 of file smscoreapi.h.

#define MSG_SMS_SWDOWNLOAD_TRIGGER_REQ   664

Definition at line 222 of file smscoreapi.h.

#define MSG_SMS_SWDOWNLOAD_TRIGGER_RES   665

Definition at line 223 of file smscoreapi.h.

#define MSG_SMS_TRANSMISSION_IND   782

Definition at line 244 of file smscoreapi.h.

#define MSG_SW_RELOAD_EXEC_REQ   704

Definition at line 237 of file smscoreapi.h.

#define MSG_SW_RELOAD_EXEC_RES   705

Definition at line 238 of file smscoreapi.h.

#define MSG_SW_RELOAD_REQ   697

Definition at line 233 of file smscoreapi.h.

#define MSG_SW_RELOAD_START_REQ   702

Definition at line 235 of file smscoreapi.h.

#define MSG_SW_RELOAD_START_RES   703

Definition at line 236 of file smscoreapi.h.

#define SMS_ALIGN_ADDRESS (   addr)    ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))

Definition at line 50 of file smscoreapi.h.

#define SMS_ALLOC_ALIGNMENT   128

Definition at line 48 of file smscoreapi.h.

#define SMS_ANTENNA_GPIO_0   1

Definition at line 176 of file smscoreapi.h.

#define SMS_ANTENNA_GPIO_1   0

Definition at line 177 of file smscoreapi.h.

#define sms_debug (   fmt,
  arg... 
)    dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)

Definition at line 771 of file smscoreapi.h.

#define SMS_DEVICE_FAMILY2   1

Definition at line 53 of file smscoreapi.h.

#define SMS_DEVICE_NOT_READY   0x8000000

Definition at line 55 of file smscoreapi.h.

#define SMS_DMA_ALIGNMENT   16

Definition at line 49 of file smscoreapi.h.

#define sms_err (   fmt,
  arg... 
)    sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg)

Definition at line 766 of file smscoreapi.h.

#define SMS_GPIO_DIRECTION_INPUT   0

Definition at line 653 of file smscoreapi.h.

#define SMS_GPIO_DIRECTION_INPUT   0

Definition at line 653 of file smscoreapi.h.

#define SMS_GPIO_DIRECTION_OUTPUT   1

Definition at line 654 of file smscoreapi.h.

#define SMS_GPIO_DIRECTION_OUTPUT   1

Definition at line 654 of file smscoreapi.h.

#define SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL   0

Definition at line 663 of file smscoreapi.h.

#define SMS_GPIO_INPUT_CHARACTERISTICS_SCHMITT   1

Definition at line 664 of file smscoreapi.h.

#define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL   0

Definition at line 637 of file smscoreapi.h.

#define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT   1

Definition at line 638 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_10mA   4 /* 11xx */

Definition at line 686 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_11mA   5 /* 11xx */

Definition at line 687 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_14mA   6 /* 11xx */

Definition at line 688 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_16mA   7 /* 11xx */

Definition at line 689 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_1_5mA   0 /* 11xx */

Definition at line 682 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_2_8mA   1 /* 11xx */

Definition at line 683 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_4mA   2 /* 11xx */

Definition at line 684 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_7mA   3 /* 11xx */

Definition at line 685 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_S_12mA   2 /* 10xx */

Definition at line 679 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_S_16mA   3 /* 10xx */

Definition at line 680 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_S_4mA   0 /* 10xx */

Definition at line 677 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_DRIVING_S_8mA   1 /* 10xx */

Definition at line 678 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS   0 /* 11xx */

Definition at line 671 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS   1 /* 11xx */

Definition at line 672 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS   2 /* 11xx */

Definition at line 673 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS   3 /* 11xx */

Definition at line 674 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_FAST   0 /* 10xx */

Definition at line 668 of file smscoreapi.h.

#define SMS_GPIO_OUTPUT_SLEW_RATE_SLOW   1 /* 10xx */

Definition at line 667 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTDRIVING_12mA   2

Definition at line 647 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTDRIVING_16mA   3

Definition at line 648 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTDRIVING_4mA   0

Definition at line 645 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTDRIVING_8mA   1

Definition at line 646 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTSLEWRATE_FAST   0

Definition at line 641 of file smscoreapi.h.

#define SMS_GPIO_OUTPUTSLEWRATE_SLOW   1

Definition at line 642 of file smscoreapi.h.

#define SMS_GPIO_PULL_UP_DOWN_KEEPER   3

Definition at line 660 of file smscoreapi.h.

#define SMS_GPIO_PULL_UP_DOWN_NONE   0

Definition at line 657 of file smscoreapi.h.

#define SMS_GPIO_PULL_UP_DOWN_PULLDOWN   1

Definition at line 658 of file smscoreapi.h.

#define SMS_GPIO_PULL_UP_DOWN_PULLUP   2

Definition at line 659 of file smscoreapi.h.

#define SMS_GPIO_PULLUPDOWN_KEEPER   3

Definition at line 634 of file smscoreapi.h.

#define SMS_GPIO_PULLUPDOWN_NONE   0

Definition at line 631 of file smscoreapi.h.

#define SMS_GPIO_PULLUPDOWN_PULLDOWN   1

Definition at line 632 of file smscoreapi.h.

#define SMS_GPIO_PULLUPDOWN_PULLUP   2

Definition at line 633 of file smscoreapi.h.

#define SMS_HOST_LIB   150

Definition at line 191 of file smscoreapi.h.

#define sms_info (   fmt,
  arg... 
)    dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)

Definition at line 769 of file smscoreapi.h.

#define SMS_INIT_MSG (   ptr,
  type,
  len 
)    SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)

Definition at line 256 of file smscoreapi.h.

#define SMS_INIT_MSG_EX (   ptr,
  type,
  src,
  dst,
  len 
)
Value:
do { \
(ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \
(ptr)->msgLength = len; (ptr)->msgFlags = 0; \
} while (0)

Definition at line 251 of file smscoreapi.h.

#define sms_log (   fmt,
  arg... 
)    sms_printk(KERN_INFO, fmt, ##arg)

Definition at line 765 of file smscoreapi.h.

#define SMS_MAX_PAYLOAD_SIZE   240

Definition at line 194 of file smscoreapi.h.

#define sms_printk (   kern,
  fmt,
  arg... 
)    printk(kern "%s: " fmt "\n", __func__, ##arg)

Definition at line 758 of file smscoreapi.h.

#define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS   (10000)

Definition at line 47 of file smscoreapi.h.

#define SMS_ROM_NO_RESPONSE   2

Definition at line 54 of file smscoreapi.h.

#define SMS_TUNE_TIMEOUT   500

Definition at line 195 of file smscoreapi.h.

#define sms_warn (   fmt,
  arg... 
)    sms_printk(KERN_WARNING, fmt, ##arg)

Definition at line 768 of file smscoreapi.h.

#define SRVM_MAX_PID_FILTERS   8

Definition at line 592 of file smscoreapi.h.

Typedef Documentation

typedef void(* detectmode_t)(void *context, int *mode)

Definition at line 73 of file smscoreapi.h.

typedef int(* hotplug_t)(struct smscore_device_t *coredev, struct device *device, int arrival)

Definition at line 69 of file smscoreapi.h.

typedef int(* loadfirmware_t)(void *context, void *buffer, size_t size)

Definition at line 75 of file smscoreapi.h.

typedef void(* onremove_t)(void *context)

Definition at line 80 of file smscoreapi.h.

typedef int(* onresponse_t)(void *context, struct smscore_buffer_t *cb)

Definition at line 79 of file smscoreapi.h.

typedef int(* postload_t)(void *context)

Definition at line 77 of file smscoreapi.h.

typedef int(* preload_t)(void *context)

Definition at line 76 of file smscoreapi.h.

typedef int(* sendrequest_t)(void *context, void *buffer, size_t size)

Definition at line 74 of file smscoreapi.h.

typedef int(* setmode_t)(void *context, int mode)

Definition at line 72 of file smscoreapi.h.

Enumeration Type Documentation

Enumerator:
DEVICE_MODE_NONE 
DEVICE_MODE_DVBT 
DEVICE_MODE_DVBH 
DEVICE_MODE_DAB_TDMB 
DEVICE_MODE_DAB_TDMB_DABIP 
DEVICE_MODE_DVBT_BDA 
DEVICE_MODE_ISDBT 
DEVICE_MODE_ISDBT_BDA 
DEVICE_MODE_CMMB 
DEVICE_MODE_RAW_TUNER 
DEVICE_MODE_MAX 

Definition at line 269 of file smscoreapi.h.

Enumerator:
SMS_STELLAR 
SMS_NOVA_A0 
SMS_NOVA_B0 
SMS_VEGA 
SMS_NUM_OF_DEVICE_TYPES 

Definition at line 57 of file smscoreapi.h.

Enumerator:
DVB3_EVENT_INIT 
DVB3_EVENT_SLEEP 
DVB3_EVENT_HOTPLUG 
DVB3_EVENT_FE_LOCK 
DVB3_EVENT_FE_UNLOCK 
DVB3_EVENT_UNC_OK 
DVB3_EVENT_UNC_ERR 

Definition at line 259 of file smscoreapi.h.

Function Documentation

int smsclient_sendrequest ( struct smscore_client_t client,
void buffer,
size_t  size 
)

verifies that source id is not taken by another client, calls device handler to send requests to the device

Parameters
clientpointer to smsclient object returned by smscore_register_client
bufferpointer to a request buffer
sizesize (in bytes) of request buffer
Returns
0 on success, <0 on error.

Definition at line 1256 of file smscoreapi.c.

int smscore_configure_gpio ( struct smscore_device_t coredev,
u32  pin,
struct smscore_config_gpio pinconfig 
)

Definition at line 1287 of file smscoreapi.c.

int smscore_get_board_id ( struct smscore_device_t core)

Definition at line 79 of file smscoreapi.c.

int smscore_get_common_buffer_size ( struct smscore_device_t coredev)
int smscore_get_device_mode ( struct smscore_device_t coredev)

calls device handler to get current mode of operation

Parameters
coredevpointer to a coredev object returned by smscore_register_device
Returns
current mode

Definition at line 920 of file smscoreapi.c.

int smscore_get_fw_filename ( struct smscore_device_t coredev,
int  mode,
char filename 
)
struct smscore_buffer_t* smscore_getbuffer ( struct smscore_device_t coredev)
read

Definition at line 1109 of file smscoreapi.c.

int smscore_gpio_configure ( struct smscore_device_t coredev,
u8  PinNum,
struct smscore_gpio_config pGpioConfig 
)

Definition at line 1408 of file smscoreapi.c.

int smscore_gpio_get_level ( struct smscore_device_t coredev,
u8  PinNum,
u8 level 
)

Definition at line 1537 of file smscoreapi.c.

int smscore_gpio_set_level ( struct smscore_device_t coredev,
u8  PinNum,
u8  NewLevel 
)

Definition at line 1488 of file smscoreapi.c.

int smscore_led_state ( struct smscore_device_t core,
int  led 
)

Definition at line 71 of file smscoreapi.c.

int smscore_load_firmware ( struct smscore_device_t coredev,
char filename,
loadfirmware_t  loadfirmware_handler 
)
int smscore_map_common_buffer ( struct smscore_device_t coredev,
struct vm_area_struct vma 
)
void smscore_onresponse ( struct smscore_device_t coredev,
struct smscore_buffer_t cb 
)

find client by response id/type, call clients onresponse handler return buffer to pool on error

Parameters
coredevpointer to a coredev object returned by smscore_register_device
cbpointer to response buffer descriptor

Definition at line 972 of file smscoreapi.c.

void smscore_putbuffer ( struct smscore_device_t coredev,
struct smscore_buffer_t cb 
)

return buffer descriptor to a pool

Parameters
coredevpointer to a coredev object returned by smscore_register_device
cbpointer buffer descriptor

Definition at line 1127 of file smscoreapi.c.

int smscore_register_client ( struct smscore_device_t coredev,
struct smsclient_params_t params,
struct smscore_client_t **  client 
)

creates smsclient object, check that id is taken by another client

Parameters
coredevpointer to a coredev object from clients hotplug
initial_idall messages with this id would be sent to this client
data_typeall messages of this type would be sent to this client
onresponse_handlerclient handler that is called to process incoming messages
onremove_handlerclient handler that is called when device is removed
contextclient-specific context
clientpointer to a value that receives created smsclient object
Returns
0 on success, <0 on error.

Definition at line 1179 of file smscoreapi.c.

int smscore_register_device ( struct smsdevice_params_t params,
struct smscore_device_t **  coredev 
)

creates coredev object for a device, prepares buffers, creates buffer mappings, notifies registered hotplugs about new device.

Parameters
paramsdevice pointer to struct with device specific parameters and handlers
coredevpointer to a value that receives created coredev object
Returns
0 on success, <0 on error.

Definition at line 321 of file smscoreapi.c.

int smscore_register_hotplug ( hotplug_t  hotplug)

register a client callback that called when device plugged in/unplugged NOTE: if devices exist callback is called immediately for each device

Parameters
hotplugcallback
Returns
0 on success, <0 on error.

Definition at line 201 of file smscoreapi.c.

int smscore_registry_getmode ( char devpath)

Definition at line 130 of file smscoreapi.c.

void smscore_registry_setmode ( char devpath,
int  mode 
)

Definition at line 157 of file smscoreapi.c.

int smscore_send_fw_file ( struct smscore_device_t coredev,
u8 ufwbuf,
int  size 
)
void smscore_set_board_id ( struct smscore_device_t core,
int  id 
)

Definition at line 66 of file smscoreapi.c.

int smscore_set_device_mode ( struct smscore_device_t coredev,
int  mode 
)

calls device handler to change mode of operation NOTE: stellar/usb may disconnect when changing mode

Parameters
coredevpointer to a coredev object returned by smscore_register_device
moderequested mode of operation
Returns
0 on success, <0 on error.

Definition at line 807 of file smscoreapi.c.

int smscore_set_gpio ( struct smscore_device_t coredev,
u32  pin,
int  level 
)

Definition at line 1333 of file smscoreapi.c.

int smscore_start_device ( struct smscore_device_t coredev)

sets initial device mode and notifies client hotplugs that device is ready

Parameters
coredevpointer to a coredev object returned by smscore_register_device
Returns
0 on success, <0 on error.

Definition at line 486 of file smscoreapi.c.

void smscore_unregister_client ( struct smscore_client_t client)

frees smsclient object and all subclients associated with it

Parameters
clientpointer to smsclient object returned by smscore_register_client

Definition at line 1221 of file smscoreapi.c.

void smscore_unregister_device ( struct smscore_device_t coredev)

notifies all clients registered with the device, notifies hotplugs, frees all buffers and coredev object

Parameters
coredevpointer to a coredev object returned by smscore_register_device
Returns
0 on success, <0 on error.

Definition at line 679 of file smscoreapi.c.

void smscore_unregister_hotplug ( hotplug_t  hotplug)

unregister a client callback that called when device plugged in/unplugged

Parameters
hotplugcallback

Definition at line 242 of file smscoreapi.c.