summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/eswin/fw_head_check.h
blob: 65a60c7d506c6576c3e9e8636149895c7868bc3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
******************************************************************************
*
* @file fw_head_check.h
*
* @brief ecrnx usb firmware validity check functions
*
* Copyright (C) ESWIN 2015-2020
*
******************************************************************************
*/

#ifndef _FW_HEAD_CHECK_H_
#define _FW_HEAD_CHECK_H_

#include "core.h"

#define HEAD_SIZE  (64)
#define INFO_SIZE  (48)

typedef struct _bin_head_data {
    unsigned int head_crc32;
    unsigned int crc32;
    unsigned int magic;
    unsigned int UTC_time;
    unsigned char *fw_Info;
}bin_head_data;

typedef struct{
	uint32_t initVal;
	uint32_t POLY;
	uint32_t sub;
	uint8_t  bits;
	char 	 *funcName;
}crc32_Table_TypeDef;


extern unsigned int offset;

void localtime(struct tm *stTm, unsigned int time);
bool fw_check_head(struct eswin *tr);

#endif