Maya Erez <[email protected]> writes:

> From: Ahmad Masri <[email protected]>
>
> Separate sending command to the fw from the event handling function to
> simplify the disconnect flow and track the from_event flag correctly.
>
> Signed-off-by: Ahmad Masri <[email protected]>
> Signed-off-by: Maya Erez <[email protected]>

[...]

> +static int wil_disconnect_cid(struct wil6210_vif *vif, int cid,
> +                           u16 reason_code)
> +__acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
> +{
> +     struct wil6210_priv *wil = vif_to_wil(vif);
> +     struct wireless_dev *wdev = vif_to_wdev(vif);
> +     struct wil_sta_info *sta = &wil->sta[cid];
> +     bool del_sta = false;
> +
> +     might_sleep();
> +     wil_dbg_misc(wil, "disconnect_cid: CID %d, MID %d, status %d\n",
> +                  cid, sta->mid, sta->status);
> +
> +     if (sta->status == wil_sta_unused)
> +             return 0;
> +
> +     if (vif->mid != sta->mid) {
> +             wil_err(wil, "STA MID mismatch with VIF MID(%d)\n", vif->mid);
> +             return -EINVAL;
> +     }
> +
> +     /* inform lower layers */
> +     if (wdev->iftype == NL80211_IFTYPE_AP && disable_ap_sme)
> +             del_sta = true;
> +
> +     /* disconnect by sending command disconnect/del_sta and wait
> +      * synchronously for WMI_DISCONNECT_EVENTID event.
> +      */
> +     return wmi_disconnect_sta(vif, sta->addr, reason_code, del_sta);
> +}

I don't get use of __acquires() and __releases() in this function. I see
similar pattern already in wil6210 but care to explain why this is
needed? I don't see the function even accessing tid_rx_lock so I'm very
confused.

-- 
Kalle Valo

Reply via email to