hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/intel/iwlwifi/dvm/main.c
....@@ -1,26 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /******************************************************************************
23 *
3
- * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
4
+ * Copyright(c) 2003 - 2014, 2018 - 2020 Intel Corporation. All rights reserved.
45 * Copyright(c) 2015 Intel Deutschland GmbH
56 *
67 * Portions of this file are derived from the ipw3945 project, as well
78 * as portions of the ieee80211 subsystem header files.
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of version 2 of the GNU General Public License as
11
- * published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful, but WITHOUT
14
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
- * more details.
17
- *
18
- * You should have received a copy of the GNU General Public License along with
19
- * this program; if not, write to the Free Software Foundation, Inc.,
20
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
21
- *
22
- * The full GNU General Public License is included in this distribution in the
23
- * file called LICENSE.
249 *
2510 * Contact Information:
2611 * Intel Linux Wireless <linuxwifi@intel.com>
....@@ -67,7 +52,7 @@
6752
6853 #define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link AGN driver for Linux"
6954 MODULE_DESCRIPTION(DRV_DESCRIPTION);
70
-MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
55
+MODULE_AUTHOR(DRV_AUTHOR);
7156 MODULE_LICENSE("GPL");
7257
7358 /* Please keep this array *SORTED* by hex value.
....@@ -389,7 +374,7 @@
389374 &statistics_cmd);
390375 }
391376
392
-/**
377
+/*
393378 * iwl_bg_statistics_periodic - Timer callback to queue statistics
394379 *
395380 * This callback is provided in order to send a statistics request.
....@@ -548,7 +533,7 @@
548533 priv->event_log.next_entry = next_entry;
549534 }
550535
551
-/**
536
+/*
552537 * iwl_bg_ucode_trace - Timer callback to log ucode event
553538 *
554539 * The timer is continually set to execute every
....@@ -777,7 +762,7 @@
777762 IWL_ERR(priv, "failed to send BT Coex Config\n");
778763 }
779764
780
-/**
765
+/*
781766 * iwl_alive_start - called after REPLY_ALIVE notification received
782767 * from protocol/runtime uCode (initialization uCode's
783768 * Alive gets handled by iwl_init_alive_start()).
....@@ -1057,7 +1042,7 @@
10571042 ieee80211_restart_hw(priv->hw);
10581043 else
10591044 IWL_ERR(priv,
1060
- "Cannot request restart before registrating with mac80211\n");
1045
+ "Cannot request restart before registering with mac80211\n");
10611046 } else {
10621047 WARN_ON(1);
10631048 }
....@@ -1269,7 +1254,7 @@
12691254 ************************/
12701255 hw = iwl_alloc_all();
12711256 if (!hw) {
1272
- pr_err("%s: Cannot allocate network device\n", cfg->name);
1257
+ pr_err("%s: Cannot allocate network device\n", trans->name);
12731258 goto out;
12741259 }
12751260
....@@ -1281,7 +1266,7 @@
12811266 priv->cfg = cfg;
12821267 priv->fw = fw;
12831268
1284
- switch (priv->cfg->device_family) {
1269
+ switch (priv->trans->trans_cfg->device_family) {
12851270 case IWL_DEVICE_FAMILY_1000:
12861271 case IWL_DEVICE_FAMILY_100:
12871272 priv->lib = &iwl_dvm_1000_cfg;
....@@ -1356,7 +1341,7 @@
13561341 driver_data[2]);
13571342
13581343 WARN_ON(sizeof(priv->transport_queue_stop) * BITS_PER_BYTE <
1359
- priv->cfg->base_params->num_of_queues);
1344
+ priv->trans->trans_cfg->base_params->num_of_queues);
13601345
13611346 ucode_flags = fw->ucode_capa.flags;
13621347
....@@ -1384,12 +1369,6 @@
13841369
13851370 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
13861371
1387
- /* is antenna coupling more than 35dB ? */
1388
- priv->bt_ant_couple_ok =
1389
- (iwlwifi_mod_params.antenna_coupling >
1390
- IWL_BT_ANTENNA_COUPLING_THRESHOLD) ?
1391
- true : false;
1392
-
13931372 /* bt channel inhibition enabled*/
13941373 priv->bt_ch_announce = true;
13951374 IWL_DEBUG_INFO(priv, "BT channel inhibition is %s\n",
....@@ -1404,7 +1383,7 @@
14041383 * 2. Read REV register
14051384 ***********************/
14061385 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1407
- priv->cfg->name, priv->trans->hw_rev);
1386
+ priv->trans->name, priv->trans->hw_rev);
14081387
14091388 if (iwl_trans_start_hw(priv->trans))
14101389 goto out_free_hw;
....@@ -1419,9 +1398,9 @@
14191398 /* Reset chip to save power until we load uCode during "up". */
14201399 iwl_trans_stop_device(priv->trans);
14211400
1422
- priv->nvm_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg,
1423
- priv->eeprom_blob,
1424
- priv->eeprom_blob_size);
1401
+ priv->nvm_data = iwl_parse_eeprom_data(priv->trans, priv->cfg,
1402
+ priv->eeprom_blob,
1403
+ priv->eeprom_blob_size);
14251404 if (!priv->nvm_data)
14261405 goto out_free_eeprom_blob;
14271406
....@@ -1512,13 +1491,10 @@
15121491 if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
15131492 goto out_destroy_workqueue;
15141493
1515
- if (iwl_dbgfs_register(priv, dbgfs_dir))
1516
- goto out_mac80211_unregister;
1494
+ iwl_dbgfs_register(priv, dbgfs_dir);
15171495
15181496 return op_mode;
15191497
1520
-out_mac80211_unregister:
1521
- iwlagn_mac_unregister(priv);
15221498 out_destroy_workqueue:
15231499 iwl_tt_exit(priv);
15241500 iwl_cancel_deferred_work(priv);
....@@ -1668,7 +1644,6 @@
16681644 priv->status, table.valid);
16691645 }
16701646
1671
- trace_iwlwifi_dev_ucode_error(trans->dev, &table, 0, table.brd_ver);
16721647 IWL_ERR(priv, "0x%08X | %-28s\n", table.error_id,
16731648 desc_lookup(table.error_id));
16741649 IWL_ERR(priv, "0x%08X | uPc\n", table.pc);
....@@ -1707,9 +1682,8 @@
17071682
17081683 #define EVENT_START_OFFSET (4 * sizeof(u32))
17091684
1710
-/**
1685
+/*
17111686 * iwl_print_event_log - Dump error event log to syslog
1712
- *
17131687 */
17141688 static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
17151689 u32 num_events, u32 mode,
....@@ -1787,7 +1761,7 @@
17871761 return pos;
17881762 }
17891763
1790
-/**
1764
+/*
17911765 * iwl_print_last_event_logs - Dump the newest # of event log to syslog
17921766 */
17931767 static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
....@@ -1885,7 +1859,7 @@
18851859 return pos;
18861860 }
18871861
1888
- if (!(iwl_have_debug_level(IWL_DL_FW_ERRORS)) && !full_log)
1862
+ if (!(iwl_have_debug_level(IWL_DL_FW)) && !full_log)
18891863 size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
18901864 ? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
18911865 IWL_ERR(priv, "Start IWL Event Log Dump: display last %u entries\n",
....@@ -1901,7 +1875,7 @@
19011875 if (!*buf)
19021876 return -ENOMEM;
19031877 }
1904
- if (iwl_have_debug_level(IWL_DL_FW_ERRORS) || full_log) {
1878
+ if (iwl_have_debug_level(IWL_DL_FW) || full_log) {
19051879 /*
19061880 * if uCode has wrapped back to top of log,
19071881 * start at the oldest entry,
....@@ -1931,7 +1905,7 @@
19311905 unsigned int reload_msec;
19321906 unsigned long reload_jiffies;
19331907
1934
- if (iwl_have_debug_level(IWL_DL_FW_ERRORS))
1908
+ if (iwl_have_debug_level(IWL_DL_FW))
19351909 iwl_print_rx_config_cmd(priv, IWL_RXON_CTX_BSS);
19361910
19371911 /* uCode is no longer loaded. */
....@@ -1969,12 +1943,12 @@
19691943
19701944 if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) {
19711945 if (iwlwifi_mod_params.fw_restart) {
1972
- IWL_DEBUG_FW_ERRORS(priv,
1973
- "Restarting adapter due to uCode error.\n");
1946
+ IWL_DEBUG_FW(priv,
1947
+ "Restarting adapter due to uCode error.\n");
19741948 queue_work(priv->workqueue, &priv->restart);
19751949 } else
1976
- IWL_DEBUG_FW_ERRORS(priv,
1977
- "Detected FW error, but not restarting\n");
1950
+ IWL_DEBUG_FW(priv,
1951
+ "Detected FW error, but not restarting\n");
19781952 }
19791953 }
19801954