rsi_ps.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * Copyright (c) 2017 Redpine Signals Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef __RSI_PS_H__
  17. #define __RSI_PS_H__
  18. #define PS_CONFIRM_INDEX 12
  19. #define RSI_DEF_DS_WAKEUP_PERIOD 200
  20. #define RSI_DEF_LISTEN_INTERVAL 200
  21. #define RSI_SLEEP_TYPE_LP 1
  22. enum ps_state {
  23. PS_NONE = 0,
  24. PS_ENABLE_REQ_SENT = 1,
  25. PS_DISABLE_REQ_SENT = 2,
  26. PS_ENABLED = 3
  27. };
  28. struct ps_sleep_params {
  29. u8 enable;
  30. u8 sleep_type;
  31. u8 connected_sleep;
  32. u8 reserved1;
  33. __le16 num_bcns_per_lis_int;
  34. __le16 wakeup_type;
  35. __le32 sleep_duration;
  36. } __packed;
  37. struct rsi_ps_info {
  38. u8 enabled;
  39. u8 sleep_type;
  40. u8 tx_threshold;
  41. u8 rx_threshold;
  42. u8 tx_hysterisis;
  43. u8 rx_hysterisis;
  44. u16 monitor_interval;
  45. u32 listen_interval;
  46. u16 num_bcns_per_lis_int;
  47. u32 dtim_interval_duration;
  48. u16 num_dtims_per_sleep;
  49. u32 deep_sleep_wakeup_period;
  50. } __packed;
  51. char *str_psstate(enum ps_state state);
  52. void rsi_enable_ps(struct rsi_hw *adapter, struct ieee80211_vif *vif);
  53. void rsi_disable_ps(struct rsi_hw *adapter, struct ieee80211_vif *vif);
  54. int rsi_handle_ps_confirm(struct rsi_hw *adapter, u8 *msg);
  55. void rsi_default_ps_params(struct rsi_hw *hw);
  56. void rsi_conf_uapsd(struct rsi_hw *adapter, struct ieee80211_vif *vif);
  57. #endif