sta.h 4.7 KB

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