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: wlan util notifier header 15 * Create: 2022-05-20 16 */ 17 // 支持优先级,返回值,支持携带参数 18 #ifndef __FRW_UTIL_NOTIFIER_H__ 19 #define __FRW_UTIL_NOTIFIER_H__ 20 #include "osal_adapt.h" 21 #include "osal_types.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif 28 29 /* notifier 事件类型 */ 30 typedef enum { 31 WLAN_UTIL_NOTIFIER_EVENT_SYS_INIT, 32 WLAN_UTIL_NOTIFIER_EVENT_ADD_VAP, 33 WLAN_UTIL_NOTIFIER_EVENT_DEL_VAP, 34 WLAN_UTIL_NOTIFIER_EVENT_DEL_VAP_FEATURE, 35 WLAN_UTIL_NOTIFIER_EVENT_START_VAP, 36 WLAN_UTIL_NOTIFIER_EVENT_START_VAP_EXIT, 37 WLAN_UTIL_NOTIFIER_EVENT_DOWN_VAP, 38 WLAN_UTIL_NOTIFIER_EVENT_ADD_USER, 39 WLAN_UTIL_NOTIFIER_EVENT_DEL_USER, 40 WLAN_UTIL_NOTIFIER_EVENT_DEL_USER_FEATURE, 41 WLAN_UTIL_NOTIFIER_EVENT_DEL_USER_RESET, 42 WLAN_UTIL_NOTIFIER_EVENT_TBTT_HANDLE, 43 WLAN_UTIL_NOTIFIER_EVENT_TBTT_AP, 44 WLAN_UTIL_NOTIFIER_EVENT_VAP_STATE_CHANGE, 45 WLAN_UTIL_NOTIFIER_EVENT_SCAN_BEGIN, 46 WLAN_UTIL_NOTIFIER_EVENT_SCAN_END, 47 WLAN_UTIL_NOTIFIER_EVENT_ROAM_ACTIVE, 48 WLAN_UTIL_NOTIFIER_EVENT_ROAM_DEACTIVE, 49 WLAN_UTIL_NOTIFIER_EVENT_INETADDR_NOTIFIER_UP, 50 WLAN_UTIL_NOTIFIER_EVENT_SUSPEND_CHANGE, 51 WLAN_UTIL_NOTIFIER_EVENT_ADD_GTK, 52 WLAN_UTIL_NOTIFIER_EVENT_DEL_GTK, 53 WLAN_UTIL_NOTIFIER_EVENT_LINKLOSS_INIT, 54 WLAN_UTIL_NOTIFIER_EVENT_RX_ASSOC_RSP, 55 WLAN_UTIL_NOTIFIER_EVENT_11V_NEW_BSS_LIST, 56 WLAN_UTIL_NOTIFIER_EVENT_11V_FREE_BSS_LIST, 57 WLAN_UTIL_NOTIFIER_EVENT_11V_VAP_ROAM_INFO_INIT, 58 WLAN_UTIL_NOTIFIER_EVENT_11V_VAP_ROAM_INFO_DEINIT, 59 60 WLAN_UTIL_NOTIFIER_EVENT_MAX, 61 } wlan_util_notifier_event_en; 62 63 /* notifier事件优先级,值越大,优先级越高 */ 64 typedef enum { 65 WLAN_UTIL_NOTIFIER_PRIORITY_DEFAULT, 66 67 WLAN_UTIL_NOTIFIER_PRIORITY_MAX, 68 } wlan_util_notifier_priority_en; 69 70 71 typedef osal_bool (*wlan_util_notifier_hook_func)(osal_void *notify_data); 72 73 typedef struct { 74 struct osal_list_head list_entry; 75 osal_u32 priority; 76 wlan_util_notifier_hook_func hook_func; 77 } notifier_node_stru; 78 79 osal_void frw_util_notifier_init(osal_void); 80 osal_void frw_util_notifier_exit(osal_void); 81 osal_u32 frw_util_notifier_notify(wlan_util_notifier_event_en event, osal_void *notify_data); 82 83 osal_bool frw_util_notifier_unregister(wlan_util_notifier_event_en event, wlan_util_notifier_hook_func hook_func); 84 osal_bool frw_util_notifier_unregister_with_priority(wlan_util_notifier_event_en event, 85 wlan_util_notifier_hook_func hook_func, osal_u32 priority); 86 87 osal_bool frw_util_notifier_register(wlan_util_notifier_event_en event, wlan_util_notifier_hook_func hook_func); 88 osal_bool frw_util_notifier_register_with_priority(wlan_util_notifier_event_en event, 89 wlan_util_notifier_hook_func hook_func, osal_u32 priority); 90 91 typedef osal_u32 (*frw_wifi_module_func_init)(osal_void); 92 typedef osal_void (*frw_wifi_module_func_exit)(osal_void); 93 94 #ifdef __cplusplus 95 #if __cplusplus 96 } 97 #endif 98 #endif 99 100 #endif 101