linux/drivers/net/wireless/intel/iwlwifi/mvm/rs.h

/* SPDX-License-Identifier: GPL-2.0-only */
/******************************************************************************
 *
 * Copyright(c) 2015 Intel Mobile Communications GmbH
 * Copyright(c) 2017 Intel Deutschland GmbH
 * Copyright (C) 2003 - 2014, 2018 - 2024 Intel Corporation
 *****************************************************************************/

#ifndef __rs_h__
#define __rs_h__

#include <net/mac80211.h>

#include "iwl-config.h"

#include "fw-api.h"
#include "iwl-trans.h"

#define RS_NAME

struct iwl_rs_rate_info {};

#define IWL_RATE_60M_PLCP

#define LINK_QUAL_MAX_RETRY_NUM

enum {};

/* #define vs. enum to keep from defaulting to 'large integer' */
#define IWL_RATE_6M_MASK
#define IWL_RATE_9M_MASK
#define IWL_RATE_12M_MASK
#define IWL_RATE_18M_MASK
#define IWL_RATE_24M_MASK
#define IWL_RATE_36M_MASK
#define IWL_RATE_48M_MASK
#define IWL_RATE_54M_MASK
#define IWL_RATE_60M_MASK
#define IWL_RATE_1M_MASK
#define IWL_RATE_2M_MASK
#define IWL_RATE_5M_MASK
#define IWL_RATE_11M_MASK


/* uCode API values for HT/VHT bit rates */
enum {};

#define IWL_RATES_MASK

#define IWL_INVALID_VALUE

#define TPC_MAX_REDUCTION
#define TPC_NO_REDUCTION
#define TPC_INVALID

#define LINK_QUAL_AGG_FRAME_LIMIT_DEF
#define LINK_QUAL_AGG_FRAME_LIMIT_MAX
#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF
#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_MAX
#define LINK_QUAL_AGG_FRAME_LIMIT_MIN

#define LQ_SIZE

/* load per tid defines for A-MPDU activation */
#define IWL_AGG_TPT_THREHOLD
#define IWL_AGG_ALL_TID

enum iwl_table_type {};

struct rs_rate {};


#define is_type_legacy(type)
#define is_type_ht_siso(type)
#define is_type_ht_mimo2(type)
#define is_type_vht_siso(type)
#define is_type_vht_mimo2(type)
#define is_type_he_siso(type)
#define is_type_he_mimo2(type)
#define is_type_siso(type)
#define is_type_mimo2(type)
#define is_type_mimo(type)
#define is_type_ht(type)
#define is_type_vht(type)
#define is_type_he(type)
#define is_type_a_band(type)
#define is_type_g_band(type)

#define is_legacy(rate)
#define is_ht_siso(rate)
#define is_ht_mimo2(rate)
#define is_vht_siso(rate)
#define is_vht_mimo2(rate)
#define is_siso(rate)
#define is_mimo2(rate)
#define is_mimo(rate)
#define is_ht(rate)
#define is_vht(rate)
#define is_he(rate)
#define is_a_band(rate)
#define is_g_band(rate)

#define is_ht20(rate)
#define is_ht40(rate)
#define is_ht80(rate)
#define is_ht160(rate)

/**
 * struct iwl_lq_sta_rs_fw - rate and related statistics for RS in FW
 * @last_rate_n_flags: last rate reported by FW
 * @pers: persistent fields
 * @pers.sta_id: the id of the station
 * @pers.chains: bitmask of chains reported in %chain_signal
 * @pers.chain_signal: per chain signal strength
 * @pers.last_rssi: last rssi reported
 * @pers.drv: pointer back to the driver data
 */
struct iwl_lq_sta_rs_fw {};

/*
 * struct iwl_rate_scale_data -- tx success history for one rate
 */
struct iwl_rate_scale_data {};

/* Possible Tx columns
 * Tx Column = a combo of legacy/siso/mimo x antenna x SGI
 */
enum rs_column {};

enum rs_ss_force_opt {};

/* Packet stats per rate */
struct rs_rate_stats {};

/*
 * struct iwl_scale_tbl_info -- tx params and success history for all rates
 *
 * There are two of these in struct iwl_lq_sta,
 * one for "active", and one for "search".
 */
struct iwl_scale_tbl_info {};

enum {};

/*
 * struct iwl_lq_sta -- driver's rate scaling private structure
 *
 * Pointer to this gets passed back and forth between driver and mac80211.
 */
struct iwl_lq_sta {};

/* ieee80211_tx_info's status_driver_data[0] is packed with lq color and txp
 * Note, it's iwlmvm <-> mac80211 interface.
 * bits 0-7: reduced tx power
 * bits 8-10: LQ command's color
 */
#define RS_DRV_DATA_TXP_MSK
#define RS_DRV_DATA_LQ_COLOR_POS
#define RS_DRV_DATA_LQ_COLOR_MSK
#define RS_DRV_DATA_LQ_COLOR_GET(_f)
#define RS_DRV_DATA_PACK(_c, _p)

/* Initialize station's rate scaling information after adding station */
void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm,
			  struct ieee80211_vif *vif,
			  struct ieee80211_sta *sta,
			  struct ieee80211_bss_conf *link_conf,
			  struct ieee80211_link_sta *link_sta,
			  enum nl80211_band band);

/* Notify RS about Tx status */
void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
			  int tid, struct ieee80211_tx_info *info, bool ndp);

/**
 * iwl_mvm_rate_control_register - Register the rate control algorithm callbacks
 *
 * Since the rate control algorithm is hardware specific, there is no need
 * or reason to place it as a stand alone module.  The driver can call
 * iwl_rate_control_register in order to register the rate control callbacks
 * with the mac80211 subsystem.  This should be performed prior to calling
 * ieee80211_register_hw
 *
 */
int iwl_mvm_rate_control_register(void);

/**
 * iwl_mvm_rate_control_unregister - Unregister the rate control callbacks
 *
 * This should be called after calling ieee80211_unregister_hw, but before
 * the driver is unloaded.
 */
void iwl_mvm_rate_control_unregister(void);

struct iwl_mvm_sta;

int iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
			  bool enable);

#ifdef CONFIG_IWLWIFI_DEBUGFS
void iwl_mvm_reset_frame_stats(struct iwl_mvm *mvm);
#endif

struct iwl_mvm_link_sta;

void iwl_mvm_rs_add_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta);
void iwl_mvm_rs_add_sta_link(struct iwl_mvm *mvm,
			     struct iwl_mvm_link_sta *link_sta);

void iwl_mvm_rs_fw_rate_init(struct iwl_mvm *mvm,
			     struct ieee80211_vif *vif,
			     struct ieee80211_sta *sta,
			     struct ieee80211_bss_conf *link_conf,
			     struct ieee80211_link_sta *link_sta,
			     enum nl80211_band band);
int rs_fw_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
			bool enable);
void iwl_mvm_tlc_update_notif(struct iwl_mvm *mvm,
			      struct iwl_rx_cmd_buffer *rxb);

u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta,
			    struct ieee80211_bss_conf *link_conf,
			    struct ieee80211_link_sta *link_sta);
#endif /* __rs__ */