mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Andre Eikmeyer <dev@deq.rocks>
Cc: arend.vanspriel@broadcom.com, linux-wireless@vger.kernel.org,
	brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com,
	linux-kernel@vger.kernel.org,
	Sasha Finkelstein <k@chaosmail.tech>,
	Sven Peter <sven@kernel.org>, Janne Grunau <j@jannau.net>,
	Aditya Garg <aditya.garg@linux.dev>,
	Yossef Osman <Yossef.Osman@proton.me>
Subject: Re: [PATCH wireless-next v3 5/6] wifi: brcmfmac: add vendor commands for AWDL
Date: Sun, 29 Nov 2026 16:38:19 +0100	[thread overview]
Message-ID: <20261129153819.1017394-2-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <20261127124104.233236-6-dev@deq.rocks>

On Fri, 27 Nov 2026 13:41:03 +0100, Andre Eikmeyer <dev@deq.rocks> wrote:
> AWDL election, peer discovery and services run in user space, the
> firmware carries the AWDL frames and data. Add vendor commands of the
> Broadcom OUI on the primary interface, described in vendor.h:

[...]

> Tested-by: Yossef Osman <Yossef.Osman@proton.me>
> Tested-by: Aditya Garg <aditya.garg@linux.dev>
> Signed-off-by: Andre Eikmeyer <dev@deq.rocks>
> ---
>  .../broadcom/brcm80211/brcmfmac/awdl.c        | 726 +++++++++++++++++-
>  .../broadcom/brcm80211/brcmfmac/awdl.h        |  64 +-
>  .../broadcom/brcm80211/brcmfmac/cfg80211.c    |   5 +-
>  .../broadcom/brcm80211/brcmfmac/feature.c     |   6 +
>  .../broadcom/brcm80211/brcmfmac/feature.h     |   5 +-
>  .../broadcom/brcm80211/brcmfmac/vendor.c      |  82 ++
>  .../broadcom/brcm80211/brcmfmac/vendor.h      |  97 +++
>  7 files changed, 959 insertions(+), 26 deletions(-)

[...]

> +static void brcmf_awdl_remove_work(struct work_struct *work)
> +{
> +	struct brcmf_awdl *awdl = container_of(work, struct brcmf_awdl,
> +					       remove_work);
> +	struct brcmf_pub *drvr = container_of(awdl, struct brcmf_pub, awdl);
> +	bool gone;
> +
> +	rtnl_lock();
> +	wiphy_lock(drvr->wiphy);
> +	/* After a STOP, a suspend or the detach there is nothing left */
> +	spin_lock(&awdl->lock);
> +	gone = awdl->ifp && awdl->fw_removed;
> +	spin_unlock(&awdl->lock);
> +	if (gone && !brcmf_awdl_del(drvr))
> +		brcmf_awdl_send_result(drvr, BRCMF_VNDR_EVTS_AWDL_STOPPED,
> +				       -ENOLINK, NULL);
> +	wiphy_unlock(drvr->wiphy);
> +	rtnl_unlock();
> +}

[...]

> +	if (awdl->op != BRCMF_AWDL_OP_NONE)
> +		return -EBUSY;
> +	if (!awdl->ifp)
> +		return -ENOENT;
> +
> +	spin_lock(&awdl->lock);
> +	awdl->op = BRCMF_AWDL_OP_STOP;
> +	spin_unlock(&awdl->lock);
> +	schedule_work(&awdl->ctrl_work);
> +	return 0;
> +}

After an unsolicited removal sets fw_removed and queues remove_work,
AWDL_STOP can still see ifp and queue ctrl_work. If remove_work gets the
locks first, it sends AWDL_STOPPED(-ENOLINK), then ctrl_work consumes the
accepted STOP and sends a second AWDL_STOPPED(-ENOENT).

The driver state remains safe here, and the two events can be viewed as the
unsolicited removal followed by the result of the accepted STOP. I leave it
to you as I do not know whether user space can handle duplicate STOPPED
events, or whether the pending STOP should be coalesced with the
unsolicited-removal work (have remove_work consume pending STOP).

You may add my acknowledgement in v4.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>

Regards,
Arend

  reply	other threads:[~2026-11-29 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 12:40 [PATCH wireless-next v3 0/6] wifi: brcmfmac: AWDL for AirDrop on Apple T2 Macs Andre Eikmeyer
2026-11-27 12:40 ` [PATCH wireless-next v3 1/6] wifi: brcmfmac: move the interface_create definitions to fwil_types.h Andre Eikmeyer
2026-11-27 12:41 ` [PATCH wireless-next v3 2/6] wifi: brcmfmac: detect AWDL support of the firmware Andre Eikmeyer
2026-11-27 12:41 ` [PATCH wireless-next v3 3/6] wifi: brcmfmac: create and remove the AWDL interface Andre Eikmeyer
2026-11-29 15:38   ` Arend van Spriel
2026-11-27 12:41 ` [PATCH wireless-next v3 4/6] wifi: brcmfmac: add the AWDL data path Andre Eikmeyer
2026-11-27 12:41 ` [PATCH wireless-next v3 5/6] wifi: brcmfmac: add vendor commands for AWDL Andre Eikmeyer
2026-11-29 15:38   ` Arend van Spriel [this message]
2026-11-27 12:41 ` [PATCH wireless-next v3 6/6] wifi: brcmfmac: pass AWDL frames and role changes to user space Andre Eikmeyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129153819.1017394-2-arend.vanspriel@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=Yossef.Osman@proton.me \
    --cc=aditya.garg@linux.dev \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=dev@deq.rocks \
    --cc=j@jannau.net \
    --cc=k@chaosmail.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sven@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®