@@ -1750,8 +1750,9 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1750
1750
& cp -> channel_config [ch_cnt ];
1751
1751
1752
1752
u32 s_ssid_bitmap = 0 , bssid_bitmap = 0 , flags = 0 ;
1753
- u8 j , k , s_max = 0 , b_max = 0 , n_used_bssid_entries ;
1754
- bool force_passive , found = false, allow_passive = true,
1753
+ u8 j , k , n_s_ssids = 0 , n_bssids = 0 ;
1754
+ u8 max_s_ssids , max_bssids ;
1755
+ bool force_passive = false, found = false, allow_passive = true,
1755
1756
unsolicited_probe_on_chan = false, psc_no_listen = false;
1756
1757
s8 psd_20 = IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED ;
1757
1758
@@ -1774,20 +1775,15 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1774
1775
cfg -> v5 .iter_count = 1 ;
1775
1776
cfg -> v5 .iter_interval = 0 ;
1776
1777
1777
- /*
1778
- * The optimize the scan time, i.e., reduce the scan dwell time
1779
- * on each channel, the below logic tries to set 3 direct BSSID
1780
- * probe requests for each broadcast probe request with a short
1781
- * SSID.
1782
- * TODO: improve this logic
1783
- */
1784
- n_used_bssid_entries = 3 ;
1785
1778
for (j = 0 ; j < params -> n_6ghz_params ; j ++ ) {
1786
1779
s8 tmp_psd_20 ;
1787
1780
1788
1781
if (!(scan_6ghz_params [j ].channel_idx == i ))
1789
1782
continue ;
1790
1783
1784
+ unsolicited_probe_on_chan |=
1785
+ scan_6ghz_params [j ].unsolicited_probe ;
1786
+
1791
1787
/* Use the highest PSD value allowed as advertised by
1792
1788
* APs for this channel
1793
1789
*/
@@ -1799,12 +1795,69 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1799
1795
psd_20 < tmp_psd_20 ))
1800
1796
psd_20 = tmp_psd_20 ;
1801
1797
1802
- found = false;
1803
- unsolicited_probe_on_chan |=
1804
- scan_6ghz_params [j ].unsolicited_probe ;
1805
1798
psc_no_listen |= scan_6ghz_params [j ].psc_no_listen ;
1799
+ }
1800
+
1801
+ /*
1802
+ * In the following cases apply passive scan:
1803
+ * 1. Non fragmented scan:
1804
+ * - PSC channel with NO_LISTEN_FLAG on should be treated
1805
+ * like non PSC channel
1806
+ * - Non PSC channel with more than 3 short SSIDs or more
1807
+ * than 9 BSSIDs.
1808
+ * - Non PSC Channel with unsolicited probe response and
1809
+ * more than 2 short SSIDs or more than 6 BSSIDs.
1810
+ * - PSC channel with more than 2 short SSIDs or more than
1811
+ * 6 BSSIDs.
1812
+ * 3. Fragmented scan:
1813
+ * - PSC channel with more than 1 SSID or 3 BSSIDs.
1814
+ * - Non PSC channel with more than 2 SSIDs or 6 BSSIDs.
1815
+ * - Non PSC channel with unsolicited probe response and
1816
+ * more than 1 SSID or more than 3 BSSIDs.
1817
+ */
1818
+ if (!iwl_mvm_is_scan_fragmented (params -> type )) {
1819
+ if (!cfg80211_channel_is_psc (params -> channels [i ]) ||
1820
+ flags & IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN ) {
1821
+ if (unsolicited_probe_on_chan ) {
1822
+ max_s_ssids = 2 ;
1823
+ max_bssids = 6 ;
1824
+ } else {
1825
+ max_s_ssids = 3 ;
1826
+ max_bssids = 9 ;
1827
+ }
1828
+ } else {
1829
+ max_s_ssids = 2 ;
1830
+ max_bssids = 6 ;
1831
+ }
1832
+ } else if (cfg80211_channel_is_psc (params -> channels [i ])) {
1833
+ max_s_ssids = 1 ;
1834
+ max_bssids = 3 ;
1835
+ } else {
1836
+ if (unsolicited_probe_on_chan ) {
1837
+ max_s_ssids = 1 ;
1838
+ max_bssids = 3 ;
1839
+ } else {
1840
+ max_s_ssids = 2 ;
1841
+ max_bssids = 6 ;
1842
+ }
1843
+ }
1844
+
1845
+ /*
1846
+ * The optimize the scan time, i.e., reduce the scan dwell time
1847
+ * on each channel, the below logic tries to set 3 direct BSSID
1848
+ * probe requests for each broadcast probe request with a short
1849
+ * SSID.
1850
+ * TODO: improve this logic
1851
+ */
1852
+ for (j = 0 ; j < params -> n_6ghz_params ; j ++ ) {
1853
+ if (!(scan_6ghz_params [j ].channel_idx == i ))
1854
+ continue ;
1855
+
1856
+ found = false;
1806
1857
1807
- for (k = 0 ; k < pp -> short_ssid_num ; k ++ ) {
1858
+ for (k = 0 ;
1859
+ k < pp -> short_ssid_num && n_s_ssids < max_s_ssids ;
1860
+ k ++ ) {
1808
1861
if (!scan_6ghz_params [j ].unsolicited_probe &&
1809
1862
le32_to_cpu (pp -> short_ssid [k ]) ==
1810
1863
scan_6ghz_params [j ].short_ssid ) {
@@ -1815,25 +1868,25 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1815
1868
}
1816
1869
1817
1870
/*
1818
- * Use short SSID only to create a new
1819
- * iteration during channel dwell or in
1820
- * case that the short SSID has a
1821
- * matching SSID, i.e., scan for hidden
1822
- * APs.
1871
+ * Prefer creating BSSID entries unless
1872
+ * the short SSID probe can be done in
1873
+ * the same channel dwell iteration.
1874
+ *
1875
+ * We also need to create a short SSID
1876
+ * entry for any hidden AP.
1823
1877
*/
1824
- if (n_used_bssid_entries >= 3 ) {
1825
- s_ssid_bitmap |= BIT (k );
1826
- s_max ++ ;
1827
- n_used_bssid_entries -= 3 ;
1828
- found = true;
1878
+ if (3 * n_s_ssids > n_bssids &&
1879
+ !pp -> direct_scan [k ].len )
1829
1880
break ;
1830
- } else if (pp -> direct_scan [k ].len ) {
1831
- s_ssid_bitmap |= BIT (k );
1832
- s_max ++ ;
1833
- found = true;
1881
+
1882
+ /* Hidden AP, cannot do passive scan */
1883
+ if (pp -> direct_scan [k ].len )
1834
1884
allow_passive = false;
1835
- break ;
1836
- }
1885
+
1886
+ s_ssid_bitmap |= BIT (k );
1887
+ n_s_ssids ++ ;
1888
+ found = true;
1889
+ break ;
1837
1890
}
1838
1891
}
1839
1892
@@ -1845,9 +1898,12 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1845
1898
scan_6ghz_params [j ].bssid ,
1846
1899
ETH_ALEN )) {
1847
1900
if (!(bssid_bitmap & BIT (k ))) {
1848
- bssid_bitmap |= BIT (k );
1849
- b_max ++ ;
1850
- n_used_bssid_entries ++ ;
1901
+ if (n_bssids < max_bssids ) {
1902
+ bssid_bitmap |= BIT (k );
1903
+ n_bssids ++ ;
1904
+ } else {
1905
+ force_passive = TRUE;
1906
+ }
1851
1907
}
1852
1908
break ;
1853
1909
}
@@ -1861,39 +1917,6 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1861
1917
if (unsolicited_probe_on_chan )
1862
1918
flags |= IWL_UHB_CHAN_CFG_FLAG_UNSOLICITED_PROBE_RES ;
1863
1919
1864
- /*
1865
- * In the following cases apply passive scan:
1866
- * 1. Non fragmented scan:
1867
- * - PSC channel with NO_LISTEN_FLAG on should be treated
1868
- * like non PSC channel
1869
- * - Non PSC channel with more than 3 short SSIDs or more
1870
- * than 9 BSSIDs.
1871
- * - Non PSC Channel with unsolicited probe response and
1872
- * more than 2 short SSIDs or more than 6 BSSIDs.
1873
- * - PSC channel with more than 2 short SSIDs or more than
1874
- * 6 BSSIDs.
1875
- * 3. Fragmented scan:
1876
- * - PSC channel with more than 1 SSID or 3 BSSIDs.
1877
- * - Non PSC channel with more than 2 SSIDs or 6 BSSIDs.
1878
- * - Non PSC channel with unsolicited probe response and
1879
- * more than 1 SSID or more than 3 BSSIDs.
1880
- */
1881
- if (!iwl_mvm_is_scan_fragmented (params -> type )) {
1882
- if (!cfg80211_channel_is_psc (params -> channels [i ]) ||
1883
- flags & IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN ) {
1884
- force_passive = (s_max > 3 || b_max > 9 );
1885
- force_passive |= (unsolicited_probe_on_chan &&
1886
- (s_max > 2 || b_max > 6 ));
1887
- } else {
1888
- force_passive = (s_max > 2 || b_max > 6 );
1889
- }
1890
- } else if (cfg80211_channel_is_psc (params -> channels [i ])) {
1891
- force_passive = (s_max > 1 || b_max > 3 );
1892
- } else {
1893
- force_passive = (s_max > 2 || b_max > 6 );
1894
- force_passive |= (unsolicited_probe_on_chan &&
1895
- (s_max > 1 || b_max > 3 ));
1896
- }
1897
1920
if ((allow_passive && force_passive ) ||
1898
1921
(!(bssid_bitmap | s_ssid_bitmap ) &&
1899
1922
!cfg80211_channel_is_psc (params -> channels [i ])))
0 commit comments