ath10k: move fw_features to struct ath10k_fw_file
[cascardo/linux.git] / drivers / net / wireless / ath / ath10k / core.c
index 015241a..71b8ca7 100644 (file)
@@ -261,7 +261,7 @@ void ath10k_core_get_fw_features_str(struct ath10k *ar,
        int i;
 
        for (i = 0; i < ATH10K_FW_FEATURE_COUNT; i++) {
-               if (test_bit(i, ar->fw_features)) {
+               if (test_bit(i, ar->normal_mode_fw.fw_file.fw_features)) {
                        if (len > 0)
                                len += scnprintf(buf + len, buf_len - len, ",");
 
@@ -627,7 +627,7 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
        ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result);
 
        if (!(skip_otp || test_bit(ATH10K_FW_FEATURE_IGNORE_OTP_RESULT,
-                                  ar->fw_features)) &&
+                                  ar->running_fw->fw_file.fw_features)) &&
            result != 0) {
                ath10k_err(ar, "otp calibration failed: %d", result);
                return -EINVAL;
@@ -1074,13 +1074,13 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
                                        ath10k_dbg(ar, ATH10K_DBG_BOOT,
                                                   "Enabling feature bit: %i\n",
                                                   i);
-                                       __set_bit(i, ar->fw_features);
+                                       __set_bit(i, fw_file->fw_features);
                                }
                        }
 
                        ath10k_dbg_dump(ar, ATH10K_DBG_BOOT, "features", "",
-                                       ar->fw_features,
-                                       sizeof(ar->fw_features));
+                                       ar->running_fw->fw_file.fw_features,
+                                       sizeof(fw_file->fw_features));
                        break;
                case ATH10K_FW_IE_FW_IMAGE:
                        ath10k_dbg(ar, ATH10K_DBG_BOOT,
@@ -1430,8 +1430,10 @@ static void ath10k_core_restart(struct work_struct *work)
 
 static int ath10k_core_init_firmware_features(struct ath10k *ar)
 {
-       if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features) &&
-           !test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
+       struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file;
+
+       if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) &&
+           !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) {
                ath10k_err(ar, "feature bits corrupted: 10.2 feature requires 10.x feature to be set as well");
                return -EINVAL;
        }
@@ -1450,7 +1452,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                break;
        case ATH10K_CRYPT_MODE_SW:
                if (!test_bit(ATH10K_FW_FEATURE_RAW_MODE_SUPPORT,
-                             ar->fw_features)) {
+                             fw_file->fw_features)) {
                        ath10k_err(ar, "cryptmode > 0 requires raw mode support from firmware");
                        return -EINVAL;
                }
@@ -1469,7 +1471,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 
        if (rawmode) {
                if (!test_bit(ATH10K_FW_FEATURE_RAW_MODE_SUPPORT,
-                             ar->fw_features)) {
+                             fw_file->fw_features)) {
                        ath10k_err(ar, "rawmode = 1 requires support from firmware");
                        return -EINVAL;
                }
@@ -1495,9 +1497,9 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
         * ATH10K_FW_IE_WMI_OP_VERSION.
         */
        if (ar->wmi.op_version == ATH10K_FW_WMI_OP_VERSION_UNSET) {
-               if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
+               if (test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) {
                        if (test_bit(ATH10K_FW_FEATURE_WMI_10_2,
-                                    ar->fw_features))
+                                    fw_file->fw_features))
                                ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_2;
                        else
                                ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_1;
@@ -1553,7 +1555,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                ar->max_spatial_stream = ar->hw_params.max_spatial_stream;
 
                if (test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
-                            ar->fw_features))
+                            fw_file->fw_features))
                        ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC_PFC;
                else
                        ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC;
@@ -1621,7 +1623,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
         * to set the clock source once the target is initialized.
         */
        if (test_bit(ATH10K_FW_FEATURE_SUPPORTS_SKIP_CLOCK_INIT,
-                    ar->fw_features)) {
+                    ar->running_fw->fw_file.fw_features)) {
                status = ath10k_bmi_write32(ar, hi_skip_clock_init, 1);
                if (status) {
                        ath10k_err(ar, "could not write to skip_clock_init: %d\n",