Re: [PATCH wireless-next v4 21/21] wifi: mac80211: define API to invoke SMD Drain Completion event
From: Johannes Berg
Date: Tue Nov 10 2026 - 15:55:53 EST
On Fri, 2026-11-06 at 13:28 +0530, Pooventhiran G wrote:
>
> +int ieee80211_notify_smd_drain_completion(struct ieee80211_vif *vif,
> + struct ieee80211_sta *station)
> +{
> + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> + struct sta_info *sta = container_of(station, struct sta_info, sta);
> +
> + lockdep_assert_wiphy(sdata->local->hw.wiphy);
> +
> + /* doesn't make sense to terminate if we are not draining already */
> + if (sta->smd_state != IEEE80211_STA_SMD_DRAIN)
> + return -EINVAL;
> +
> + cfg80211_notify_smd_drain_completion(&sdata->wdev, sta->addr);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(ieee80211_notify_smd_drain_completion);
I don't really see anyone checking the return value of this, and if we
don't think we need to protect hostapd from broken drivers, then this
could also just be an inline (or not exist). Anyway if it goes wrong the
client will just hit the timeout without much loss.
johannes