1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2017-2026 Morse Micro 4 */ 5 6 #ifndef _MM81X_RC_H_ 7 #define _MM81X_RC_H_ 8 9 #include <linux/list.h> 10 #include <linux/workqueue.h> 11 #include "core.h" 12 #include "mmrc.h" 13 14 struct mm81x_vif; 15 16 #define INIT_MAX_RATES_NUM 4 17 18 struct mm81x_rc { 19 /* Serialise rate control queue manipulation and timer functions */ 20 spinlock_t lock; 21 struct list_head stas; 22 struct timer_list timer; 23 struct work_struct work; 24 struct mm81x *mors; 25 }; 26 27 struct mm81x_rc_sta { 28 struct mmrc_table *tb; 29 struct list_head list; 30 unsigned long last_update; 31 }; 32 33 void mm81x_rc_init(struct mm81x *mors); 34 void mm81x_rc_deinit(struct mm81x *mors); 35 int mm81x_rc_sta_add(struct mm81x *mors, struct ieee80211_vif *vif, 36 struct ieee80211_sta *sta); 37 void mm81x_rc_sta_remove(struct mm81x *mors, struct ieee80211_sta *sta); 38 void mm81x_rc_sta_fill_tx_rates(struct mm81x *mors, 39 struct mm81x_skb_tx_info *tx_info, 40 struct sk_buff *skb, struct ieee80211_sta *sta, 41 int tx_bw, bool rts_allowed); 42 void mm81x_rc_sta_feedback_rates(struct mm81x *mors, struct sk_buff *skb, 43 struct ieee80211_sta *sta, 44 struct mm81x_skb_tx_status *tx_sts, 45 int tx_attempts); 46 void mm81x_rc_sta_state_check(struct mm81x *mors, struct ieee80211_vif *vif, 47 struct ieee80211_sta *sta, 48 enum ieee80211_sta_state old_state, 49 enum ieee80211_sta_state new_state); 50 51 #endif /* !_MM81X_RC_H_ */ 52