1 /* 2 * Copyright (c) 2024 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 /** 8 * @brief Header containing utility function declarations for the 9 * Wi-Fi driver. 10 */ 11 12 #ifndef __UTIL_H__ 13 #define __UTIL_H__ 14 15 #include "osal_api.h" 16 #include "host_rpu_umac_if.h" 17 18 #ifndef ARRAY_SIZE 19 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) 20 #endif 21 22 /* Convert power from mBm to dBm */ 23 #define MBM_TO_DBM(gain) ((gain) / 100) 24 25 int nrf_wifi_utils_hex_str_to_val(unsigned char *hex_arr, 26 unsigned int hex_arr_sz, 27 unsigned char *str); 28 29 bool nrf_wifi_utils_is_mac_addr_valid(const char *mac_addr); 30 31 int nrf_wifi_utils_chan_to_freq(enum nrf_wifi_band band, 32 unsigned short chan); 33 #endif /* __UTIL_H__ */ 34