net:wireless:Support eswin usb wifi ECR6600U
[platform/kernel/linux-starfive.git] / drivers / net / wireless / eswin / fw_head_check.h
1 /**
2 ******************************************************************************
3 *
4 * @file fw_head_check.h
5 *
6 * @brief ecrnx usb firmware validity check functions
7 *
8 * Copyright (C) ESWIN 2015-2020
9 *
10 ******************************************************************************
11 */
12
13 #ifndef _FW_HEAD_CHECK_H_
14 #define _FW_HEAD_CHECK_H_
15
16 #include "core.h"
17
18 #define HEAD_SIZE  (64)
19 #define INFO_SIZE  (48)
20
21 typedef struct _bin_head_data {
22     unsigned int head_crc32;
23     unsigned int crc32;
24     unsigned int magic;
25     unsigned int UTC_time;
26     unsigned char *fw_Info;
27 }bin_head_data;
28
29 typedef struct{
30         uint32_t initVal;
31         uint32_t POLY;
32         uint32_t sub;
33         uint8_t  bits;
34         char     *funcName;
35 }crc32_Table_TypeDef;
36
37
38 extern unsigned int offset;
39
40 void localtime(struct tm *stTm, unsigned int time);
41 bool fw_check_head(struct eswin *tr);
42
43 #endif