/*-1* Copyright (c) 2020-2025 The FreeBSD Foundation2*3* This software was developed by Björn Zeeb under sponsorship from4* the FreeBSD Foundation.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*27* $FreeBSD$28*/2930/*31* XXX-BZ:32* This file is left as a wrapper to make mvm compile and we will only33* deal with it on a need basis. Most newer chipsets do this in firmware.34*/3536#ifndef _IWLWIFI_MVM_RS_H37#define _IWLWIFI_MVM_RS_H3839#include <net/mac80211.h>4041#include "iwl-trans.h"42#include "fw-api.h"4344#define RS_NAME "XXX_unknown"4546#define LINK_QUAL_AGG_FRAME_LIMIT_DEF (64-1)47#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF (256-1)4849struct iwl_mvm;5051struct iwl_lq_sta_rs_fw {52int last_rate_n_flags;53struct {54struct iwl_mvm *drv;55uint8_t sta_id;56uint8_t chains;57uint8_t chain_signal[IEEE80211_MAX_CHAINS];58uint8_t last_rssi;59#ifdef CONFIG_MAC80211_DEBUGFS60uint32_t dbg_fixed_rate;61uint32_t dbg_agg_frame_count_lim;62#endif63} pers;64};6566struct iwl_lq_sta {67struct iwl_lq_cmd lq;68struct {69spinlock_t lock;70uint16_t max_agg_bufsize;71/*72* Based on the assumption that these are in "FW" too and73* there is a f() to set last_rssi add them here too.74*/75uint8_t chains;76uint8_t chain_signal[IEEE80211_MAX_CHAINS];77uint8_t last_rssi;78} pers;79};8081#define RS_DRV_DATA_PACK(_c, _f) ((void *)(uintptr_t)(_c | (uintptr_t)(_f) << sizeof(_c))) /* XXX TODO | ? */8283struct iwl_mvm_sta;84struct iwl_mvm_link_sta;8586#ifdef CONFIG_IWLWIFI_DEBUGFS87void iwl_mvm_reset_frame_stats(struct iwl_mvm *);88#endif8990void iwl_mvm_rs_add_sta(struct iwl_mvm *, struct iwl_mvm_sta *);91void iwl_mvm_tlc_update_notif(struct iwl_mvm *, struct iwl_rx_cmd_buffer *);92u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *,93struct ieee80211_bss_conf *, struct ieee80211_link_sta *);94void rs_fw_rate_init(struct iwl_mvm *, struct ieee80211_sta *,95enum nl80211_band, bool);96int rs_fw_tx_protection(struct iwl_mvm *, struct iwl_mvm_sta *, bool);97int iwl_mvm_tx_protection(struct iwl_mvm *, struct iwl_mvm_sta *, bool);9899int iwl_mvm_rate_control_register(void);100void iwl_mvm_rate_control_unregister(void);101void iwl_mvm_rs_rate_init(struct iwl_mvm *, struct ieee80211_vif *,102struct ieee80211_sta *, struct ieee80211_bss_conf *,103struct ieee80211_link_sta *, enum nl80211_band);104void iwl_mvm_rs_fw_rate_init(struct iwl_mvm *, struct ieee80211_vif *,105struct ieee80211_sta *, struct ieee80211_bss_conf *,106struct ieee80211_link_sta *, enum nl80211_band);107void iwl_mvm_rs_tx_status(struct iwl_mvm *, struct ieee80211_sta *,108int, struct ieee80211_tx_info *, bool);109void iwl_mvm_rs_add_sta_link(struct iwl_mvm *, struct iwl_mvm_link_sta *);110111#endif /* _IWLWIFI_MVM_RS_H */112113114