Re: [PATCH 10/12] iwlwifi: Add support for getting rf id with blank otp
From: Kalle Valo <hidden>
Date: 2021-08-21 14:08:22
Luca Coelho [off-list ref] writes:
From: Matti Gottlieb <redacted> 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 <redacted> Signed-off-by: Luca Coelho <redacted>
[...]
+/*
+ * struct iwl_crf_chip_id_reg
+ *
+ * type: bits 0-11
+ * reserved: bits 12-18
+ * slave_exist: bit 19
+ * dash: bits 20-23
+ * step: bits 24-26
+ * flavor: bits 27-31
+ */
+struct iwl_crf_chip_id_reg {
+ u32 type : 12;
+ u32 reserved : 7;
+ u32 slave_exist : 1;
+ u32 dash : 4;
+ u32 step : 4;
+ u32 flavor : 4;
+};This doesn't look endian safe.
+ /* Set CDB capabilities */
+ if (cdb & BIT(4)) {
+ iwl_trans->hw_rf_id += BIT(28);
+ IWL_INFO(iwl_trans, "Adding cdb to rf id\n");
+ }Magic numbers. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches