| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright(c) 2005 - 2014 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. |
|---|
| 5 | + * Copyright (C) 2019 - 2020 Intel Corporation |
|---|
| 20 | 6 | * |
|---|
| 21 | 7 | * Contact Information: |
|---|
| 22 | 8 | * Intel Linux Wireless <linuxwifi@intel.com> |
|---|
| .. | .. |
|---|
| 165 | 151 | {} |
|---|
| 166 | 152 | #endif |
|---|
| 167 | 153 | |
|---|
| 168 | | -/** |
|---|
| 154 | +/* |
|---|
| 169 | 155 | * The following tables contain the expected throughput metrics for all rates |
|---|
| 170 | 156 | * |
|---|
| 171 | 157 | * 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 60 MBits |
|---|
| .. | .. |
|---|
| 332 | 318 | } |
|---|
| 333 | 319 | |
|---|
| 334 | 320 | #ifdef CONFIG_MAC80211_DEBUGFS |
|---|
| 335 | | -/** |
|---|
| 321 | +/* |
|---|
| 336 | 322 | * Program the device to use fixed rate for frame transmit |
|---|
| 337 | 323 | * This is for debugging/testing only |
|---|
| 338 | 324 | * once the device start use fixed rate, we need to reload the module |
|---|
| .. | .. |
|---|
| 454 | 440 | return 0; |
|---|
| 455 | 441 | } |
|---|
| 456 | 442 | |
|---|
| 457 | | -/** |
|---|
| 443 | +/* |
|---|
| 458 | 444 | * rs_collect_tx_data - Update the success/failure sliding window |
|---|
| 459 | 445 | * |
|---|
| 460 | 446 | * We keep a sliding window of the last 62 packets transmitted |
|---|
| .. | .. |
|---|
| 687 | 673 | return 1; |
|---|
| 688 | 674 | } |
|---|
| 689 | 675 | |
|---|
| 690 | | -/** |
|---|
| 676 | +/* |
|---|
| 691 | 677 | * Green-field mode is valid if the station supports it and |
|---|
| 692 | 678 | * there are no non-GF stations present in the BSS. |
|---|
| 693 | 679 | */ |
|---|
| .. | .. |
|---|
| 703 | 689 | return false; |
|---|
| 704 | 690 | } |
|---|
| 705 | 691 | |
|---|
| 706 | | -/** |
|---|
| 692 | +/* |
|---|
| 707 | 693 | * rs_get_supported_rates - get the available rates |
|---|
| 708 | 694 | * |
|---|
| 709 | 695 | * if management frame or broadcast frame only return |
|---|
| .. | .. |
|---|
| 861 | 847 | struct iwl_scale_tbl_info *tbl; |
|---|
| 862 | 848 | bool full_concurrent = priv->bt_full_concurrent; |
|---|
| 863 | 849 | |
|---|
| 864 | | - if (priv->bt_ant_couple_ok) { |
|---|
| 865 | | - /* |
|---|
| 866 | | - * Is there a need to switch between |
|---|
| 867 | | - * full concurrency and 3-wire? |
|---|
| 868 | | - */ |
|---|
| 869 | | - if (priv->bt_ci_compliance && priv->bt_ant_couple_ok) |
|---|
| 870 | | - full_concurrent = true; |
|---|
| 871 | | - else |
|---|
| 872 | | - full_concurrent = false; |
|---|
| 873 | | - } |
|---|
| 874 | 850 | if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || |
|---|
| 875 | 851 | (priv->bt_full_concurrent != full_concurrent)) { |
|---|
| 876 | 852 | priv->bt_full_concurrent = full_concurrent; |
|---|
| .. | .. |
|---|
| 2636 | 2612 | lq_sta->last_txrate_idx = index; |
|---|
| 2637 | 2613 | } |
|---|
| 2638 | 2614 | |
|---|
| 2639 | | -/** |
|---|
| 2615 | +/* |
|---|
| 2640 | 2616 | * rs_initialize_lq - Initialize a station's hardware rate table |
|---|
| 2641 | 2617 | * |
|---|
| 2642 | 2618 | * The uCode's station table contains a table of fallback rates |
|---|
| .. | .. |
|---|
| 2734 | 2710 | IWL_DEBUG_RATE(priv, "Rate scaling not initialized yet.\n"); |
|---|
| 2735 | 2711 | priv_sta = NULL; |
|---|
| 2736 | 2712 | } |
|---|
| 2737 | | - |
|---|
| 2738 | | - /* Send management frames and NO_ACK data using lowest rate. */ |
|---|
| 2739 | | - if (rate_control_send_low(sta, priv_sta, txrc)) |
|---|
| 2740 | | - return; |
|---|
| 2741 | 2713 | |
|---|
| 2742 | 2714 | rate_idx = lq_sta->last_txrate_idx; |
|---|
| 2743 | 2715 | |
|---|
| .. | .. |
|---|
| 3038 | 3010 | cpu_to_le16(priv->lib->bt_params->agg_time_limit); |
|---|
| 3039 | 3011 | } |
|---|
| 3040 | 3012 | |
|---|
| 3041 | | -static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
|---|
| 3013 | +static void *rs_alloc(struct ieee80211_hw *hw) |
|---|
| 3042 | 3014 | { |
|---|
| 3043 | 3015 | return hw->priv; |
|---|
| 3044 | 3016 | } |
|---|
| .. | .. |
|---|
| 3275 | 3247 | struct dentry *dir) |
|---|
| 3276 | 3248 | { |
|---|
| 3277 | 3249 | struct iwl_lq_sta *lq_sta = priv_sta; |
|---|
| 3278 | | - lq_sta->rs_sta_dbgfs_scale_table_file = |
|---|
| 3279 | | - debugfs_create_file("rate_scale_table", 0600, dir, |
|---|
| 3280 | | - lq_sta, &rs_sta_dbgfs_scale_table_ops); |
|---|
| 3281 | | - lq_sta->rs_sta_dbgfs_stats_table_file = |
|---|
| 3282 | | - debugfs_create_file("rate_stats_table", 0400, dir, |
|---|
| 3283 | | - lq_sta, &rs_sta_dbgfs_stats_table_ops); |
|---|
| 3284 | | - lq_sta->rs_sta_dbgfs_rate_scale_data_file = |
|---|
| 3285 | | - debugfs_create_file("rate_scale_data", 0400, dir, |
|---|
| 3286 | | - lq_sta, &rs_sta_dbgfs_rate_scale_data_ops); |
|---|
| 3287 | | - lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file = |
|---|
| 3288 | | - debugfs_create_u8("tx_agg_tid_enable", 0600, dir, |
|---|
| 3289 | | - &lq_sta->tx_agg_tid_en); |
|---|
| 3290 | 3250 | |
|---|
| 3291 | | -} |
|---|
| 3251 | + debugfs_create_file("rate_scale_table", 0600, dir, lq_sta, |
|---|
| 3252 | + &rs_sta_dbgfs_scale_table_ops); |
|---|
| 3253 | + debugfs_create_file("rate_stats_table", 0400, dir, lq_sta, |
|---|
| 3254 | + &rs_sta_dbgfs_stats_table_ops); |
|---|
| 3255 | + debugfs_create_file("rate_scale_data", 0400, dir, lq_sta, |
|---|
| 3256 | + &rs_sta_dbgfs_rate_scale_data_ops); |
|---|
| 3257 | + debugfs_create_u8("tx_agg_tid_enable", 0600, dir, |
|---|
| 3258 | + &lq_sta->tx_agg_tid_en); |
|---|
| 3292 | 3259 | |
|---|
| 3293 | | -static void rs_remove_debugfs(void *priv, void *priv_sta) |
|---|
| 3294 | | -{ |
|---|
| 3295 | | - struct iwl_lq_sta *lq_sta = priv_sta; |
|---|
| 3296 | | - debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file); |
|---|
| 3297 | | - debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); |
|---|
| 3298 | | - debugfs_remove(lq_sta->rs_sta_dbgfs_rate_scale_data_file); |
|---|
| 3299 | | - debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file); |
|---|
| 3300 | 3260 | } |
|---|
| 3301 | 3261 | #endif |
|---|
| 3302 | 3262 | |
|---|
| .. | .. |
|---|
| 3322 | 3282 | .free_sta = rs_free_sta, |
|---|
| 3323 | 3283 | #ifdef CONFIG_MAC80211_DEBUGFS |
|---|
| 3324 | 3284 | .add_sta_debugfs = rs_add_debugfs, |
|---|
| 3325 | | - .remove_sta_debugfs = rs_remove_debugfs, |
|---|
| 3326 | 3285 | #endif |
|---|
| 3327 | 3286 | }; |
|---|
| 3328 | 3287 | |
|---|