@@ -1107,6 +1107,28 @@ static void brcmf_scan_params_v2_to_v1(struct brcmf_scan_params_v2_le *params_v2
11071107 & params_v2_le -> channel_list [0 ], params_size );
11081108}
11091109
1110+ static u32 brcmf_nl80211_scan_flags_to_scan_flags (u32 nl80211_flags )
1111+ {
1112+ u32 scan_flags = 0 ;
1113+ if (nl80211_flags & NL80211_SCAN_FLAG_LOW_SPAN ) {
1114+ scan_flags |= BRCMF_SCANFLAGS_LOW_SPAN ;
1115+ brcmf_dbg (SCAN , "requested low span scan\n" );
1116+ }
1117+ if (nl80211_flags & NL80211_SCAN_FLAG_HIGH_ACCURACY ) {
1118+ scan_flags |= BRCMF_SCANFLAGS_HIGH_ACCURACY ;
1119+ brcmf_dbg (SCAN , "requested high accuracy scan\n" );
1120+ }
1121+ if (nl80211_flags & NL80211_SCAN_FLAG_LOW_POWER ) {
1122+ scan_flags |= BRCMF_SCANFLAGS_LOW_POWER ;
1123+ brcmf_dbg (SCAN , "requested low power scan\n" );
1124+ }
1125+ if (nl80211_flags & NL80211_SCAN_FLAG_LOW_PRIORITY ) {
1126+ scan_flags |= BRCMF_SCANFLAGS_LOW_PRIO ;
1127+ brcmf_dbg (SCAN , "requested low priority scan\n" );
1128+ }
1129+ return scan_flags ;
1130+ }
1131+
11101132static void brcmf_escan_prep (struct brcmf_cfg80211_info * cfg ,
11111133 struct brcmf_if * ifp ,
11121134 struct brcmf_scan_params_v2_le * params_le ,
@@ -1120,6 +1142,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
11201142 char * ptr ;
11211143 int length ;
11221144 struct brcmf_ssid_le ssid_le ;
1145+ u32 scan_type = BRCMF_SCANTYPE_ACTIVE ;
11231146
11241147 eth_broadcast_addr (params_le -> bssid );
11251148
@@ -1132,7 +1155,6 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
11321155
11331156 params_le -> bss_type = DOT11_BSSTYPE_ANY ;
11341157 params_le -> ssid_type = 0 ;
1135- params_le -> scan_type = cpu_to_le32 (BRCMF_SCANTYPE_ACTIVE );
11361158 params_le -> channel_num = 0 ;
11371159 params_le -> nprobes = cpu_to_le32 (-1 );
11381160 params_le -> active_time = cpu_to_le32 (-1 );
@@ -1192,9 +1214,17 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
11921214 }
11931215 } else {
11941216 brcmf_dbg (SCAN , "Performing passive scan\n" );
1195- params_le -> scan_type = cpu_to_le32 ( BRCMF_SCANTYPE_PASSIVE ) ;
1217+ scan_type = BRCMF_SCANTYPE_PASSIVE ;
11961218 }
1219+ scan_type |= brcmf_nl80211_scan_flags_to_scan_flags (request -> flags );
1220+ params_le -> scan_type = cpu_to_le32 (scan_type );
11971221 params_le -> length = cpu_to_le16 (length );
1222+
1223+ /* Include RNR results if requested */
1224+ if (request -> flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ ) {
1225+ params_le -> ssid_type |= BRCMF_SCANSSID_INC_RNR ;
1226+ }
1227+
11981228 /* Adding mask to channel numbers */
11991229 params_le -> channel_num =
12001230 cpu_to_le32 ((n_ssids << BRCMF_SCAN_PARAMS_NSSID_SHIFT ) |
@@ -7912,6 +7942,13 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
79127942 }
79137943 if (brcmf_feat_is_enabled (ifp , BRCMF_FEAT_SAE_EXT ))
79147944 wiphy -> features |= NL80211_FEATURE_SAE ;
7945+
7946+ /* High accuracy and low power scans are always supported. */
7947+ wiphy_ext_feature_set (wiphy , NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN );
7948+ wiphy_ext_feature_set (wiphy , NL80211_EXT_FEATURE_LOW_POWER_SCAN );
7949+ wiphy_ext_feature_set (wiphy , NL80211_EXT_FEATURE_LOW_SPAN_SCAN );
7950+ wiphy -> features |= NL80211_FEATURE_LOW_PRIORITY_SCAN ;
7951+
79157952 wiphy -> mgmt_stypes = brcmf_txrx_stypes ;
79167953 wiphy -> max_remain_on_channel_duration = 5000 ;
79177954 if (brcmf_feat_is_enabled (ifp , BRCMF_FEAT_PNO )) {
0 commit comments