Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'iwlwifi-next-for-kalle-2020-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Second set of iwlwifi patches intended for v5.8

* Support new FW APIs;
* Remove some old and unused features;
* HW configuration rework continues;
* Some queues rework by Johannes;
* Enable A-AMSDU in low latency;
* Some debugging fixes;
* Some other small fixes and clean-ups;

# gpg: Signature made Fri 08 May 2020 10:08:58 AM EEST using RSA key ID 1A3CC5FA
# gpg: Good signature from "Luciano Roth Coelho (Luca) <luca@coelho.fi>"
# gpg: aka "Luciano Roth Coelho (Intel) <luciano.coelho@intel.com>"

+761 -475
+47 -57
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2015-2017 Intel Deutschland GmbH 9 - * Copyright (C) 2018-2019 Intel Corporation 9 + * Copyright (C) 2018-2020 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 20 20 * BSD LICENSE 21 21 * 22 22 * Copyright(c) 2015-2017 Intel Deutschland GmbH 23 - * Copyright (C) 2018-2019 Intel Corporation 23 + * Copyright (C) 2018-2020 Intel Corporation 24 24 * All rights reserved. 25 25 * 26 26 * Redistribution and use in source and binary forms, with or without ··· 57 57 #include "iwl-prph.h" 58 58 59 59 /* Highest firmware API version supported */ 60 - #define IWL_22000_UCODE_API_MAX 53 60 + #define IWL_22000_UCODE_API_MAX 55 61 61 62 62 /* Lowest firmware API version supported */ 63 63 #define IWL_22000_UCODE_API_MIN 39 ··· 73 73 #define IWL_22000_SMEM_OFFSET 0x400000 74 74 #define IWL_22000_SMEM_LEN 0xD0000 75 75 76 - #define IWL_22000_JF_FW_PRE "iwlwifi-Qu-a0-jf-b0-" 77 - #define IWL_22000_HR_FW_PRE "iwlwifi-Qu-a0-hr-a0-" 78 - #define IWL_22000_HR_CDB_FW_PRE "iwlwifi-QuIcp-z0-hrcdb-a0-" 79 - #define IWL_22000_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-" 80 - #define IWL_22000_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-" 76 + #define IWL_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-" 77 + #define IWL_QNJ_B_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-" 81 78 #define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0-" 82 79 #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-" 83 80 #define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0-" ··· 82 85 #define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0-" 83 86 #define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-" 84 87 #define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-" 85 - #define IWL_22000_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-" 86 - #define IWL_22000_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0-" 87 - #define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-" 88 - #define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-" 89 - #define IWL_22000_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-" 88 + #define IWL_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-" 89 + #define IWL_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0-" 90 + #define IWL_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-" 91 + #define IWL_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-" 92 + #define IWL_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-" 90 93 #define IWL_SNJ_A_GF4_A_FW_PRE "iwlwifi-SoSnj-a0-gf4-a0-" 91 94 #define IWL_SNJ_A_GF_A_FW_PRE "iwlwifi-SoSnj-a0-gf-a0-" 92 95 93 - #define IWL_22000_HR_MODULE_FIRMWARE(api) \ 94 - IWL_22000_HR_FW_PRE __stringify(api) ".ucode" 95 - #define IWL_22000_JF_MODULE_FIRMWARE(api) \ 96 - IWL_22000_JF_FW_PRE __stringify(api) ".ucode" 97 - #define IWL_22000_QU_B_HR_B_MODULE_FIRMWARE(api) \ 98 - IWL_22000_QU_B_HR_B_FW_PRE __stringify(api) ".ucode" 99 - #define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(api) \ 100 - IWL_22000_HR_B_FW_PRE __stringify(api) ".ucode" 96 + #define IWL_QU_B_HR_B_MODULE_FIRMWARE(api) \ 97 + IWL_QU_B_HR_B_FW_PRE __stringify(api) ".ucode" 98 + #define IWL_QNJ_B_HR_B_MODULE_FIRMWARE(api) \ 99 + IWL_QNJ_B_HR_B_FW_PRE __stringify(api) ".ucode" 101 100 #define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \ 102 101 IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode" 103 102 #define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \ ··· 106 113 IWL_QNJ_B_JF_B_FW_PRE __stringify(api) ".ucode" 107 114 #define IWL_CC_A_MODULE_FIRMWARE(api) \ 108 115 IWL_CC_A_FW_PRE __stringify(api) ".ucode" 109 - #define IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(api) \ 110 - IWL_22000_SO_A_JF_B_FW_PRE __stringify(api) ".ucode" 111 - #define IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(api) \ 112 - IWL_22000_SO_A_HR_B_FW_PRE __stringify(api) ".ucode" 113 - #define IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(api) \ 114 - IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode" 115 - #define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(api) \ 116 - IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode" 116 + #define IWL_SO_A_JF_B_MODULE_FIRMWARE(api) \ 117 + IWL_SO_A_JF_B_FW_PRE __stringify(api) ".ucode" 118 + #define IWL_SO_A_HR_B_MODULE_FIRMWARE(api) \ 119 + IWL_SO_A_HR_B_FW_PRE __stringify(api) ".ucode" 120 + #define IWL_SO_A_GF_A_MODULE_FIRMWARE(api) \ 121 + IWL_SO_A_GF_A_FW_PRE __stringify(api) ".ucode" 122 + #define IWL_TY_A_GF_A_MODULE_FIRMWARE(api) \ 123 + IWL_TY_A_GF_A_FW_PRE __stringify(api) ".ucode" 117 124 #define IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(api) \ 118 125 IWL_SNJ_A_GF4_A_FW_PRE __stringify(api) ".ucode" 119 126 #define IWL_SNJ_A_GF_A_MODULE_FIRMWARE(api) \ ··· 211 218 .trans.base_params = &iwl_ax210_base_params, \ 212 219 .min_txq_size = 128, \ 213 220 .gp2_reg_addr = 0xd02c68, \ 214 - .min_256_ba_txq_size = 512, \ 221 + .min_256_ba_txq_size = 1024, \ 215 222 .mon_dram_regs = { \ 216 223 .write_ptr = { \ 217 224 .addr = DBGC_CUR_DBGBUF_STATUS, \ ··· 336 343 }; 337 344 338 345 const char iwl_ax200_name[] = "Intel(R) Wi-Fi 6 AX200 160MHz"; 346 + const char iwl_ax201_name[] = "Intel(R) Wi-Fi 6 AX201 160MHz"; 347 + const char iwl_ax101_name[] = "Intel(R) Wi-Fi 6 AX101"; 339 348 340 349 const char iwl_ax200_killer_1650w_name[] = 341 350 "Killer(R) Wi-Fi 6 AX1650w 160MHz Wireless Network Adapter (200D2W)"; 342 351 const char iwl_ax200_killer_1650x_name[] = 343 352 "Killer(R) Wi-Fi 6 AX1650x 160MHz Wireless Network Adapter (200NGW)"; 344 353 345 - const struct iwl_cfg iwl_ax101_cfg_qu_hr = { 346 - .name = "Intel(R) Wi-Fi 6 AX101", 347 - .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 354 + const struct iwl_cfg iwl_qu_b0_hr1_b0 = { 355 + .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 348 356 IWL_DEVICE_22500, 349 357 /* 350 358 * This device doesn't support receiving BlockAck with a large bitmap ··· 359 365 360 366 const struct iwl_cfg iwl_ax201_cfg_qu_hr = { 361 367 .name = "Intel(R) Wi-Fi 6 AX201 160MHz", 362 - .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 368 + .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 363 369 IWL_DEVICE_22500, 364 370 /* 365 371 * This device doesn't support receiving BlockAck with a large bitmap ··· 370 376 .num_rbds = IWL_NUM_RBDS_22000_HE, 371 377 }; 372 378 373 - const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0 = { 374 - .name = "Intel(R) Wi-Fi 6 AX101", 379 + const struct iwl_cfg iwl_qu_c0_hr1_b0 = { 375 380 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 376 381 IWL_DEVICE_22500, 377 382 /* ··· 396 403 .num_rbds = IWL_NUM_RBDS_22000_HE, 397 404 }; 398 405 399 - const struct iwl_cfg iwl_ax101_cfg_quz_hr = { 400 - .name = "Intel(R) Wi-Fi 6 AX101", 406 + const struct iwl_cfg iwl_quz_a0_hr1_b0 = { 401 407 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 402 408 IWL_DEVICE_22500, 403 409 /* ··· 462 470 463 471 const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0 = { 464 472 .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)", 465 - .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 473 + .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 466 474 IWL_DEVICE_22500, 467 475 /* 468 476 * This device doesn't support receiving BlockAck with a large bitmap ··· 475 483 476 484 const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0 = { 477 485 .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)", 478 - .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 486 + .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 479 487 IWL_DEVICE_22500, 480 488 /* 481 489 * This device doesn't support receiving BlockAck with a large bitmap ··· 512 520 .num_rbds = IWL_NUM_RBDS_22000_HE, 513 521 }; 514 522 515 - const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0 = { 516 - .name = "Intel(R) Dual Band Wireless AX 22000", 517 - .fw_name_pre = IWL_22000_HR_B_FW_PRE, 523 + const struct iwl_cfg iwl_qnj_b0_hr_b0_cfg = { 524 + .fw_name_pre = IWL_QNJ_B_HR_B_FW_PRE, 518 525 IWL_DEVICE_22500, 519 526 /* 520 527 * This device doesn't support receiving BlockAck with a large bitmap ··· 526 535 527 536 const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = { 528 537 .name = "Intel(R) Wireless-AC 9560 160MHz", 529 - .fw_name_pre = IWL_22000_SO_A_JF_B_FW_PRE, 538 + .fw_name_pre = IWL_SO_A_JF_B_FW_PRE, 530 539 IWL_DEVICE_AX210, 531 540 .num_rbds = IWL_NUM_RBDS_NON_HE, 532 541 }; 533 542 534 543 const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = { 535 544 .name = "Intel(R) Wi-Fi 6 AX210 160MHz", 536 - .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE, 545 + .fw_name_pre = IWL_SO_A_HR_B_FW_PRE, 537 546 IWL_DEVICE_AX210, 538 547 .num_rbds = IWL_NUM_RBDS_AX210_HE, 539 548 }; 540 549 541 550 const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = { 542 551 .name = "Intel(R) Wi-Fi 6 AX211 160MHz", 543 - .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, 552 + .fw_name_pre = IWL_SO_A_GF_A_FW_PRE, 544 553 .uhb_supported = true, 545 554 IWL_DEVICE_AX210, 546 555 .num_rbds = IWL_NUM_RBDS_AX210_HE, ··· 548 557 549 558 const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0_long = { 550 559 .name = "Intel(R) Wi-Fi 6 AX211 160MHz", 551 - .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, 560 + .fw_name_pre = IWL_SO_A_GF_A_FW_PRE, 552 561 .uhb_supported = true, 553 562 IWL_DEVICE_AX210, 554 563 .num_rbds = IWL_NUM_RBDS_AX210_HE, ··· 558 567 559 568 const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { 560 569 .name = "Intel(R) Wi-Fi 6 AX210 160MHz", 561 - .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE, 570 + .fw_name_pre = IWL_TY_A_GF_A_FW_PRE, 562 571 .uhb_supported = true, 563 572 IWL_DEVICE_AX210, 564 573 .num_rbds = IWL_NUM_RBDS_AX210_HE, ··· 566 575 567 576 const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = { 568 577 .name = "Intel(R) Wi-Fi 6 AX411 160MHz", 569 - .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, 578 + .fw_name_pre = IWL_SO_A_GF4_A_FW_PRE, 570 579 .uhb_supported = true, 571 580 IWL_DEVICE_AX210, 572 581 .num_rbds = IWL_NUM_RBDS_AX210_HE, ··· 574 583 575 584 const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long = { 576 585 .name = "Intel(R) Wi-Fi 6 AX411 160MHz", 577 - .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, 586 + .fw_name_pre = IWL_SO_A_GF4_A_FW_PRE, 578 587 .uhb_supported = true, 579 588 IWL_DEVICE_AX210, 580 589 .num_rbds = IWL_NUM_RBDS_AX210_HE, ··· 598 607 .num_rbds = IWL_NUM_RBDS_AX210_HE, 599 608 }; 600 609 601 - MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 602 - MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 603 - MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 610 + MODULE_FIRMWARE(IWL_QU_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 611 + MODULE_FIRMWARE(IWL_QNJ_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 604 612 MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 605 613 MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 606 614 MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 607 615 MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 608 616 MODULE_FIRMWARE(IWL_QNJ_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 609 617 MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 610 - MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 611 - MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 612 - MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 613 - MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 618 + MODULE_FIRMWARE(IWL_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 619 + MODULE_FIRMWARE(IWL_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 620 + MODULE_FIRMWARE(IWL_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 621 + MODULE_FIRMWARE(IWL_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 614 622 MODULE_FIRMWARE(IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 615 623 MODULE_FIRMWARE(IWL_SNJ_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
+1 -2
drivers/net/wireless/intel/iwlwifi/dvm/dev.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 /****************************************************************************** 3 3 * 4 - * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 + * Copyright(c) 2003 - 2014, 2020 Intel Corporation. All rights reserved. 5 5 * 6 6 * Contact Information: 7 7 * Intel Linux Wireless <linuxwifi@intel.com> ··· 810 810 u8 bt_traffic_load, last_bt_traffic_load; 811 811 bool bt_ch_announce; 812 812 bool bt_full_concurrent; 813 - bool bt_ant_couple_ok; 814 813 __le32 kill_ack_mask; 815 814 __le32 kill_cts_mask; 816 815 __le16 bt_valid;
+2 -9
drivers/net/wireless/intel/iwlwifi/dvm/main.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /****************************************************************************** 3 3 * 4 - * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 + * Copyright(c) 2003 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2015 Intel Deutschland GmbH 6 - * Copyright (C) 2018 - 2019 Intel Corporation 7 6 * 8 7 * Portions of this file are derived from the ipw3945 project, as well 9 8 * as portions of the ieee80211 subsystem header files. ··· 52 53 53 54 #define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link AGN driver for Linux" 54 55 MODULE_DESCRIPTION(DRV_DESCRIPTION); 55 - MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); 56 + MODULE_AUTHOR(DRV_AUTHOR); 56 57 MODULE_LICENSE("GPL"); 57 58 58 59 /* Please keep this array *SORTED* by hex value. ··· 1368 1369 iwl_option_config(priv); 1369 1370 1370 1371 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); 1371 - 1372 - /* is antenna coupling more than 35dB ? */ 1373 - priv->bt_ant_couple_ok = 1374 - (iwlwifi_mod_params.antenna_coupling > 1375 - IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? 1376 - true : false; 1377 1372 1378 1373 /* bt channel inhibition enabled*/ 1379 1374 priv->bt_ch_announce = true;
+1 -10
drivers/net/wireless/intel/iwlwifi/dvm/rs.c
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 5 + * Copyright (C) 2019 - 2020 Intel Corporation 5 6 * 6 7 * Contact Information: 7 8 * Intel Linux Wireless <linuxwifi@intel.com> ··· 847 846 struct iwl_scale_tbl_info *tbl; 848 847 bool full_concurrent = priv->bt_full_concurrent; 849 848 850 - if (priv->bt_ant_couple_ok) { 851 - /* 852 - * Is there a need to switch between 853 - * full concurrency and 3-wire? 854 - */ 855 - if (priv->bt_ci_compliance) 856 - full_concurrent = true; 857 - else 858 - full_concurrent = false; 859 - } 860 849 if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || 861 850 (priv->bt_full_concurrent != full_concurrent)) { 862 851 priv->bt_full_concurrent = full_concurrent;
+3 -2
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright (C) 2018 - 2019 Intel Corporation 8 + * Copyright (C) 2018 - 2020 Intel Corporation 9 9 * 10 10 * This program is free software; you can redistribute it and/or modify 11 11 * it under the terms of version 2 of the GNU General Public License as ··· 25 25 * 26 26 * BSD LICENSE 27 27 * 28 - * Copyright (C) 2018 - 2019 Intel Corporation 28 + * Copyright (C) 2018 - 2020 Intel Corporation 29 29 * All rights reserved. 30 30 * 31 31 * Redistribution and use in source and binary forms, with or without ··· 304 304 IWL_FW_INI_LOCATION_SRAM_PATH, 305 305 IWL_FW_INI_LOCATION_DRAM_PATH, 306 306 IWL_FW_INI_LOCATION_NPK_PATH, 307 + IWL_FW_INI_LOCATION_NUM, 307 308 }; /* FW_DEBUG_TLV_BUFFER_LOCATION_E_VER_1 */ 308 309 309 310 /**
+8 -6
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright (C) 2018 - 2019 Intel Corporation 33 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 216 218 * @page_buff_size: size of %page_buff_addr 217 219 * @lmac_num: number of LMACs (1 or 2) 218 220 * @lmac_smem: per - LMAC smem data 221 + * @rxfifo2_control_addr: start addr of RXF2C 222 + * @rxfifo2_control_size: size of RXF2C 219 223 */ 220 224 struct iwl_shared_mem_cfg { 221 225 __le32 shared_mem_addr; ··· 229 229 __le32 page_buff_addr; 230 230 __le32 page_buff_size; 231 231 __le32 lmac_num; 232 - struct iwl_shared_mem_lmac_cfg lmac_smem[2]; 233 - } __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */ 232 + struct iwl_shared_mem_lmac_cfg lmac_smem[3]; 233 + __le32 rxfifo2_control_addr; 234 + __le32 rxfifo2_control_size; 235 + } __packed; /* SHARED_MEM_ALLOC_API_S_VER_4 */ 234 236 235 237 /** 236 238 * struct iwl_mfuart_load_notif - mfuart image version & status
+101 -9
drivers/net/wireless/intel/iwlwifi/fw/api/location.h
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 9 - * Copyright (C) 2018 Intel Corporation 10 - * Copyright (C) 2019 Intel Corporation 9 + * Copyright (C) 2018 - 2020 Intel Corporation 11 10 * 12 11 * This program is free software; you can redistribute it and/or modify 13 12 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * BSD LICENSE 28 29 * 29 30 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 30 - * Copyright (C) 2018 Intel Corporation 31 - * Copyright (C) 2019 Intel Corporation 31 + * Copyright (C) 2018 - 2020 Intel Corporation 32 32 * All rights reserved. 33 33 * 34 34 * Redistribution and use in source and binary forms, with or without ··· 145 147 * @IWL_TOF_BW_40: 40 MHz 146 148 * @IWL_TOF_BW_80: 80 MHz 147 149 * @IWL_TOF_BW_160: 160 MHz 150 + * @IWL_TOF_BW_NUM: number of tof bandwidths 148 151 */ 149 152 enum iwl_tof_bandwidth { 150 153 IWL_TOF_BW_20_LEGACY, ··· 153 154 IWL_TOF_BW_40, 154 155 IWL_TOF_BW_80, 155 156 IWL_TOF_BW_160, 157 + IWL_TOF_BW_NUM, 156 158 }; /* LOCAT_BW_TYPE_E */ 157 159 158 160 /* ··· 430 430 * @IWL_INITIATOR_AP_FLAGS_NON_TB: Use non trigger based flow 431 431 * @IWL_INITIATOR_AP_FLAGS_TB: Use trigger based flow 432 432 * @IWL_INITIATOR_AP_FLAGS_SECURED: request secured measurement 433 + * @IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK: Send LMR feedback 434 + * @IWL_INITIATOR_AP_FLAGS_USE_CALIB: Use calibration values from the request 435 + * instead of fw internal values. 433 436 */ 434 437 enum iwl_initiator_ap_flags { 435 438 IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1), ··· 445 442 IWL_INITIATOR_AP_FLAGS_NON_TB = BIT(9), 446 443 IWL_INITIATOR_AP_FLAGS_TB = BIT(10), 447 444 IWL_INITIATOR_AP_FLAGS_SECURED = BIT(11), 445 + IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK = BIT(12), 446 + IWL_INITIATOR_AP_FLAGS_USE_CALIB = BIT(13), 448 447 }; 449 448 450 449 /** ··· 513 508 #define LOCATION_BW_POS 4 514 509 515 510 /** 516 - * struct iwl_tof_range_req_ap_entry - AP configuration parameters 511 + * struct iwl_tof_range_req_ap_entry_v4 - AP configuration parameters 517 512 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags. 518 513 * @channel_num: AP Channel number 519 514 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. ··· 532 527 * @hltk: HLTK to be used for secured 11az measurement 533 528 * @tk: TK to be used for secured 11az measurement 534 529 */ 535 - struct iwl_tof_range_req_ap_entry { 530 + struct iwl_tof_range_req_ap_entry_v4 { 536 531 __le32 initiator_ap_flags; 537 532 u8 channel_num; 538 533 u8 format_bw; ··· 546 541 u8 hltk[HLTK_11AZ_LEN]; 547 542 u8 tk[TK_11AZ_LEN]; 548 543 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_4 */ 544 + 545 + /** 546 + * enum iwl_location_cipher - location cipher selection 547 + * @IWL_LOCATION_CIPHER_CCMP_128: CCMP 128 548 + * @IWL_LOCATION_CIPHER_CCMP_256: CCMP 256 549 + * @IWL_LOCATION_CIPHER_GCMP_128: GCMP 128 550 + * @IWL_LOCATION_CIPHER_GCMP_256: GCMP 256 551 + */ 552 + enum iwl_location_cipher { 553 + IWL_LOCATION_CIPHER_CCMP_128, 554 + IWL_LOCATION_CIPHER_CCMP_256, 555 + IWL_LOCATION_CIPHER_GCMP_128, 556 + IWL_LOCATION_CIPHER_GCMP_256, 557 + }; 558 + 559 + /** 560 + * struct iwl_tof_range_req_ap_entry - AP configuration parameters 561 + * @initiator_ap_flags: see &enum iwl_initiator_ap_flags. 562 + * @channel_num: AP Channel number 563 + * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. 564 + * bits 4 - 7: &enum iwl_location_bw. 565 + * @ctrl_ch_position: Coding of the control channel position relative to the 566 + * center frequency, see iwl_mvm_get_ctrl_pos(). 567 + * @ftmr_max_retries: Max number of retries to send the FTMR in case of no 568 + * reply from the AP. 569 + * @bssid: AP's BSSID 570 + * @burst_period: Recommended value to be sent to the AP. Measurement 571 + * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0 572 + * @samples_per_burst: the number of FTMs pairs in single Burst (1-31); 573 + * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of 574 + * the number of measurement iterations (min 2^0 = 1, max 2^14) 575 + * @reserved: For alignment and future use 576 + * @cipher: pairwise cipher suite for secured measurement. 577 + * &enum iwl_location_cipher. 578 + * @hltk: HLTK to be used for secured 11az measurement 579 + * @tk: TK to be used for secured 11az measurement 580 + * @calib: An array of calibration values per FTM rx bandwidth. 581 + * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the 582 + * calibration value that corresponds to the rx bandwidth of the FTM 583 + * frame. 584 + * @reserved2: For alignment and future use. 585 + */ 586 + struct iwl_tof_range_req_ap_entry { 587 + __le32 initiator_ap_flags; 588 + u8 channel_num; 589 + u8 format_bw; 590 + u8 ctrl_ch_position; 591 + u8 ftmr_max_retries; 592 + u8 bssid[ETH_ALEN]; 593 + __le16 burst_period; 594 + u8 samples_per_burst; 595 + u8 num_of_bursts; 596 + u8 reserved; 597 + u8 cipher; 598 + u8 hltk[HLTK_11AZ_LEN]; 599 + u8 tk[TK_11AZ_LEN]; 600 + __le16 calib[IWL_TOF_BW_NUM]; 601 + __le16 reserved2; 602 + } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_5 */ 549 603 550 604 /** 551 605 * enum iwl_tof_response_mode ··· 740 676 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_7 */ 741 677 742 678 /** 743 - * struct iwl_tof_range_req_cmd - start measurement cmd 679 + * struct iwl_tof_range_req_cmd_v8 - start measurement cmd 744 680 * @initiator_flags: see flags @ iwl_tof_initiator_flags 745 681 * @request_id: A Token incremented per request. The same Token will be 746 682 * sent back in the range response ··· 757 693 * @specific_calib: The specific calib value to inject to this measurement calc 758 694 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2. 759 695 */ 760 - struct iwl_tof_range_req_cmd { 696 + struct iwl_tof_range_req_cmd_v8 { 761 697 __le32 initiator_flags; 762 698 u8 request_id; 763 699 u8 num_of_ap; ··· 768 704 __le32 tsf_mac_id; 769 705 __le16 common_calib; 770 706 __le16 specific_calib; 771 - struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; 707 + struct iwl_tof_range_req_ap_entry_v4 ap[IWL_MVM_TOF_MAX_APS]; 772 708 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_8 */ 709 + 710 + /** 711 + * struct iwl_tof_range_req_cmd - start measurement cmd 712 + * @initiator_flags: see flags @ iwl_tof_initiator_flags 713 + * @request_id: A Token incremented per request. The same Token will be 714 + * sent back in the range response 715 + * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) 716 + * @range_req_bssid: ranging request BSSID 717 + * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template. 718 + * Bits set to 1 shall be randomized by the UMAC 719 + * @macaddr_template: MAC address template to use for non-randomized bits 720 + * @req_timeout_ms: Requested timeout of the response in units of milliseconds. 721 + * This is the session time for completing the measurement. 722 + * @tsf_mac_id: report the measurement start time for each ap in terms of the 723 + * TSF of this mac id. 0xff to disable TSF reporting. 724 + * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2. 725 + */ 726 + struct iwl_tof_range_req_cmd { 727 + __le32 initiator_flags; 728 + u8 request_id; 729 + u8 num_of_ap; 730 + u8 range_req_bssid[ETH_ALEN]; 731 + u8 macaddr_mask[ETH_ALEN]; 732 + u8 macaddr_template[ETH_ALEN]; 733 + __le32 req_timeout_ms; 734 + __le32 tsf_mac_id; 735 + struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; 736 + } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_9 */ 773 737 774 738 /* 775 739 * enum iwl_tof_range_request_status - status of the sent request
+6 -8
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 533 535 __le32 filter_match; 534 536 535 537 /** 536 - * @phy_data2: depends on info type (see @phy_data1) 538 + * @phy_data3: depends on info type (see @phy_data1) 537 539 */ 538 - __le32 phy_data2; 540 + __le32 phy_data3; 539 541 }; 540 542 541 543 /* DW8 - carries rss_hash only when rpa_en == 1 */ ··· 546 548 __le32 rss_hash; 547 549 548 550 /** 549 - * @phy_data3: depends on info type (see @phy_data1) 551 + * @phy_data2: depends on info type (see @phy_data1) 550 552 */ 551 - __le32 phy_data3; 553 + __le32 phy_data2; 552 554 }; 553 555 /* DW9 */ 554 556 /**
+74 -25
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 1367 1367 struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data; 1368 1368 u32 fid1 = le32_to_cpu(reg->fifos.fid[0]); 1369 1369 u32 fid2 = le32_to_cpu(reg->fifos.fid[1]); 1370 - u32 fifo_idx; 1370 + u8 fifo_idx; 1371 1371 1372 1372 if (!data) 1373 1373 return; 1374 1374 1375 + /* make sure only one bit is set in only one fid */ 1376 + if (WARN_ONCE(hweight_long(fid1) + hweight_long(fid2) != 1, 1377 + "fid1=%x, fid2=%x\n", fid1, fid2)) 1378 + return; 1379 + 1375 1380 memset(data, 0, sizeof(*data)); 1376 1381 1377 - if (WARN_ON_ONCE((fid1 && fid2) || (!fid1 && !fid2))) 1378 - return; 1382 + if (fid1) { 1383 + fifo_idx = ffs(fid1) - 1; 1384 + if (WARN_ONCE(fifo_idx >= MAX_NUM_LMAC, "fifo_idx=%d\n", 1385 + fifo_idx)) 1386 + return; 1379 1387 1380 - fifo_idx = ffs(fid1) - 1; 1381 - if (fid1 && !WARN_ON_ONCE((~BIT(fifo_idx) & fid1) || 1382 - fifo_idx >= MAX_NUM_LMAC)) { 1383 1388 data->size = fwrt->smem_cfg.lmac[fifo_idx].rxfifo1_size; 1384 1389 data->fifo_num = fifo_idx; 1385 - return; 1386 - } 1390 + } else { 1391 + u8 max_idx; 1387 1392 1388 - fifo_idx = ffs(fid2) - 1; 1389 - if (fid2 && !WARN_ON_ONCE(fifo_idx != 0)) { 1390 - data->size = fwrt->smem_cfg.rxfifo2_size; 1391 - data->offset = RXF_DIFF_FROM_PREV; 1393 + fifo_idx = ffs(fid2) - 1; 1394 + if (iwl_fw_lookup_notif_ver(fwrt->fw, SYSTEM_GROUP, 1395 + SHARED_MEM_CFG_CMD, 0) <= 3) 1396 + max_idx = 0; 1397 + else 1398 + max_idx = 1; 1399 + 1400 + if (WARN_ONCE(fifo_idx > max_idx, 1401 + "invalid umac fifo idx %d", fifo_idx)) 1402 + return; 1403 + 1392 1404 /* use bit 31 to distinguish between umac and lmac rxf while 1393 1405 * parsing the dump 1394 1406 */ 1395 1407 data->fifo_num = fifo_idx | IWL_RXF_UMAC_BIT; 1396 - return; 1408 + 1409 + switch (fifo_idx) { 1410 + case 0: 1411 + data->size = fwrt->smem_cfg.rxfifo2_size; 1412 + data->offset = iwl_umac_prph(fwrt->trans, 1413 + RXF_DIFF_FROM_PREV); 1414 + break; 1415 + case 1: 1416 + data->size = fwrt->smem_cfg.rxfifo2_control_size; 1417 + data->offset = iwl_umac_prph(fwrt->trans, 1418 + RXF2C_DIFF_FROM_PREV); 1419 + break; 1420 + } 1397 1421 } 1398 1422 } 1399 1423 ··· 1958 1934 struct iwl_fw_ini_dump_cfg_name *cfg_name; 1959 1935 u32 size = sizeof(*tlv) + sizeof(*dump); 1960 1936 u32 num_of_cfg_names = 0; 1937 + u32 hw_type; 1961 1938 1962 1939 list_for_each_entry(node, &fwrt->trans->dbg.debug_info_tlv_list, list) { 1963 1940 size += sizeof(*cfg_name); ··· 1987 1962 dump->ver_subtype = cpu_to_le32(fwrt->dump.fw_ver.subtype); 1988 1963 1989 1964 dump->hw_step = cpu_to_le32(CSR_HW_REV_STEP(fwrt->trans->hw_rev)); 1990 - dump->hw_type = cpu_to_le32(CSR_HW_REV_TYPE(fwrt->trans->hw_rev)); 1965 + 1966 + /* 1967 + * Several HWs all have type == 0x42, so we'll override this value 1968 + * according to the detected HW 1969 + */ 1970 + hw_type = CSR_HW_REV_TYPE(fwrt->trans->hw_rev); 1971 + if (hw_type == IWL_AX210_HW_TYPE) { 1972 + u32 prph_val = iwl_read_prph(fwrt->trans, WFPM_OTP_CFG1_ADDR); 1973 + u32 is_jacket = !!(prph_val & WFPM_OTP_CFG1_IS_JACKET_BIT); 1974 + u32 is_cdb = !!(prph_val & WFPM_OTP_CFG1_IS_CDB_BIT); 1975 + u32 masked_bits = is_jacket | (is_cdb << 1); 1976 + 1977 + /* 1978 + * The HW type depends on certain bits in this case, so add 1979 + * these bits to the HW type. We won't have collisions since we 1980 + * add these bits after the highest possible bit in the mask. 1981 + */ 1982 + hw_type |= masked_bits << IWL_AX210_HW_TYPE_ADDITION_SHIFT; 1983 + } 1984 + dump->hw_type = cpu_to_le32(hw_type); 1991 1985 1992 1986 dump->rf_id_flavor = 1993 1987 cpu_to_le32(CSR_HW_RFID_FLAVOR(fwrt->trans->hw_rf_id)); ··· 2139 2095 u32 size = 0; 2140 2096 u64 regions_mask = le64_to_cpu(trigger->regions_mask); 2141 2097 2142 - for (i = 0; i < 64; i++) { 2098 + BUILD_BUG_ON(sizeof(trigger->regions_mask) != sizeof(regions_mask)); 2099 + BUILD_BUG_ON((sizeof(trigger->regions_mask) * BITS_PER_BYTE) < 2100 + ARRAY_SIZE(fwrt->trans->dbg.active_regions)); 2101 + 2102 + for (i = 0; i < ARRAY_SIZE(fwrt->trans->dbg.active_regions); i++) { 2143 2103 u32 reg_type; 2144 2104 struct iwl_fw_ini_region_tlv *reg; 2145 2105 ··· 2222 2174 } 2223 2175 2224 2176 static inline void iwl_fw_free_dump_desc(struct iwl_fw_runtime *fwrt, 2225 - const struct iwl_fw_dump_desc **desc) 2177 + const struct iwl_fw_dump_desc *desc) 2226 2178 { 2227 - if (desc && *desc != &iwl_dump_desc_assert) 2228 - kfree(*desc); 2179 + if (desc && desc != &iwl_dump_desc_assert) 2180 + kfree(desc); 2229 2181 2230 - *desc = NULL; 2231 2182 fwrt->dump.lmac_err_id[0] = 0; 2232 2183 if (fwrt->smem_cfg.num_lmacs > 1) 2233 2184 fwrt->dump.lmac_err_id[1] = 0; ··· 2338 2291 unsigned long idx; 2339 2292 2340 2293 if (iwl_trans_dbg_ini_valid(fwrt->trans)) { 2341 - iwl_fw_free_dump_desc(fwrt, &desc); 2294 + iwl_fw_free_dump_desc(fwrt, desc); 2342 2295 return 0; 2343 2296 } 2344 2297 ··· 2359 2312 wk_data = &fwrt->dump.wks[idx]; 2360 2313 2361 2314 if (WARN_ON(wk_data->dump_data.desc)) 2362 - iwl_fw_free_dump_desc(fwrt, &wk_data->dump_data.desc); 2315 + iwl_fw_free_dump_desc(fwrt, wk_data->dump_data.desc); 2363 2316 2364 2317 wk_data->dump_data.desc = desc; 2365 2318 wk_data->dump_data.monitor_only = monitor_only; ··· 2616 2569 iwl_fw_dbg_stop_restart_recording(fwrt, &params, false); 2617 2570 2618 2571 out: 2619 - if (iwl_trans_dbg_ini_valid(fwrt->trans)) 2572 + if (iwl_trans_dbg_ini_valid(fwrt->trans)) { 2620 2573 iwl_fw_error_dump_data_free(dump_data); 2621 - else 2622 - iwl_fw_free_dump_desc(fwrt, &dump_data->desc); 2574 + } else { 2575 + iwl_fw_free_dump_desc(fwrt, dump_data->desc); 2576 + dump_data->desc = NULL; 2577 + } 2623 2578 2624 2579 clear_bit(wk_idx, &fwrt->dump.active_wks); 2625 2580 } ··· 2780 2731 struct iwl_fw_dbg_params *params, 2781 2732 bool stop) 2782 2733 { 2783 - int ret = 0; 2734 + int ret __maybe_unused = 0; 2784 2735 2785 2736 if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status)) 2786 2737 return;
+100 -4
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 Intel Corporation 10 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright (C) 2018 Intel Corporation 33 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 62 64 #include "api/commands.h" 63 65 #include "debugfs.h" 64 66 #include "dbg.h" 67 + #include <linux/seq_file.h> 65 68 66 69 #define FWRT_DEBUGFS_OPEN_WRAPPER(name, buflen, argtype) \ 67 70 struct dbgfs_##name##_data { \ ··· 328 329 329 330 FWRT_DEBUGFS_READ_FILE_OPS(fw_dbg_domain, 20); 330 331 332 + struct iwl_dbgfs_fw_info_priv { 333 + struct iwl_fw_runtime *fwrt; 334 + }; 335 + 336 + struct iwl_dbgfs_fw_info_state { 337 + loff_t pos; 338 + }; 339 + 340 + static void *iwl_dbgfs_fw_info_seq_next(struct seq_file *seq, 341 + void *v, loff_t *pos) 342 + { 343 + struct iwl_dbgfs_fw_info_state *state = v; 344 + struct iwl_dbgfs_fw_info_priv *priv = seq->private; 345 + const struct iwl_fw *fw = priv->fwrt->fw; 346 + 347 + *pos = ++state->pos; 348 + if (*pos >= fw->ucode_capa.n_cmd_versions) 349 + return NULL; 350 + 351 + return state; 352 + } 353 + 354 + static void iwl_dbgfs_fw_info_seq_stop(struct seq_file *seq, 355 + void *v) 356 + { 357 + kfree(v); 358 + } 359 + 360 + static void *iwl_dbgfs_fw_info_seq_start(struct seq_file *seq, loff_t *pos) 361 + { 362 + struct iwl_dbgfs_fw_info_priv *priv = seq->private; 363 + const struct iwl_fw *fw = priv->fwrt->fw; 364 + struct iwl_dbgfs_fw_info_state *state; 365 + 366 + if (*pos >= fw->ucode_capa.n_cmd_versions) 367 + return NULL; 368 + 369 + state = kzalloc(sizeof(*state), GFP_KERNEL); 370 + if (!state) 371 + return NULL; 372 + state->pos = *pos; 373 + return state; 374 + }; 375 + 376 + static int iwl_dbgfs_fw_info_seq_show(struct seq_file *seq, void *v) 377 + { 378 + struct iwl_dbgfs_fw_info_state *state = v; 379 + struct iwl_dbgfs_fw_info_priv *priv = seq->private; 380 + const struct iwl_fw *fw = priv->fwrt->fw; 381 + const struct iwl_fw_cmd_version *ver; 382 + u32 cmd_id; 383 + 384 + if (!state->pos) 385 + seq_puts(seq, "fw_api_ver:\n"); 386 + 387 + ver = &fw->ucode_capa.cmd_versions[state->pos]; 388 + 389 + cmd_id = iwl_cmd_id(ver->cmd, ver->group, 0); 390 + 391 + seq_printf(seq, " 0x%04x:\n", cmd_id); 392 + seq_printf(seq, " name: %s\n", 393 + iwl_get_cmd_string(priv->fwrt->trans, cmd_id)); 394 + seq_printf(seq, " cmd_ver: %d\n", ver->cmd_ver); 395 + seq_printf(seq, " notif_ver: %d\n", ver->notif_ver); 396 + return 0; 397 + } 398 + 399 + static const struct seq_operations iwl_dbgfs_info_seq_ops = { 400 + .start = iwl_dbgfs_fw_info_seq_start, 401 + .next = iwl_dbgfs_fw_info_seq_next, 402 + .stop = iwl_dbgfs_fw_info_seq_stop, 403 + .show = iwl_dbgfs_fw_info_seq_show, 404 + }; 405 + 406 + static int iwl_dbgfs_fw_info_open(struct inode *inode, struct file *filp) 407 + { 408 + struct iwl_dbgfs_fw_info_priv *priv; 409 + 410 + priv = __seq_open_private(filp, &iwl_dbgfs_info_seq_ops, 411 + sizeof(*priv)); 412 + 413 + if (!priv) 414 + return -ENOMEM; 415 + 416 + priv->fwrt = inode->i_private; 417 + return 0; 418 + } 419 + 420 + static const struct file_operations iwl_dbgfs_fw_info_ops = { 421 + .owner = THIS_MODULE, 422 + .open = iwl_dbgfs_fw_info_open, 423 + .read = seq_read, 424 + .llseek = seq_lseek, 425 + .release = seq_release_private, 426 + }; 427 + 331 428 void iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt, 332 429 struct dentry *dbgfs_dir) 333 430 { 334 431 INIT_DELAYED_WORK(&fwrt->timestamp.wk, iwl_fw_timestamp_marker_wk); 335 432 FWRT_DEBUGFS_ADD_FILE(timestamp_marker, dbgfs_dir, 0200); 433 + FWRT_DEBUGFS_ADD_FILE(fw_info, dbgfs_dir, 0200); 336 434 FWRT_DEBUGFS_ADD_FILE(send_hcmd, dbgfs_dir, 0200); 337 435 FWRT_DEBUGFS_ADD_FILE(fw_dbg_domain, dbgfs_dir, 0400); 338 436 }
+11 -2
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
··· 8 8 * Copyright(c) 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2019 Intel Corporation 11 + * Copyright (C) 2018 - 2020 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright (C) 2018 - 2019 Intel Corporation 34 + * Copyright (C) 2018 - 2020 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 393 393 __le32 cfg_name_len; 394 394 u8 cfg_name[IWL_FW_INI_MAX_CFG_NAME]; 395 395 } __packed; 396 + 397 + /* AX210's HW type */ 398 + #define IWL_AX210_HW_TYPE 0x42 399 + /* How many bits to roll when adding to the HW type of AX210 HW */ 400 + #define IWL_AX210_HW_TYPE_ADDITION_SHIFT 12 401 + /* This prph is used to tell apart HW_TYPE == 0x42 NICs */ 402 + #define WFPM_OTP_CFG1_ADDR 0xd03098 403 + #define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) 404 + #define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) 396 405 397 406 /* struct iwl_fw_ini_dump_info - ini dump information 398 407 * @version: dump version
+53 -2
drivers/net/wireless/intel/iwlwifi/fw/init.c
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2017 Intel Deutschland GmbH 9 - * Copyright(c) 2019 Intel Corporation 9 + * Copyright(c) 2019 - 2020 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 27 27 * BSD LICENSE 28 28 * 29 29 * Copyright(c) 2017 Intel Deutschland GmbH 30 - * Copyright(c) 2019 Intel Corporation 30 + * Copyright(c) 2019 - 2020 Intel Corporation 31 31 * All rights reserved. 32 32 * 33 33 * Redistribution and use in source and binary forms, with or without ··· 62 62 #include "dbg.h" 63 63 #include "debugfs.h" 64 64 65 + #include "fw/api/soc.h" 66 + #include "fw/api/commands.h" 67 + 65 68 void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, 66 69 const struct iwl_fw *fw, 67 70 const struct iwl_fw_runtime_ops *ops, void *ops_ctx, ··· 98 95 iwl_fw_resume_timestamp(fwrt); 99 96 } 100 97 IWL_EXPORT_SYMBOL(iwl_fw_runtime_resume); 98 + 99 + /* set device type and latency */ 100 + int iwl_set_soc_latency(struct iwl_fw_runtime *fwrt) 101 + { 102 + struct iwl_soc_configuration_cmd cmd = {}; 103 + struct iwl_host_cmd hcmd = { 104 + .id = iwl_cmd_id(SOC_CONFIGURATION_CMD, SYSTEM_GROUP, 0), 105 + .data[0] = &cmd, 106 + .len[0] = sizeof(cmd), 107 + }; 108 + int ret; 109 + 110 + /* 111 + * In VER_1 of this command, the discrete value is considered 112 + * an integer; In VER_2, it's a bitmask. Since we have only 2 113 + * values in VER_1, this is backwards-compatible with VER_2, 114 + * as long as we don't set any other bits. 115 + */ 116 + if (!fwrt->trans->trans_cfg->integrated) 117 + cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE); 118 + 119 + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_NONE != 120 + SOC_FLAGS_LTR_APPLY_DELAY_NONE); 121 + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_200US != 122 + SOC_FLAGS_LTR_APPLY_DELAY_200); 123 + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_2500US != 124 + SOC_FLAGS_LTR_APPLY_DELAY_2500); 125 + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_1820US != 126 + SOC_FLAGS_LTR_APPLY_DELAY_1820); 127 + 128 + if (fwrt->trans->trans_cfg->ltr_delay != IWL_CFG_TRANS_LTR_DELAY_NONE && 129 + !WARN_ON(!fwrt->trans->trans_cfg->integrated)) 130 + cmd.flags |= le32_encode_bits(fwrt->trans->trans_cfg->ltr_delay, 131 + SOC_FLAGS_LTR_APPLY_DELAY_MASK); 132 + 133 + if (iwl_fw_lookup_cmd_ver(fwrt->fw, IWL_ALWAYS_LONG_GROUP, 134 + SCAN_REQ_UMAC) >= 2 && 135 + fwrt->trans->trans_cfg->low_latency_xtal) 136 + cmd.flags |= cpu_to_le32(SOC_CONFIG_CMD_FLAGS_LOW_LATENCY); 137 + 138 + cmd.latency = cpu_to_le32(fwrt->trans->trans_cfg->xtal_latency); 139 + 140 + ret = iwl_trans_send_cmd(fwrt->trans, &hcmd); 141 + if (ret) 142 + IWL_ERR(fwrt, "Failed to set soc latency: %d\n", ret); 143 + return ret; 144 + } 145 + IWL_EXPORT_SYMBOL(iwl_set_soc_latency);
+4 -2
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2017 Intel Deutschland GmbH 9 - * Copyright (C) 2018-2019 Intel Corporation 9 + * Copyright (C) 2018-2020 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 27 27 * BSD LICENSE 28 28 * 29 29 * Copyright(c) 2017 Intel Deutschland GmbH 30 - * Copyright (C) 2018-2019 Intel Corporation 30 + * Copyright (C) 2018-2020 Intel Corporation 31 31 * All rights reserved. 32 32 * 33 33 * Redistribution and use in source and binary forms, with or without ··· 86 86 u32 rxfifo1_size; 87 87 } lmac[MAX_NUM_LMAC]; 88 88 u32 rxfifo2_size; 89 + u32 rxfifo2_control_size; 89 90 u32 internal_txfifo_addr; 90 91 u32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM]; 91 92 }; ··· 242 241 void iwl_free_fw_paging(struct iwl_fw_runtime *fwrt); 243 242 244 243 void iwl_get_shared_mem_conf(struct iwl_fw_runtime *fwrt); 244 + int iwl_set_soc_latency(struct iwl_fw_runtime *fwrt); 245 245 246 246 #endif /* __iwl_fw_runtime_h__ */
+10 -4
drivers/net/wireless/intel/iwlwifi/fw/smem.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 33 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 69 71 struct iwl_shared_mem_cfg *mem_cfg = (void *)pkt->data; 70 72 int i, lmac; 71 73 int lmac_num = le32_to_cpu(mem_cfg->lmac_num); 74 + u8 api_ver = iwl_fw_lookup_notif_ver(fwrt->fw, SYSTEM_GROUP, 75 + SHARED_MEM_CFG_CMD, 0); 72 76 73 77 if (WARN_ON(lmac_num > ARRAY_SIZE(mem_cfg->lmac_smem))) 74 78 return; ··· 79 79 fwrt->smem_cfg.num_txfifo_entries = 80 80 ARRAY_SIZE(mem_cfg->lmac_smem[0].txfifo_size); 81 81 fwrt->smem_cfg.rxfifo2_size = le32_to_cpu(mem_cfg->rxfifo2_size); 82 + 83 + if (api_ver >= 4 && 84 + !WARN_ON_ONCE(iwl_rx_packet_payload_len(pkt) < sizeof(*mem_cfg))) { 85 + fwrt->smem_cfg.rxfifo2_control_size = 86 + le32_to_cpu(mem_cfg->rxfifo2_control_size); 87 + } 82 88 83 89 for (lmac = 0; lmac < lmac_num; lmac++) { 84 90 struct iwl_shared_mem_lmac_cfg *lmac_cfg =
+10 -5
drivers/net/wireless/intel/iwlwifi/iwl-config.h
··· 477 477 #define IWL_CFG_RF_TYPE_TH1 0x108 478 478 #define IWL_CFG_RF_TYPE_JF2 0x105 479 479 #define IWL_CFG_RF_TYPE_JF1 0x108 480 + #define IWL_CFG_RF_TYPE_HR2 0x10A 481 + #define IWL_CFG_RF_TYPE_HR1 0x10C 480 482 481 483 #define IWL_CFG_RF_ID_TH 0x1 482 484 #define IWL_CFG_RF_ID_TH1 0x1 483 485 #define IWL_CFG_RF_ID_JF 0x3 484 486 #define IWL_CFG_RF_ID_JF1 0x6 485 487 #define IWL_CFG_RF_ID_JF1_DIV 0xA 488 + #define IWL_CFG_RF_ID_HR 0x7 489 + #define IWL_CFG_RF_ID_HR1 0x4 486 490 487 491 #define IWL_CFG_NO_160 0x0 488 492 #define IWL_CFG_160 0x1 ··· 539 535 extern const char iwl9560_killer_1550i_name[]; 540 536 extern const char iwl9560_killer_1550s_name[]; 541 537 extern const char iwl_ax200_name[]; 538 + extern const char iwl_ax201_name[]; 539 + extern const char iwl_ax101_name[]; 542 540 extern const char iwl_ax200_killer_1650w_name[]; 543 541 extern const char iwl_ax200_killer_1650x_name[]; 544 542 ··· 615 609 extern const struct iwl_cfg iwl9560_quz_a0_jf_b0_cfg; 616 610 extern const struct iwl_cfg iwl9560_qnj_b0_jf_b0_cfg; 617 611 extern const struct iwl_cfg iwl9560_2ac_cfg_soc; 618 - extern const struct iwl_cfg iwl_ax101_cfg_qu_hr; 619 - extern const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0; 620 - extern const struct iwl_cfg iwl_ax101_cfg_quz_hr; 612 + extern const struct iwl_cfg iwl_qu_b0_hr1_b0; 613 + extern const struct iwl_cfg iwl_qu_c0_hr1_b0; 614 + extern const struct iwl_cfg iwl_quz_a0_hr1_b0; 621 615 extern const struct iwl_cfg iwl_ax200_cfg_cc; 622 616 extern const struct iwl_cfg iwl_ax201_cfg_qu_hr; 623 617 extern const struct iwl_cfg iwl_ax201_cfg_qu_hr; ··· 631 625 extern const struct iwl_cfg killer1650i_2ax_cfg_qu_c0_hr_b0; 632 626 extern const struct iwl_cfg killer1650x_2ax_cfg; 633 627 extern const struct iwl_cfg killer1650w_2ax_cfg; 634 - extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0_f0; 635 - extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0; 628 + extern const struct iwl_cfg iwl_qnj_b0_hr_b0_cfg; 636 629 extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0; 637 630 extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0; 638 631 extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0;
+21 -23
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
··· 165 165 struct iwl_ucode_tlv *tlv) 166 166 { 167 167 struct iwl_fw_ini_allocation_tlv *alloc = (void *)tlv->data; 168 - u32 buf_location = le32_to_cpu(alloc->buf_location); 169 - u32 alloc_id = le32_to_cpu(alloc->alloc_id); 168 + u32 buf_location; 169 + u32 alloc_id; 170 170 171 - if (le32_to_cpu(tlv->length) != sizeof(*alloc) || 172 - (buf_location != IWL_FW_INI_LOCATION_SRAM_PATH && 173 - buf_location != IWL_FW_INI_LOCATION_DRAM_PATH && 174 - buf_location != IWL_FW_INI_LOCATION_NPK_PATH)) { 175 - IWL_ERR(trans, 176 - "WRT: Invalid allocation TLV\n"); 171 + if (le32_to_cpu(tlv->length) != sizeof(*alloc)) 177 172 return -EINVAL; 178 - } 173 + 174 + buf_location = le32_to_cpu(alloc->buf_location); 175 + alloc_id = le32_to_cpu(alloc->alloc_id); 176 + 177 + if (buf_location == IWL_FW_INI_LOCATION_INVALID || 178 + buf_location >= IWL_FW_INI_LOCATION_NUM) 179 + goto err; 180 + 181 + if (alloc_id == IWL_FW_INI_ALLOCATION_INVALID || 182 + alloc_id >= IWL_FW_INI_ALLOCATION_NUM) 183 + goto err; 179 184 180 185 if ((buf_location == IWL_FW_INI_LOCATION_SRAM_PATH || 181 186 buf_location == IWL_FW_INI_LOCATION_NPK_PATH) && 182 - alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) { 183 - IWL_ERR(trans, 184 - "WRT: Allocation TLV for SMEM/NPK path must have id %u (current: %u)\n", 185 - IWL_FW_INI_ALLOCATION_ID_DBGC1, alloc_id); 186 - return -EINVAL; 187 - } 188 - 189 - if (alloc_id == IWL_FW_INI_ALLOCATION_INVALID || 190 - alloc_id >= IWL_FW_INI_ALLOCATION_NUM) { 191 - IWL_ERR(trans, 192 - "WRT: Invalid allocation id %u for allocation TLV\n", 193 - alloc_id); 194 - return -EINVAL; 195 - } 187 + alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) 188 + goto err; 196 189 197 190 trans->dbg.fw_mon_cfg[alloc_id] = *alloc; 198 191 199 192 return 0; 193 + err: 194 + IWL_ERR(trans, 195 + "WRT: Invalid allocation id %u and/or location id %u for allocation TLV\n", 196 + alloc_id, buf_location); 197 + return -EINVAL; 200 198 } 201 199 202 200 static int iwl_dbg_tlv_alloc_hcmd(struct iwl_trans *trans,
+3 -11
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 85 87 86 88 #define DRV_DESCRIPTION "Intel(R) Wireless WiFi driver for Linux" 87 89 MODULE_DESCRIPTION(DRV_DESCRIPTION); 88 - MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); 90 + MODULE_AUTHOR(DRV_AUTHOR); 89 91 MODULE_LICENSE("GPL"); 90 92 91 93 #ifdef CONFIG_IWLWIFI_DEBUGFS ··· 1774 1776 INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv); 1775 1777 1776 1778 pr_info(DRV_DESCRIPTION "\n"); 1777 - pr_info(DRV_COPYRIGHT "\n"); 1778 1779 1779 1780 #ifdef CONFIG_IWLWIFI_DEBUGFS 1780 1781 /* Create the root of iwlwifi debugfs subsystem. */ ··· 1820 1823 "4K for other devices 1:4K 2:8K 3:12K 4: 2K (default 0)"); 1821 1824 module_param_named(fw_restart, iwlwifi_mod_params.fw_restart, bool, 0444); 1822 1825 MODULE_PARM_DESC(fw_restart, "restart firmware in case of error (default true)"); 1823 - 1824 - module_param_named(antenna_coupling, iwlwifi_mod_params.antenna_coupling, 1825 - int, 0444); 1826 - MODULE_PARM_DESC(antenna_coupling, 1827 - "specify antenna coupling in dB (default: 0 dB)"); 1828 1826 1829 1827 module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444); 1830 1828 MODULE_PARM_DESC(nvm_file, "NVM file name");
+3 -4
drivers/net/wireless/intel/iwlwifi/iwl-drv.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2008 - 2014, 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify ··· 26 26 * 27 27 * BSD LICENSE 28 28 * 29 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 29 + * Copyright(c) 2005 - 2014, 2020 Intel Corporation. All rights reserved. 30 30 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 31 31 * All rights reserved. 32 32 * ··· 63 63 64 64 /* for all modules */ 65 65 #define DRV_NAME "iwlwifi" 66 - #define DRV_COPYRIGHT "Copyright(c) 2003- 2015 Intel Corporation" 67 - #define DRV_AUTHOR "<linuxwifi@intel.com>" 66 + #define DRV_AUTHOR "Intel Corporation <linuxwifi@intel.com>" 68 67 69 68 /* radio config bits (actual values from NVM definition) */ 70 69 #define NVM_RF_CFG_DASH_MSK(x) (x & 0x3) /* bits 0-1 */
+3 -4
drivers/net/wireless/intel/iwlwifi/iwl-fh.h
··· 7 7 * 8 8 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 10 - * Copyright(c) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2018 - 2020 Intel Corporation 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify 13 13 * it under the terms of version 2 of the GNU General Public License as ··· 29 29 * 30 30 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 32 - * Copyright(c) 2018 - 2019 Intel Corporation 32 + * Copyright(c) 2018 - 2020 Intel Corporation 33 33 * All rights reserved. 34 34 * 35 35 * Redistribution and use in source and binary forms, with or without ··· 646 646 #define TFD_QUEUE_CB_SIZE(x) (ilog2(x) - 3) 647 647 #define TFD_QUEUE_SIZE_BC_DUP (64) 648 648 #define TFD_QUEUE_BC_SIZE (TFD_QUEUE_SIZE_MAX + TFD_QUEUE_SIZE_BC_DUP) 649 - #define TFD_QUEUE_BC_SIZE_GEN3 (TFD_QUEUE_SIZE_MAX_GEN3 + \ 650 - TFD_QUEUE_SIZE_BC_DUP) 649 + #define TFD_QUEUE_BC_SIZE_GEN3 1024 651 650 #define IWL_TX_DMA_MASK DMA_BIT_MASK(36) 652 651 #define IWL_NUM_OF_TBS 20 653 652 #define IWL_TFH_NUM_TBS 25
+2 -6
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 - * Copyright(c) 2018 - 2019 Intel Corporation 8 + * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 10 9 * 11 10 * This program is free software; you can redistribute it and/or modify 12 11 * it under the terms of version 2 of the GNU General Public License as ··· 25 26 * 26 27 * BSD LICENSE 27 28 * 28 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 29 - * Copyright(c) 2018 - 2019 Intel Corporation 29 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 30 30 * All rights reserved. 31 31 * 32 32 * Redistribution and use in source and binary forms, with or without ··· 109 111 * @power_save: enable power save, default = false 110 112 * @power_level: power level, default = 1 111 113 * @debug_level: levels are IWL_DL_* 112 - * @antenna_coupling: antenna coupling in dB, default = 0 113 114 * @nvm_file: specifies a external NVM file 114 115 * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default = 115 116 * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT ··· 128 131 #ifdef CONFIG_IWLWIFI_DEBUG 129 132 u32 debug_level; 130 133 #endif 131 - int antenna_coupling; 132 134 char *nvm_file; 133 135 u32 uapsd_disable; 134 136 bool disable_11ac;
+5 -6
drivers/net/wireless/intel/iwlwifi/iwl-prph.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 9 - * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 8 + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 31 - * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 31 + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * Copyright(c) 2016 Intel Deutschland GmbH 33 - * Copyright (C) 2018 - 2019 Intel Corporation 33 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 324 326 #define RXF_SIZE_BYTE_CND_POS (7) 325 327 #define RXF_SIZE_BYTE_CNT_MSK (0x3ff << RXF_SIZE_BYTE_CND_POS) 326 328 #define RXF_DIFF_FROM_PREV (0x200) 329 + #define RXF2C_DIFF_FROM_PREV (0x4e00) 327 330 328 331 #define RXF_LD_FENCE_OFFSET_ADDR (0xa00c10) 329 332 #define RXF_FIFO_RD_FENCE_ADDR (0xa00c0c)
+3 -4
drivers/net/wireless/intel/iwlwifi/mvm/coex.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify ··· 26 26 * 27 27 * BSD LICENSE 28 28 * 29 - * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. 29 + * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 30 30 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 31 31 * All rights reserved. 32 32 * ··· 216 216 goto send_cmd; 217 217 } 218 218 219 - mode = iwlwifi_mod_params.bt_coex_active ? BT_COEX_NW : BT_COEX_DISABLE; 220 - bt_cmd.mode = cpu_to_le32(mode); 219 + bt_cmd.mode = cpu_to_le32(BT_COEX_NW); 221 220 222 221 if (IWL_MVM_BT_COEX_SYNC2SCO) 223 222 bt_cmd.enabled_modules |=
+15 -19
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 77 79 { 78 80 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 79 81 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 80 - 81 - if (iwlwifi_mod_params.swcrypto) 82 - return; 83 82 84 83 mutex_lock(&mvm->mutex); 85 84 ··· 838 843 return ret; 839 844 } 840 845 841 - if (!iwlwifi_mod_params.swcrypto) { 842 - /* 843 - * This needs to be unlocked due to lock ordering 844 - * constraints. Since we're in the suspend path 845 - * that isn't really a problem though. 846 - */ 847 - mutex_unlock(&mvm->mutex); 848 - ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC); 849 - mutex_lock(&mvm->mutex); 850 - if (ret) 851 - return ret; 852 - } 846 + /* 847 + * This needs to be unlocked due to lock ordering 848 + * constraints. Since we're in the suspend path 849 + * that isn't really a problem though. 850 + */ 851 + mutex_unlock(&mvm->mutex); 852 + ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC); 853 + mutex_lock(&mvm->mutex); 854 + if (ret) 855 + return ret; 853 856 854 857 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, 0, 855 858 sizeof(*wowlan_config_cmd), ··· 1985 1992 ret = 1; 1986 1993 goto err; 1987 1994 } 1995 + 1996 + iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_END, 1997 + NULL); 1988 1998 1989 1999 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test, !unified_image); 1990 2000 if (ret)
+7 -4
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 33 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 478 480 479 481 if (kstrtou16(buf, 0, &amsdu_len)) 480 482 return -EINVAL; 483 + 484 + /* only change from debug set <-> debug unset */ 485 + if ((amsdu_len && mvmsta->orig_amsdu_len) || 486 + (!!amsdu_len && mvmsta->orig_amsdu_len)) 487 + return -EBUSY; 481 488 482 489 if (amsdu_len) { 483 490 mvmsta->orig_amsdu_len = sta->max_amsdu_len;
+54 -13
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
··· 164 164 eth_broadcast_addr(cmd->range_req_bssid); 165 165 } 166 166 167 - static void iwl_mvm_ftm_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 168 - struct iwl_tof_range_req_cmd *cmd, 169 - struct cfg80211_pmsr_request *req) 167 + static void iwl_mvm_ftm_cmd_common(struct iwl_mvm *mvm, 168 + struct ieee80211_vif *vif, 169 + struct iwl_tof_range_req_cmd *cmd, 170 + struct cfg80211_pmsr_request *req) 170 171 { 171 172 int i; 172 173 ··· 209 208 210 209 /* Don't report AP's TSF */ 211 210 cmd->tsf_mac_id = cpu_to_le32(0xff); 211 + } 212 + 213 + static void iwl_mvm_ftm_cmd_v8(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 214 + struct iwl_tof_range_req_cmd_v8 *cmd, 215 + struct cfg80211_pmsr_request *req) 216 + { 217 + iwl_mvm_ftm_cmd_common(mvm, vif, (void *)cmd, req); 212 218 } 213 219 214 220 static int ··· 390 382 return 0; 391 383 } 392 384 393 - static int iwl_mvm_ftm_put_target_v4(struct iwl_mvm *mvm, 394 - struct cfg80211_pmsr_request_peer *peer, 395 - struct iwl_tof_range_req_ap_entry *target) 385 + static int 386 + iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, 387 + struct cfg80211_pmsr_request_peer *peer, 388 + struct iwl_tof_range_req_ap_entry_v4 *target) 396 389 { 397 390 int ret; 398 391 ··· 403 394 if (ret) 404 395 return ret; 405 396 406 - iwl_mvm_ftm_put_target_common(mvm, peer, target); 397 + iwl_mvm_ftm_put_target_common(mvm, peer, (void *)target); 407 398 408 399 return 0; 409 400 } ··· 465 456 * Versions 7 and 8 has the same structure except from the responders 466 457 * list, so iwl_mvm_ftm_cmd() can be used for version 7 too. 467 458 */ 468 - iwl_mvm_ftm_cmd(mvm, vif, (void *)&cmd_v7, req); 459 + iwl_mvm_ftm_cmd_v8(mvm, vif, (void *)&cmd_v7, req); 469 460 470 461 for (i = 0; i < cmd_v7.num_of_ap; i++) { 471 462 struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; ··· 481 472 static int iwl_mvm_ftm_start_v8(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 482 473 struct cfg80211_pmsr_request *req) 483 474 { 475 + struct iwl_tof_range_req_cmd_v8 cmd; 476 + struct iwl_host_cmd hcmd = { 477 + .id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0), 478 + .dataflags[0] = IWL_HCMD_DFL_DUP, 479 + .data[0] = &cmd, 480 + .len[0] = sizeof(cmd), 481 + }; 482 + u8 i; 483 + int err; 484 + 485 + iwl_mvm_ftm_cmd_v8(mvm, vif, (void *)&cmd, req); 486 + 487 + for (i = 0; i < cmd.num_of_ap; i++) { 488 + struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; 489 + 490 + err = iwl_mvm_ftm_put_target(mvm, peer, &cmd.ap[i]); 491 + if (err) 492 + return err; 493 + } 494 + 495 + return iwl_mvm_ftm_send_cmd(mvm, &hcmd); 496 + } 497 + 498 + static int iwl_mvm_ftm_start_v9(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 499 + struct cfg80211_pmsr_request *req) 500 + { 484 501 struct iwl_tof_range_req_cmd cmd; 485 502 struct iwl_host_cmd hcmd = { 486 503 .id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0), ··· 517 482 u8 i; 518 483 int err; 519 484 520 - iwl_mvm_ftm_cmd(mvm, vif, &cmd, req); 485 + iwl_mvm_ftm_cmd_common(mvm, vif, &cmd, req); 521 486 522 487 for (i = 0; i < cmd.num_of_ap; i++) { 523 488 struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; 524 489 525 - err = iwl_mvm_ftm_put_target_v4(mvm, peer, &cmd.ap[i]); 490 + err = iwl_mvm_ftm_put_target(mvm, peer, (void *)&cmd.ap[i]); 526 491 if (err) 527 492 return err; 528 493 } ··· 546 511 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, LOCATION_GROUP, 547 512 TOF_RANGE_REQ_CMD); 548 513 549 - if (cmd_ver == 8) 514 + switch (cmd_ver) { 515 + case 9: 516 + err = iwl_mvm_ftm_start_v9(mvm, vif, req); 517 + break; 518 + case 8: 550 519 err = iwl_mvm_ftm_start_v8(mvm, vif, req); 551 - else 520 + break; 521 + default: 552 522 err = iwl_mvm_ftm_start_v7(mvm, vif, req); 553 - 523 + break; 524 + } 554 525 } else { 555 526 err = iwl_mvm_ftm_start_v5(mvm, vif, req); 556 527 }
+4 -49
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 87 87 u32 scd_base_addr; 88 88 }; 89 89 90 - /* set device type and latency */ 91 - static int iwl_set_soc_latency(struct iwl_mvm *mvm) 92 - { 93 - struct iwl_soc_configuration_cmd cmd = {}; 94 - int ret; 95 - 96 - /* 97 - * In VER_1 of this command, the discrete value is considered 98 - * an integer; In VER_2, it's a bitmask. Since we have only 2 99 - * values in VER_1, this is backwards-compatible with VER_2, 100 - * as long as we don't set any other bits. 101 - */ 102 - if (!mvm->trans->trans_cfg->integrated) 103 - cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE); 104 - 105 - BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_NONE != 106 - SOC_FLAGS_LTR_APPLY_DELAY_NONE); 107 - BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_200US != 108 - SOC_FLAGS_LTR_APPLY_DELAY_200); 109 - BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_2500US != 110 - SOC_FLAGS_LTR_APPLY_DELAY_2500); 111 - BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_1820US != 112 - SOC_FLAGS_LTR_APPLY_DELAY_1820); 113 - 114 - if (mvm->trans->trans_cfg->ltr_delay != IWL_CFG_TRANS_LTR_DELAY_NONE && 115 - !WARN_ON(!mvm->trans->trans_cfg->integrated)) 116 - cmd.flags |= le32_encode_bits(mvm->trans->trans_cfg->ltr_delay, 117 - SOC_FLAGS_LTR_APPLY_DELAY_MASK); 118 - 119 - if (iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP, 120 - SCAN_REQ_UMAC) >= 2 && 121 - mvm->trans->trans_cfg->low_latency_xtal) 122 - cmd.flags |= cpu_to_le32(SOC_CONFIG_CMD_FLAGS_LOW_LATENCY); 123 - 124 - cmd.latency = cpu_to_le32(mvm->trans->trans_cfg->xtal_latency); 125 - 126 - ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(SOC_CONFIGURATION_CMD, 127 - SYSTEM_GROUP, 0), 0, 128 - sizeof(cmd), &cmd); 129 - if (ret) 130 - IWL_ERR(mvm, "Failed to set soc latency: %d\n", ret); 131 - return ret; 132 - } 133 - 134 90 static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant) 135 91 { 136 92 struct iwl_tx_ant_cfg_cmd tx_ant_cmd = { ··· 743 787 union { 744 788 struct iwl_dev_tx_power_cmd v5; 745 789 struct iwl_dev_tx_power_cmd_v4 v4; 746 - } cmd; 747 - 790 + } cmd = { 791 + .v5.v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS), 792 + }; 748 793 int ret; 749 794 u16 len = 0; 750 - 751 - cmd.v5.v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS); 752 795 753 796 if (fw_has_api(&mvm->fw->ucode_capa, 754 797 IWL_UCODE_TLV_API_REDUCE_TX_POWER)) ··· 1193 1238 1194 1239 if (fw_has_capa(&mvm->fw->ucode_capa, 1195 1240 IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT)) { 1196 - ret = iwl_set_soc_latency(mvm); 1241 + ret = iwl_set_soc_latency(&mvm->fwrt); 1197 1242 if (ret) 1198 1243 goto error; 1199 1244 }
+27 -29
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 475 475 hw->wiphy->n_cipher_suites++; 476 476 } 477 477 478 - /* Enable 11w if software crypto is not enabled (as the 479 - * firmware will interpret some mgmt packets, so enabling it 480 - * with software crypto isn't safe). 481 - */ 482 - if (!iwlwifi_mod_params.swcrypto) { 483 - ieee80211_hw_set(hw, MFP_CAPABLE); 478 + if (iwlwifi_mod_params.swcrypto) 479 + IWL_ERR(mvm, 480 + "iwlmvm doesn't allow to disable HW crypto, check swcrypto module parameter\n"); 481 + if (!iwlwifi_mod_params.bt_coex_active) 482 + IWL_ERR(mvm, 483 + "iwlmvm doesn't allow to disable BT Coex, check bt_coex_active module parameter\n"); 484 + 485 + ieee80211_hw_set(hw, MFP_CAPABLE); 486 + mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_AES_CMAC; 487 + hw->wiphy->n_cipher_suites++; 488 + if (iwl_mvm_has_new_rx_api(mvm)) { 484 489 mvm->ciphers[hw->wiphy->n_cipher_suites] = 485 - WLAN_CIPHER_SUITE_AES_CMAC; 490 + WLAN_CIPHER_SUITE_BIP_GMAC_128; 486 491 hw->wiphy->n_cipher_suites++; 487 - if (iwl_mvm_has_new_rx_api(mvm)) { 488 - mvm->ciphers[hw->wiphy->n_cipher_suites] = 489 - WLAN_CIPHER_SUITE_BIP_GMAC_128; 490 - hw->wiphy->n_cipher_suites++; 491 - mvm->ciphers[hw->wiphy->n_cipher_suites] = 492 - WLAN_CIPHER_SUITE_BIP_GMAC_256; 493 - hw->wiphy->n_cipher_suites++; 494 - } 492 + mvm->ciphers[hw->wiphy->n_cipher_suites] = 493 + WLAN_CIPHER_SUITE_BIP_GMAC_256; 494 + hw->wiphy->n_cipher_suites++; 495 495 } 496 496 497 497 /* currently FW API supports only one optional cipher scheme */ ··· 697 697 WIPHY_WOWLAN_EAP_IDENTITY_REQ | 698 698 WIPHY_WOWLAN_RFKILL_RELEASE | 699 699 WIPHY_WOWLAN_NET_DETECT; 700 - if (!iwlwifi_mod_params.swcrypto) 701 - mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | 702 - WIPHY_WOWLAN_GTK_REKEY_FAILURE | 703 - WIPHY_WOWLAN_4WAY_HANDSHAKE; 700 + mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | 701 + WIPHY_WOWLAN_GTK_REKEY_FAILURE | 702 + WIPHY_WOWLAN_4WAY_HANDSHAKE; 704 703 705 704 mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; 706 705 mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; ··· 2179 2180 flags |= STA_CTXT_HE_PACKET_EXT; 2180 2181 } 2181 2182 } 2183 + 2184 + if (sta->he_cap.he_cap_elem.mac_cap_info[2] & 2185 + IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP) 2186 + flags |= STA_CTXT_HE_32BIT_BA_BITMAP; 2187 + 2188 + if (sta->he_cap.he_cap_elem.mac_cap_info[2] & 2189 + IEEE80211_HE_MAC_CAP2_ACK_EN) 2190 + flags |= STA_CTXT_HE_ACK_ENABLED; 2191 + 2182 2192 rcu_read_unlock(); 2183 2193 2184 2194 /* Mark MU EDCA as enabled, unless none detected on some AC */ ··· 2212 2204 cpu_to_le16(mu_edca->mu_edca_timer); 2213 2205 } 2214 2206 2215 - if (vif->bss_conf.multi_sta_back_32bit) 2216 - flags |= STA_CTXT_HE_32BIT_BA_BITMAP; 2217 - 2218 - if (vif->bss_conf.ack_enabled) 2219 - flags |= STA_CTXT_HE_ACK_ENABLED; 2220 2207 2221 2208 if (vif->bss_conf.uora_exists) { 2222 2209 flags |= STA_CTXT_HE_TRIG_RND_ALLOC; ··· 3368 3365 int keyidx = key->keyidx; 3369 3366 int ret, i; 3370 3367 u8 key_offset; 3371 - 3372 - if (iwlwifi_mod_params.swcrypto) { 3373 - IWL_DEBUG_MAC80211(mvm, "leave - hwcrypto disabled\n"); 3374 - return -EOPNOTSUPP; 3375 - } 3376 3368 3377 3369 switch (key->cipher) { 3378 3370 case WLAN_CIPHER_SUITE_TKIP:
+2 -6
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 132 134 * We will register to mac80211 to have testmode working. The NIC must not 133 135 * be up'ed after the INIT fw asserted. This is useful to be able to use 134 136 * proprietary tools over testmode to debug the INIT fw. 135 - * @tfd_q_hang_detect: enabled the detection of hung transmit queues 136 137 * @power_scheme: one of enum iwl_power_scheme 137 138 */ 138 139 struct iwl_mvm_mod_params { 139 140 bool init_dbg; 140 - bool tfd_q_hang_detect; 141 141 int power_scheme; 142 142 }; 143 143 extern struct iwl_mvm_mod_params iwlmvm_mod_params;
+3 -10
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 84 86 85 87 #define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux" 86 88 MODULE_DESCRIPTION(DRV_DESCRIPTION); 87 - MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); 89 + MODULE_AUTHOR(DRV_AUTHOR); 88 90 MODULE_LICENSE("GPL"); 89 91 90 92 static const struct iwl_op_mode_ops iwl_mvm_ops; ··· 92 94 93 95 struct iwl_mvm_mod_params iwlmvm_mod_params = { 94 96 .power_scheme = IWL_POWER_SCHEME_BPS, 95 - .tfd_q_hang_detect = true 96 97 /* rest of fields are 0 by default */ 97 98 }; 98 99 ··· 101 104 module_param_named(power_scheme, iwlmvm_mod_params.power_scheme, int, 0444); 102 105 MODULE_PARM_DESC(power_scheme, 103 106 "power management scheme: 1-active, 2-balanced, 3-low power, default: 2"); 104 - module_param_named(tfd_q_hang_detect, iwlmvm_mod_params.tfd_q_hang_detect, 105 - bool, 0444); 106 - MODULE_PARM_DESC(tfd_q_hang_detect, 107 - "TFD queues hang detection (default: true"); 108 107 109 108 /* 110 109 * module init and exit functions
+8 -7
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
··· 369 369 u16 size = le32_to_cpu(notif->amsdu_size); 370 370 int i; 371 371 372 - /* 373 - * In debug sta->max_amsdu_len < size 374 - * so also check with orig_amsdu_len which holds the original 375 - * data before debugfs changed the value 376 - */ 377 - if (WARN_ON(sta->max_amsdu_len < size && 378 - mvmsta->orig_amsdu_len < size)) 372 + if (sta->max_amsdu_len < size) { 373 + /* 374 + * In debug sta->max_amsdu_len < size 375 + * so also check with orig_amsdu_len which holds the 376 + * original data before debugfs changed the value 377 + */ 378 + WARN_ON(mvmsta->orig_amsdu_len < size); 379 379 goto out; 380 + } 380 381 381 382 mvmsta->amsdu_enabled = le32_to_cpu(notif->amsdu_enabled); 382 383 mvmsta->max_amsdu_len = size;
+32 -19
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2015, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2015, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 749 751 size = max_t(u32, IWL_MGMT_QUEUE_SIZE, 750 752 mvm->trans->cfg->min_txq_size); 751 753 } 752 - queue = iwl_trans_txq_alloc(mvm->trans, 753 - cpu_to_le16(TX_QUEUE_CFG_ENABLE_QUEUE), 754 - sta_id, tid, SCD_QUEUE_CFG, size, timeout); 755 754 756 - if (queue < 0) { 757 - IWL_DEBUG_TX_QUEUES(mvm, 758 - "Failed allocating TXQ for sta %d tid %d, ret: %d\n", 759 - sta_id, tid, queue); 755 + do { 756 + __le16 enable = cpu_to_le16(TX_QUEUE_CFG_ENABLE_QUEUE); 757 + 758 + queue = iwl_trans_txq_alloc(mvm->trans, enable, 759 + sta_id, tid, SCD_QUEUE_CFG, 760 + size, timeout); 761 + 762 + if (queue < 0) 763 + IWL_DEBUG_TX_QUEUES(mvm, 764 + "Failed allocating TXQ of size %d for sta %d tid %d, ret: %d\n", 765 + size, sta_id, tid, queue); 766 + size /= 2; 767 + } while (queue < 0 && size >= 16); 768 + 769 + if (queue < 0) 760 770 return queue; 761 - } 762 771 763 772 IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d for sta %d tid %d\n", 764 773 queue, sta_id, tid); ··· 1400 1395 if (tid == IEEE80211_NUM_TIDS) 1401 1396 tid = IWL_MAX_TID_COUNT; 1402 1397 1403 - iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid); 1398 + /* 1399 + * We can't really do much here, but if this fails we can't 1400 + * transmit anyway - so just don't transmit the frame etc. 1401 + * and let them back up ... we've tried our best to allocate 1402 + * a queue in the function itself. 1403 + */ 1404 + if (iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid)) { 1405 + list_del_init(&mvmtxq->list); 1406 + continue; 1407 + } 1408 + 1404 1409 list_del_init(&mvmtxq->list); 1405 1410 local_bh_disable(); 1406 1411 iwl_mvm_mac_itxq_xmit(mvm->hw, txq); ··· 1980 1965 static void iwl_mvm_enable_aux_snif_queue(struct iwl_mvm *mvm, u16 queue, 1981 1966 u8 sta_id, u8 fifo) 1982 1967 { 1983 - unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? 1984 - mvm->trans->trans_cfg->base_params->wd_timeout : 1985 - IWL_WATCHDOG_DISABLED; 1968 + unsigned int wdg_timeout = 1969 + mvm->trans->trans_cfg->base_params->wd_timeout; 1986 1970 struct iwl_trans_txq_scd_cfg cfg = { 1987 1971 .fifo = fifo, 1988 1972 .sta_id = sta_id, ··· 1997 1983 1998 1984 static int iwl_mvm_enable_aux_snif_queue_tvqm(struct iwl_mvm *mvm, u8 sta_id) 1999 1985 { 2000 - unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? 2001 - mvm->trans->trans_cfg->base_params->wd_timeout : 2002 - IWL_WATCHDOG_DISABLED; 1986 + unsigned int wdg_timeout = 1987 + mvm->trans->trans_cfg->base_params->wd_timeout; 2003 1988 2004 1989 WARN_ON(!iwl_mvm_has_new_tx_api(mvm)); 2005 1990
+4 -7
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 11 + * Copyright(c) 2018 - 2020 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 - 2019 Intel Corporation 34 + * Copyright(c) 2018 - 2020 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 920 920 * No need to lock amsdu_in_ampdu_allowed since it can't be modified 921 921 * during an BA session. 922 922 */ 923 - if (info->flags & IEEE80211_TX_CTL_AMPDU && 924 - !mvmsta->tid_data[tid].amsdu_in_ampdu_allowed) 925 - return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); 926 - 927 - if (iwl_mvm_vif_low_latency(iwl_mvm_vif_from_mac80211(mvmsta->vif)) || 923 + if ((info->flags & IEEE80211_TX_CTL_AMPDU && 924 + !mvmsta->tid_data[tid].amsdu_in_ampdu_allowed) || 928 925 !(mvmsta->amsdu_enabled & BIT(tid))) 929 926 return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); 930 927
+23 -6
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. 31 32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 32 33 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 33 - * Copyright(c) 2018 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 586 588 IWL_ERR(mvm, "0x%08X | flow_handler\n", table.flow_handler); 587 589 } 588 590 591 + static void iwl_mvm_dump_iml_error_log(struct iwl_mvm *mvm) 592 + { 593 + struct iwl_trans *trans = mvm->trans; 594 + u32 error; 595 + 596 + error = iwl_read_umac_prph(trans, UMAG_SB_CPU_2_STATUS); 597 + 598 + IWL_ERR(trans, "IML/ROM dump:\n"); 599 + 600 + if (error & 0xFFFF0000) 601 + IWL_ERR(trans, "IML/ROM SYSASSERT:\n"); 602 + 603 + IWL_ERR(mvm, "0x%08X | IML/ROM error/state\n", error); 604 + IWL_ERR(mvm, "0x%08X | IML/ROM data1\n", 605 + iwl_read_umac_prph(trans, UMAG_SB_CPU_1_STATUS)); 606 + } 607 + 589 608 void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) 590 609 { 591 610 if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) { ··· 617 602 iwl_mvm_dump_lmac_error_log(mvm, 1); 618 603 619 604 iwl_mvm_dump_umac_error_log(mvm); 605 + 606 + if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) 607 + iwl_mvm_dump_iml_error_log(mvm); 620 608 621 609 iwl_fw_error_print_fseq_regs(&mvm->fwrt); 622 610 } ··· 970 952 IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) && 971 953 vif && vif->type == NL80211_IFTYPE_AP) 972 954 return IWL_WATCHDOG_DISABLED; 973 - return iwlmvm_mod_params.tfd_q_hang_detect ? 974 - default_timeout : IWL_WATCHDOG_DISABLED; 955 + return default_timeout; 975 956 } 976 957 977 958 trigger = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS);
+32 -79
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 9 * Copyright(c) 2016-2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 10 + * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation 12 11 * 13 12 * This program is free software; you can redistribute it and/or modify 14 13 * it under the terms of version 2 of the GNU General Public License as ··· 27 28 * 28 29 * BSD LICENSE 29 30 * 30 - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 31 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 32 * All rights reserved. 33 33 * Copyright(c) 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 - 2019 Intel Corporation 34 + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without 37 37 * modification, are permitted provided that the following conditions ··· 590 592 IWL_DEV_INFO(0x2723, 0x1654, iwl_ax200_cfg_cc, iwl_ax200_killer_1650x_name), 591 593 IWL_DEV_INFO(0x2723, IWL_CFG_ANY, iwl_ax200_cfg_cc, iwl_ax200_name), 592 594 593 - /* Qu with Hr */ 594 - IWL_DEV_INFO(0x43F0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), 595 + /* QnJ with Hr */ 596 + IWL_DEV_INFO(0x2720, IWL_CFG_ANY, iwl_qnj_b0_hr_b0_cfg, iwl_ax201_name), 597 + 598 + /* Qu with Hr */ 595 599 IWL_DEV_INFO(0x43F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), 596 600 IWL_DEV_INFO(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 597 601 IWL_DEV_INFO(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 598 602 IWL_DEV_INFO(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 599 - IWL_DEV_INFO(0x43F0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), 600 - IWL_DEV_INFO(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), 601 - IWL_DEV_INFO(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), 602 603 IWL_DEV_INFO(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 603 604 IWL_DEV_INFO(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 604 - IWL_DEV_INFO(0x43F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), 605 - IWL_DEV_INFO(0xA0F0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), 606 605 IWL_DEV_INFO(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), 607 606 IWL_DEV_INFO(0xA0F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 608 607 IWL_DEV_INFO(0xA0F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 609 608 IWL_DEV_INFO(0xA0F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 610 - IWL_DEV_INFO(0xA0F0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), 611 609 IWL_DEV_INFO(0xA0F0, 0x0A10, iwl_ax201_cfg_qu_hr, NULL), 612 610 IWL_DEV_INFO(0xA0F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), 613 611 IWL_DEV_INFO(0xA0F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), 614 612 IWL_DEV_INFO(0xA0F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 615 613 IWL_DEV_INFO(0xA0F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 616 - IWL_DEV_INFO(0xA0F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), 617 614 IWL_DEV_INFO(0x02F0, 0x0070, iwl_ax201_cfg_quz_hr, NULL), 618 615 IWL_DEV_INFO(0x02F0, 0x0074, iwl_ax201_cfg_quz_hr, NULL), 619 616 IWL_DEV_INFO(0x02F0, 0x0078, iwl_ax201_cfg_quz_hr, NULL), 620 617 IWL_DEV_INFO(0x02F0, 0x007C, iwl_ax201_cfg_quz_hr, NULL), 621 - IWL_DEV_INFO(0x02F0, 0x0244, iwl_ax101_cfg_quz_hr, NULL), 622 618 IWL_DEV_INFO(0x02F0, 0x0310, iwl_ax201_cfg_quz_hr, NULL), 623 619 IWL_DEV_INFO(0x02F0, 0x1651, iwl_ax1650s_cfg_quz_hr, NULL), 624 620 IWL_DEV_INFO(0x02F0, 0x1652, iwl_ax1650i_cfg_quz_hr, NULL), 625 621 IWL_DEV_INFO(0x02F0, 0x2074, iwl_ax201_cfg_quz_hr, NULL), 626 622 IWL_DEV_INFO(0x02F0, 0x4070, iwl_ax201_cfg_quz_hr, NULL), 627 - IWL_DEV_INFO(0x02F0, 0x4244, iwl_ax101_cfg_quz_hr, NULL), 628 623 IWL_DEV_INFO(0x06F0, 0x0070, iwl_ax201_cfg_quz_hr, NULL), 629 624 IWL_DEV_INFO(0x06F0, 0x0074, iwl_ax201_cfg_quz_hr, NULL), 630 625 IWL_DEV_INFO(0x06F0, 0x0078, iwl_ax201_cfg_quz_hr, NULL), 631 626 IWL_DEV_INFO(0x06F0, 0x007C, iwl_ax201_cfg_quz_hr, NULL), 632 - IWL_DEV_INFO(0x06F0, 0x0244, iwl_ax101_cfg_quz_hr, NULL), 633 627 IWL_DEV_INFO(0x06F0, 0x0310, iwl_ax201_cfg_quz_hr, NULL), 634 628 IWL_DEV_INFO(0x06F0, 0x1651, iwl_ax1650s_cfg_quz_hr, NULL), 635 629 IWL_DEV_INFO(0x06F0, 0x1652, iwl_ax1650i_cfg_quz_hr, NULL), 636 630 IWL_DEV_INFO(0x06F0, 0x2074, iwl_ax201_cfg_quz_hr, NULL), 637 631 IWL_DEV_INFO(0x06F0, 0x4070, iwl_ax201_cfg_quz_hr, NULL), 638 - IWL_DEV_INFO(0x06F0, 0x4244, iwl_ax101_cfg_quz_hr, NULL), 639 - IWL_DEV_INFO(0x34F0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), 640 632 IWL_DEV_INFO(0x34F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), 641 633 IWL_DEV_INFO(0x34F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 642 634 IWL_DEV_INFO(0x34F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 643 635 IWL_DEV_INFO(0x34F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 644 - IWL_DEV_INFO(0x34F0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), 645 636 IWL_DEV_INFO(0x34F0, 0x0310, iwl_ax201_cfg_qu_hr, NULL), 646 637 IWL_DEV_INFO(0x34F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), 647 638 IWL_DEV_INFO(0x34F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), 648 639 IWL_DEV_INFO(0x34F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 649 640 IWL_DEV_INFO(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 650 - IWL_DEV_INFO(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), 651 641 652 - IWL_DEV_INFO(0x3DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), 653 642 IWL_DEV_INFO(0x3DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), 654 643 IWL_DEV_INFO(0x3DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 655 644 IWL_DEV_INFO(0x3DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 656 645 IWL_DEV_INFO(0x3DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 657 - IWL_DEV_INFO(0x3DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), 658 646 IWL_DEV_INFO(0x3DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL), 659 647 IWL_DEV_INFO(0x3DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), 660 648 IWL_DEV_INFO(0x3DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), 661 649 IWL_DEV_INFO(0x3DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 662 650 IWL_DEV_INFO(0x3DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 663 - IWL_DEV_INFO(0x3DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), 664 651 665 - IWL_DEV_INFO(0x4DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), 666 652 IWL_DEV_INFO(0x4DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), 667 653 IWL_DEV_INFO(0x4DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 668 654 IWL_DEV_INFO(0x4DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 669 655 IWL_DEV_INFO(0x4DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 670 - IWL_DEV_INFO(0x4DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), 671 656 IWL_DEV_INFO(0x4DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL), 672 657 IWL_DEV_INFO(0x4DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), 673 658 IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), 674 659 IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 675 660 IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 676 - IWL_DEV_INFO(0x4DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), 677 - 678 - IWL_DEV_INFO(0x2720, 0x0000, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 679 - IWL_DEV_INFO(0x2720, 0x0040, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 680 - IWL_DEV_INFO(0x2720, 0x0044, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 681 - IWL_DEV_INFO(0x2720, 0x0070, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 682 - IWL_DEV_INFO(0x2720, 0x0074, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 683 - IWL_DEV_INFO(0x2720, 0x0078, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 684 - IWL_DEV_INFO(0x2720, 0x007C, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 685 - IWL_DEV_INFO(0x2720, 0x0244, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 686 - IWL_DEV_INFO(0x2720, 0x0310, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 687 - IWL_DEV_INFO(0x2720, 0x0A10, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 688 - IWL_DEV_INFO(0x2720, 0x1080, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 689 - IWL_DEV_INFO(0x2720, 0x1651, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 690 - IWL_DEV_INFO(0x2720, 0x1652, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 691 - IWL_DEV_INFO(0x2720, 0x2074, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 692 - IWL_DEV_INFO(0x2720, 0x4070, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 693 - IWL_DEV_INFO(0x2720, 0x4244, iwl22000_2ax_cfg_qnj_hr_b0, NULL), 694 661 695 662 _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 696 663 IWL_CFG_MAC_TYPE_PU, IWL_CFG_ANY, ··· 754 791 IWL_CFG_NO_160, IWL_CFG_CORES_BT, 755 792 iwl9260_2ac_cfg, iwl9260_name), 756 793 757 - /* Qu with Jf */ 794 + /* Qu with Jf */ 758 795 /* Qu B step */ 759 796 _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 760 797 IWL_CFG_MAC_TYPE_QU, SILICON_B_STEP, ··· 930 967 IWL_CFG_RF_TYPE_JF2, IWL_CFG_RF_ID_JF, 931 968 IWL_CFG_NO_160, IWL_CFG_CORES_BT, 932 969 iwl9560_qnj_b0_jf_b0_cfg, iwl9560_killer_1550i_name), 970 + 971 + /* Qu with Hr */ 972 + /* Qu B step */ 973 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 974 + IWL_CFG_MAC_TYPE_QU, SILICON_B_STEP, 975 + IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY, 976 + IWL_CFG_ANY, IWL_CFG_ANY, 977 + iwl_qu_b0_hr1_b0, iwl_ax101_name), 978 + 979 + /* Qu C step */ 980 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 981 + IWL_CFG_MAC_TYPE_QU, SILICON_C_STEP, 982 + IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY, 983 + IWL_CFG_ANY, IWL_CFG_ANY, 984 + iwl_qu_c0_hr1_b0, iwl_ax101_name), 985 + 986 + /* QuZ */ 987 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 988 + IWL_CFG_MAC_TYPE_QUZ, IWL_CFG_ANY, 989 + IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY, 990 + IWL_CFG_ANY, IWL_CFG_ANY, 991 + iwl_quz_a0_hr1_b0, iwl_ax101_name), 992 + 933 993 #endif /* CONFIG_IWLMVM */ 934 994 }; 935 995 ··· 1050 1064 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) { 1051 1065 iwl_trans->cfg = &iwlax411_2ax_cfg_so_gf4_a0; 1052 1066 } 1053 - } else if (cfg == &iwl_ax101_cfg_qu_hr) { 1054 - if ((CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id) == 1055 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && 1056 - iwl_trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0) || 1057 - (CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id) == 1058 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR1))) { 1059 - iwl_trans->cfg = &iwl22000_2ax_cfg_qnj_hr_b0; 1060 - } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id) == 1061 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && 1062 - iwl_trans->hw_rev == CSR_HW_REV_TYPE_QUZ) { 1063 - iwl_trans->cfg = &iwl_ax101_cfg_quz_hr; 1064 - } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id) == 1065 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) { 1066 - iwl_trans->cfg = &iwl_ax101_cfg_qu_hr; 1067 - } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id) == 1068 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HRCDB)) { 1069 - IWL_ERR(iwl_trans, "RF ID HRCDB is not supported\n"); 1070 - return -EINVAL; 1071 - } else { 1072 - IWL_ERR(iwl_trans, "Unrecognized RF ID 0x%08x\n", 1073 - CSR_HW_RF_ID_TYPE_CHIP_ID(iwl_trans->hw_rf_id)); 1074 - return -EINVAL; 1075 - } 1076 1067 } 1077 1068 1078 1069 /* ··· 1059 1096 * rest must be removed once we convert Qu with Hr as well. 1060 1097 */ 1061 1098 if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QU_C0) { 1062 - if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr) 1063 - iwl_trans->cfg = &iwl_ax101_cfg_qu_c0_hr_b0; 1064 - else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr) 1099 + if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr) 1065 1100 iwl_trans->cfg = &iwl_ax201_cfg_qu_c0_hr_b0; 1066 1101 else if (iwl_trans->cfg == &killer1650s_2ax_cfg_qu_b0_hr_b0) 1067 1102 iwl_trans->cfg = &killer1650s_2ax_cfg_qu_c0_hr_b0; ··· 1069 1108 1070 1109 /* same thing for QuZ... */ 1071 1110 if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QUZ) { 1072 - if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr) 1073 - iwl_trans->cfg = &iwl_ax101_cfg_quz_hr; 1074 - else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr) 1111 + if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr) 1075 1112 iwl_trans->cfg = &iwl_ax201_cfg_quz_hr; 1076 1113 } 1077 1114 ··· 1120 1161 1121 1162 /* register transport layer debugfs here */ 1122 1163 iwl_trans_pcie_dbgfs_register(iwl_trans); 1123 - 1124 - /* The PCI device starts with a reference taken and we are 1125 - * supposed to release it here. But to simplify the 1126 - * interaction with the opmode, we don't do it now, but let 1127 - * the opmode release it when it's ready. 1128 - */ 1129 1164 1130 1165 return 0; 1131 1166
+4 -1
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
··· 189 189 * @rb_stts_dma: bus address of receive buffer status 190 190 * @lock: 191 191 * @queue: actual rx queue. Not used for multi-rx queue. 192 + * @next_rb_is_fragment: indicates that the previous RB that we handled set 193 + * the fragmented flag, so the next one is still another fragment 192 194 * 193 195 * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers 194 196 */ ··· 216 214 u32 queue_size; 217 215 struct list_head rx_free; 218 216 struct list_head rx_used; 219 - bool need_update; 217 + bool need_update, next_rb_is_fragment; 220 218 void *rb_stts; 221 219 dma_addr_t rb_stts_dma; 222 220 spinlock_t lock; ··· 558 556 u32 scd_base_addr; 559 557 struct iwl_dma_ptr scd_bc_tbls; 560 558 struct iwl_dma_ptr kw; 559 + struct dma_pool *bc_pool; 561 560 562 561 struct iwl_txq *txq_memory; 563 562 struct iwl_txq *txq[IWL_MAX_TVQM_QUEUES];
+27 -5
drivers/net/wireless/intel/iwlwifi/pcie/rx.c
··· 1427 1427 } 1428 1428 1429 1429 static struct iwl_rx_mem_buffer *iwl_pcie_get_rxb(struct iwl_trans *trans, 1430 - struct iwl_rxq *rxq, int i) 1430 + struct iwl_rxq *rxq, int i, 1431 + bool *join) 1431 1432 { 1432 1433 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 1433 1434 struct iwl_rx_mem_buffer *rxb; ··· 1442 1441 return rxb; 1443 1442 } 1444 1443 1445 - if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) 1444 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 1446 1445 vid = le16_to_cpu(rxq->cd[i].rbid); 1447 - else 1446 + *join = rxq->cd[i].flags & IWL_RX_CD_FLAGS_FRAGMENTED; 1447 + } else { 1448 1448 vid = le32_to_cpu(rxq->bd_32[i]) & 0x0FFF; /* 12-bit VID */ 1449 + } 1449 1450 1450 1451 if (!vid || vid > RX_POOL_SIZE(trans_pcie->num_rx_bufs)) 1451 1452 goto out_err; ··· 1505 1502 u32 rb_pending_alloc = 1506 1503 atomic_read(&trans_pcie->rba.req_pending) * 1507 1504 RX_CLAIM_REQ_ALLOC; 1505 + bool join = false; 1508 1506 1509 1507 if (unlikely(rb_pending_alloc >= rxq->queue_size / 2 && 1510 1508 !emergency)) { ··· 1518 1514 1519 1515 IWL_DEBUG_RX(trans, "Q %d: HW = %d, SW = %d\n", rxq->id, r, i); 1520 1516 1521 - rxb = iwl_pcie_get_rxb(trans, rxq, i); 1517 + rxb = iwl_pcie_get_rxb(trans, rxq, i, &join); 1522 1518 if (!rxb) 1523 1519 goto out; 1524 1520 1525 - iwl_pcie_rx_handle_rb(trans, rxq, rxb, emergency, i); 1521 + if (unlikely(join || rxq->next_rb_is_fragment)) { 1522 + rxq->next_rb_is_fragment = join; 1523 + /* 1524 + * We can only get a multi-RB in the following cases: 1525 + * - firmware issue, sending a too big notification 1526 + * - sniffer mode with a large A-MSDU 1527 + * - large MTU frames (>2k) 1528 + * since the multi-RB functionality is limited to newer 1529 + * hardware that cannot put multiple entries into a 1530 + * single RB. 1531 + * 1532 + * Right now, the higher layers aren't set up to deal 1533 + * with that, so discard all of these. 1534 + */ 1535 + list_add_tail(&rxb->list, &rxq->rx_free); 1536 + rxq->free_count++; 1537 + } else { 1538 + iwl_pcie_rx_handle_rb(trans, rxq, rxb, emergency, i); 1539 + } 1526 1540 1527 1541 i = (i + 1) & (rxq->queue_size - 1); 1528 1542
+19
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 3672 3672 3673 3673 init_waitqueue_head(&trans_pcie->sx_waitq); 3674 3674 3675 + /* 3676 + * For gen2 devices, we use a single allocation for each byte-count 3677 + * table, but they're pretty small (1k) so use a DMA pool that we 3678 + * allocate here. 3679 + */ 3680 + if (cfg_trans->gen2) { 3681 + size_t bc_tbl_size; 3682 + 3683 + if (cfg_trans->device_family >= IWL_DEVICE_FAMILY_AX210) 3684 + bc_tbl_size = sizeof(struct iwl_gen3_bc_tbl); 3685 + else 3686 + bc_tbl_size = sizeof(struct iwlagn_scd_bc_tbl); 3687 + 3688 + trans_pcie->bc_pool = dmam_pool_create("iwlwifi:bc", &pdev->dev, 3689 + bc_tbl_size, 256, 0); 3690 + if (!trans_pcie->bc_pool) 3691 + goto out_no_pci; 3692 + } 3693 + 3675 3694 if (trans_pcie->msix_enabled) { 3676 3695 ret = iwl_pcie_init_msix_handler(pdev, trans_pcie); 3677 3696 if (ret)
+23 -10
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2017 Intel Deutschland GmbH 9 - * Copyright(c) 2018 - 2019 Intel Corporation 9 + * Copyright(c) 2018 - 2020 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 20 20 * BSD LICENSE 21 21 * 22 22 * Copyright(c) 2017 Intel Deutschland GmbH 23 - * Copyright(c) 2018 - 2019 Intel Corporation 23 + * Copyright(c) 2018 - 2020 Intel Corporation 24 24 * All rights reserved. 25 25 * 26 26 * Redistribution and use in source and binary forms, with or without ··· 1224 1224 } 1225 1225 1226 1226 kfree(txq->entries); 1227 - iwl_pcie_free_dma_ptr(trans, &txq->bc_tbl); 1227 + if (txq->bc_tbl.addr) 1228 + dma_pool_free(trans_pcie->bc_pool, txq->bc_tbl.addr, 1229 + txq->bc_tbl.dma); 1228 1230 kfree(txq); 1229 1231 } 1230 1232 ··· 1274 1272 struct iwl_txq **intxq, int size, 1275 1273 unsigned int timeout) 1276 1274 { 1275 + struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 1276 + size_t bc_tbl_size, bc_tbl_entries; 1277 + struct iwl_txq *txq; 1277 1278 int ret; 1278 1279 1279 - struct iwl_txq *txq; 1280 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 1281 + bc_tbl_size = sizeof(struct iwl_gen3_bc_tbl); 1282 + bc_tbl_entries = bc_tbl_size / sizeof(u16); 1283 + } else { 1284 + bc_tbl_size = sizeof(struct iwlagn_scd_bc_tbl); 1285 + bc_tbl_entries = bc_tbl_size / sizeof(u16); 1286 + } 1287 + 1288 + if (WARN_ON(size > bc_tbl_entries)) 1289 + return -EINVAL; 1290 + 1280 1291 txq = kzalloc(sizeof(*txq), GFP_KERNEL); 1281 1292 if (!txq) 1282 1293 return -ENOMEM; 1283 - ret = iwl_pcie_alloc_dma_ptr(trans, &txq->bc_tbl, 1284 - (trans->trans_cfg->device_family >= 1285 - IWL_DEVICE_FAMILY_AX210) ? 1286 - sizeof(struct iwl_gen3_bc_tbl) : 1287 - sizeof(struct iwlagn_scd_bc_tbl)); 1288 - if (ret) { 1294 + 1295 + txq->bc_tbl.addr = dma_pool_alloc(trans_pcie->bc_pool, GFP_KERNEL, 1296 + &txq->bc_tbl.dma); 1297 + if (!txq->bc_tbl.addr) { 1289 1298 IWL_ERR(trans, "Scheduler BC Table allocation failed\n"); 1290 1299 kfree(txq); 1291 1300 return -ENOMEM;
+6 -6
drivers/net/wireless/intel/iwlwifi/pcie/tx.c
··· 8 8 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 - 2019 Intel Corporation 11 + * Copyright(c) 2018 - 2020 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify it 14 14 * under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 - 2019 Intel Corporation 34 + * Copyright(c) 2018 - 2020 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 954 954 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 955 955 u16 bc_tbls_size = trans->trans_cfg->base_params->num_of_queues; 956 956 957 - bc_tbls_size *= (trans->trans_cfg->device_family >= 958 - IWL_DEVICE_FAMILY_AX210) ? 959 - sizeof(struct iwl_gen3_bc_tbl) : 960 - sizeof(struct iwlagn_scd_bc_tbl); 957 + if (WARN_ON(trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)) 958 + return -EINVAL; 959 + 960 + bc_tbls_size *= sizeof(struct iwlagn_scd_bc_tbl); 961 961 962 962 /*It is not allowed to alloc twice, so warn when this happens. 963 963 * We cannot rely on the previous allocation, so free and fail */