Skip to content

Commit

Permalink
iwlwifi: mvm: read the rfkill state and feed it to iwlmei
Browse files Browse the repository at this point in the history
Read the rfkill state upon boot, mac start and mac stop.

Reviewed-by: Luciano Coelho <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
egrumbach authored and Kalle Valo committed Nov 26, 2021
1 parent bfcfdb5 commit 7ce1f21
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ static int iwl_mvm_mac_start(struct ieee80211_hw *hw)
ret = __iwl_mvm_mac_start(mvm);
mutex_unlock(&mvm->mutex);

iwl_mvm_mei_set_sw_rfkill_state(mvm);

return ret;
}

Expand Down Expand Up @@ -1265,6 +1267,8 @@ static void iwl_mvm_mac_stop(struct ieee80211_hw *hw)
*/
flush_work(&mvm->roc_done_wk);

iwl_mvm_mei_set_sw_rfkill_state(mvm);

mutex_lock(&mvm->mutex);
__iwl_mvm_mac_stop(mvm);
mutex_unlock(&mvm->mutex);
Expand Down
8 changes: 6 additions & 2 deletions drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2218,10 +2218,14 @@ static inline void iwl_mvm_mei_device_down(struct iwl_mvm *mvm)
iwl_mei_device_down();
}

static inline void iwl_mvm_mei_set_sw_rfkill_state(struct iwl_mvm *mvm, bool sw_rfkill)
static inline void iwl_mvm_mei_set_sw_rfkill_state(struct iwl_mvm *mvm)
{
bool sw_rfkill =
mvm->hw_registered ? rfkill_blocked(mvm->hw->wiphy->rfkill) : false;

if (mvm->mei_registered)
iwl_mei_set_rfkill_state(iwl_mvm_is_radio_killed(mvm), sw_rfkill);
iwl_mei_set_rfkill_state(iwl_mvm_is_radio_killed(mvm),
sw_rfkill);
}

void iwl_mvm_send_roaming_forbidden_event(struct iwl_mvm *mvm,
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,9 @@ static int iwl_mvm_start_post_nvm(struct iwl_mvm *mvm)
wiphy_rfkill_set_hw_state_reason(mvm->hw->wiphy,
mvm->mei_rfkill_blocked,
RFKILL_HARD_BLOCK_NOT_OWNER);

iwl_mvm_mei_set_sw_rfkill_state(mvm);

return 0;
}

Expand Down

0 comments on commit 7ce1f21

Please sign in to comment.