aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c
Commit message (Collapse)AuthorAgeFilesLines
* wifi: iwlwifi: add support for accepting raw DSM tables by firmwarePagadala Yesu Anjaneyulu2025-07-111-0/+6
| | | | | | | | | | | Firmware would assert on undefined bits in DSM-originated DWs. With this change, Firmware introduces a fail-safe mechanism and removes the assert behavior. This ensures robustness when handling raw DSM table data. Signed-off-by: Pagadala Yesu Anjaneyulu <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250710212632.eee871df03c9.I2be2eaa16437e84aa1be0c6c95ec334034ce7e50@changeid
* wifi: iwlwifi: convert to use secs_to_jiffies()Yuesong Li2025-06-251-1/+1
| | | | | | | | | Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can use it to avoid scaling the time to msec. Signed-off-by: Yuesong Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Miri Korenblit <[email protected]>
* wifi: iwlwifi: trans: collect device informationJohannes Berg2025-05-071-1/+1
| | | | | | | | | | | Add a new device information 'info' substruct to the transport that's const and can only be set by a special helper, and move some information there. Signed-off-by: Johannes Berg <[email protected]> Reviewed-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250503224232.cd80cb55403c.Ic18524b66d655fad734bf97192a54d9cfa9fdf1f@changeid
* wifi: iwlwifi: move fw_dbg_collect to fw debugfsEmmanuel Grumbach2025-01-131-0/+19
| | | | | | | | | | This debugfs hook really belongs to the firmware handling code and then we can use it across different op_modes. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20241228223206.d31f5994c6a6.Ibe3bc7a25e2bbf7a575287e19db58833bb3e6b9e@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: move fw_ver debugfs to firmware runtimeEmmanuel Grumbach2025-01-131-1/+22
| | | | | | | | | This is really where it belongs. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20241228223206.98bdc5e62828.Iee7a8365dd63ebf580d324f90e1e04466d8ef5d5@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: remove fw_running opShahar S Matityahu2024-05-231-2/+1
| | | | | | | | | | | | | | fw_running assumes that memory can be retrieved only after alive. This assumption is no longer true as we support dump before alive. To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED bit in trans status is set before dumping instead of the prior check. Signed-off-by: Shahar S Matityahu <[email protected]> Reviewed-by: Luciano Coelho <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: fw: Fix debugfs command sendingMukesh Sisodiya2023-10-231-1/+5
| | | | | | | | | | | | | | | During debugfs command handling transport function is used directly, this bypasses the locking used by runtime operation function and leads to a kernel warning when two commands are sent in parallel. Fix it by using runtime operations function when sending debugfs command. Signed-off-by: Mukesh Sisodiya <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231004123422.4f80ac90658a.Ia1dfa1195c919f3002fe08db3eefbd2bfa921bbf@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: implement enable/disable for China 2022 regulatoryAnjaneyulu2023-09-251-1/+7
| | | | | | | | | | | | | | China 2022 regulations are enabled by default. Disable only when disabled in BIOS or the firmware don't support this capability. If the firmware has this capability, read BIOS configuration data in function 4 using ACPI API and send GRP_REGULATORY_LARI_CONFIG_CHANGE_CMD to the firmware. Any error while reading BIOS data results in enablement of china 2022 regulations. Signed-off-by: Anjaneyulu <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230921110726.ba7cb3003e53.If5a180a59ee85ed4a4c9146cfeff841c25b81066@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: fw: send marker cmd before suspend cmdMiri Korenblit2023-06-211-22/+0
| | | | | | | | | This is needed to sync the times in the FW and driver logs Signed-off-by: Miri Korenblit <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230620125813.9c84322c41b5.Id13816b3ece103f88514a7523b22bb2b9dcc8ab7@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: debugfs: add ppag capa to fw info fileAlon Giladi2023-06-141-1/+10
| | | | | | | | | Add information about ppag_china_bit_support capability. Signed-off-by: Alon Giladi <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230612184434.4655922aff4d.Ie934027940bd53d05124222aa6a8a8b7021952c4@changeid Signed-off-by: Johannes Berg <[email protected]>
* wifi: iwlwifi: fw: fix memory leak in debugfsJohannes Berg2023-04-201-1/+3
| | | | | | | | | | | | Fix a memory leak that occurs when reading the fw_info file all the way, since we return NULL indicating no more data, but don't free the status tracking object. Fixes: 36dfe9ac6e8b ("iwlwifi: dump api version in yaml format") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230418122405.239e501b3b8d.I4268f87809ef91209cbcd748eee0863195e70fa2@changeid Signed-off-by: Johannes Berg <[email protected]>
* iwlwifi: prefer WIDE_ID() over iwl_cmd_id()Johannes Berg2022-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | The order of arguments for iwl_cmd_id() is confusing, and the version is always 0 and thus a useless argument. Prefer the WIDE_ID() macro (which needs to be a macro due to use in switch cases etc.) over the iwl_cmd_id() function. Obviously done with spatch: @@ expression G, C; @@ -iwl_cmd_id(C, G, 0) +WIDE_ID(G, C) Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20220128153014.cc4f9d1a2e9b.Ieb023cd773ea22e819d1ef1c37ae857ecc1a839d@changeid Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: use SPDX tagsJohannes Berg2020-12-091-61/+6
| | | | | | | | | | Use SPDX tags instead of the long copyright notices. Also cleanup some duplicate copyright notices and combine the years where possible. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: enable sending/setting debug host eventMordechay Goodstein2020-12-091-0/+29
| | | | | | | | | | This is used for BT node and for any user that wants to control what events would be send from FW to the driver. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201209231352.a9dba2daca59.I2b18bccf0d409f1517c3e2841b667014f9dafc24@changeid Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: Replace zero-length array with flexible-arrayGustavo A. R. Silva2020-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/20200507185538.GA14674@embeddedor Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: dump api version in yaml formatMordechay Goodstein2020-05-081-4/+100
| | | | | | | | | | | | | | | | | | | | | | Used for debugging what FW API we are using to understand misalignment with API changes. The output looks like this as a yaml format fw_api_ver: 0x0001: name: MVM_ALIVE cmd_ver: 99 notif_ver: 4 0x0108: name: PHY_CONTEXT_CMD cmd_ver: 2 notif_ver: 0 ... Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200424194456.18bf540ab8e0.I6217488f1740f0e6accd0cecd09dfd46bad88426@changeid
* iwlwifi: yoyo: don't allow changing the domain via debugfsLuca Coelho2020-01-041-27/+2
| | | | | | | | | | We don't want to allow changing the domain via debugfs so that we can apply the domain to all TLV types more easily (doing some at runtime is difficult due to buffer allocations etc.). Change the fw_dbg_domain debugfs file to be read-only and remove the write function. Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: dbg_ini: support domain changing via debugfsShahar S Matityahu2019-10-251-0/+35
| | | | | | | | Allow to change or read the debug domain bitmap at runtime via fw_dbg_domain debugfs. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: fw: no need to check return value of debugfs_create functionsGreg Kroah-Hartman2019-02-201-8/+3
| | | | | | | | | | | | | | | When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Johannes Berg <[email protected]> Cc: Emmanuel Grumbach <[email protected]> Cc: Luca Coelho <[email protected]> Cc: Intel Linux Wireless <[email protected]> Cc: Kalle Valo <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: add debugfs to send host commandShahar S Matityahu2018-10-061-0/+64
| | | | | | | | | | | | | | | Add debugfs to send host command in mvm and fmac op modes. Allows to send host command at runtime via send_hcmd debugfs file. The command is received as a string that represents hex values. The struct of the command is as follows: [cmd_id][flags][length][data] cmd_id and flags are 8 chars long each. length is 4 chars long. data is length * 2 chars long. Signed-off-by: Shahar S Matityahu <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho2018-08-311-3/+0
| | | | | | | | The Free Software Foundation address is superfluous and causes checkpatch to issue a warning when present. Remove all paragraphs with FSF's address to prevent that. Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: enable reading the value of delay in timestamp_marker cmdMordechay Goodstein2018-08-311-1/+9
| | | | | | | | The user can validate what was written to the file by reading it, and check what is the default value before changing it. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: runtime: avoid calling debugfs read functions more than onceNaftali Goldstein2018-08-311-24/+87
| | | | | | | | | | | | | | | | | | Upon first calling read() on a debugfs file, invoke iwl_dbgfs_##name##_read and store the response buffer on the heap, so subsequent read() calls don't need to invoke said function again. This is done because cat etc will call read() repeatedly until EOF is reached (or read() returns 0), which in the current implementation will cause said function to be invoked multiple times. With the current implementation this can also cause buggy behavior in some weird edge cases where the first invocation returns a string of length n, and the second of length m>n: The last m-n characters of the second invocation will be printed to screen. Signed-off-by: Naftali Goldstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: move timestamp functions from debugfs.h to dbg.hHaim Dreyfuss2018-04-201-0/+1
| | | | | | | | These functions are not debugfs functions so they should be in dbg.h instad in debugfs.h. Signed-off-by: Haim Dreyfuss <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* iwlwifi: set default timstamp marker cmdMordechay Goodstein2018-03-281-9/+15
| | | | | | | | In case debug configuration is started with LDBG cmd also start timestamp marker for syncing logs witn the FW. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
* wireless: Use octal not symbolic permissionsJoe Perches2018-03-271-1/+1
| | | | | | | | | | | | | | Prefer the direct use of octal for permissions. Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace and some typing. Miscellanea: o Whitespace neatening around these conversions. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
* iwlwifi: runtime: sync FW and host clocks for logsMordechay Goodstein2017-12-201-0/+195
For sync we send a marker cmd every <defined throughout debugfs> seconds. The trigger for getting gp2 clock values from the FW is set by writing to debugfs a periodic time in seconds, if value zero is written, only one request would be sent and the timer would be canceled. Also added a small infrastructure for debugfs runtime code. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]>