1 /* 2 * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved. 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 */ 15 #ifndef _WIFI_HOST_CONFIG_H 16 #define _WIFI_HOST_CONFIG_H 17 18 #include "rwnx_config.h" 19 #include "wifi_msg.h" 20 #include "wifi_host_api.h" 21 22 extern struct me_chan_config_req fhost_chan; 23 24 /** 25 **************************************************************************************** 26 * @brief Initialize wifi configuration structure from fhost configuration 27 * 28 * To be called before initializing the wifi stack. 29 * Can also be used to retrieve firmware feature list at run-time. In this case @p init 30 * is false. 31 * 32 * @param[out] me_config Configuration structure for the UMAC (i.e. ME task) 33 * @param[out] start Configuration structure for the LMAC (i.e. MM task) 34 * @param[out] base_mac_addr Base MAC address of the device (from which all VIF MAC 35 * addresses are computed) 36 * @param[in] init Whether it is called before firmware initialization or not. 37 **************************************************************************************** 38 */ 39 void fhost_config_prepare(struct me_config_req *me_config, struct mm_start_req *start, 40 struct mac_addr *base_mac_addr, bool init); 41 42 /** 43 **************************************************************************************** 44 * @brief Return the channel associated to a given frequency 45 * 46 * @param[in] freq Channel frequency 47 * 48 * @return Channel definition whose primary frequency is the requested one and NULL if 49 * there no such channel. 50 **************************************************************************************** 51 */ 52 struct mac_chan_def *fhost_chan_get(int freq); 53 54 extern void set_mac_address(uint8_t *addr); 55 56 extern uint8_t* get_mac_address(void); 57 58 const char * fhost_config_name_get(enum fhost_config_id id); 59 uint32_t fhost_config_value_get(enum fhost_config_id id); 60 void fhost_config_value_set(enum fhost_config_id id, uint32_t val); 61 62 #endif // _WIFI_HOST_CONFIG_H 63