diff options
author | Liad Kaufman <liad.kaufman@intel.com> | 2014-11-17 04:36:21 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-12-02 09:51:55 -0500 |
commit | 6a95126763fb48784f9cb32c7c8d70d79d310550 (patch) | |
tree | 4981475a44fe64d680f1d7d334f75ffa483a6533 | |
parent | 490fefebb6db4c5f80c12ae2c1c6230e24733b2a (diff) |
iwlwifi: mvm: send dbg config hcmds to fw if set in tlv
Send all debug-configuration HCMDs that are set in the TLVs
to the FW. This may include HCMDs to configure the FW
monitor and FW log level, for example.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/fw.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c index bbb78710f237..1f1337a72127 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/iwlwifi/mvm/fw.c | |||
@@ -394,6 +394,42 @@ out: | |||
394 | return ret; | 394 | return ret; |
395 | } | 395 | } |
396 | 396 | ||
397 | static int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, | ||
398 | enum iwl_fw_dbg_conf conf_id) | ||
399 | { | ||
400 | u8 *ptr; | ||
401 | int ret; | ||
402 | int i; | ||
403 | |||
404 | if (WARN_ONCE(conf_id >= ARRAY_SIZE(mvm->fw->dbg_conf_tlv), | ||
405 | "Invalid configuration %d\n", conf_id)) | ||
406 | return -EINVAL; | ||
407 | |||
408 | if (!mvm->fw->dbg_conf_tlv[conf_id]) | ||
409 | return -EINVAL; | ||
410 | |||
411 | if (mvm->fw_dbg_conf != FW_DBG_INVALID) | ||
412 | IWL_WARN(mvm, "FW already configured (%d) - re-configuring\n", | ||
413 | mvm->fw_dbg_conf); | ||
414 | |||
415 | /* Send all HCMDs for configuring the FW debug */ | ||
416 | ptr = (void *)&mvm->fw->dbg_conf_tlv[conf_id]->hcmd; | ||
417 | for (i = 0; i < mvm->fw->dbg_conf_tlv[conf_id]->num_of_hcmds; i++) { | ||
418 | struct iwl_fw_dbg_conf_hcmd *cmd = (void *)ptr; | ||
419 | |||
420 | ret = iwl_mvm_send_cmd_pdu(mvm, cmd->id, 0, | ||
421 | le16_to_cpu(cmd->len), cmd->data); | ||
422 | if (ret) | ||
423 | return ret; | ||
424 | |||
425 | ptr += sizeof(*cmd); | ||
426 | ptr += le16_to_cpu(cmd->len); | ||
427 | } | ||
428 | |||
429 | mvm->fw_dbg_conf = conf_id; | ||
430 | return ret; | ||
431 | } | ||
432 | |||
397 | int iwl_mvm_up(struct iwl_mvm *mvm) | 433 | int iwl_mvm_up(struct iwl_mvm *mvm) |
398 | { | 434 | { |
399 | int ret, i; | 435 | int ret, i; |
@@ -445,6 +481,9 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
445 | if (ret) | 481 | if (ret) |
446 | IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); | 482 | IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); |
447 | 483 | ||
484 | mvm->fw_dbg_conf = FW_DBG_INVALID; | ||
485 | iwl_mvm_start_fw_dbg_conf(mvm, FW_DBG_CUSTOM); | ||
486 | |||
448 | ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant); | 487 | ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant); |
449 | if (ret) | 488 | if (ret) |
450 | goto error; | 489 | goto error; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 12be7f3fadfb..d24660fb4ef2 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -670,6 +670,7 @@ struct iwl_mvm { | |||
670 | /* -1 for always, 0 for never, >0 for that many times */ | 670 | /* -1 for always, 0 for never, >0 for that many times */ |
671 | s8 restart_fw; | 671 | s8 restart_fw; |
672 | struct work_struct fw_error_dump_wk; | 672 | struct work_struct fw_error_dump_wk; |
673 | enum iwl_fw_dbg_conf fw_dbg_conf; | ||
673 | 674 | ||
674 | #ifdef CONFIG_IWLWIFI_LEDS | 675 | #ifdef CONFIG_IWLWIFI_LEDS |
675 | struct led_classdev led; | 676 | struct led_classdev led; |