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 3/6] wifi: brcmfmac: create and remove the AWDL interface
Date: Sun, 29 Nov 2026 16:38:18 +0100 [thread overview]
Message-ID: <20261129153819.1017394-1-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <20261127124104.233236-4-dev@deq.rocks>
On Fri, 27 Nov 2026 13:41:01 +0100, Andre Eikmeyer <dev@deq.rocks> wrote:
> Firmware with AWDL support creates an interface of type AWDL with
> interface_create. The host gives the MAC address, the firmware
> interface index 2 and the AWDL BSSID 00:25:00:ff:94:73.
[...]
> 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/Makefile | 3 +-
> .../broadcom/brcm80211/brcmfmac/awdl.c | 292 ++++++++++++++++++
> .../broadcom/brcm80211/brcmfmac/awdl.h | 53 ++++
> .../broadcom/brcm80211/brcmfmac/cfg80211.c | 6 +
> .../broadcom/brcm80211/brcmfmac/core.c | 65 +++-
> .../broadcom/brcm80211/brcmfmac/core.h | 7 +
> .../broadcom/brcm80211/brcmfmac/fweh.c | 17 +
> 7 files changed, 434 insertions(+), 9 deletions(-)
> create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/awdl.c
> create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/awdl.h
[...]
> + spin_lock(&awdl->lock);
> + own = awdl->adding && ifp->ndev &&
> + ether_addr_equal(ifp->mac_addr, awdl->mac);
> + late = !own && awdl->abandoned && ifp->ndev &&
> + ether_addr_equal(ifp->mac_addr, awdl->abandoned_mac);
> + if (own) {
> + ifp->awdl = true;
> + strscpy(ifp->ndev->name, "awdl%d", IFNAMSIZ);
> + /* Keeps udev from giving it a name from the bus path */
> + ifp->ndev->name_assign_type = NET_NAME_PREDICTABLE;
> + awdl->ifp = ifp;
> + awdl->adding = false;
> + complete(&awdl->if_event);
> + } else if (late) {
> + awdl->abandoned = false;
> + }
> + spin_unlock(&awdl->lock);
[...]
> + if (awdl->ifp)
> + return -EBUSY;
> + if (brcmf_awdl_ifidx_used(drvr)) {
> + bphy_err(drvr, "interface index %d is in use, no AWDL\n",
> + BRCMF_AWDL_IFIDX);
> + return -EBUSY;
> + }
> +
> + spin_lock(&awdl->lock);
> + ether_addr_copy(awdl->mac, mac);
> + awdl->adding = true;
> + reinit_completion(&awdl->if_event);
> + spin_unlock(&awdl->lock);
A retry is still allowed while an abandoned interface event can arrive.
When the retry uses the same MAC, as it normally will, a late event from
the first create matches "own" before "late" and is accepted as the
retry's event.
If the retrying interface_create returns an error, awdl->ifp is then left
pointing at an unregistered interface. If it succeeds and sends another
event, brcmf_add_if() may replace and free the first ifp while awdl->ifp
still points to it. Please do not issue another create while abandoned is
set, unless the two create generations can be distinguished independently
of the MAC address.
Regards,
Arend
next prev parent 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 [this message]
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
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-1-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®