aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iwm
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2017-07-17 21:29:18 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2017-07-17 21:29:18 +0000
commitfe845d8e27bf3ebc742d7f8f2f7d1e21a848055d (patch)
tree370ca3092720b8fec01f8a324915f4d894edaccb /sys/dev/iwm
parent7e3db62753839a1adb6560af7d3824b65a912500 (diff)
downloadsrc-fe845d8e27bf3ebc742d7f8f2f7d1e21a848055d.tar.gz
src-fe845d8e27bf3ebc742d7f8f2f7d1e21a848055d.zip
[iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.
From the original commit: == * Actually look at the first channel in the list. If it's a 2.4GHz channel, set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we don't need to look further. * While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check. Taken-From: Linux iwlwifi == However, this only really does the latter. The sc_ic channel list isn't the scan channel list, it's the /whole list/ for the set of active channels, so I don't know what the right thing to do is here. So I'll commit this as an intermediary commit and we'll have to revisit whether to finish the refactor as-is. Tested: * Intel 7260, STA mode Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432
Notes
Notes: svn path=/head/; revision=321100
Diffstat (limited to 'sys/dev/iwm')
-rw-r--r--sys/dev/iwm/if_iwm_scan.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/sys/dev/iwm/if_iwm_scan.c b/sys/dev/iwm/if_iwm_scan.c
index de041b9a5f01..ab047d9b4d91 100644
--- a/sys/dev/iwm/if_iwm_scan.c
+++ b/sys/dev/iwm/if_iwm_scan.c
@@ -179,6 +179,17 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc)
return htole16(rx_chain);
}
+#if 0
+static uint32_t
+iwm_mvm_scan_rxon_flags(struct ieee80211_channel *c)
+{
+ if (IEEE80211_IS_CHAN_2GHZ(c))
+ return htole32(IWM_PHY_BAND_24);
+ else
+ return htole32(IWM_PHY_BAND_5);
+}
+#endif
+
static uint32_t
iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int flags, int no_cck)
{
@@ -202,6 +213,14 @@ iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int flags, int no_cck)
return htole32(IWM_RATE_6M_PLCP | tx_ant);
}
+static inline boolean_t
+iwm_mvm_rrm_scan_needed(struct iwm_softc *sc)
+{
+ /* require rrm scan whenever the fw supports it */
+ return fw_has_capa(&sc->ucode_capa,
+ IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT);
+}
+
#ifdef IWM_DEBUG
static const char *
iwm_mvm_ebs_status_str(enum iwm_scan_ebs_status status)
@@ -416,8 +435,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iwm_scan_probe_req *preq)
preq->band_data[0].len = htole16(frm - pos);
remain -= frm - pos;
- if (fw_has_capa(&sc->ucode_capa,
- IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) {
+ if (iwm_mvm_rrm_scan_needed(sc)) {
if (remain < 3)
return ENOBUFS;
*frm++ = IEEE80211_ELEMID_DSPARMS;
@@ -639,8 +657,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc)
IWM_SCAN_CHANNEL_FLAG_EBS_ACCURATE |
IWM_SCAN_CHANNEL_FLAG_CACHE_ADD;
- if (fw_has_capa(&sc->ucode_capa,
- IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT))
+ if (iwm_mvm_rrm_scan_needed(sc))
req->general_flags |=
htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED);
@@ -708,13 +725,14 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc)
req->scan_flags = htole32(IWM_MVM_LMAC_SCAN_FLAG_PASS_ALL |
IWM_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE |
IWM_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL);
- if (fw_has_capa(&sc->ucode_capa,
- IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT))
+ if (iwm_mvm_rrm_scan_needed(sc))
req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED);
+ /* Note - IWM_PHY_BAND_5 is 0 anyway */
req->flags = htole32(IWM_PHY_BAND_24);
if (sc->nvm_data->sku_cap_band_52GHz_enable)
req->flags |= htole32(IWM_PHY_BAND_5);
+
req->filter_flags =
htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON);