Skip to content

Commit 4531735

Browse files
committed
ath10k: move fw_version inside struct ath10k_fw_file
Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n(). Signed-off-by: Kalle Valo <[email protected]>
1 parent 7ebf721 commit 4531735

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,15 +1039,15 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
10391039

10401040
switch (ie_id) {
10411041
case ATH10K_FW_IE_FW_VERSION:
1042-
if (ie_len > sizeof(ar->hw->wiphy->fw_version) - 1)
1042+
if (ie_len > sizeof(fw_file->fw_version) - 1)
10431043
break;
10441044

1045-
memcpy(ar->hw->wiphy->fw_version, data, ie_len);
1046-
ar->hw->wiphy->fw_version[ie_len] = '\0';
1045+
memcpy(fw_file->fw_version, data, ie_len);
1046+
fw_file->fw_version[ie_len] = '\0';
10471047

10481048
ath10k_dbg(ar, ATH10K_DBG_BOOT,
10491049
"found fw version %s\n",
1050-
ar->hw->wiphy->fw_version);
1050+
fw_file->fw_version);
10511051
break;
10521052
case ATH10K_FW_IE_TIMESTAMP:
10531053
if (ie_len != sizeof(u32))
@@ -1866,6 +1866,11 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
18661866
goto err_power_down;
18671867
}
18681868

1869+
BUILD_BUG_ON(sizeof(ar->hw->wiphy->fw_version) !=
1870+
sizeof(ar->normal_mode_fw.fw_file.fw_version));
1871+
memcpy(ar->hw->wiphy->fw_version, ar->normal_mode_fw.fw_file.fw_version,
1872+
sizeof(ar->hw->wiphy->fw_version));
1873+
18691874
ath10k_debug_print_hwfw_info(ar);
18701875

18711876
ret = ath10k_core_pre_cal_download(ar);

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ enum ath10k_tx_pause_reason {
630630
struct ath10k_fw_file {
631631
const struct firmware *firmware;
632632

633+
char fw_version[ETHTOOL_FWVERS_LEN];
634+
633635
const void *firmware_data;
634636
size_t firmware_len;
635637

@@ -893,7 +895,6 @@ struct ath10k {
893895
struct {
894896
/* protected by conf_mutex */
895897
struct ath10k_fw_components utf_mode_fw;
896-
char utf_version[32];
897898
DECLARE_BITMAP(orig_fw_features, ATH10K_FW_FEATURE_COUNT);
898899
enum ath10k_fw_wmi_op_version orig_wmi_op_version;
899900
enum ath10k_fw_wmi_op_version op_version;

drivers/net/wireless/ath/ath10k/testmode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ static int ath10k_tm_fetch_utf_firmware_api_2(struct ath10k *ar,
205205

206206
switch (ie_id) {
207207
case ATH10K_FW_IE_FW_VERSION:
208-
if (ie_len > sizeof(ar->testmode.utf_version) - 1)
208+
if (ie_len > sizeof(fw_file->fw_version) - 1)
209209
break;
210210

211-
memcpy(ar->testmode.utf_version, data, ie_len);
212-
ar->testmode.utf_version[ie_len] = '\0';
211+
memcpy(fw_file->fw_version, data, ie_len);
212+
fw_file->fw_version[ie_len] = '\0';
213213

214214
ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
215215
"testmode found fw utf version %s\n",
216-
ar->testmode.utf_version);
216+
fw_file->fw_version);
217217
break;
218218
case ATH10K_FW_IE_TIMESTAMP:
219219
/* ignore timestamp, but don't warn about it either */
@@ -392,8 +392,8 @@ static int ath10k_tm_cmd_utf_start(struct ath10k *ar, struct nlattr *tb[])
392392

393393
ar->state = ATH10K_STATE_UTF;
394394

395-
if (strlen(ar->testmode.utf_version) > 0)
396-
ver = ar->testmode.utf_version;
395+
if (strlen(ar->testmode.utf_mode_fw.fw_file.fw_version) > 0)
396+
ver = ar->testmode.utf_mode_fw.fw_file.fw_version;
397397
else
398398
ver = "API 1";
399399

0 commit comments

Comments
 (0)