(Patches split per file for review, see cover letter for more information) Signed-off-by: Lachlan Hodges --- drivers/net/wireless/morsemicro/mm81x/rc.h | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 drivers/net/wireless/morsemicro/mm81x/rc.h diff --git a/drivers/net/wireless/morsemicro/mm81x/rc.h b/drivers/net/wireless/morsemicro/mm81x/rc.h new file mode 100644 index 000000000000..0c391183680b --- /dev/null +++ b/drivers/net/wireless/morsemicro/mm81x/rc.h @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2017-2026 Morse Micro + */ + +#ifndef _MM81X_RC_H_ +#define _MM81X_RC_H_ + +#include +#include +#include "core.h" +#include "mmrc.h" + +struct mm81x_vif; + +#define INIT_MAX_RATES_NUM 4 + +struct mm81x_rc { + /* Serialise rate control queue manipulation and timer functions */ + spinlock_t lock; + struct list_head stas; + struct timer_list timer; + struct work_struct work; + struct mm81x *mm; +}; + +struct mm81x_rc_sta { + struct mmrc_table *tb; + struct list_head list; + unsigned long last_update; +}; + +void mm81x_rc_init(struct mm81x *mm); +void mm81x_rc_deinit(struct mm81x *mm); +int mm81x_rc_sta_add(struct mm81x *mm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta); +#define mm81x_rc_set_fixed_rate(mm, sta, mcs, bw, ss, guard) \ + _mm81x_rc_set_fixed_rate(mm, sta, mcs, bw, ss, guard, __func__) +bool _mm81x_rc_set_fixed_rate(struct mm81x *mm, struct ieee80211_sta *sta, + int mcs, int bw, int ss, int guard, + const char *caller); +void mm81x_rc_sta_remove(struct mm81x *mm, struct ieee80211_sta *sta); +void mm81x_rc_sta_fill_tx_rates(struct mm81x *mm, + struct mm81x_skb_tx_info *tx_info, + struct sk_buff *skb, struct ieee80211_sta *sta, + int tx_bw, bool rts_allowed); +void mm81x_rc_sta_feedback_rates(struct mm81x *mm, struct sk_buff *skb, + struct ieee80211_sta *sta, + struct mm81x_skb_tx_status *tx_sts, + int tx_attempts); +void mm81x_rc_sta_state_check(struct mm81x *mm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + enum ieee80211_sta_state old_state, + enum ieee80211_sta_state new_state); + +/* + * Reinitialize the associated stations when there is a change in BW. + * Must be called with mm->lock held + */ +void mm81x_rc_reinit_stas(struct mm81x *mm, struct ieee80211_vif *vif); + +#endif /* !_MM81X_RC_H_ */ -- 2.43.0