testmode.c (453173550256542c20b24a8d85b806941b77ac76) | testmode.c (c4cdf753ed4287467248126a4fac072fbba53b31) |
---|---|
1/* 2 * Copyright (c) 2014 Qualcomm Atheros, Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 348 unchanged lines hidden (view full) --- 357 if (ret) { 358 ath10k_err(ar, "failed to fetch UTF firmware: %d", ret); 359 goto err; 360 } 361 362 spin_lock_bh(&ar->data_lock); 363 ar->testmode.utf_monitor = true; 364 spin_unlock_bh(&ar->data_lock); | 1/* 2 * Copyright (c) 2014 Qualcomm Atheros, Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 348 unchanged lines hidden (view full) --- 357 if (ret) { 358 ath10k_err(ar, "failed to fetch UTF firmware: %d", ret); 359 goto err; 360 } 361 362 spin_lock_bh(&ar->data_lock); 363 ar->testmode.utf_monitor = true; 364 spin_unlock_bh(&ar->data_lock); |
365 BUILD_BUG_ON(sizeof(ar->fw_features) != 366 sizeof(ar->testmode.orig_fw_features)); | |
367 | 365 |
368 memcpy(ar->testmode.orig_fw_features, ar->fw_features, 369 sizeof(ar->fw_features)); | |
370 ar->testmode.orig_wmi_op_version = ar->wmi.op_version; | 366 ar->testmode.orig_wmi_op_version = ar->wmi.op_version; |
371 memset(ar->fw_features, 0, sizeof(ar->fw_features)); 372 | |
373 ar->wmi.op_version = ar->testmode.op_version; 374 375 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode wmi version %d\n", 376 ar->wmi.op_version); 377 378 ret = ath10k_hif_power_up(ar); 379 if (ret) { 380 ath10k_err(ar, "failed to power up hif (testmode): %d\n", ret); --- 21 unchanged lines hidden (view full) --- 402 mutex_unlock(&ar->conf_mutex); 403 404 return 0; 405 406err_power_down: 407 ath10k_hif_power_down(ar); 408 409err_fw_features: | 367 ar->wmi.op_version = ar->testmode.op_version; 368 369 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode wmi version %d\n", 370 ar->wmi.op_version); 371 372 ret = ath10k_hif_power_up(ar); 373 if (ret) { 374 ath10k_err(ar, "failed to power up hif (testmode): %d\n", ret); --- 21 unchanged lines hidden (view full) --- 396 mutex_unlock(&ar->conf_mutex); 397 398 return 0; 399 400err_power_down: 401 ath10k_hif_power_down(ar); 402 403err_fw_features: |
410 /* return the original firmware features */ 411 memcpy(ar->fw_features, ar->testmode.orig_fw_features, 412 sizeof(ar->fw_features)); | |
413 ar->wmi.op_version = ar->testmode.orig_wmi_op_version; 414 415 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware); 416 ar->testmode.utf_mode_fw.fw_file.firmware = NULL; 417 418err: 419 mutex_unlock(&ar->conf_mutex); 420 --- 8 unchanged lines hidden (view full) --- 429 ath10k_hif_power_down(ar); 430 431 spin_lock_bh(&ar->data_lock); 432 433 ar->testmode.utf_monitor = false; 434 435 spin_unlock_bh(&ar->data_lock); 436 | 404 ar->wmi.op_version = ar->testmode.orig_wmi_op_version; 405 406 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware); 407 ar->testmode.utf_mode_fw.fw_file.firmware = NULL; 408 409err: 410 mutex_unlock(&ar->conf_mutex); 411 --- 8 unchanged lines hidden (view full) --- 420 ath10k_hif_power_down(ar); 421 422 spin_lock_bh(&ar->data_lock); 423 424 ar->testmode.utf_monitor = false; 425 426 spin_unlock_bh(&ar->data_lock); 427 |
437 /* return the original firmware features */ 438 memcpy(ar->fw_features, ar->testmode.orig_fw_features, 439 sizeof(ar->fw_features)); 440 ar->wmi.op_version = ar->testmode.orig_wmi_op_version; 441 | |
442 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware); 443 ar->testmode.utf_mode_fw.fw_file.firmware = NULL; 444 445 ar->state = ATH10K_STATE_OFF; 446} 447 448static int ath10k_tm_cmd_utf_stop(struct ath10k *ar, struct nlattr *tb[]) 449{ --- 121 unchanged lines hidden --- | 428 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware); 429 ar->testmode.utf_mode_fw.fw_file.firmware = NULL; 430 431 ar->state = ATH10K_STATE_OFF; 432} 433 434static int ath10k_tm_cmd_utf_stop(struct ath10k *ar, struct nlattr *tb[]) 435{ --- 121 unchanged lines hidden --- |