wlan_cfg.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-08-06 tyx the first version
  9. */
  10. #ifndef __WLAN_CFG_H__
  11. #define __WLAN_CFG_H__
  12. #include <wlan_dev.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef RT_WLAN_CFG_INFO_MAX
  17. #define RT_WLAN_CFG_INFO_MAX (3) /* min is 1 */
  18. #endif
  19. #define RT_WLAN_CFG_MAGIC (0x426f6d62)
  20. struct rt_wlan_cfg_info
  21. {
  22. struct rt_wlan_info info;
  23. struct rt_wlan_key key;
  24. };
  25. typedef int (*rt_wlan_wr)(void *buff, int len);
  26. struct rt_wlan_cfg_ops
  27. {
  28. int (*read_cfg)(void *buff, int len);
  29. int (*get_len)(void);
  30. int (*write_cfg)(void *buff, int len);
  31. };
  32. void rt_wlan_cfg_init(void);
  33. void rt_wlan_cfg_set_ops(const struct rt_wlan_cfg_ops *ops);
  34. int rt_wlan_cfg_get_num(void);
  35. int rt_wlan_cfg_read(struct rt_wlan_cfg_info *cfg_info, int num);
  36. int rt_wlan_cfg_read_index(struct rt_wlan_cfg_info *cfg_info, int index);
  37. rt_err_t rt_wlan_cfg_save(struct rt_wlan_cfg_info *cfg_info);
  38. rt_err_t rt_wlan_cfg_cache_refresh(void);
  39. rt_err_t rt_wlan_cfg_cache_save(void);
  40. int rt_wlan_cfg_delete_index(int index);
  41. void rt_wlan_cfg_delete_all(void);
  42. void rt_wlan_cfg_dump(void);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif