net:wireless:Support eswin usb wifi ECR6600U
[platform/kernel/linux-starfive.git] / drivers / net / wireless / eswin / fullmac / ecrnx_calibration_data.h
1 /**
2  ****************************************************************************************
3  *
4  * @file ecrnx_calibration_data.h
5  *
6  * @brief Calibration Data function declarations
7  *
8  * Copyright (C) ESWIN 2015-2020
9  *
10  ****************************************************************************************
11  */
12
13 #ifndef _ECRNX_CALIBRATION_H_
14 #define _ECRNX_CALIBRATION_H_
15 #include "lmac_types.h"
16 /**
17  * INCLUDE FILES
18  ****************************************************************************************
19  */
20
21 /**
22  * DEFINES
23  ****************************************************************************************
24  */
25 #define CAL_MAC_ADDR_LEN 6
26 #define CAL_FORMAT_CLASS 3
27 #define CAL_MCS_CNT      10
28 #define CAL_CHAN_CNT     3
29 #define IS_LOW_CHAN(ch)  ((ch) >= 1 && (ch) <= 4)
30 #define IS_MID_CHAN(ch)  ((ch) >= 5 && (ch) <= 8)
31 #define IS_HIG_CHAN(ch)  ((ch) >= 9 && (ch) <= 14)
32 #define GAIN_DELTA_CFG_BUF_SIZE (CAL_FORMAT_MAX * CAL_MCS_CNT)
33
34
35 typedef enum {
36     CHAN_LEVEL_LOW,
37     CHAN_LEVEL_MID,
38     CHAN_LEVEL_HIGH,
39     CHAN_LEVEL_MAX,
40 } chan_level_e;
41
42 typedef enum {
43     CAL_FORMAT_11B,
44     CAL_FORMAT_11G,
45     CAL_FORMAT_11N,
46     CAL_FORMAT_11N_40M,
47     CAL_FORMAT_11AX,
48     CAL_FORMAT_MAX
49 } wifi_cal_format_e;
50
51 typedef struct {
52     uint8_t gain[CHAN_LEVEL_MAX][CAL_FORMAT_MAX][CAL_MCS_CNT];
53 }tx_gain_cal_t;
54
55 typedef struct {
56     uint8_t fine;
57     uint8_t corase;
58     uint8_t swl;
59 }cfo_cal_t;
60
61 typedef struct {
62     tx_gain_cal_t tx_gain;
63     cfo_cal_t     cfo_cal;
64     uint8_t       mac_addr[CAL_MAC_ADDR_LEN];
65     uint32_t      lol;
66 }wifi_cal_data_t;
67
68 /**
69  * TYPE DEFINITIONS
70  ****************************************************************************************
71  */
72
73 extern s8 gain_delta[];
74 extern wifi_cal_data_t cal_result;
75 /**
76  * FUNCTION DECLARATIONS
77  ****************************************************************************************
78  */
79
80 #endif /* _ECRNX_CALIBRATION_H_ */