Re: [PATCH wireless-next v4 21/21] wifi: mac80211: define API to invoke SMD Drain Completion event
From: Pooventhiran G
Date: Fri Nov 13 2026 - 15:00:46 EST
On 11/11/2026 02:19 am, Johannes Berg wrote:
> 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.
>
Yes, it was made to return an int especially because of the ST state check.
But an invalid early-termination cannot (need not) be handled here and the STA
can just timeout. I will clean this up.
> johannes