lockdep_assert_held(&mvm->mutex); BUG_ON(mvm->scan_cmd == NULL); IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n"); mvm->scan_status = IWL_MVM_SCAN_OS; memset(cmd, 0, sizeof(struct iwl_scan_cmd) + mvm->fw->ucode_capa.max_probe_length + (MAX_NUM_SCAN_CHANNELS * sizeof(struct iwl_scan_channel))); cmd->channel_count = (u8)req->n_channels; cmd->quiet_time = cpu_to_le16(IWL_ACTIVE_QUIET_TIME); cmd->quiet_plcp_th = cpu_to_le16(IWL_PLCP_QUIET_THRESH); cmd->rxchain_sel_flags = iwl_mvm_scan_rx_chain(mvm); cmd->max_out_time = iwl_mvm_scan_max_out_time(vif); cmd->suspend_time = iwl_mvm_scan_suspend_time(vif); cmd->rxon_flags = iwl_mvm_scan_rxon_flags(req); cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP | MAC_FILTER_IN_BEACON); if (vif->type == NL80211_IFTYPE_P2P_DEVICE) cmd->type = cpu_to_le32(SCAN_TYPE_DISCOVERY_FORCED); else cmd->type = cpu_to_le32(SCAN_TYPE_FORCED); cmd->repeats = cpu_to_le32(1); /* * If the user asked for passive scan, don't change to active scan if * you see any activity on the channel - remain passive. */
IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n"); mvm->scan_status = IWL_MVM_SCAN_OS; memset(cmd, 0, sizeof(struct iwl_scan_cmd) + mvm->fw->ucode_capa.max_probe_length + (MAX_NUM_SCAN_CHANNELS * sizeof(struct iwl_scan_channel))); ieee80211_iterate_active_interfaces_atomic(mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_vif_assoc_iterator, &is_assoc); cmd->channel_count = (u8)req->n_channels; cmd->quiet_time = cpu_to_le16(IWL_ACTIVE_QUIET_TIME); cmd->quiet_plcp_th = cpu_to_le16(IWL_PLCP_QUIET_THRESH); cmd->rxchain_sel_flags = iwl_mvm_scan_rx_chain(mvm); cmd->max_out_time = iwl_mvm_scan_max_out_time(vif, req->flags, is_assoc); cmd->suspend_time = iwl_mvm_scan_suspend_time(vif, is_assoc); cmd->rxon_flags = iwl_mvm_scan_rxon_flags(req); cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP | MAC_FILTER_IN_BEACON); if (vif->type == NL80211_IFTYPE_P2P_DEVICE) cmd->type = cpu_to_le32(SCAN_TYPE_DISCOVERY_FORCED); else cmd->type = cpu_to_le32(SCAN_TYPE_FORCED); cmd->repeats = cpu_to_le32(1); /* * If the user asked for passive scan, don't change to active scan if * you see any activity on the channel - remain passive. */