@@ -137,6 +137,8 @@ enum net_request_wifi_cmd {
137137 NET_REQUEST_WIFI_CMD_AP_WPS_CONFIG ,
138138 /** Configure BSS maximum idle period */
139139 NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD ,
140+ /** Configure background scanning */
141+ NET_REQUEST_WIFI_CMD_BGSCAN ,
140142 /** @cond INTERNAL_HIDDEN */
141143 NET_REQUEST_WIFI_CMD_MAX
142144 /** @endcond */
@@ -332,6 +334,11 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE);
332334
333335NET_MGMT_DEFINE_REQUEST_HANDLER (NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD );
334336
337+ #define NET_REQUEST_WIFI_BGSCAN \
338+ (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BGSCAN)
339+
340+ NET_MGMT_DEFINE_REQUEST_HANDLER (NET_REQUEST_WIFI_BGSCAN );
341+
335342/** @cond INTERNAL_HIDDEN */
336343
337344enum {
@@ -1393,6 +1400,32 @@ enum wifi_sap_iface_state {
13931400 WIFI_SAP_IFACE_ENABLED
13941401};
13951402
1403+ #if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN ) || defined(__DOXYGEN__ )
1404+ /** @brief Wi-Fi background scan implementation */
1405+ enum wifi_bgscan_type {
1406+ /** None, background scan is disabled */
1407+ WIFI_BGSCAN_NONE = 0 ,
1408+ /** Simple, periodic scan based on signal strength */
1409+ WIFI_BGSCAN_SIMPLE ,
1410+ /** Learn channels used by the network (experimental) */
1411+ WIFI_BGSCAN_LEARN ,
1412+ };
1413+
1414+ /** @brief Wi-Fi background scan parameters */
1415+ struct wifi_bgscan_params {
1416+ /** The type of background scanning */
1417+ enum wifi_bgscan_type type ;
1418+ /** Short scan interval in seconds */
1419+ uint16_t short_interval ;
1420+ /** Long scan interval in seconds */
1421+ uint16_t long_interval ;
1422+ /** Signal strength threshold in dBm */
1423+ int8_t rssi_threshold ;
1424+ /** Number of BSS Transition Management (BTM) queries */
1425+ uint16_t btm_queries ;
1426+ };
1427+ #endif
1428+
13961429/* Extended Capabilities */
13971430enum wifi_ext_capab {
13981431 WIFI_EXT_CAPAB_20_40_COEX = 0 ,
@@ -1732,6 +1765,16 @@ struct wifi_mgmt_ops {
17321765 */
17331766 int (* set_bss_max_idle_period )(const struct device * dev ,
17341767 unsigned short bss_max_idle_period );
1768+ #if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN ) || defined(__DOXYGEN__ )
1769+ /** Configure background scanning
1770+ *
1771+ * @param dev Pointer to the device structure for the driver instance.
1772+ * @param params Background scanning configuration parameters
1773+ *
1774+ * @return 0 if ok, < 0 if error
1775+ */
1776+ int (* set_bgscan )(const struct device * dev , struct wifi_bgscan_params * params );
1777+ #endif
17351778};
17361779
17371780/** Wi-Fi management offload API */
0 commit comments