mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
wifi: iwlwifi: enable monitor on passive/inactive channels
If firmware supports pure passive monitor on passive/inactive channels, enable that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240319100755.7c62f421f03e.I9969d3a46fed48e67fa28a7d00080b0dd314dabd@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
1c78d39f4e
commit
84ace57c22
|
|
@ -395,6 +395,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
|
|||
* @IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT: Support SPP (signaling and payload
|
||||
* protected) A-MSDU.
|
||||
* @IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT: Support secure LTF measurement.
|
||||
* @IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS: Support monitor mode on otherwise
|
||||
* passive channels
|
||||
*
|
||||
* @NUM_IWL_UCODE_TLV_CAPA: number of bits used
|
||||
*/
|
||||
|
|
@ -494,6 +496,7 @@ enum iwl_ucode_tlv_capa {
|
|||
IWL_UCODE_TLV_CAPA_SNIFF_VALIDATE_SUPPORT = (__force iwl_ucode_tlv_capa_t)116,
|
||||
IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT = (__force iwl_ucode_tlv_capa_t)117,
|
||||
IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT = (__force iwl_ucode_tlv_capa_t)121,
|
||||
IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS = (__force iwl_ucode_tlv_capa_t)122,
|
||||
NUM_IWL_UCODE_TLV_CAPA
|
||||
/*
|
||||
* This construction make both sparse (which cannot increment the previous
|
||||
|
|
|
|||
|
|
@ -392,11 +392,14 @@ static enum nl80211_band iwl_nl80211_band_from_channel_idx(int ch_idx)
|
|||
return NL80211_BAND_2GHZ;
|
||||
}
|
||||
|
||||
static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
|
||||
static int iwl_init_channel_map(struct iwl_trans *trans,
|
||||
const struct iwl_fw *fw,
|
||||
struct iwl_nvm_data *data,
|
||||
const void * const nvm_ch_flags,
|
||||
u32 sbands_flags, bool v4)
|
||||
{
|
||||
const struct iwl_cfg *cfg = trans->cfg;
|
||||
struct device *dev = trans->dev;
|
||||
int ch_idx;
|
||||
int n_channels = 0;
|
||||
struct ieee80211_channel *channel;
|
||||
|
|
@ -478,6 +481,10 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
|
|||
else
|
||||
channel->flags = 0;
|
||||
|
||||
if (fw_has_capa(&fw->ucode_capa,
|
||||
IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS))
|
||||
channel->flags |= IEEE80211_CHAN_CAN_MONITOR;
|
||||
|
||||
iwl_nvm_print_channel_flags(dev, IWL_DL_EEPROM,
|
||||
channel->hw_value, ch_flags);
|
||||
IWL_DEBUG_EEPROM(dev, "Ch. %d: %ddBm\n",
|
||||
|
|
@ -1171,12 +1178,11 @@ static void iwl_init_sbands(struct iwl_trans *trans,
|
|||
const struct iwl_fw *fw)
|
||||
{
|
||||
struct device *dev = trans->dev;
|
||||
const struct iwl_cfg *cfg = trans->cfg;
|
||||
int n_channels;
|
||||
int n_used = 0;
|
||||
struct ieee80211_supported_band *sband;
|
||||
|
||||
n_channels = iwl_init_channel_map(dev, cfg, data, nvm_ch_flags,
|
||||
n_channels = iwl_init_channel_map(trans, fw, data, nvm_ch_flags,
|
||||
sbands_flags, v4);
|
||||
sband = &data->bands[NL80211_BAND_2GHZ];
|
||||
sband->band = NL80211_BAND_2GHZ;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user