rtw_rm.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. #ifndef __RTW_RM_H_
  16. #define __RTW_RM_H_
  17. u8 rm_post_event_hdl(_adapter *padapter, u8 *pbuf);
  18. #define RM_TIMER_NUM 32
  19. #define RM_ALL_MEAS BIT(1)
  20. #define RM_ID_FOR_ALL(aid) ((aid<<16)|RM_ALL_MEAS)
  21. #define RM_CAP_ARG(x) ((u8 *)(x))[4], ((u8 *)(x))[3], ((u8 *)(x))[2], ((u8 *)(x))[1], ((u8 *)(x))[0]
  22. #define RM_CAP_FMT "%02x %02x%02x %02x%02x"
  23. /* remember to modify rm_event_name() when adding new event */
  24. enum RM_EV_ID {
  25. RM_EV_state_in,
  26. RM_EV_busy_timer_expire,
  27. RM_EV_delay_timer_expire,
  28. RM_EV_meas_timer_expire,
  29. RM_EV_retry_timer_expire,
  30. RM_EV_repeat_delay_expire,
  31. RM_EV_request_timer_expire,
  32. RM_EV_wait_report,
  33. RM_EV_start_meas,
  34. RM_EV_survey_done,
  35. RM_EV_recv_rep,
  36. RM_EV_cancel,
  37. RM_EV_state_out,
  38. RM_EV_max
  39. };
  40. struct rm_event {
  41. u32 rmid;
  42. enum RM_EV_ID evid;
  43. _list list;
  44. };
  45. #ifdef CONFIG_RTW_80211K
  46. struct rm_clock {
  47. struct rm_obj *prm;
  48. ATOMIC_T counter;
  49. enum RM_EV_ID evid;
  50. };
  51. struct rm_priv {
  52. u8 enable;
  53. _queue ev_queue;
  54. _queue rm_queue;
  55. _timer rm_timer;
  56. struct rm_clock clock[RM_TIMER_NUM];
  57. u8 rm_en_cap_def[5];
  58. u8 rm_en_cap_assoc[5];
  59. /* rm debug */
  60. void *prm_sel;
  61. };
  62. int rtw_init_rm(_adapter *padapter);
  63. int rtw_free_rm_priv(_adapter *padapter);
  64. unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame);
  65. void RM_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  66. void rtw_ap_parse_sta_rm_en_cap(_adapter *padapter,
  67. struct sta_info *psta, struct rtw_ieee802_11_elems *elems);
  68. int rm_post_event(_adapter *padapter, u32 rmid, enum RM_EV_ID evid);
  69. void rm_handler(_adapter *padapter, struct rm_event *pev);
  70. u8 rm_add_nb_req(_adapter *padapter, struct sta_info *psta);
  71. #endif /*CONFIG_RTW_80211K */
  72. #endif /* __RTW_RM_H_ */