new file mode 100644
@@ -0,0 +1,565 @@
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
+/* Copyright(c) 2019-2022, Celeno Communications Ltd. */
+
+#ifndef CL_WRS_H
+#define CL_WRS_H
+
+#include <net/mac80211.h>
+
+#include "def.h"
+#include "debug.h"
+#include "rx.h"
+
+/**
+ * WRS (=Weighted Rate Selection)
+ */
+
+struct cl_hw;
+struct cl_sta;
+struct cl_vif;
+
+/* Rate Table Size */
+#define WRS_HE_RATE_TABLE_SIZE (WRS_MCS_MAX_HE * WRS_SS_MAX * CHNL_BW_MAX * WRS_GI_MAX_HE)
+#define WRS_HT_VHT_RATE_TABLE_SIZE (WRS_MCS_MAX_VHT * WRS_SS_MAX * CHNL_BW_MAX * WRS_GI_MAX_VHT)
+
+/* Initial Thresholds */
+#define WRS_INIT_MSEC_WEIGHT_DOWN (WRS_MAINTENANCE_PERIOD_MS * 3) /* Msec */
+#define WRS_INIT_MSEC_WEIGHT_UP (WRS_MAINTENANCE_PERIOD_MS * 3) /* Msec */
+
+#define WRS_MSEC_WEIGHT_MIN (WRS_MAINTENANCE_PERIOD_MS * 2) /* Msec */
+#define WRS_MSEC_WEIGHT_MAX_UP 30000 /* Msec */
+#define WRS_MSEC_WEIGHT_MAX_DOWN 4000 /* Msec */
+#define WRS_MSEC_STEP_DOWN 5000 /* Msec */
+#define WRS_MSEC_STEP_UP_SAME 1000 /* Msec */
+#define WRS_INVALID_RATE ((u16)(~0))
+
+enum cl_wrs_table_node_up {
+ WRS_TABLE_NODE_UP_MCS,
+ WRS_TABLE_NODE_UP_BW,
+ WRS_TABLE_NODE_UP_NSS,
+ WRS_TABLE_NODE_UP_BF,
+ WRS_TABLE_NODE_UP_GI,
+
+ WRS_TABLE_NODE_UP_MAX
+};
+
+struct cl_wrs_table_validity {
+ bool is_valid;
+ u16 new_rate_idx;
+};
+
+struct cl_wrs_table_node {
+ u16 rate_idx;
+ u16 time_th;
+ bool quick_up_check;
+};
+
+struct cl_wrs_rate {
+ u16 mcs : 4,
+ nss : 3,
+ bw : 2,
+ gi : 2,
+ rsv : 2;
+};
+
+struct cl_wrs_table {
+ struct cl_wrs_rate rate;
+ struct cl_wrs_table_node rate_down;
+ struct cl_wrs_table_node rate_up[WRS_TABLE_NODE_UP_MAX];
+ u32 frames_total;
+ u32 ba_not_rcv_total;
+ u64 epr_acc;
+};
+
+#define WRS_MAINTENANCE_PERIOD_MS 40
+#define WRS_DATA_RATE_FACTOR 10
+#define WRS_RSSI_PROTECT_UP_THR 10
+#define WRS_RSSI_PROTECT_DN_THR 10
+#define WRS_MIN_FRAMES_FOR_DECISION 15
+#define WRS_EPR_FACTOR 105
+#define WRS_CONVERGE_IDLE_PACKET_TH 5
+#define WRS_CONVERGE_IDLE_INTERVAL_RESET 6000 /* 6 sec */
+#define WRS_CONVERGE_IDLE_INTERVAL_RSSI 2000 /* 2 sec */
+#define WRS_CONVERGE_TRFC_INTERVAL_STATIC 30000 /* 30 sec */
+#define WRS_CONVERGE_TRFC_INTERVAL_MOTION 1000 /* 1 sec */
+#define WRS_IMMEDIATE_DROP_EPR_FACTOR 70 /* 70% */
+#define WRS_IMMEDIATE_DROP_MAX_IN_ROW U32_MAX
+#define WRS_SYNC_MIN_ATTEMPTS 4
+#define WRS_SYNC_TIMEOUT 1000 /* 1 sec */
+#define WRS_QUICK_UP_BA_THR 5
+#define WRS_QUICK_UP_INTERVAL_MS 1000
+#define WRS_QUICK_DOWN_EPR_FACTOR 85
+#define WRS_QUICK_DOWN_AGG_THR 3
+#define WRS_QUICK_DOWN_PKT_THR 60
+#define WRS_RSSI_PROTECT_SHIFT 7
+#define WRS_RSSI_PROTECT_BUF_SZ_OLD BIT(WRS_RSSI_PROTECT_SHIFT) /* 2 ^ 7 = 128 */
+#define WRS_RSSI_PROTECT_BUF_SZ_NEW 3
+#define WRS_BA_NOT_RCV_TIME_SINCE_SYNC 1000
+#define WRS_CCA_PERIOD_MS 1000
+#define WRS_CCA_PRIMARY_SHIFT 7
+#define WRS_CCA_PRIMARY_FACTOR 160 /* 160 / 2^7 = 1.25 = 25% */
+
+enum cl_wrs_rssi_prot_mode {
+ WRS_RSSI_PROT_MODE_RSSI, /* Up/down based on rssi */
+ WRS_RSSI_PROT_MODE_NEIGHBOR, /* Up/down based on neighbors */
+
+ WRS_RSSI_PROTECT_MODE_MAX
+};
+
+enum cl_wrs_fixed_rate {
+ WRS_AUTO_RATE,
+ WRS_FIXED_FALLBACK_EN,
+ WRS_FIXED_FALLBACK_DIS,
+
+ WRS_FIXED_RATE_MAX
+};
+
+enum cl_wrs_fixed_param {
+ WRS_FIXED_PARAM_MODE,
+ WRS_FIXED_PARAM_BW,
+ WRS_FIXED_PARAM_NSS,
+ WRS_FIXED_PARAM_MCS,
+ WRS_FIXED_PARAM_GI,
+
+ WRS_FIXED_PARAM_MAX
+};
+
+#define FIXED_RATE_STR(x) \
+ (((x) == WRS_AUTO_RATE) ? "auto rate" : \
+ (((x) == WRS_FIXED_FALLBACK_EN) ? "fixed rate (fallbacks enabled)" : \
+ "fixed rate (fallbacks disabled)"))
+
+enum cl_wrs_decision {
+ WRS_DECISION_NONE,
+ WRS_DECISION_SAME,
+ WRS_DECISION_UP,
+ WRS_DECISION_UP_QUICK,
+ WRS_DECISION_UP_RSSI,
+ WRS_DECISION_UP_MCS1,
+ WRS_DECISION_DOWN,
+ WRS_DECISION_DOWN_RSSI,
+ WRS_DECISION_DOWN_IMMEDIATE,
+ WRS_DECISION_DOWN_QUICK,
+ WRS_DECISION_DOWN_NO_SYNC,
+ WRS_DECISION_RSSI_MGMT,
+ WRS_DECISION_RX_RATE,
+
+ WRS_DECISION_MAX,
+};
+
+enum cl_wrs_mcs {
+ WRS_MCS_0,
+ WRS_MCS_1,
+ WRS_MCS_2,
+ WRS_MCS_3,
+ WRS_MCS_4,
+ WRS_MCS_5,
+ WRS_MCS_6,
+ WRS_MCS_7,
+ WRS_MCS_8,
+ WRS_MCS_9,
+ WRS_MCS_10,
+ WRS_MCS_11,
+ WRS_MCS_MAX,
+};
+
+#define WRS_MCS_MAX_CCK WRS_MCS_4
+#define WRS_MCS_MAX_OFDM WRS_MCS_8
+#define WRS_MCS_MAX_HT WRS_MCS_8
+#define WRS_MCS_MAX_VHT WRS_MCS_10
+#define WRS_MCS_MAX_HE WRS_MCS_MAX
+
+enum cl_wrs_ss {
+ WRS_SS_1,
+ WRS_SS_2,
+ WRS_SS_3,
+ WRS_SS_4,
+
+ WRS_SS_MAX
+};
+
+enum cl_wrs_gi {
+ WRS_GI_LONG,
+ WRS_GI_SHORT,
+ WRS_GI_VSHORT,
+
+ WRS_GI_MAX
+};
+
+#define WRS_GI_MAX_HT WRS_GI_VSHORT
+#define WRS_GI_MAX_VHT WRS_GI_VSHORT
+#define WRS_GI_MAX_HE WRS_GI_MAX
+
+enum cl_wrs_ltf {
+ LTF_X1,
+ LTF_X2,
+ LTF_X4,
+ LTF_MAX
+};
+
+enum cl_wrs_converge_mode {
+ WRS_CONVERGE_MODE_RESET,
+ WRS_CONVERGE_MODE_RSSI,
+
+ WRS_CONVERGE_MODE_MAX,
+};
+
+enum cl_wrs_mode {
+ WRS_MODE_CCK,
+ WRS_MODE_OFDM,
+ WRS_MODE_HT,
+ WRS_MODE_VHT,
+ WRS_MODE_HE,
+
+ WRS_MODE_MAX,
+};
+
+enum cl_wrs_type {
+ WRS_TYPE_TX_SU,
+ WRS_TYPE_TX_MU_MIMO,
+ WRS_TYPE_RX,
+
+ WRS_TYPE_MAX,
+};
+
+#define WRS_TYPE_STR(type) \
+ ((type) == WRS_TYPE_TX_SU ? "TX_SU" : \
+ ((type) == WRS_TYPE_RX ? "RX" : \
+ ((type) == WRS_TYPE_TX_MU_MIMO ? "TX_MU-MIMO" : "")))
+
+#define WRS_TYPE_IS_TX_SU(wrs_params) ((wrs_params)->type == WRS_TYPE_TX_SU)
+#define WRS_TYPE_IS_TX_MU_MIMO(wrs_params) ((wrs_params)->type == WRS_TYPE_TX_MU_MIMO)
+#define WRS_TYPE_IS_RX(wrs_params) ((wrs_params)->type == WRS_TYPE_RX)
+
+/* m MUST be power of 2 ! */
+#define WRS_INC_POW2(c, m) (((c) + 1) & ((m) - 1))
+
+#define WRS_INC(c, m) \
+ do { \
+ (c)++; \
+ if ((c) == (m)) \
+ (c) = 0; \
+ } while (0)
+
+#define WRS_IS_DECISION_UP(decision) \
+ (((decision) >= WRS_DECISION_UP) && ((decision) <= WRS_DECISION_UP_MCS1))
+#define WRS_IS_DECISION_DOWN(decision) \
+ (((decision) >= WRS_DECISION_DOWN) && ((decision) <= WRS_DECISION_DOWN_NO_SYNC))
+
+#define WRS_DECISION_STR(decision) ( \
+ (decision) == WRS_DECISION_NONE ? "NONE" : \
+ (decision) == WRS_DECISION_SAME ? "SAME" : \
+ (decision) == WRS_DECISION_UP ? "UP" : \
+ (decision) == WRS_DECISION_UP_QUICK ? "UP QUICK" : \
+ (decision) == WRS_DECISION_UP_RSSI ? "UP RSSI" : \
+ (decision) == WRS_DECISION_UP_MCS1 ? "UP MCS1" : \
+ (decision) == WRS_DECISION_DOWN ? "DOWN" : \
+ (decision) == WRS_DECISION_DOWN_RSSI ? "DOWN RSSI" : \
+ (decision) == WRS_DECISION_DOWN_IMMEDIATE ? "DOWN IMMEDIATE" : \
+ (decision) == WRS_DECISION_DOWN_QUICK ? "DOWN QUICK" : \
+ (decision) == WRS_DECISION_DOWN_NO_SYNC ? "DOWN NO_SYNC" : \
+ (decision) == WRS_DECISION_RSSI_MGMT ? "RSSI MGMT" : \
+ (decision) == WRS_DECISION_RX_RATE ? "RX_RATE" : \
+ "ERROR")
+
+struct cl_wrs_cntrs {
+ u64 epr_acc;
+ u32 total;
+ u32 fail;
+ u32 ba_not_rcv;
+ u32 ba_not_rcv_consecutive;
+};
+
+struct cl_wrs_rate_params {
+ u16 mode : 3, /* Mode - 0 = CCK, 1 = OFDM, 2 = HT, 3 = VHT, 4 = HE. */
+ gi : 2, /* GI - O = Long, 1 = Short, 2 = Very short. */
+ bw : 2, /* Bandwidth - 0 = 20M, 1 = 40M, 2 = 80M, 3 = 160M. */
+ nss : 3, /* Spatial Streams - 0 = 1SS, 1 = 2SS, .. 7 = 8SS. */
+ mcs : 4, /* MCS - CCK (0 - 3), OFDM/HT (0 - 7), VHT (0 - 9), HE (0 - 11). */
+ fallback_en : 1,
+ is_fixed : 1;
+};
+
+struct cl_wrs_logger {
+ unsigned long timestamp;
+ u16 rate_idx;
+ u32 success;
+ u32 fail;
+ u32 ba_not_rcv;
+ u16 down_rate_idx;
+ u16 up_rate_idx;
+ u16 curr_epr;
+ u16 down_epr;
+ u16 down_epr_factorized;
+ u16 penalty;
+ u16 up_time;
+ enum cl_wrs_decision decision;
+ u16 new_rate_idx;
+};
+
+struct cl_wrs_per_stats {
+ struct list_head list;
+ u8 mcs;
+ u8 bw;
+ u8 nss;
+ u8 gi;
+ u32 frames_total;
+ u32 frames_failed;
+ u64 epr_acc;
+};
+
+struct cl_wrs_rssi_prot_db {
+ s8 samples_old[WRS_RSSI_PROTECT_BUF_SZ_OLD];
+ s8 samples_new[WRS_RSSI_PROTECT_BUF_SZ_NEW];
+ u8 curr_idx_old;
+ u8 curr_idx_new;
+ s32 sum;
+};
+
+struct cl_wrs_params {
+ u8 group_id;
+ u8 is_mu_valid : 1,
+ is_fixed_rate : 2,
+ is_logger_en : 1,
+ quick_up_check : 1,
+ type : 2,
+ rsv : 1;
+ u32 up_same_time_cnt;
+ u32 down_time_cnt;
+ enum cl_wrs_converge_mode converge_mode;
+ u32 converge_time_idle;
+ u32 converge_time_trfc;
+ u16 data_rate;
+ u16 rate_idx;
+ u16 initial_rate_idx;
+ struct cl_wrs_table *table;
+ u16 table_size;
+ u16 penalty_decision_dn;
+ struct cl_wrs_rate_params rate_params;
+ struct cl_wrs_rate rx_rate_idle;
+ enum cl_wrs_decision last_decision;
+ u32 decision_cnt[WRS_DECISION_MAX];
+ struct list_head list_rates;
+ u32 frames_total;
+ u32 fail_total;
+ u32 ba_not_rcv_total;
+ u64 epr_acc;
+ bool calc_ba_not_rcv;
+ bool sync;
+ unsigned long sync_timestamp;
+ unsigned long no_sync_timestamp;
+ struct cl_wrs_logger *logger;
+ u16 logger_idx;
+ u16 logger_size;
+ u32 immediate_drop_cntr;
+ u32 immediate_drop_ignore;
+};
+
+struct cl_wrs_sta {
+ u8 sta_idx;
+ bool smps_enable;
+ u8 assoc_bw;
+ u8 he_minrate;
+ u8 gi_cap[CHNL_BW_MAX];
+ u64 supported_rates[CHNL_BW_MAX];
+ enum cl_wrs_mode mode;
+ struct cl_wrs_rate max_rate_cap;
+ struct cl_wrs_rssi_prot_db rssi_prot_db;
+ struct cl_wrs_params tx_su_params;
+ struct cl_wrs_params *rx_params;
+};
+
+struct cl_wrs_db {
+ /* General */
+ spinlock_t lock;
+ enum cl_dbg_level debug_level;
+ /* Timer */
+ struct timer_list timer_maintenance;
+ u32 interval;
+ /* Fixed rate */
+ u8 is_fixed_rate;
+ /* Conservative initial rate */
+ bool conservative_mcs_noisy_env;
+ bool conservative_nss_noisy_env;
+ /* Immediate drop */
+ bool immediate_drop_en;
+ u8 immediate_drop_epr_factor;
+ u32 immediate_drop_max_in_row;
+ /* Converge idle */
+ bool converge_idle_en;
+ u32 converge_idle_interval_reset;
+ u32 converge_idle_interval_rssi;
+ u32 converge_idle_packet_th;
+ /* Converge traffic */
+ bool converge_trfc_en;
+ u32 converge_trfc_interval_static;
+ u32 converge_trfc_interval_motion;
+ /* Supported rates */
+ u8 mode;
+ u64 ap_supported_rates[CHNL_BW_MAX]; /* Bit array for each bw */
+ struct cl_wrs_rate max_cap;
+ u8 coex_bw;
+ /* RSSI protect */
+ bool rssi_protect_en;
+ u8 rssi_protect_mode;
+ s8 rssi_protect_up_thr;
+ s8 rssi_protect_dn_thr;
+ /* Time + step thresholds */
+ u16 time_th_min;
+ u16 time_th_max_up;
+ u16 time_th_max_down;
+ u16 step_down;
+ u16 step_up_same;
+ /* Quick up */
+ bool quick_up_en;
+ u8 quick_up_ba_thr;
+ u16 quick_up_interval;
+ /* Quick down */
+ bool quick_down_en;
+ u8 quick_down_epr_factor;
+ u8 quick_down_agg_thr;
+ u16 quick_down_pkt_thr;
+ /* BA not received */
+ bool ba_not_rcv_collision_filter;
+ bool ba_not_rcv_force;
+ u32 ba_not_rcv_time_since_sync;
+ /* Sync */
+ u16 sync_timeout;
+ u8 sync_min_attempts;
+ /* CCA counters */
+ unsigned long cca_timestamp;
+ u32 cca_primary;
+ u32 cca_sec80;
+ u32 cca_sec40;
+ u32 cca_sec20;
+ bool adjacent_interference20;
+ bool adjacent_interference40;
+ bool adjacent_interference80;
+ /* All the rest */
+ u32 min_frames_for_decision;
+ u8 epr_factor;
+};
+
+struct cl_wrs_info {
+ u64 epr_acc;
+ u32 success;
+ u32 fail;
+ u32 fail_prev;
+ u32 ba_not_rcv;
+ u8 ba_not_rcv_consecutive;
+ u8 ba_not_rcv_consecutive_max;
+ bool synced;
+ u32 sync_attempts;
+ u8 quick_rate_agg_cntr;
+ u16 quick_rate_pkt_cntr;
+ bool quick_rate_check;
+};
+
+struct cl_wrs_rssi {
+ s32 sum[MAX_ANTENNAS];
+ s32 cnt;
+};
+
+bool cl_wrs_rssi_set_rate(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta);
+void cl_wrs_rssi_prot_start(struct cl_hw *cl_hw, struct cl_sta *cl_sta);
+bool cl_wrs_rssi_prot_decision(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params,
+ bool up_rate_valid,
+ u8 up_rate_idx, u8 down_rate_idx);
+u16 cl_wrs_rssi_find_rate(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params,
+ s8 *rssi_sort);
+void cl_wrs_sta_add(struct cl_hw *cl_hw, struct ieee80211_sta *sta);
+bool cl_wrs_sta_add_mu(struct cl_hw *cl_hw, struct cl_wrs_sta *wrs_sta, u8 group_id);
+void cl_wrs_sta_add_rx(struct cl_hw *cl_hw, struct ieee80211_sta *sta);
+void cl_wrs_sta_remove(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db, struct cl_sta *cl_sta);
+bool cl_wrs_sta_remove_mu(struct cl_wrs_db *wrs_db, struct cl_wrs_sta *wrs_sta);
+struct cl_wrs_sta *cl_wrs_sta_get(struct cl_hw *cl_hw, u8 sta_idx);
+void cl_wrs_sta_select_first_rate(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params);
+void cl_wrs_sta_capabilities_set(struct cl_wrs_db *wrs_db, struct ieee80211_sta *sta);
+void cl_wrs_sta_set_supported_rate(struct cl_wrs_sta *wrs_sta, u8 bw, u8 nss, u8 mcs);
+void cl_wrs_stats_per_update(struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params,
+ struct cl_wrs_cntrs *cntrs);
+void cl_wrs_stats_per_init(struct cl_wrs_params *wrs_params);
+void cl_wrs_stats_per_remove(struct cl_wrs_params *wrs_params);
+void cl_wrs_tables_global_build(void);
+void cl_wrs_tables_reset(struct cl_wrs_db *wrs_db, struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params);
+void cl_wrs_tables_build(struct cl_hw *cl_hw, struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params);
+u16 cl_wrs_tables_find_rate_idx(struct cl_wrs_params *wrs_params,
+ u8 bw, u8 nss, u8 mcs, u8 gi);
+void cl_wrs_init(struct cl_hw *cl_hw);
+void cl_wrs_lock_bh(struct cl_wrs_db *wrs_db);
+void cl_wrs_unlock_bh(struct cl_wrs_db *wrs_db);
+void cl_wrs_lock(struct cl_wrs_db *wrs_db);
+void cl_wrs_unlock(struct cl_wrs_db *wrs_db);
+void cl_wrs_fixed_rate_set(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params,
+ u8 is_fixed_rate, u8 mode, u8 bw, u8 nss, u8 mcs, u8 gi, bool mu_valid);
+void cl_wrs_rate_param_sync(struct cl_wrs_db *wrs_db, struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params);
+void cl_wrs_rate_params_update(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params,
+ u16 new_rate_idx, bool is_sync_required, bool mu_valid);
+void cl_wrs_decision_make(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params,
+ enum cl_wrs_decision decision, u16 new_rate_idx);
+void cl_wrs_decision_update(struct cl_wrs_db *wrs_db, struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params, enum cl_wrs_decision decision,
+ u16 new_rate_idx);
+void cl_wrs_quick_down_check(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params);
+bool cl_wrs_up_mcs1(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params);
+void cl_wrs_rate_param_set(struct cl_hw *cl_hw, struct cl_wrs_sta *wrs_sta,
+ struct cl_wrs_params *wrs_params,
+ struct cl_wrs_rate_params *rate_params,
+ struct cl_wrs_rate *rate_fallback,
+ bool mu_mimo_valid, bool set_su);
+s8 cl_wrs_rssi_eq_calc(struct cl_hw *cl_hw, struct cl_wrs_sta *wrs_sta,
+ bool read_clear, s8 *sorted_rssi);
+void cl_wrs_cntrs_reset(struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params);
+struct cl_wrs_info *cl_wrs_info_get(struct cl_sta *cl_sta, u8 type);
+struct cl_wrs_params *cl_wrs_params_get(struct cl_wrs_sta *wrs_sta, u8 type);
+void cl_wrs_update_rx_rate(struct cl_hw *cl_hw, struct cl_sta *cl_sta, struct hw_rxhdr *rxhdr);
+bool cl_wrs_set_rate_idle(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db,
+ struct cl_wrs_sta *wrs_sta, struct cl_wrs_params *wrs_params);
+struct cl_wrs_rate_params *cl_wrs_rx_rate_get(struct cl_sta *cl_sta);
+void cl_wrs_rx_rate_idle_reset(struct cl_wrs_params *rx_params);
+void cl_wrs_ap_capab_set(struct cl_hw *cl_hw, u8 bw, u8 use_sgi);
+void cl_wrs_ap_capab_modify_bw(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db, u8 max_bw);
+void cl_wrs_ap_capab_modify_gi(struct cl_hw *cl_hw, struct cl_wrs_db *wrs_db, u8 use_sgi);
+void cl_wrs_ap_capab_update(struct cl_hw *cl_hw, u8 bw, u8 use_sgi);
+
+/* Driver --> WRS */
+void cl_wrs_api_init(struct cl_hw *cl_hw);
+void cl_wrs_api_close(struct cl_hw *cl_hw);
+void cl_wrs_api_sta_add(struct cl_hw *cl_hw, struct ieee80211_sta *sta);
+void cl_wrs_api_sta_remove(struct cl_hw *cl_hw, struct cl_sta *cl_sta);
+void cl_wrs_api_bss_set_bw(struct cl_hw *cl_hw, u8 bw);
+void cl_wrs_api_bss_set_sgi(struct cl_hw *cl_hw, u8 use_sgi);
+bool cl_wrs_api_bss_is_sgi_en(struct cl_hw *cl_hw);
+void cl_wrs_api_nss_or_bw_changed(struct cl_hw *cl_hw, struct ieee80211_sta *sta, u8 nss, u8 bw);
+void cl_wrs_api_he_minrate_changed(struct cl_sta *cl_sta, u8 he_minrate);
+void cl_wrs_api_recovery(struct cl_hw *cl_hw);
+void cl_wrs_api_beamforming_sync(struct cl_hw *cl_hw, struct cl_sta *cl_sta);
+void cl_wrs_api_quick_down_check(struct cl_hw *cl_hw, struct cl_sta *cl_sta,
+ struct cl_wrs_params *wrs_params);
+void cl_wrs_api_rate_sync(struct cl_hw *cl_hw, struct cl_sta *cl_sta,
+ struct cl_wrs_params *wrs_params);
+bool cl_wrs_api_up_mcs1(struct cl_hw *cl_hw, struct cl_sta *cl_sta,
+ struct cl_wrs_params *wrs_params);
+void cl_wrs_api_set_smps_mode(struct cl_hw *cl_hw, struct ieee80211_sta *sta, const u8 bw);
+u16 cl_wrs_api_get_tx_sta_data_rate(struct cl_sta *cl_sta);
+void cl_wrs_api_bss_capab_update(struct cl_hw *cl_hw, u8 bw, u8 use_sgi);
+void cl_wrs_fill_sinfo_rates(struct rate_info *rate_info,
+ const struct cl_wrs_params *wrs_params,
+ const struct cl_sta *sta);
+
+#endif /* CL_WRS_H */