]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iwlwifi: runtime: add send host command op to firmware runtime op struct
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Tue, 12 Jun 2018 12:40:42 +0000 (15:40 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Sat, 6 Oct 2018 07:25:52 +0000 (10:25 +0300)
Add send host command op to firmware runtime op struct to allow sending
host commands to the op mode from the fw runtime context.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index ac6db5e2b3d02251c9f96110eeea5334b100208e..6b95d0e758897cbecf8cac036411cce590d408e8 100644 (file)
@@ -71,6 +71,7 @@ struct iwl_fw_runtime_ops {
        int (*dump_start)(void *ctx);
        void (*dump_end)(void *ctx);
        bool (*fw_running)(void *ctx);
+       int (*send_hcmd)(void *ctx, struct iwl_host_cmd *host_cmd);
 };
 
 #define MAX_NUM_LMAC 2
index c388e0e758e770d342c29c55cd1c3fe95cfc8978..3acf512bad47436da0e04ce00102669edc0d8003 100644 (file)
@@ -565,10 +565,23 @@ static bool iwl_mvm_fwrt_fw_running(void *ctx)
        return iwl_mvm_firmware_running(ctx);
 }
 
+static int iwl_mvm_fwrt_send_hcmd(void *ctx, struct iwl_host_cmd *host_cmd)
+{
+       struct iwl_mvm *mvm = (struct iwl_mvm *)ctx;
+       int ret;
+
+       mutex_lock(&mvm->mutex);
+       ret = iwl_mvm_send_cmd(mvm, host_cmd);
+       mutex_unlock(&mvm->mutex);
+
+       return ret;
+}
+
 static const struct iwl_fw_runtime_ops iwl_mvm_fwrt_ops = {
        .dump_start = iwl_mvm_fwrt_dump_start,
        .dump_end = iwl_mvm_fwrt_dump_end,
        .fw_running = iwl_mvm_fwrt_fw_running,
+       .send_hcmd = iwl_mvm_fwrt_send_hcmd,
 };
 
 static struct iwl_op_mode *