RDK Documentation (Open Sourced RDK Components)

Description

Modules

 IARM-MFR Manager internal API
 

Data Structures

struct  _VL_NVRAM_DATA
 
struct  _IARM_Bus_MFRLib_SerializedData_Param_t
 
struct  _IARM_Bus_MFRLib_WriteImage_Param_t
 
struct  _IARM_Bus_MFRLib_GetImageWriteProgress_Param_t
 
struct  _IARM_Bus_MFRLib_SetImageWriteProgress_Param_t
 
struct  _IARM_Bus_MFRLib_Reboot_Param_t
 
struct  _IARM_Bus_MFRLib_SetCableCardType_Param_t
 
struct  _IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t
 
struct  _IARM_Bus_MFRLib_GetBootImageName_Param_t
 
struct  _IARM_Bus_MFRLib_GetPathConfiguration_Param_t
 
struct  _IARM_Bus_MFRLib_GetDFAST2Data_Param_t
 
struct  _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t
 
struct  _IARM_BUS_MfrMgr_StatusUpdate_EventData_t
 
struct  _mfrSerializedData_t
 
struct  _mfrDFAST2Params_t
 
struct  _mfrHostFrmwareInfo_t
 
struct  _mfrUpgradeStatus_t
 
struct  _mfrUpgradeStatusNotify_t
 
struct  _IARM_Bus_MFRLib_GetSerializedData_Param_t
 
struct  _IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t
 
struct  _IARM_Bus_MFRLib_SetBLPattern_Param_t
 

Macros

#define MFR_CRYPTO_KEY_LENGTH   16
 
#define MFR_CRYPTO_IVEC_LENGTH   16
 
#define IARM_BUS_MFRLIB_NAME   "MFRLib"
 
#define IARM_BUS_MFRLIB_API_GetSerializedData   "mfrGetSerializedData"
 
#define IARM_BUS_MFRLIB_API_SetSerializedData   "mfrSetSerializedData"
 
#define IARM_BUS_MFRLIB_API_WriteImage   "mfrWriteImage"
 
#define IARM_BUS_MFRLIB_API_SetImageWriteProgress   "mfrSetImageWriteProgress"
 
#define IARM_BUS_MFRLIB_API_GetImageWriteProgress   "mfrGetImageWriteProgress"
 
#define IARM_BUS_MFRLIB_API_DeletePDRI   "mfrDeletePDRI"
 
#define IARM_BUS_MFRLIB_API_ScrubAllBanks   "mfrScrubAllBanks"
 
#define IARM_BUS_MFRLIB_API_Reboot   "mfrReboot"
 
#define IARM_BUS_MFRLIB_API_SetCableCardType   "mfrSetCableCardType"
 
#define IARM_BUS_MFRLIB_API_SetHostFirmwareInfo   "mfrSetHostFirmwareInfo"
 
#define IARM_BUS_MFRLIB_API_GetBootImageName   "mfrGetBootImageName"
 
#define IARM_BUS_MFRLIB_API_GetPathConfiguration   "mfrGetPathConfiguration"
 
#define IARM_BUS_MFRLIB_API_GetDFAST2Data   "mfrGetDFAST2Data"
 
#define IARM_BUS_MFRLIB_COMMON_API_WriteImageCb   "WriteImageCb"
 
#define IARM_BUS_MFRLIB_API_Init   "mfrInit"
 
#define IARM_BUS_MFRLIB_API_Shutdown   "mfrShutdown"
 
#define MAX_BUF   255
 
#define MAX_SERIALIZED_BUF   1280
 
#define MFR_MAX_STR_SIZE   (256)
 
#define MFR_DFAST_INPUT_BYTES   (16)
 
#define MFR_DFAST_OUTPUT_BYTES   (16)
 
#define mfrBOOT_INSTANCE_CURRENT   0
 
#define mfrBOOT_INSTANCE_PREVIOUS   1
 
#define mfrBOOT_INSTANCE_UPGRADED   2
 
#define LOG(...)   printf(__VA_ARGS__)
 
#define IARM_Bus_Lock(lock)   pthread_mutex_lock(&mfrLock)
 
#define IARM_Bus_Unlock(lock)   pthread_mutex_unlock(&mfrLock)
 
#define RDK_MFRCRYPTOLIB_NAME   "libmfrcrypto.so"
 
#define IARM_BUS_MFRLIB_NAME   "MFRLib"
 
#define IARM_BUS_MFRLIB_API_GetSerializedData   "mfrGetManufacturerData"
 
#define IARM_BUS_MFRLIB_API_DeletePDRI   "mfrDeletePDRI"
 
#define IARM_BUS_MFRLIB_API_ScrubAllBanks   "scrubAllBanks"
 
#define IARM_BUS_MFRLIB_API_WriteImage   "mfrWriteImage"
 
#define IARM_BUS_MFRLIB_API_WIFI_EraseAllData   "mfrWifiEraseAllData"
 
#define IARM_BUS_MFRLIB_API_WIFI_Credentials   "mfrWifiCredentials"
 
#define IARM_BUS_MFRLIB_API_SetBootLoaderPattern   "mfrSetBootloaderPattern"
 
#define IARM_BUS_MFRLIB_COMMON_API_WriteImageCb   "WriteImageCb"
 
#define HDCP_KEY_MAX_SIZE   (1280)
 
#define MAX_SERIALIZED_BUF   HDCP_KEY_MAX_SIZE
 
#define MAX_BUF   255
 
#define LOG(...)   printf(__VA_ARGS__)
 
#define SAFEC_ERR_CHECK(safec_rc)
 
#define SAFEC_ERR_CHECK(safec_rc)
 

Typedefs

typedef unsigned long VL_MFR_DEVICE_HANDLE_t
 
typedef enum _VL_MFR_API_RESULT VL_MFR_API_RESULT
 
typedef enum _VL_PLATFORM_VERSION_TYPE VL_PLATFORM_VERSION_TYPE
 
typedef enum _VL_NORMAL_NVRAM_DATA_TYPE VL_NORMAL_NVRAM_DATA_TYPE
 
typedef enum _VL_SECURE_NVRAM_DATA_TYPE VL_SECURE_NVRAM_DATA_TYPE
 
typedef enum _VL_STACK_2_MFR_EVENT_TYPE VL_STACK_2_MFR_EVENT_TYPE
 
typedef struct _VL_NVRAM_DATA VL_NVRAM_DATA
 
typedef struct _IARM_Bus_MFRLib_SerializedData_Param_t IARM_Bus_MFRLib_SerializedData_Param_t
 
typedef struct _IARM_Bus_MFRLib_WriteImage_Param_t IARM_Bus_MFRLib_WriteImage_Param_t
 
typedef struct _IARM_Bus_MFRLib_GetImageWriteProgress_Param_t IARM_Bus_MFRLib_GetImageWriteProgress_Param_t
 
typedef struct _IARM_Bus_MFRLib_SetImageWriteProgress_Param_t IARM_Bus_MFRLib_SetImageWriteProgress_Param_t
 
typedef struct _IARM_Bus_MFRLib_Reboot_Param_t IARM_Bus_MFRLib_Reboot_Param_t
 
typedef struct _IARM_Bus_MFRLib_SetCableCardType_Param_t IARM_Bus_MFRLib_SetCableCardType_Param_t
 
typedef struct _IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t
 
typedef struct _IARM_Bus_MFRLib_GetBootImageName_Param_t IARM_Bus_MFRLib_GetBootImageName_Param_t
 
typedef struct _IARM_Bus_MFRLib_GetPathConfiguration_Param_t IARM_Bus_MFRLib_GetPathConfiguration_Param_t
 
typedef struct _IARM_Bus_MFRLib_GetDFAST2Data_Param_t IARM_Bus_MFRLib_GetDFAST2Data_Param_t
 
typedef struct _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t
 
typedef enum _MfrMgr_EventId_t IARM_Bus_MfrMgr_EventId_t
 
typedef struct _IARM_BUS_MfrMgr_StatusUpdate_EventData_t IARM_BUS_MfrMgr_StatusUpdate_EventData_t
 
typedef enum _mfrError_t mfrError_t
 
typedef struct _mfrSerializedData_t mfrSerializedData_t
 
typedef enum _mfrSerializedType_t mfrSerializedType_t
 
typedef enum _mfrConfigPathType_t mfrConfigPathType_t
 
typedef enum _mfrImageType_t mfrImageType_t
 
typedef enum _mfrUpgradeProgress_t mfrUpgradeProgress_t
 
typedef enum _mfrCableCardType_t mfrCableCardType_t
 
typedef struct _mfrDFAST2Params_t mfrDFAST2Params_t
 
typedef struct _mfrHostFrmwareInfo_t mfrHostFirmwareInfo_t
 
typedef struct _mfrUpgradeStatus_t mfrUpgradeStatus_t
 
typedef struct _mfrUpgradeStatusNotify_t mfrUpgradeStatusNotify_t
 
typedef mfrError_t(* mfrEncryptFunction_t) (const mfrSerializedData_t *pClearText, mfrSerializedData_t *pCipherText)
 crypto funcionality. This function should be called to encrypt a block of data More...
 
typedef mfrError_t(* mfrDecryptFunction_t) (const mfrSerializedData_t *pCipherText, mfrSerializedData_t *pClearText)
 crypto funcionality. This function should be called to decrypt a block of data that are encrypted by mfrEncryptFunction_t; More...
 
typedef mfrError_t(* mfrCrypto_init_t) (const mfrSerializedData_t *)
 
typedef mfrError_t(* mfrCrypto_Encrypt_t) (const mfrSerializedData_t *, mfrSerializedData_t *)
 
typedef mfrError_t(* mfrCrypto_Decrypt_t) (const mfrSerializedData_t *, mfrSerializedData_t *)
 
typedef mfrError_t(* mfrCrypto_term_t) ()
 
typedef mfrError_t(* mfr_init_t) ()
 
typedef mfrError_t(* mfrGetSerializedData_t) (mfrSerializedType_t, mfrSerializedData_t *, mfrEncryptFunction_t *)
 
typedef mfrError_t(* mfrSetSerializedData_t) (mfrSerializedType_t, mfrSerializedData_t *, mfrDecryptFunction_t *)
 
typedef mfrError_t(* mfrWriteImage_t) (const char *, const char *, mfrImageType_t, mfrUpgradeStatusNotify_t)
 
typedef mfrError_t(* mfrSetImageWriteProgress_t) (const char *, mfrImageType_t, mfrUpgradeProgress_t)
 
typedef mfrError_t(* mfrGetImageWriteProgress_t) (const char *imageName, mfrImageType_t imageType, mfrUpgradeProgress_t *)
 
typedef mfrError_t(* mfrDeletePDRI_t) (void)
 
typedef mfrError_t(* mfrScrubAllBanks_t) (void)
 
typedef mfrError_t(* mfr_shutdown_t) (void)
 
typedef mfrError_t(* mfrReboot_t) (const char *)
 
typedef mfrError_t(* mfrSetCableCardType_t) (mfrCableCardType_t)
 
typedef mfrError_t(* mfrSetHostFirmwareInfo_t) (const mfrHostFirmwareInfo_t *)
 
typedef mfrError_t(* mfrGetBootImageName_t) (int, char *, int, mfrImageType_t)
 
typedef mfrError_t(* mfrGetPathConfiguration_t) (mfrConfigPathType_t, char *, int *)
 
typedef mfrError_t(* mfrGetDFAST2Data_t) (mfrDFAST2Params_t *)
 
typedef enum _mfrTemperatureState_t mfrTemperatureState_t
 
typedef struct _IARM_Bus_MFRLib_GetSerializedData_Param_t IARM_Bus_MFRLib_GetSerializedData_Param_t
 
typedef struct _IARM_Bus_MFRLib_WriteImage_Param_t IARM_Bus_MFRLib_WriteImage_Param_t
 
typedef struct _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t
 
typedef enum _WifiRequestType WifiRequestType_t
 
typedef struct _IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t
 
typedef struct _IARM_Bus_MFRLib_SetBLPattern_Param_t IARM_Bus_MFRLib_SetBLPattern_Param_t
 
typedef enum _mfrError_t mfrError_t
 
typedef struct _mfrSerializedData_t mfrSerializedData_t
 
typedef enum _mfrSerializedType_t mfrSerializedType_t
 
typedef enum _mfrImageType_t mfrImageType_t
 
typedef enum _mfrUpgradeProgress_t mfrUpgradeProgress_t
 
typedef enum _mfrBlPattern_t mfrBlPattern_t
 
typedef struct _mfrUpgradeStatus_t mfrUpgradeStatus_t
 
typedef struct _mfrUpgradeStatusNotify_t mfrUpgradeStatusNotify_t
 

Enumerations

enum  _VL_MFR_API_RESULT
 
enum  _VL_PLATFORM_VERSION_TYPE
 
enum  _VL_NORMAL_NVRAM_DATA_TYPE
 
enum  _VL_SECURE_NVRAM_DATA_TYPE
 
enum  _VL_STACK_2_MFR_EVENT_TYPE
 
enum  _MfrMgr_EventId_t
 
enum  _mfrError_t
 
enum  _mfrSerializedType_t
 
enum  _mfrConfigPathType_t
 
enum  _mfrImageType_t
 
enum  _mfrUpgradeProgress_t
 
enum  _mfrCableCardType_t
 
enum  _mfrTemperatureState_t
 
enum  _WifiRequestType
 
enum  _mfrError_t
 
enum  _mfrSerializedType_t
 
enum  _mfrImageType_t
 
enum  _mfrUpgradeProgress_t
 
enum  _mfrBlPattern_t
 

Functions

static void mfr_create_key (const mfrSerializedData_t *pSerialNumber, unsigned char *keybuf, unsigned char *ivec)
 
mfrError_t mfrCrypto_init (const mfrSerializedData_t *pSerialNumber)
 
mfrError_t mfrCrypto_term ()
 
mfrError_t mfrCrypto_Encrypt (const mfrSerializedData_t *pPlainText, mfrSerializedData_t *pCipherText)
 
mfrError_t mfrCrypto_Decrypt (const mfrSerializedData_t *pCipherText, mfrSerializedData_t *pPlainText)
 
int MFR_Init (void)
 
int MFR_Shutdown (void)
 
VL_MFR_API_RESULT HAL_MFR_get_version (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_PLATFORM_VERSION_TYPE eVersionType, char **ppString)
 
VL_MFR_API_RESULT HAL_MFR_read_normal_nvram (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_NORMAL_NVRAM_DATA_TYPE eType, VL_NVRAM_DATA *pNvRamData)
 
VL_MFR_API_RESULT HAL_MFR_write_normal_nvram (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_NORMAL_NVRAM_DATA_TYPE eType, const VL_NVRAM_DATA *pNvRamData)
 
VL_MFR_API_RESULT HAL_MFR_read_secure_nvram (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_SECURE_NVRAM_DATA_TYPE eType, VL_NVRAM_DATA *pNvRamData)
 
VL_MFR_API_RESULT HAL_MFR_write_secure_nvram (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_SECURE_NVRAM_DATA_TYPE eType, const VL_NVRAM_DATA *pNvRamData)
 
VL_MFR_API_RESULT HAL_MFR_set_mfr_data (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_STACK_2_MFR_EVENT_TYPE eEvent, void *_pvData)
 
VL_MFR_API_RESULT HAL_MFR_get_mfr_data (VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_STACK_2_MFR_EVENT_TYPE eEvent, void *_pvData)
 
mfrError_t mfr_init (void)
 Initialize the mfr library.
This function should be call once before the functions in this API can be used. More...
 
mfrError_t mfr_shutdown (void)
 Shutdowns the mfr library.
This function should be called to free resources in mfr library while shutdown. More...
 
mfrError_t mfrGetSerializedData (mfrSerializedType_t type, mfrSerializedData_t *data, mfrEncryptFunction_t crypto)
 Retrieve Serialized Read-Only data from device. The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. Please note that even if the serialized data returned is "string", the buffer is not required to contain the null-terminator. More...
 
mfrError_t mfrSetSerializedData (mfrSerializedType_t type, mfrSerializedData_t *data, mfrDecryptFunction_t crypto)
 Write Serialized data to device. The serialized data written as a byte stream. The 'crypto' parameter, if not null, the implementation should used the given crypto function to decrypt the data before setting the serialize data. More...
 
mfrError_t mfrWriteImage (const char *name, const char *path, mfrImageType_t type, mfrUpgradeStatusNotify_t notify)
 Validate and Write the image into flash. The process should follow these major steps: 1) Validate headers, manufacturer, model. 2) Perform Signature check. 3) Flash the image. 4) Perform CRC on flashed nvram. 5) Update boot params and switch banks to prepare for a reboot event. 6) All upgrades should be done in the alternate bank. The current bank should not be disturbed at any cost. i.e. a second upgrade will before a reboot will overwrite the non-current bank only. More...
 
mfrError_t mfrSetImageWriteProgress (const char *imageName, mfrImageType_t imageType, mfrUpgradeProgress_t progress)
 Set the the progress of image upgrade. More...
 
mfrError_t mfrGetImageWriteProgress (const char *imageName, mfrImageType_t imageType, mfrUpgradeProgress_t *progress)
 Retrieves the last/latest progress of image upgrade If the upgrade is in not progress, the progress returned should be same as the final value returned by the 'notify' function in mfrWriteImage(), or as the value set by the last invocation of mfrSetImageWriteProgress. More...
 
mfrError_t mfrDeletePDRI (void)
 Delete the P-DRI image if it is present. More...
 
mfrError_t mfrScrubAllBanks (void)
 Delete the platform images. More...
 
mfrError_t mfrReboot (const char *imageName)
 Reboots the box with image of given name. More...
 
mfrError_t mfrSetCableCardType (mfrCableCardType_t type)
 Sets the cable card type. More...
 
mfrError_t mfrSetHostFirmwareInfo (const mfrHostFirmwareInfo_t *firmwareInfo)
 Sets the Host firmware information. More...
 
mfrError_t mfrGetBootImageName (int bootInstance, char *bootImageName, int *len, mfrImageType_t bootImageType)
 Retrieve the image name used by box when booting up. (I.e. current active image) More...
 
mfrError_t mfrGetPathConfiguration (mfrConfigPathType_t type, char *path, int *len)
 Retrieves the path configuration name. More...
 
mfrError_t mfrGetDFAST2Data (mfrDFAST2Params_t *params)
 Triggers DFAST operations. More...
 
IARM_Result_t MFRLib_Start (void)
 Starts the MFR lib. More...
 
IARM_Result_t MFRLib_Stop (void)
 Terminates the MFR lib. More...
 
IARM_Result_t MFRLib_Loop ()
 Listens for component specific events from drivers. More...
 
int main (int argc, char *argv[])
 
static void _eventHandler (const char *owner, IARM_EventId_t eventId, void *data, size_t len)
 
IARM_Result_t _mfr_init (void *arg)
 
IARM_Result_t _mfr_shutdown (void *arg)
 
IARM_Result_t _mfrGetSerializedData (void *arg)
 
IARM_Result_t _mfrSetSerializedData (void *arg)
 
IARM_Result_t _mfrWriteImage (void *arg)
 
IARM_Result_t _mfrSetImageWriteProgress (void *arg)
 
IARM_Result_t _mfrGetImageWriteProgress (void *arg)
 
IARM_Result_t _mfrDeletePDRI (void *arg)
 
IARM_Result_t _mfrScrubAllBanks (void *arg)
 
IARM_Result_t _mfrReboot (void *arg)
 
IARM_Result_t _mfrSetCableCardType (void *arg)
 
IARM_Result_t _mfrSetHostFirmwareInfo (void *arg)
 
IARM_Result_t _mfrGetBootImageName (void *arg)
 
IARM_Result_t _mfrGetPathConfiguration (void *arg)
 
IARM_Result_t _mfrGetDFAST2Data (void *arg)
 
void * find_func (const char *lib_name, const char *proc_name)
 
IARM_Result_t mfrMgr_start ()
 
static void writeImageCb (mfrUpgradeStatus_t status, void *cbData)
 
mfrSerializedType_t getTypeFromMenu ()
 
int main ()
 
mfrError_t mfrGetTemperature (mfrTemperatureState_t *state, int *temperatureValue, int *wifiTemp)
 get current temperature of the core More...
 
mfrError_t mfrSetTempThresholds (int tempHigh, int tempCritical)
 Set temperature thresholds which will determine the state returned ​​* from a call to mfrGetTemperature. More...
 
mfrError_t mfrGetTempThresholds (int *tempHigh, int *tempCritical)
 Get the temperature thresholds which determine the state returned ​​* from a call to mfrGetTemperature. More...
 
mfrError_t mfrGetSerializedData (mfrSerializedType_t type, mfrSerializedData_t *data)
 Retrieve Serialized Read-Only data from device. The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. Please note that even if the serialized data returned is "string", the buffer is not required to contain the null-terminator. More...
 
mfrError_t mfrSetBootloaderPattern (mfrBlPattern_t pattern)
 Sets how the frontpanel LED(s) (and TV backlight on applicable devices) behave when running bootloader. More...
 
static IARM_Result_t getSerializedData_ (void *arg)
 
static IARM_Result_t deletePDRI_ (void *arg)
 
static IARM_Result_t scrubAllBanks_ (void *arg)
 
static IARM_Result_t writeImage_ (void *arg)
 
IARM_Result_t setBootloaderPattern_ (void *arg)
 
int main (int argc, char **argv)
 
IARM_Result_t _callback (void *arg)
 

Variables

static mfrSerializedData_t serialNumber
 
static char writeImageCbModule [MAX_BUF] = ""
 
static char cliName [32]
 
static mfrUpgradeStatusNotify_t cb_notify = {0,}
 
static int m_initialized =0
 
static pthread_mutex_t mfrLock = PTHREAD_MUTEX_INITIALIZER
 
static char writeImageCbModule [MAX_BUF] = ""
 
static mfrUpgradeStatus_t lastStatus
 
static int is_connected = 0
 
static char writeImageCbModule [MAX_BUF] = ""
 
static mfrUpgradeStatus_t lastStatus
 

Data Structure Documentation

◆ _VL_NVRAM_DATA

struct _VL_NVRAM_DATA

Definition at line 193 of file mfrApi.h.

Collaboration diagram for _VL_NVRAM_DATA:
Collaboration graph
Data Fields
unsigned long nActualBytes
int nBytes
unsigned char * pData

◆ _IARM_Bus_MFRLib_SerializedData_Param_t

struct _IARM_Bus_MFRLib_SerializedData_Param_t

Definition at line 122 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_SerializedData_Param_t:
Collaboration graph
Data Fields
mfrSerializedType_t type

[in] Type of data to be queried

char crypto[64]
int bufLen

[out] Indicates length of buffer pointed by pBuffer

char buffer[1280]

◆ _IARM_Bus_MFRLib_WriteImage_Param_t

struct _IARM_Bus_MFRLib_WriteImage_Param_t

Definition at line 129 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_WriteImage_Param_t:
Collaboration graph
Data Fields
char name[255]

[in] the path of the image file in the STB file system.

char path[255]

[in] the filename of the image file.

mfrImageType_t type

[in] the type (e.g. format, signature type) of the image.

int interval

[in] number of seconds between two callbacks

char callerModuleName[255]

[in] Name registered IARMBus by the caller module

char cbData[255]

[inout] data that could be passed through this call and returned back through callback

◆ _IARM_Bus_MFRLib_GetImageWriteProgress_Param_t

struct _IARM_Bus_MFRLib_GetImageWriteProgress_Param_t

Definition at line 136 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_GetImageWriteProgress_Param_t:
Collaboration graph
Data Fields
char imageName[255]
mfrImageType_t imageType
mfrUpgradeProgress_t progress

◆ _IARM_Bus_MFRLib_SetImageWriteProgress_Param_t

struct _IARM_Bus_MFRLib_SetImageWriteProgress_Param_t

Definition at line 142 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_SetImageWriteProgress_Param_t:
Collaboration graph
Data Fields
char imageName[255]
mfrImageType_t imageType
mfrUpgradeProgress_t progress

◆ _IARM_Bus_MFRLib_Reboot_Param_t

struct _IARM_Bus_MFRLib_Reboot_Param_t

Definition at line 148 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_Reboot_Param_t:
Collaboration graph
Data Fields
char imageName[255]

◆ _IARM_Bus_MFRLib_SetCableCardType_Param_t

struct _IARM_Bus_MFRLib_SetCableCardType_Param_t

Definition at line 152 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_SetCableCardType_Param_t:
Collaboration graph
Data Fields
mfrCableCardType_t type

◆ _IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t

struct _IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t

Definition at line 156 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_SetHostFirmwareInfo_Param_t:
Collaboration graph
Data Fields
char version[(256)]
int day
int month
int year

◆ _IARM_Bus_MFRLib_GetBootImageName_Param_t

struct _IARM_Bus_MFRLib_GetBootImageName_Param_t

Definition at line 163 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_GetBootImageName_Param_t:
Collaboration graph
Data Fields
int bootInstance
char imageName[255]
int len
mfrImageType_t type

◆ _IARM_Bus_MFRLib_GetPathConfiguration_Param_t

struct _IARM_Bus_MFRLib_GetPathConfiguration_Param_t

Definition at line 170 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_GetPathConfiguration_Param_t:
Collaboration graph
Data Fields
mfrConfigPathType_t type
char path[(256)]
int len

◆ _IARM_Bus_MFRLib_GetDFAST2Data_Param_t

struct _IARM_Bus_MFRLib_GetDFAST2Data_Param_t

Definition at line 176 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_GetDFAST2Data_Param_t:
Collaboration graph
Data Fields
unsigned int seedIn[(16)]
unsigned int keyOut[(16)]

◆ _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t

struct _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t

Data associated with WriteImage callback call

Definition at line 182 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t:
Collaboration graph
Data Fields
mfrUpgradeStatus_t status
char cbData[255]

upgrade status, set by WriteImage callback

◆ _IARM_BUS_MfrMgr_StatusUpdate_EventData_t

struct _IARM_BUS_MfrMgr_StatusUpdate_EventData_t

Event data

Definition at line 193 of file mfrMgr.h.

Collaboration diagram for _IARM_BUS_MfrMgr_StatusUpdate_EventData_t:
Collaboration graph
Data Fields
mfrUpgradeStatus_t status

New status

◆ _mfrSerializedData_t

struct _mfrSerializedData_t

Definition at line 50 of file mfrTypes.h.

Collaboration diagram for _mfrSerializedData_t:
Collaboration graph

Data Fields

char * buf
 
size_t bufLen
 
void(* freeBuf )(char *buf)
 

◆ _mfrDFAST2Params_t

struct _mfrDFAST2Params_t

Definition at line 199 of file mfrTypes.h.

Collaboration diagram for _mfrDFAST2Params_t:
Collaboration graph
Data Fields
unsigned int seedIn[(16)]
unsigned int keyOut[(16)]

◆ _mfrHostFrmwareInfo_t

struct _mfrHostFrmwareInfo_t

Definition at line 209 of file mfrTypes.h.

Collaboration diagram for _mfrHostFrmwareInfo_t:
Collaboration graph
Data Fields
char firmwareVersion[(256)]
int firmwareDay
int firmwareMonth
int firmwareYear

◆ _mfrUpgradeStatus_t

struct _mfrUpgradeStatus_t

Definition at line 218 of file mfrTypes.h.

Collaboration diagram for _mfrUpgradeStatus_t:
Collaboration graph
Data Fields
mfrUpgradeProgress_t progress
mfrError_t error
int percentage

◆ _mfrUpgradeStatusNotify_t

struct _mfrUpgradeStatusNotify_t

Definition at line 225 of file mfrTypes.h.

Collaboration diagram for _mfrUpgradeStatusNotify_t:
Collaboration graph

Data Fields

void * cbData
 
void(* cb )(mfrUpgradeStatus_t status, void *cbData)
 
int interval
 

◆ _IARM_Bus_MFRLib_GetSerializedData_Param_t

struct _IARM_Bus_MFRLib_GetSerializedData_Param_t

Definition at line 118 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_GetSerializedData_Param_t:
Collaboration graph
Data Fields
mfrSerializedType_t type

[in] Type of data to be queried

char buffer[(1280)]

[out] On success, this will be pointing to a local memory location having expected data

int bufLen

[out] Indicates length of buffer pointed by pBuffer

◆ _IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t

struct _IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t

Definition at line 144 of file mfrMgr.h.

Collaboration diagram for _IARM_BUS_MFRLIB_API_WIFI_Credentials_Param_t:
Collaboration graph
Data Fields
WIFI_DATA wifiCredentials
WifiRequestType_t requestType
WIFI_API_RESULT returnVal

◆ _IARM_Bus_MFRLib_SetBLPattern_Param_t

struct _IARM_Bus_MFRLib_SetBLPattern_Param_t

Definition at line 149 of file mfrMgr.h.

Collaboration diagram for _IARM_Bus_MFRLib_SetBLPattern_Param_t:
Collaboration graph
Data Fields
mfrBlPattern_t pattern

Macro Definition Documentation

◆ IARM_BUS_MFRLIB_NAME [1/2]

#define IARM_BUS_MFRLIB_NAME   "MFRLib"

Well-known Name for MFR libarary

Definition at line 98 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_GetSerializedData [1/2]

#define IARM_BUS_MFRLIB_API_GetSerializedData   "mfrGetSerializedData"

Retrives manufacturer specific data from the box

Definition at line 100 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_WriteImage [1/2]

#define IARM_BUS_MFRLIB_API_WriteImage   "mfrWriteImage"

Validate and Write the image into flash

Definition at line 102 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_DeletePDRI [1/2]

#define IARM_BUS_MFRLIB_API_DeletePDRI   "mfrDeletePDRI"

delete PDRI image from the box

Definition at line 105 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_ScrubAllBanks [1/2]

#define IARM_BUS_MFRLIB_API_ScrubAllBanks   "mfrScrubAllBanks"

scrub all banks from the box

Definition at line 106 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_COMMON_API_WriteImageCb [1/2]

#define IARM_BUS_MFRLIB_COMMON_API_WriteImageCb   "WriteImageCb"

This method shall be implemented by the caller calling WriteImage

Definition at line 115 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_NAME [2/2]

#define IARM_BUS_MFRLIB_NAME   "MFRLib"

Well-known Name for MFR libarary

Definition at line 101 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_GetSerializedData [2/2]

#define IARM_BUS_MFRLIB_API_GetSerializedData   "mfrGetManufacturerData"

Retrives manufacturer specific data from the box

Definition at line 103 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_DeletePDRI [2/2]

#define IARM_BUS_MFRLIB_API_DeletePDRI   "mfrDeletePDRI"

delete PDRI image from the box

Definition at line 104 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_ScrubAllBanks [2/2]

#define IARM_BUS_MFRLIB_API_ScrubAllBanks   "scrubAllBanks"

scrub all banks from the box

Definition at line 105 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_WriteImage [2/2]

#define IARM_BUS_MFRLIB_API_WriteImage   "mfrWriteImage"

Validate and Write the image into flash

Definition at line 106 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_API_SetBootLoaderPattern

#define IARM_BUS_MFRLIB_API_SetBootLoaderPattern   "mfrSetBootloaderPattern"

Sets how the frontpanel LED(s) (and TV backlight on applicable devices) behave when running bootloader.

Definition at line 109 of file mfrMgr.h.

◆ IARM_BUS_MFRLIB_COMMON_API_WriteImageCb [2/2]

#define IARM_BUS_MFRLIB_COMMON_API_WriteImageCb   "WriteImageCb"

This method shall be implemented by the caller calling WriteImage

Definition at line 111 of file mfrMgr.h.

◆ HDCP_KEY_MAX_SIZE

#define HDCP_KEY_MAX_SIZE   (1280)

Data size management need to be improved

Definition at line 114 of file mfrMgr.h.

◆ SAFEC_ERR_CHECK [1/2]

#define SAFEC_ERR_CHECK (   safec_rc)
Value:
if(safec_rc != EOK) {\
ERR_CHK(safec_rc); \
goto Error; \
}

Definition at line 37 of file mfr_wifiSetCredentials.c.

◆ SAFEC_ERR_CHECK [2/2]

#define SAFEC_ERR_CHECK (   safec_rc)
Value:
if(safec_rc != EOK) {\
ERR_CHK(safec_rc);\
goto Error; \
}

Definition at line 37 of file test_writeImage.c.

Typedef Documentation

◆ IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t [1/2]

Data associated with WriteImage callback call

◆ IARM_BUS_MfrMgr_StatusUpdate_EventData_t

◆ mfrEncryptFunction_t

typedef mfrError_t(* mfrEncryptFunction_t) (const mfrSerializedData_t *pClearText, mfrSerializedData_t *pCipherText)

crypto funcionality. This function should be called to encrypt a block of data

Parameters
[in]pClearText: uncrypted data.
[out]pCipherText: crypted data.
Returns
Error Code: If error code is returned, the crypto has failed, and pCipherText is not usable.

Definition at line 242 of file mfrTypes.h.

◆ mfrDecryptFunction_t

typedef mfrError_t(* mfrDecryptFunction_t) (const mfrSerializedData_t *pCipherText, mfrSerializedData_t *pClearText)

crypto funcionality. This function should be called to decrypt a block of data that are encrypted by mfrEncryptFunction_t;

Parameters
[in]pCipherText: crypted data.
[out]pClearText: uncrypted data.
Returns
Error Code: If error code is returned, the crypto has failed, and pClearText is not usable.

Definition at line 253 of file mfrTypes.h.

◆ IARM_Bus_MFRLib_CommonAPI_WriteImageCb_Param_t [2/2]

Data associated with WriteImage callback call

Enumeration Type Documentation

◆ _MfrMgr_EventId_t

Enumerator
IARM_BUS_MFRMGR_EVENT_STATUS_UPDATE 

Event to notify status update change

IARM_BUS_MFRMGR_EVENT_MAX 

Max event id from this module

Definition at line 187 of file mfrMgr.h.

Function Documentation

◆ mfr_init()

mfrError_t mfr_init ( void  )

Initialize the mfr library.
This function should be call once before the functions in this API can be used.

Parameters
[in]None.
[out]None.
Returns
Error Code: If error code is returned, the init has failed.

Definition at line 65 of file mfrCli.c.

◆ mfr_shutdown()

mfrError_t mfr_shutdown ( void  )

Shutdowns the mfr library.
This function should be called to free resources in mfr library while shutdown.

Parameters
[in]None.
[out]None.
Returns
Error Code: If error code is returned, the shutdown has failed.

Definition at line 84 of file mfrCli.c.

◆ mfrGetSerializedData() [1/2]

mfrError_t mfrGetSerializedData ( mfrSerializedType_t  type,
mfrSerializedData_t data,
mfrEncryptFunction_t  crypto 
)

Retrieve Serialized Read-Only data from device. The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. Please note that even if the serialized data returned is "string", the buffer is not required to contain the null-terminator.

The 'crypto' parameter, if not null, the implementation should used the given crypto function to encrypt the data befure returning.

Parameters
[in]typespecifies the serialized data to read.
[in]datacontains information about the returned data (buffer location, length, and func to free the buffer).
[in]cryptocrypto used to protect data across MFR interface.
Returns
Error Code: If error code is returned, the read has failed and values in data should not be used.

Definition at line 98 of file mfrCli.c.

◆ mfrSetSerializedData()

mfrError_t mfrSetSerializedData ( mfrSerializedType_t  type,
mfrSerializedData_t data,
mfrDecryptFunction_t  crypto 
)

Write Serialized data to device. The serialized data written as a byte stream. The 'crypto' parameter, if not null, the implementation should used the given crypto function to decrypt the data before setting the serialize data.

Parameters
[in]typespecifies the serialized data to written.
[in]datacontains information about the data to be written (buffer location, length, free function to be called to free buffer).
[in]cryptocrypto used to protect data across MFR interface.
Returns
Error Code: If error code is returned, the write has failed

Definition at line 158 of file mfrCli.c.

◆ mfrWriteImage()

mfrError_t mfrWriteImage ( const char *  name,
const char *  path,
mfrImageType_t  type,
mfrUpgradeStatusNotify_t  notify 
)

Validate and Write the image into flash. The process should follow these major steps: 1) Validate headers, manufacturer, model. 2) Perform Signature check. 3) Flash the image. 4) Perform CRC on flashed nvram. 5) Update boot params and switch banks to prepare for a reboot event. 6) All upgrades should be done in the alternate bank. The current bank should not be disturbed at any cost. i.e. a second upgrade will before a reboot will overwrite the non-current bank only.

State Transition: 0) Before the API is invoked, the Upgrade process should be in PROGRESS_NOT_STARTED state. 1) After the API returnes with success, the Upgrade process moves to PROGRESS_STARTED state. 2) After the API returnew with error, the Upgrade process stays in PROGRESS_NO_STARTED state. Notify function will not be invoked. 3) The notify function is called at regular interval with proress = PROGRESS_STARTED. 4) The last invocation of notify function should have either progress = PROGRESS_COMPLETED or progress = PROGRESS_ABORTED with error code set.

Application can either rely on the 'notify' callback to monitor image write progress, or use the mfrGetImageWriteProgress()

Parameters
[in]namethe path of the image file in the STB file system.
[in]paththe filename of the image file.
[in]typethe type (e.g. format, signature type) of the image. This can dictate the handling of the image within the MFR library.
[in]callbackfunction to provide status of the image flashing process.
Returns
Error Code: If error code is returned, the image flashing is not initiated..

State Transition: 0) Before the API is invoked, the Upgrade process should be in PROGRESS_NOT_STARTED state. 1) After the API returnes with success, the Upgrade process moves to PROGRESS_STARTED state. 2) After the API returnew with error, the Upgrade process stays in PROGRESS_NO_STARTED state. Notify function will not be invoked. 3) The notify function is called at regular interval with proress = PROGRESS_STARTED. 4) The last invocation of notify function should have either progress = PROGRESS_COMPLETED or progress = PROGRESS_ABORTED with error code set.

Parameters
[in]namethe path of the image file in the STB file system.
[in]paththe filename of the image file.
[in]typethe type (e.g. format, signature type) of the image. This can dictate the handling of the image within the MFR library.
[in]callbackfunction to provide status of the image flashing process.
Returns
Error Code: If error code is returned, the image flashing is not initiated..

Definition at line 206 of file mfrCli.c.

◆ mfrSetImageWriteProgress()

mfrError_t mfrSetImageWriteProgress ( const char *  imageName,
mfrImageType_t  imageType,
mfrUpgradeProgress_t  progress 
)

Set the the progress of image upgrade.

Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 242 of file mfrCli.c.

◆ mfrGetImageWriteProgress()

mfrError_t mfrGetImageWriteProgress ( const char *  imageName,
mfrImageType_t  imageType,
mfrUpgradeProgress_t *  progress 
)

Retrieves the last/latest progress of image upgrade If the upgrade is in not progress, the progress returned should be same as the final value returned by the 'notify' function in mfrWriteImage(), or as the value set by the last invocation of mfrSetImageWriteProgress.

If the upgrade is in progress, the progress returned should be the latest status when the function is called.

Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 272 of file mfrCli.c.

◆ mfrDeletePDRI()

mfrError_t mfrDeletePDRI ( void  )

Delete the P-DRI image if it is present.

Returns
Error Code: Return mfrERR_NONE if P-DRI is succesfully deleted or not present, mfrERR_GENERAL if deletion fails

Definition at line 302 of file mfrCli.c.

◆ mfrScrubAllBanks()

mfrError_t mfrScrubAllBanks ( void  )

Delete the platform images.

Returns
Error Code: Return mfrERR_NONE if the images are scrubbed, mfrERR_GENERAL if scrubbing fails

Definition at line 316 of file mfrCli.c.

◆ mfrReboot()

mfrError_t mfrReboot ( const char *  imageName)

Reboots the box with image of given name.

Parameters
[in]namethe path of the image file to reboot the box with
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 331 of file mfrCli.c.

◆ mfrSetCableCardType()

mfrError_t mfrSetCableCardType ( mfrCableCardType_t  type)

Sets the cable card type.

Parameters
[in]typethe cablecard type used by host.
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 359 of file mfrCli.c.

◆ mfrSetHostFirmwareInfo()

mfrError_t mfrSetHostFirmwareInfo ( const mfrHostFirmwareInfo_t firmwareInfo)

Sets the Host firmware information.

Parameters
[in]firmwareInfothe host's firmware information
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 379 of file mfrCli.c.

◆ mfrGetBootImageName()

mfrError_t mfrGetBootImageName ( int  bootInstance,
char *  bootImageName,
int *  len,
mfrImageType_t  bootImageType 
)

Retrieve the image name used by box when booting up. (I.e. current active image)

Parameters
[in]bootInstancewhich bootup instance
[out]bootImageNamebuffer to hold the image name
[in]len: size of the output buffer
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 409 of file mfrCli.c.

◆ mfrGetPathConfiguration()

mfrError_t mfrGetPathConfiguration ( mfrConfigPathType_t  type,
char *  path,
int *  len 
)

Retrieves the path configuration name.

Parameters
[in]type: which configure path
[out]pathbuffer to hold the path name
[in]len: size of the output buffer
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 439 of file mfrCli.c.

◆ mfrGetDFAST2Data()

mfrError_t mfrGetDFAST2Data ( mfrDFAST2Params_t params)

Triggers DFAST operations.

Parameters
[in]params: DFAST2 params used by MFR implementation
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails

Definition at line 472 of file mfrCli.c.

◆ MFRLib_Start()

IARM_Result_t MFRLib_Start ( void  )

Starts the MFR lib.

This function registers and connects MFR Manager to the iarm bus. Register Events that this module publishes and register APIs that can be RPCs by other entities on the bus.

Returns
IARM_Result_t Error Code.
Return values
IARM_RESULT_SUCCESSon success

Definition at line 40 of file mfrMgr.c.

◆ MFRLib_Stop()

IARM_Result_t MFRLib_Stop ( void  )

Terminates the MFR lib.

This function disconnects MFR Manager from the iarm bus and terminates MFR Manager.

Returns
IARM_Result_t Error Code.
Return values
IARM_RESULT_SUCCESSon success

Definition at line 61 of file mfrMgr.c.

◆ MFRLib_Loop()

IARM_Result_t MFRLib_Loop ( )

Listens for component specific events from drivers.

Returns
IARM_Result_t Error Code.
Return values
IARM_RESULT_SUCCESSon success

Definition at line 66 of file mfrMgr.c.

◆ mfrGetTemperature()

mfrError_t mfrGetTemperature ( mfrTemperatureState_t *  state,
int *  temperatureValue,
int *  wifiTemp 
)

get current temperature of the core

Parameters
[out]statethe current state of the core temperature
[out]temperatureValueraw temperature value of the core in degrees Celsius
Returns
Error Code

◆ mfrSetTempThresholds()

mfrError_t mfrSetTempThresholds ( int  tempHigh,
int  tempCritical 
)

Set temperature thresholds which will determine the state returned ​​* from a call to mfrGetTemperature.

Parameters
[in]tempHighTemperature threshold at which mfrTEMPERATURE_HIGH state will be reported.
[in]tempCriticalTemperature threshold at which mfrTEMPERATURE_CRITICAL state will be reported.
Returns
Error Code

◆ mfrGetTempThresholds()

mfrError_t mfrGetTempThresholds ( int *  tempHigh,
int *  tempCritical 
)

Get the temperature thresholds which determine the state returned ​​* from a call to mfrGetTemperature.

Parameters
[out]tempHighTemperature threshold at which mfrTEMPERATURE_HIGH state will be reported.
[out]tempCriticalTemperature threshold at which mfrTEMPERATURE_CRITICAL state will be reported.
Returns
Error Code

◆ mfrGetSerializedData() [2/2]

mfrError_t mfrGetSerializedData ( mfrSerializedType_t  type,
mfrSerializedData_t data 
)

Retrieve Serialized Read-Only data from device. The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. Please note that even if the serialized data returned is "string", the buffer is not required to contain the null-terminator.

Parameters
[in]typespecifies the serialized data to read.
[in]

◆ mfrSetBootloaderPattern()

mfrError_t mfrSetBootloaderPattern ( mfrBlPattern_t  pattern)

Sets how the frontpanel LED(s) (and TV backlight on applicable devices) behave when running bootloader.

Parameters
[in]pattern: options are defined by enum mfrBlPattern_t.
Returns
Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails