hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/intel/iwlegacy/4965-rs.c
....@@ -1,22 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /******************************************************************************
23 *
34 * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of version 2 of the GNU General Public License as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, write to the Free Software Foundation, Inc.,
16
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17
- *
18
- * The full GNU General Public License is included in this distribution in the
19
- * file called LICENSE.
205 *
216 * Contact Information:
227 * Intel Linux Wireless <ilw@linux.intel.com>
....@@ -157,7 +142,7 @@
157142 }
158143 #endif
159144
160
-/**
145
+/*
161146 * The following tables contain the expected throughput metrics for all rates
162147 *
163148 * 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 60 MBits
....@@ -408,7 +393,7 @@
408393 return 0;
409394 }
410395
411
-/**
396
+/*
412397 * il4965_rs_collect_tx_data - Update the success/failure sliding win
413398 *
414399 * We keep a sliding win of the last 62 packets transmitted
....@@ -635,7 +620,7 @@
635620 return 1;
636621 }
637622
638
-/**
623
+/*
639624 * Green-field mode is valid if the station supports it and
640625 * there are no non-GF stations present in the BSS.
641626 */
....@@ -646,7 +631,7 @@
646631 !il->ht.non_gf_sta_present;
647632 }
648633
649
-/**
634
+/*
650635 * il4965_rs_get_supported_rates - get the available rates
651636 *
652637 * if management frame or broadcast frame only return
....@@ -1764,7 +1749,7 @@
17641749 u8 done_search = 0;
17651750 u16 high_low;
17661751 s32 sr;
1767
- u8 tid = MAX_TID_COUNT;
1752
+ u8 tid;
17681753 struct il_tid_data *tid_data;
17691754
17701755 D_RATE("rate scale calculate new rate for skb\n");
....@@ -2129,7 +2114,7 @@
21292114 lq_sta->last_txrate_idx = i;
21302115 }
21312116
2132
-/**
2117
+/*
21332118 * il4965_rs_initialize_lq - Initialize a station's hardware rate table
21342119 *
21352120 * The uCode's station table contains a table of fallback rates
....@@ -2223,10 +2208,6 @@
22232208 D_RATE("Rate scaling not initialized yet.\n");
22242209 il_sta = NULL;
22252210 }
2226
-
2227
- /* Send management frames and NO_ACK data using lowest rate. */
2228
- if (rate_control_send_low(sta, il_sta, txrc))
2229
- return;
22302211
22312212 if (!lq_sta)
22322213 return;
....@@ -2422,7 +2403,7 @@
24222403 /* Repeat initial/next rate.
24232404 * For legacy IL_NUMBER_TRY == 1, this loop will not execute.
24242405 * For HT IL_HT_NUMBER_TRY == 3, this executes twice. */
2425
- while (repeat_rate > 0 && idx < LINK_QUAL_MAX_RETRY_NUM) {
2406
+ while (repeat_rate > 0 && idx < (LINK_QUAL_MAX_RETRY_NUM - 1)) {
24262407 if (is_legacy(tbl_type.lq_type)) {
24272408 if (ant_toggle_cnt < NUM_TRY_BEFORE_ANT_TOGGLE)
24282409 ant_toggle_cnt++;
....@@ -2493,7 +2474,7 @@
24932474 }
24942475
24952476 static void *
2496
-il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
2477
+il4965_rs_alloc(struct ieee80211_hw *hw)
24972478 {
24982479 return hw->priv;
24992480 }
....@@ -2767,29 +2748,15 @@
27672748 il4965_rs_add_debugfs(void *il, void *il_sta, struct dentry *dir)
27682749 {
27692750 struct il_lq_sta *lq_sta = il_sta;
2770
- lq_sta->rs_sta_dbgfs_scale_table_file =
2771
- debugfs_create_file("rate_scale_table", 0600, dir,
2772
- lq_sta, &rs_sta_dbgfs_scale_table_ops);
2773
- lq_sta->rs_sta_dbgfs_stats_table_file =
2774
- debugfs_create_file("rate_stats_table", 0400, dir, lq_sta,
2775
- &rs_sta_dbgfs_stats_table_ops);
2776
- lq_sta->rs_sta_dbgfs_rate_scale_data_file =
2777
- debugfs_create_file("rate_scale_data", 0400, dir, lq_sta,
2778
- &rs_sta_dbgfs_rate_scale_data_ops);
2779
- lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file =
2780
- debugfs_create_u8("tx_agg_tid_enable", 0600, dir,
2781
- &lq_sta->tx_agg_tid_en);
27822751
2783
-}
2784
-
2785
-static void
2786
-il4965_rs_remove_debugfs(void *il, void *il_sta)
2787
-{
2788
- struct il_lq_sta *lq_sta = il_sta;
2789
- debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file);
2790
- debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file);
2791
- debugfs_remove(lq_sta->rs_sta_dbgfs_rate_scale_data_file);
2792
- debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file);
2752
+ debugfs_create_file("rate_scale_table", 0600, dir, lq_sta,
2753
+ &rs_sta_dbgfs_scale_table_ops);
2754
+ debugfs_create_file("rate_stats_table", 0400, dir, lq_sta,
2755
+ &rs_sta_dbgfs_stats_table_ops);
2756
+ debugfs_create_file("rate_scale_data", 0400, dir, lq_sta,
2757
+ &rs_sta_dbgfs_rate_scale_data_ops);
2758
+ debugfs_create_u8("tx_agg_tid_enable", 0600, dir,
2759
+ &lq_sta->tx_agg_tid_en);
27932760 }
27942761 #endif
27952762
....@@ -2816,7 +2783,6 @@
28162783 .free_sta = il4965_rs_free_sta,
28172784 #ifdef CONFIG_MAC80211_DEBUGFS
28182785 .add_sta_debugfs = il4965_rs_add_debugfs,
2819
- .remove_sta_debugfs = il4965_rs_remove_debugfs,
28202786 #endif
28212787 };
28222788