aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2013-04-28 11:55:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2013-05-13 18:15:18 +0200
commit53a9d61eb74e574aec2db86f63d9809b6116d164 (patch)
tree2249b1a5324163a62e82568c5df1805fef7745cf /drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
parentiwlwifi: mvm: Loosen the channel context/phy context coupling (diff)
downloadlinux-dev-53a9d61eb74e574aec2db86f63d9809b6116d164.tar.xz
linux-dev-53a9d61eb74e574aec2db86f63d9809b6116d164.zip
iwlwifi: mvm: Change PHY context handling
1. All the phy contexts are added immediately after the firmware is loaded and up. 2. Whenever a PHY context needs to be used, its reference counter is incremented and the PHY context is being configured to the appropriate configuration. 3. When a PHY context is no longer needed, its reference count is decremented. 4. PHY contexts are never removed. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
index f80e721eb5d0..0ea61aaf7754 100644
--- a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
@@ -212,8 +212,6 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
chains_static, chains_dynamic,
FW_CTXT_ACTION_ADD, 0);
- if (!ret)
- ctxt->ref = 1;
return ret;
}
@@ -223,9 +221,7 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
*/
void iwl_mvm_phy_ctxt_ref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
{
- WARN_ON(!ctxt->ref);
lockdep_assert_held(&mvm->mutex);
-
ctxt->ref++;
}
@@ -246,36 +242,8 @@ int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
FW_CTXT_ACTION_MODIFY, 0);
}
-/*
- * Send a command to the FW to remove the given phy context.
- * Once the command is sent, regardless of success or failure, the context is
- * marked as invalid
- */
-static void iwl_mvm_phy_ctxt_remove(struct iwl_mvm *mvm,
- struct iwl_mvm_phy_ctxt *ctxt)
-{
- struct iwl_phy_context_cmd cmd;
- int ret;
-
- lockdep_assert_held(&mvm->mutex);
-
- iwl_mvm_phy_ctxt_cmd_hdr(ctxt, &cmd, FW_CTXT_ACTION_REMOVE, 0);
- ret = iwl_mvm_send_cmd_pdu(mvm, PHY_CONTEXT_CMD, CMD_SYNC,
- sizeof(struct iwl_phy_context_cmd),
- &cmd);
- ctxt->channel = NULL;
- if (ret)
- IWL_ERR(mvm, "Failed to send PHY remove: ctxt id=%d\n",
- ctxt->id);
-}
-
void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
{
lockdep_assert_held(&mvm->mutex);
-
ctxt->ref--;
- if (ctxt->ref != 0)
- return;
-
- return iwl_mvm_phy_ctxt_remove(mvm, ctxt);
}