From d0f76d6869adad1f3757d102af47508be0642949 Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Thu, 9 Feb 2012 16:08:15 +0200 Subject: iwlwifi: virtualize the op_mode Define the op_mode as an interface with its ops. All the functions of the op_mode are "private", but its ops is made public in iwl-op-mode.h. The drv object starts the op_mode by using the start function in the public ops. Signed-off-by: Emmanuel Grumbach Signed-off-by: Wey-Yi Guy --- drivers/net/wireless/iwlwifi/iwl-drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-drv.c') diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index db430c7..8ff5256 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -65,6 +65,7 @@ #include "iwl-drv.h" #include "iwl-trans.h" #include "iwl-wifi.h" +#include "iwl-op-mode.h" int iwl_drv_start(struct iwl_shared *shrd, struct iwl_trans *trans, struct iwl_cfg *cfg) @@ -94,8 +95,9 @@ int iwl_drv_start(struct iwl_shared *shrd, void iwl_drv_stop(struct iwl_shared *shrd) { - iwl_op_mode_dvm_stop(shrd->priv); + /* op_mode can be NULL if its start failed */ + if (shrd->nic->op_mode) + iwl_op_mode_stop(shrd->nic->op_mode); kfree(shrd->nic); } - -- cgit v1.1