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 <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
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 @@
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);
}
-