sta.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Mac80211 STA interface for ST-Ericsson CW1200 mac80211 drivers
  4. *
  5. * Copyright (c) 2010, ST-Ericsson
  6. * Author: Dmitry Tarnyagin <[email protected]>
  7. */
  8. #ifndef STA_H_INCLUDED
  9. #define STA_H_INCLUDED
  10. /* ******************************************************************** */
  11. /* mac80211 API */
  12. int cw1200_start(struct ieee80211_hw *dev);
  13. void cw1200_stop(struct ieee80211_hw *dev);
  14. int cw1200_add_interface(struct ieee80211_hw *dev,
  15. struct ieee80211_vif *vif);
  16. void cw1200_remove_interface(struct ieee80211_hw *dev,
  17. struct ieee80211_vif *vif);
  18. int cw1200_change_interface(struct ieee80211_hw *dev,
  19. struct ieee80211_vif *vif,
  20. enum nl80211_iftype new_type,
  21. bool p2p);
  22. int cw1200_config(struct ieee80211_hw *dev, u32 changed);
  23. void cw1200_configure_filter(struct ieee80211_hw *dev,
  24. unsigned int changed_flags,
  25. unsigned int *total_flags,
  26. u64 multicast);
  27. int cw1200_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
  28. unsigned int link_id, u16 queue,
  29. const struct ieee80211_tx_queue_params *params);
  30. int cw1200_get_stats(struct ieee80211_hw *dev,
  31. struct ieee80211_low_level_stats *stats);
  32. int cw1200_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
  33. struct ieee80211_vif *vif, struct ieee80211_sta *sta,
  34. struct ieee80211_key_conf *key);
  35. int cw1200_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
  36. void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  37. u32 queues, bool drop);
  38. u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
  39. struct netdev_hw_addr_list *mc_list);
  40. int cw1200_set_pm(struct cw1200_common *priv, const struct wsm_set_pm *arg);
  41. /* ******************************************************************** */
  42. /* WSM callbacks */
  43. void cw1200_join_complete_cb(struct cw1200_common *priv,
  44. struct wsm_join_complete *arg);
  45. /* ******************************************************************** */
  46. /* WSM events */
  47. void cw1200_free_event_queue(struct cw1200_common *priv);
  48. void cw1200_event_handler(struct work_struct *work);
  49. void cw1200_bss_loss_work(struct work_struct *work);
  50. void cw1200_bss_params_work(struct work_struct *work);
  51. void cw1200_keep_alive_work(struct work_struct *work);
  52. void cw1200_tx_failure_work(struct work_struct *work);
  53. void __cw1200_cqm_bssloss_sm(struct cw1200_common *priv, int init, int good,
  54. int bad);
  55. static inline void cw1200_cqm_bssloss_sm(struct cw1200_common *priv,
  56. int init, int good, int bad)
  57. {
  58. spin_lock(&priv->bss_loss_lock);
  59. __cw1200_cqm_bssloss_sm(priv, init, good, bad);
  60. spin_unlock(&priv->bss_loss_lock);
  61. }
  62. /* ******************************************************************** */
  63. /* Internal API */
  64. int cw1200_setup_mac(struct cw1200_common *priv);
  65. void cw1200_join_timeout(struct work_struct *work);
  66. void cw1200_unjoin_work(struct work_struct *work);
  67. void cw1200_join_complete_work(struct work_struct *work);
  68. void cw1200_wep_key_work(struct work_struct *work);
  69. void cw1200_update_listening(struct cw1200_common *priv, bool enabled);
  70. void cw1200_update_filtering(struct cw1200_common *priv);
  71. void cw1200_update_filtering_work(struct work_struct *work);
  72. void cw1200_set_beacon_wakeup_period_work(struct work_struct *work);
  73. int cw1200_enable_listening(struct cw1200_common *priv);
  74. int cw1200_disable_listening(struct cw1200_common *priv);
  75. int cw1200_set_uapsd_param(struct cw1200_common *priv,
  76. const struct wsm_edca_params *arg);
  77. void cw1200_ba_work(struct work_struct *work);
  78. void cw1200_ba_timer(unsigned long arg);
  79. /* AP stuffs */
  80. int cw1200_set_tim(struct ieee80211_hw *dev, struct ieee80211_sta *sta,
  81. bool set);
  82. int cw1200_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  83. struct ieee80211_sta *sta);
  84. int cw1200_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  85. struct ieee80211_sta *sta);
  86. void cw1200_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
  87. enum sta_notify_cmd notify_cmd,
  88. struct ieee80211_sta *sta);
  89. void cw1200_bss_info_changed(struct ieee80211_hw *dev,
  90. struct ieee80211_vif *vif,
  91. struct ieee80211_bss_conf *info,
  92. u64 changed);
  93. int cw1200_ampdu_action(struct ieee80211_hw *hw,
  94. struct ieee80211_vif *vif,
  95. struct ieee80211_ampdu_params *params);
  96. void cw1200_suspend_resume(struct cw1200_common *priv,
  97. struct wsm_suspend_resume *arg);
  98. void cw1200_set_tim_work(struct work_struct *work);
  99. void cw1200_set_cts_work(struct work_struct *work);
  100. void cw1200_multicast_start_work(struct work_struct *work);
  101. void cw1200_multicast_stop_work(struct work_struct *work);
  102. void cw1200_mcast_timeout(struct timer_list *t);
  103. #endif