Search Linux Wireless

Re: [PATCH 07/16] wil6210: refactor disconnect flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maya Erez <merez@xxxxxxxxxxxxxx> writes:

> From: Ahmad Masri <amasri@xxxxxxxxxxxxxx>
>
> 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 <amasri@xxxxxxxxxxxxxx>
> Signed-off-by: Maya Erez <merez@xxxxxxxxxxxxxx>

[...]

> +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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux