• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: Header file for hal_device.c.
15  */
16 
17 #ifndef __HAL_DEVICE_H__
18 #define __HAL_DEVICE_H__
19 
20 /*****************************************************************************
21     头文件包含
22 *****************************************************************************/
23 #include "hal_common_ops.h"
24 #include "hal_device_rom.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif
30 #endif
31 
32 /*****************************************************************************
33     宏定义
34 *****************************************************************************/
35 #define HAL_DEVICE_2G_BAND_NUM_FOR_LOSS (3) /* 2g 插损的band个数,用于插损相关的计算 */
36 #define HAL_DEVICE_5G_BAND_NUM_FOR_LOSS WLAN_5G_SUB_BAND_NUM
37 #define HAL_DEVICE_2G_DELTA_RSSI_NUM (2) /* 20M/40M */
38 #define HAL_DEVICE_5G_DELTA_RSSI_NUM (4) /* 20M/40M/80M/160M */
39 #define HAL_2G_CHANNEL_NUM (13)
40 #define INVALID_SAR_PWR_LIMIT                 (0XFF)   /* 当前SAR功率值 */
41 #define HAL_SAR_PWR_LIMIT_THRESHOLD            (15)    /* SAR功率阈值,低于阈值表示正在降SAR,高于阈值表示降SAR结束 */
42 
43 #define WLAN_HAL_OHTER_BSS_ID                   6   /* 其他BSS的广播ID */
44 #define WLAN_HAL_OTHER_BSS_OTHER_ID             7   /* 来自其他BSS的其他帧(组播、单播) */
45 /* MAC上报的tbtt中断类别最大值,2个ap的tbtt中断(0-1)+3个sta的tbtt中断(4-6) */
46 #define WLAN_MAC_REPORT_TBTT_IRQ_MAX            7
47 /*****************************************************************************
48     结构体定义
49 *****************************************************************************/
50 
51 #ifdef _PRE_PLAT_FEATURE_CUSTOMIZE
52 /* customize rf cfg struct */
53 typedef struct {
54     osal_s8 rf_gain_db_mult4; /* 插损值(单位0.25dB) */
55     osal_u8 resv[3];            /* 3 byte保留字段 */
56 } hal_cfg_custom_gain_db_per_band_stru;
57 #endif /* #ifdef _PRE_PLAT_FEATURE_CUSTOMIZE */
58 
59 /*****************************************************************************
60     函数声明
61 *****************************************************************************/
62 osal_u8 get_sar_ctrl_params(osal_u8 idx);
63 osal_u8 *get_sar_ctrl_params_dev(osal_void);
64 oal_bool_enum_uint8 hal_is_hw_tx_queue_empty(hal_to_dmac_device_stru *hal_device);
65 osal_u8 hal_device_get_m2s_mask(osal_void);
66 
67 #ifdef _PRE_PLAT_FEATURE_CUSTOMIZE
68 osal_void hal_set_nvram_params_by_delt_pwr(hal_to_dmac_device_stru *hal_device, const osal_u8 *param);
69 #endif
70 
71 #ifdef __cplusplus
72 #if __cplusplus
73 }
74 #endif
75 #endif
76 
77 #endif /* end of hal_device.h */
78