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