int hostapd_flush(struct hostapd_data *hapd)
{
+ int link_id = -1;
+
if (hapd->driver == NULL || hapd->driver->flush == NULL)
return 0;
- return hapd->driver->flush(hapd->drv_priv);
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf && hapd->conf->mld_ap)
+ link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+
+ return hapd->driver->flush(hapd->drv_priv, link_id);
}
/**
* flush - Flush all association stations (AP only)
* @priv: Private driver interface data
+ * @link_id: In case of MLO, valid link ID on which all associated
+ * stations will be flushed, -1 otherwise.
* Returns: 0 on success, -1 on failure
*
* This function requests the driver to disassociate all associated
* stations. This function does not need to be implemented if the
* driver does not process association frames internally.
*/
- int (*flush)(void *priv);
+ int (*flush)(void *priv, int link_id);
/**
* set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
static int
-atheros_flush(void *priv)
+atheros_flush(void *priv, int link_id)
{
u8 allsta[IEEE80211_ADDR_LEN];
os_memset(allsta, 0xff, IEEE80211_ADDR_LEN);
static int
-bsd_flush(void *priv)
+bsd_flush(void *priv, int link_id)
{
u8 allsta[IEEE80211_ADDR_LEN];
}
-static int hostap_flush(void *priv)
+static int hostap_flush(void *priv, int link_id)
{
struct hostap_driver_data *drv = priv;
struct prism2_hostapd_param param;
}
-static int i802_flush(void *priv)
+static int i802_flush(void *priv, int link_id)
{
struct i802_bss *bss = priv;
struct nl_msg *msg;
int res;
- wpa_printf(MSG_DEBUG, "nl80211: flush -> DEL_STATION %s (all)",
- bss->ifname);
+ if (link_id == NL80211_DRV_LINK_ID_NA)
+ wpa_printf(MSG_DEBUG, "nl80211: flush -> DEL_STATION %s (all)",
+ bss->ifname);
+ else
+ wpa_printf(MSG_DEBUG,
+ "nl80211: flush -> DEL_STATION %s (with link %d)",
+ bss->ifname, link_id);
/*
* XXX: FIX! this needs to flush all VLANs too
*/
msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION);
+ if (link_id >= 0 && (bss->valid_links & BIT(link_id)) &&
+ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))
+ goto fail;
+
res = send_and_recv_cmd(bss->drv, msg);
if (res) {
wpa_printf(MSG_DEBUG, "nl80211: Station flush failed: ret=%d "
"(%s)", res, strerror(-res));
}
return res;
+fail:
+ nlmsg_free(msg);
+ return -1;
}