| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * 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. |
|---|
| 20 | 5 | * |
|---|
| 21 | 6 | * Contact Information: |
|---|
| 22 | 7 | * Intel Linux Wireless <ilw@linux.intel.com> |
|---|
| .. | .. |
|---|
| 157 | 142 | } |
|---|
| 158 | 143 | #endif |
|---|
| 159 | 144 | |
|---|
| 160 | | -/** |
|---|
| 145 | +/* |
|---|
| 161 | 146 | * The following tables contain the expected throughput metrics for all rates |
|---|
| 162 | 147 | * |
|---|
| 163 | 148 | * 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 60 MBits |
|---|
| .. | .. |
|---|
| 408 | 393 | return 0; |
|---|
| 409 | 394 | } |
|---|
| 410 | 395 | |
|---|
| 411 | | -/** |
|---|
| 396 | +/* |
|---|
| 412 | 397 | * il4965_rs_collect_tx_data - Update the success/failure sliding win |
|---|
| 413 | 398 | * |
|---|
| 414 | 399 | * We keep a sliding win of the last 62 packets transmitted |
|---|
| .. | .. |
|---|
| 635 | 620 | return 1; |
|---|
| 636 | 621 | } |
|---|
| 637 | 622 | |
|---|
| 638 | | -/** |
|---|
| 623 | +/* |
|---|
| 639 | 624 | * Green-field mode is valid if the station supports it and |
|---|
| 640 | 625 | * there are no non-GF stations present in the BSS. |
|---|
| 641 | 626 | */ |
|---|
| .. | .. |
|---|
| 646 | 631 | !il->ht.non_gf_sta_present; |
|---|
| 647 | 632 | } |
|---|
| 648 | 633 | |
|---|
| 649 | | -/** |
|---|
| 634 | +/* |
|---|
| 650 | 635 | * il4965_rs_get_supported_rates - get the available rates |
|---|
| 651 | 636 | * |
|---|
| 652 | 637 | * if management frame or broadcast frame only return |
|---|
| .. | .. |
|---|
| 1764 | 1749 | u8 done_search = 0; |
|---|
| 1765 | 1750 | u16 high_low; |
|---|
| 1766 | 1751 | s32 sr; |
|---|
| 1767 | | - u8 tid = MAX_TID_COUNT; |
|---|
| 1752 | + u8 tid; |
|---|
| 1768 | 1753 | struct il_tid_data *tid_data; |
|---|
| 1769 | 1754 | |
|---|
| 1770 | 1755 | D_RATE("rate scale calculate new rate for skb\n"); |
|---|
| .. | .. |
|---|
| 2129 | 2114 | lq_sta->last_txrate_idx = i; |
|---|
| 2130 | 2115 | } |
|---|
| 2131 | 2116 | |
|---|
| 2132 | | -/** |
|---|
| 2117 | +/* |
|---|
| 2133 | 2118 | * il4965_rs_initialize_lq - Initialize a station's hardware rate table |
|---|
| 2134 | 2119 | * |
|---|
| 2135 | 2120 | * The uCode's station table contains a table of fallback rates |
|---|
| .. | .. |
|---|
| 2223 | 2208 | D_RATE("Rate scaling not initialized yet.\n"); |
|---|
| 2224 | 2209 | il_sta = NULL; |
|---|
| 2225 | 2210 | } |
|---|
| 2226 | | - |
|---|
| 2227 | | - /* Send management frames and NO_ACK data using lowest rate. */ |
|---|
| 2228 | | - if (rate_control_send_low(sta, il_sta, txrc)) |
|---|
| 2229 | | - return; |
|---|
| 2230 | 2211 | |
|---|
| 2231 | 2212 | if (!lq_sta) |
|---|
| 2232 | 2213 | return; |
|---|
| .. | .. |
|---|
| 2422 | 2403 | /* Repeat initial/next rate. |
|---|
| 2423 | 2404 | * For legacy IL_NUMBER_TRY == 1, this loop will not execute. |
|---|
| 2424 | 2405 | * 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)) { |
|---|
| 2426 | 2407 | if (is_legacy(tbl_type.lq_type)) { |
|---|
| 2427 | 2408 | if (ant_toggle_cnt < NUM_TRY_BEFORE_ANT_TOGGLE) |
|---|
| 2428 | 2409 | ant_toggle_cnt++; |
|---|
| .. | .. |
|---|
| 2493 | 2474 | } |
|---|
| 2494 | 2475 | |
|---|
| 2495 | 2476 | static void * |
|---|
| 2496 | | -il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
|---|
| 2477 | +il4965_rs_alloc(struct ieee80211_hw *hw) |
|---|
| 2497 | 2478 | { |
|---|
| 2498 | 2479 | return hw->priv; |
|---|
| 2499 | 2480 | } |
|---|
| .. | .. |
|---|
| 2767 | 2748 | il4965_rs_add_debugfs(void *il, void *il_sta, struct dentry *dir) |
|---|
| 2768 | 2749 | { |
|---|
| 2769 | 2750 | 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); |
|---|
| 2782 | 2751 | |
|---|
| 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); |
|---|
| 2793 | 2760 | } |
|---|
| 2794 | 2761 | #endif |
|---|
| 2795 | 2762 | |
|---|
| .. | .. |
|---|
| 2816 | 2783 | .free_sta = il4965_rs_free_sta, |
|---|
| 2817 | 2784 | #ifdef CONFIG_MAC80211_DEBUGFS |
|---|
| 2818 | 2785 | .add_sta_debugfs = il4965_rs_add_debugfs, |
|---|
| 2819 | | - .remove_sta_debugfs = il4965_rs_remove_debugfs, |
|---|
| 2820 | 2786 | #endif |
|---|
| 2821 | 2787 | }; |
|---|
| 2822 | 2788 | |
|---|