aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/fw/dbg.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-05-06wifi: iwlwifi: Ensure prph_mac dump includes all addressesDaniel Gabay1-7/+2
In prph_mac_iter, ensure that all required addresses are dumped even if a read fails. Currently, if a read fails, the region dump is stopped, preventing the creation of prph_mac.lst. By dumping all addresses even if a read fails, we can accurately determine which addresses were successfully read and which were not. Signed-off-by: Daniel Gabay <daniel.gabay@intel.com> Reviewed-by: Eilon Rinat <eilon.rinat@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240506095953.31fa9ce91a1c.Ia0c86f70c7a6874c15ffc6f8235aa88530208546@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-04-03Merge tag 'wireless-next-2024-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-nextJakub Kicinski1-0/+1
Kalle Valo says: ==================== wireless-next patches for v6.10 The first "new features" pull request for v6.10 with changes both in stack and in drivers. The big thing in this pull request is that wireless subsystem is now almost free of sparse warnings. There's only one warning left in ath11k which was introduced in v6.9-rc1 and will be fixed via the wireless tree. Realtek drivers continue to improve, now we have support for RTL8922AE and RTL8723CS devices. ath11k also has long waited support for P2P. This time we have a small conflict in iwlwifi, Stephen has an example merge resolution which should help with fixing the conflict: https://lore.kernel.org/all/20240326100945.765b8caf@canb.auug.org.au/ Major changes: rtw89 * RTL8922AE Wi-Fi 7 PCI device support rtw88 * RTL8723CS SDIO device support iwlwifi * don't support puncturing in 5 GHz * support monitor mode on passive channels * BZ-W device support * P2P with HE/EHT support ath11k * P2P support for QCA6390, WCN6855 and QCA2066 * tag 'wireless-next-2024-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (122 commits) wifi: mt76: mt7915: workaround dubious x | !y warning wifi: mwl8k: Avoid -Wflex-array-member-not-at-end warnings wifi: ti: Avoid a hundred -Wflex-array-member-not-at-end warnings wifi: iwlwifi: mvm: fix check in iwl_mvm_sta_fw_id_mask net: rfkill: gpio: Convert to platform remove callback returning void wifi: mac80211: use kvcalloc() for codel vars wifi: iwlwifi: reconfigure TLC during HW restart wifi: iwlwifi: mvm: don't change BA sessions during restart wifi: iwlwifi: mvm: select STA mask only for active links wifi: iwlwifi: mvm: set wider BW OFDMA ignore correctly wifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD cmd v9 wifi: iwlwifi: mvm: Declare HE/EHT capabilities support for P2P interfaces wifi: iwlwifi: mvm: Remove outdated comment wifi: iwlwifi: add support for BZ_W wifi: iwlwifi: Print a specific device name. wifi: iwlwifi: remove wrong CRF_IDs wifi: iwlwifi: remove devices that never came out wifi: iwlwifi: mvm: mark EMLSR disabled in cleanup iterator wifi: iwlwifi: mvm: fix active link counting during recovery wifi: iwlwifi: mvm: assign link STA ID lookups during restart ... ==================== Link: https://lore.kernel.org/r/20240403093625.CF515C433C7@smtp.kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-03-25wifi: iwlwifi: fw: add clarifying comments about iwl_fwrt_dump_dataJohannes Berg1-0/+1
iwl_fw_dbg_collect_sync() unconditionally accesses 'trig' at the beginning of the function, even though the data has an inner union and 'trig' isn't necessarily always used, it can be 'desc' instead. Add comments clarifying why this is OK, that 'trig'/'desc' must be first in the struct and how in it the use of the union's sub-structs is differentiated. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240319100755.49c3a39737cc.I91c588e0d66b49f0ee9103e8d4a0e501c2fd36d6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-03-25wifi: iwlwifi: fw: don't always use FW dump trigJohannes Berg1-7/+8
Since the dump_data (struct iwl_fwrt_dump_data) is a union, it's not safe to unconditionally access and use the 'trig' member, it might be 'desc' instead. Access it only if it's known to be 'trig' rather than 'desc', i.e. if ini-debug is present. Cc: stable@vger.kernel.org Fixes: 0eb50c674a1e ("iwlwifi: yoyo: send hcmd to fw after dump collection completes.") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240319100755.e2976bc58b29.I72fbd6135b3623227de53d8a2bb82776066cb72b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-08wifi: iwlwifi: use system_unbound_wq for debug dumpJohannes Berg1-2/+5
This can take some time, so it's better to use the unbound workqueue. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240204235836.75c8d2286f81.I478e9faf422f22ae66c0a113003fea83565c5692@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-08Merge wireless into wireless-nextJohannes Berg1-2/+1
There are some changes coming to wireless-next that will otherwise cause conflicts, pull wireless in first to be able to resolve that when applying the individual changes rather than having to do merge resolution later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02wifi: iwlwifi: fw: dbg: ensure correct config name sizesJohannes Berg1-1/+4
This hard-codes the size, but it's not obvious why that's correct. Use sizeof() and cross-check the two structs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240128084842.58fcdea2ace7.I49cb1d7bdbea12085aada0c96ef42fcbcb3d2b38@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02wifi: iwlwifi: fix some kernel-doc issuesJohannes Berg1-6/+9
Add return descriptions, move description contents after (parameter) sections and fix short descriptions. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240128084842.02ac00f67239.I4ad17097badfcbb82ccdb8c126f61a6f3170798e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-01wifi: iwlwifi: remove extra kernel-docJohannes Berg1-2/+1
This no longer exists, remove the kernel-doc. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240128102209.d2192d79bc09.Id9551728d618248dd471382a5283503a8976237a@changeid
2023-12-21wifi: iwlwifi: mvm: use the new command to clear the internal bufferEmmanuel Grumbach1-0/+9
The firmware can allow to clear the internal debug buffer. This can be used to sanitize the data when requested to. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20231219215605.99aed3efbacb.Ib5bda1d1ff4bae476667737d4081ad066d1d7e6b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-12-12wifi: iwlwifi: mvm: add a debugfs hook to clear the monitor dataEmmanuel Grumbach1-0/+10
This can be used by the user space when it wants to clear the data we collected so far for privacy reasons. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20231207044813.d5e97d5ec0d9.I7a5e836e6109e1fce7e6301dba8d1f28e60a5440@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-12-01wifi: iwlwifi: fw: replace deprecated strncpy with strscpy_padJustin Stitt1-4/+4
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Based on the deliberate `sizeof(dest) ... - 1` pattern we can see that both dump_info->dev_human_readable and dump_info->bus_human_readable are intended to be NUL-terminated. Moreover, since this seems to cross the file boundary let's NUL-pad to ensure no behavior change. strscpy_pad() covers both the NUL-termination and NUL-padding, let's use it. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt <justinstitt@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231019-strncpy-drivers-net-wireless-intel-iwlwifi-fw-dbg-c-v2-1-179b211a374b@google.com
2023-10-23wifi: iwlwifi: add support for SNPS DPHYIP region typeDaniel Gabay1-1/+55
Add the required logic for parsing and dumping this new region. Signed-off-by: Daniel Gabay <daniel.gabay@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20231017115047.c859539194e7.I965482de2871e28b09f4572f1aa87ae4e3b366be@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-23wifi: iwlwifi: add support for new ini region typesMiri Korenblit1-1/+71
YoYo introduces 2 new region types: prph mac and phy blocks. The data in this regions consists of a list of (base address, size) pairs. This way we can set a block of consecutive registers by the base address and the size, instead of a list of registers. Add support for parsing and dumping these new region types Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20231004123422.0a10320f4259.I680ef6e16267d95329ee239f05d0999f5a1719ac@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-10-23wifi: iwlwifi: Extract common prph mac/phy regions data dump logicMiri Korenblit1-17/+35
YoYo (debug data collection mechanism) is introducing 2 new types of regions: prph mac/phy ranges. These types will have a common logic of reading the data from the device as the mac/phy prph has. Put it in a separate function so it can be reused. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20231004123422.16f06414c65c.Ie911bc83a1e2f8fddb27b4c5bd24f933f8b674b6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-09-13wifi: iwlwifi: fw: disable firmware debug assertsGregory Greenman1-0/+25
Disable firmware debug asserts, which are used for internal firmware testing purposes only. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230913145231.8feafd9b17be.Ia7bec82ac25897caab581692d67055aa1aca2ed2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-21wifi: iwlwifi: fw: send marker cmd before suspend cmdMiri Korenblit1-4/+52
This is needed to sync the times in the FW and driver logs Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230620125813.9c84322c41b5.Id13816b3ece103f88514a7523b22bb2b9dcc8ab7@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-14wifi: iwlwifi: unify checks for HW error valuesJohannes Berg1-2/+2
The hardware, depending on which part fails or times out, returns 0xA5A5A5A. or 0x5A5A5A5. with the lowest 4 bits encoding some further reason/status. However, mostly we don't really need to care about the exact reasons, so unify the checks for this to avoid hardcoding those magic values all over the driver. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230612184434.3e2959741a38.I1c297a53787b87e4e2b8f296c041921338573f4d@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-07Merge wireless into wireless-nextJohannes Berg1-8/+11
There are a number of upcoming things in both the stack and drivers that would otherwise conflict, so merge wireless to wireless-next to be able to avoid those conflicts. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-06wifi: iwlwifi: remove dead code in iwl_dump_ini_imr_get_size()Mukesh Sisodiya1-7/+5
Remove the check for the IMR debug data size which leads to dead code. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230531194630.58eec8d40729.Ifb7d64706eed45726db804f36e785283dff7adab@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-05-16wifi: iwlwifi: fw: fix DBGI dumpJohannes Berg1-8/+11
The DBGI dump is (unsurprisingly) of type DBGI, not SRAM. This leads to bad register accesses because the union is built differently, there's no allocation ID, and thus the allocation ID ends up being 0x8000. Note that this was already wrong for DRAM vs. SMEM since they use different parts of the union, but the allocation ID is at the same place, so it worked. Fix all of this but set the allocation ID in a way that the offset calculation ends up without any offset. Fixes: 34bc27783a31 ("iwlwifi: yoyo: fix DBGI_SRAM ini dump header.") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230514120631.19a302ae4c65.I12272599f7c1930666157b9d5e7f81fe9ec4c421@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-14wifi: iwlwifi: fw: move memset before early returnTom Rix1-2/+2
Clang static analysis reports this representative issue dbg.c:1455:6: warning: Branch condition evaluates to a garbage value if (!rxf_data.size) ^~~~~~~~~~~~~~ This check depends on iwl_ini_get_rxf_data() to clear rxf_data but the function can return early without doing the clear. So move the memset before the early return. Fixes: cc9b6012d34b ("iwlwifi: yoyo: use hweight_long instead of bit manipulating") Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230414130637.872a7175f1ff.I33802a77a91998276992b088fbe25f61c87c33ac@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-14wifi: iwlwifi: yoyo: skip dump correctly on hw errorDaniel Gabay1-2/+2
When NIC is in a bad state, reading data will return 28 bits as 0xa5a5a5a and the lowest 4 bits are not fixed value. Mask these bits in a few places to skip the dump correctly. Fixes: 89639e06d0f3 ("iwlwifi: yoyo: support for new DBGI_SRAM region") Signed-off-by: Daniel Gabay <daniel.gabay@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230413213309.df6c0663179d.I36d8487b2419c6fefa65e5514855d94327c3b1eb@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-14wifi: iwlwifi: Fix the duplicate dump nameMukesh Sisodiya1-0/+2
Driver is using the dump name generated first time in all generated dump in case of NMI. The validity of dump name should be with each dump created and need to reset after each use. Fixes: 834f920ef34b ("wifi: iwlwifi: yoyo: Add driver defined dump file name") Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230413213309.6c987f820557.I924f2eae1eef2fe82c7a23be566551653d46f729@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-15wifi: iwlwifi: yoyo: Add new tlv for dump file name extensionMukesh Sisodiya1-1/+31
Add tlv in dump file for dump file name extension. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Greenman, Gregory <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230314194113.ffc28212994e.Ie5f10709548497061f95c1634d942dd2facf72ec@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-10iwlwifi: dbg: check trigger data before accessMordechay Goodstein1-0/+5
Without trigger data set, no point in any collection. so check that we have the info for collecting the data. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5fb34fb1f0eb.I4d7f2a4d162e80474540c5caf1194ed7d32977bc@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-03-10iwlwifi: dbg: in sync mode don't call scheduleMordechay Goodstein1-2/+2
Today in the code we have two options for collecting data sync/schedule, the two options call the same function and can lead to racing in free resources after done. So we call only one of two sync/schedule, and in case of sync only call sync function without also schedule to immediately run as a side job. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220304131517.88574097ce1b.I1b42297619d638d677a2300ed9a95105c1262101@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-03-10iwlwifi: yoyo: dump IMR DRAM only for HW and FW errorMukesh Sisodiya1-0/+25
Support debug collection of the platform IMR memory region only for HW and FW error. This region needs to be collected as the last region. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5b70e5ba9a41.I502f9b6179b97b163992729edd2b3c5c4ca9e311@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi/fw: use struct_size over open coded arithmeticMinghao Chi (CGEL ZTE)1-1/+1
Replace zero-length array with flexible-array member and make use of the struct_size() helper in kzalloc(). Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220216030841.1839666-1-chi.minghao@zte.com.cn Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: Make use of the helper macro LIST_HEAD()Cai Huoqing1-1/+1
Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev> Link: https://lore.kernel.org/r/20220209032322.37472-1-cai.huoqing@linux.dev Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: yoyo: send hcmd to fw after dump collection completes.Mukesh Sisodiya1-1/+31
Send a command to FW once the driver completes the dump collection for the timepoint which requires the command to be send. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220210181930.b8c1228a0c0a.I71da6a799253650f3d0b181315de388cb9360e30@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: yoyo: support dump policy for the dump sizeMukesh Sisodiya1-9/+28
Support dump size limitation based on the TLV by firmware. This is needed for limited memory systems so only the most important dumps are sent by driver. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220210181930.d7e1ff264766.If2327fd890a453cdc9069d26220394d0b4e79743@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: remove unused macrosJohannes Berg1-3/+0
Found with W=2, remove unused macros in C files. In one case move the macro under the corresponding ifdef. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220204122220.068c6052689b.Idbb7a87c2fd93619c1765c7f4ed15190c3fef2a7@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: fw: make dump_start callback voidJohannes Berg1-3/+2
We never return errors there, so just make it void. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220130115024.375b3a28d89e.Ia76e9bf13e26eb148abfebdaf859eab1b81d2af1@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: yoyo: remove DBGI_SRAM address reset writingRotem Saado1-2/+0
Due to preg protection we cannot write to this register while FW is running (when FW in Halt it is ok). since we have some cases that we need to dump this region while FW is running remove this writing from DRV. FW will do this writing. Signed-off-by: Rotem Saado <rotem.saado@intel.com> Fixes: 89639e06d0f3 ("iwlwifi: yoyo: support for new DBGI_SRAM region") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220129105618.209f3078bc74.I463530bd2f40daedb39f6d9df987bb7cee209033@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: yoyo: add IMR DRAM dump supportMukesh Sisodiya1-3/+94
Support debug collection of the platform IMR memory region, where data is copied by FW during d3 state Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220129105618.715f04ecc635.Ib89a6caa06c1324c1c0dd3f9f4cf7407f2857155@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: yoyo: fix DBGI_SRAM ini dump header.Rotem Saado1-2/+27
DBGI SRAM is new type of monitor, therefore it should be dump as monitor type with ini dump monitor header. Signed-off-by: Rotem Saado <rotem.saado@intel.com> Fixes: 89639e06d0f3 ("iwlwifi: yoyo: support for new DBGI_SRAM region") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220129105618.6c31f6a2dcfc.If311c1d548bc5f7157a449e848ea01f71f5592eb@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: dbg: add infra for tracking free buffer sizeMordechay Goodstein1-30/+60
Until now function just got a pointer to some buffer and used it as if it's good to use with no boundaries about size left in the buffer. This infra helps for internal functions ops to make sure buffer usage is in bound of allocation. We also add external checks with warnings to verify every internal function didn't exceed usage of the free buffer size. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220129105618.25c90fb14968.Ic8f05581a745d08011ca29b3f42767402643e8c5@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: avoid void pointer arithmeticJohannes Berg1-1/+1
Avoid void pointer arithmetic since it's technically undefined and causes warnings in some places that use our code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220128153014.e349104ecd94.Iadc937f475158b9437becdfefb361a97e7eaa934@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-21iwlwifi: yoyo: fix issue with new DBGI_SRAM region read.Mukesh Sisodiya1-1/+1
NIC has been grabbed for reading twice which is leading to NIC hang. Code correction are done for reading data with no grab function. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211219132536.55527214f8c9.I1748215ccb3fa20a3491a46a49b12e04eb560ac6@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-21iwlwifi: yoyo: support TLV-based firmware resetMukesh Sisodiya1-0/+3
Support resetting the firmware via TLV-based debugging. When applied, this will cause the driver to reset the firmware when the debugging is triggered. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211219121514.d59b29653a1e.I7b3be4a1ad1a9d5d0e86259740e89ac113c9348b@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-21iwlwifi: Read the correct addresses when getting the crf idMatti Gottlieb1-1/+1
The original implementation checked the HW family, and as a result of that used different addresses for the prph registers. The old HWs addresses start with 0xa****** and the newer ones start with 0xd******. For this there are iwl_read/write_umac_prph functions that just add the diff in the address automatically (in this case 0x300000), so the code will be common for all HWs In the original implementation the address given already had the 0xd****** causing the address to become 0x10***** (after adding the offset) Change the registers to start with 0xa*****. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211210090244.db2722547eb2.I03dce63698befc2fd9105111c3015b8d6e36868a@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-07iwlwifi: fw: correctly detect HW-SMEM region subtypeJohannes Berg1-2/+1
This is part of the "device memory" type, but with the subtypes we can now detect it properly, rather than having to make assumptions on the ID. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211204174546.91d33aa9dd3d.Ifb48e21fbb92ea25360856b5cc2afbb9b485d6b3@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-07iwlwifi: fw: add support for splitting region type bitsMordechay Goodstein1-5/+9
In next region tlv (3) region type is going to be split into bit mask without affecting the ops for handling region type, so we just mask the type independent of the version due to all versions having the same bits usage. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211204130722.083e4b47055e.If7483d854e3d07f81236d314b8155cd5996f306c@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-07iwlwifi: support 4-bits in MAC step valueMike Golant1-2/+2
We have a MAC component (which is inside the SoC) and it has several different HW steps. 3 bits used to be enough but now we need 4-bits to represent all the different steps. Properly support 4-bits in the MAC step value by refactoring all the current handling of the MAC step/dash. Already from family 8000 and up the dash (bits 0-1) no longer exists and the step (until 8000 bits 2-3) consists of the dash bits as well. To do this remove the CSR_HW_REV_STEP and the CSR_HW_REV_DASH macros, replace them with CSR_HW_REV_STEP_DASH and add hw_rev_step into the trans struct. In addition remove the CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP and CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH macros and create a new macro combining the 2 (this way we don't need shifting or anything else.) Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Mike Golant <michael.golant@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211207160459.2e81a14d1f80.Ia5287e37fb3439d805336837361f6491f958e465@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-10-22iwlwifi: fw dump: add infrastructure for dump scrubbingJohannes Berg1-3/+41
In firmware dumps, currently all kinds of key material may be included, e.g. in host commands (if firmware crashes during the processing of a key-related command) or in the TX FIFO(s) if we have been using in-TX-command key material. Additionally, some firmware versions will advertise sections of their internal data to not dump, due to them containing some sensitive data. Add some infrastructure to allow scrubbing this data out, as dependent on the opmode's idea of what will need to be done. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211017123741.360cc8fe55b1.Ie3bd3ece38043969f7e116e61a6ec1197a58d78b@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-10-22iwlwifi: Add support for getting rf id with blank otpMatti Gottlieb1-1/+1
When having a blank OTP the only way to get the rf id and the cdb info is from prph registers. Currently there is some implementation for this, but it is located in the wrong place in the code (should be before trying to understand what HW is connected and not after), and it has a partial implementation. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210826224715.820c2ae18c2b.Iec9b2e2615ce65e6aff5ce896589227a7030f4cf@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26iwlwifi: yoyo: support for new DBGI_SRAM regionMukesh Sisodiya1-0/+37
new region handling is added for dump collection. Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210819183728.af9a24b82396.I53c5f82bd2d0f56fd699e3841c922082d99f1c90@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26iwlwifi: fw: fix debug dump data declarationsJohannes Berg1-4/+4
The debug dump ranges aren't just an array of such ranges since each range has a variable size. Therefore, the use of a struct array is misleading at best. Change it to be a u8 data[] instead of the struct array, the code doesn't significantly change since it's actually doing things correctly now. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210819183728.693c9891097d.Idcaab1fd659e8be2f56be647b2534befd61a4460@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26iwlwifi: fw: correctly limit to monitor dumpJohannes Berg1-1/+1
In commit 79f033f6f229 ("iwlwifi: dbg: don't limit dump decisions to all or monitor") we changed the code to pass around a bitmap, but in the monitor_only case, one place accidentally used the bit number, not the bit mask, resulting in CSR and FW_INFO getting dumped instead of monitor data. Fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210805141826.774fd8729a33.Ic985a787071d1c0b127ef0ba8367da896ee11f57@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>