From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.100 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795378184; b=yTZCCAfQ8BoFLGlCAAqBeoeCno5vE/54Epoa3hAETO0e9TboDwbonPxC5NlNDO1K0g8a RqIVKJ8H0r/5IVRs19Rfyl9X9jFAB9HNBYQKXdgFpl2u2XAxXR1kuB4Yi2jDG41HOC4xN XMI9yUD2E9J2FSzYzEgVgJjr3NQrda1TzZi01ABlZGgEMwNg1K3eK/x0TsYAsY+KBqCeD u7SgvF13wEck3npTFB+OOrVfGB3CuWXdXWmKOVHqKv9vo3UbA/av6u0JZakVGZvWNOHta QWklQ+1uJ5ObidU6dEVlDTKIjp6SRHY1W57MPKB/wnpv/9zNR0+d1sYr3Jdo8rfzrEA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795378184; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:X-Relaying-Domain: X-CFilter-Loop:Received:DKIM-Signature:X-Forwarded-Encrypted: X-Received:X-Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-DetectorID-Processed; bh=eZo3uX94fDb6i+qgCUNfpTyWWfZP+yOV9UK8ddrvWfc=; b=GAXzOxilHfKiqhd8g+Ttu22enNXzcxPX+3eSsn0tFbKKR+sinWQRukP6MMLYIP61NxoG 4dcxVuCShekusRNhk355ycyfGyJfFBrnmx6s/WsfNfX4X9U+6IcvwZIx7itH4jptuWi/c Yed8uSg9BeihYnlykW6+seI4OXzsDXGWsV8XfXUkix333ofeR7IBNqcGRxkGHMjuwmqQa TYRC5R/I7OmUd+bIjyx22T62JHFfH5KVxA9tKrEZRI10snibLvmLKX4wPwkTdAppYwcYU ALL+FeQ48ENShRKI7CcT4CDQ07hY5RxC/UcCEe5AhgU+/+MbwrrIDfsEG4PhTxWXA+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=fjjD9awh; arc=none smtp.remote-ip=209.85.216.100 Received: from mail-pj1-f100.google.com (mail-pj1-f100.google.com [209.85.216.100]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE34E606A33D for ; Sun, 22 Nov 2026 20:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE34E606A33D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=fjjD9awh Received: by mail-pj1-f100.google.com with SMTP id 98e67ed59e1d1-3ac9f49b984so1429394a91.1 for ; Sun, 22 Nov 2026 12:09:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795378183; x=1795982983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=eZo3uX94fDb6i+qgCUNfpTyWWfZP+yOV9UK8ddrvWfc=; b=Lz9/sViGvWlavWlufJQW32lzCtbPg30UcE/zElldoBk8d+28r0Ly0LIvVGhohNq5Bo xzyJlfArSHWyKGvu2+sxeZ9ElFbc2+wO7YKZ3hpC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eKfldH3+eZ17CI7sKM8oEiO+ms9ELhCSqm3ac/vKaAVzMMAobsiRraBYYY9Q4Ri8 F5K3OdoCKr+2gY4FcgJjJBXo0VAZi5V7WgD4I+D3vpWg== X-Received: by 2002:a17:90b:3f0f:b0:3b0:9409:6969 with SMTP id 98e67ed59e1d1-3b41c90813cmr7285157a91.19.1795378183185; Sun, 22 Nov 2026 12:09:43 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-123.dlp.protect.broadcom.com. [144.49.247.123]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-3b41ff67243sm3417097a91.3.2026.11.22.12.09.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Nov 2026 12:09:43 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-93f37c94ceeso655291685a.1 for ; Sun, 22 Nov 2026 12:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1795378181; x=1795982981; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eZo3uX94fDb6i+qgCUNfpTyWWfZP+yOV9UK8ddrvWfc=; b=fjjD9awhKgUWYZySiNnUZp55Po7jObF1TCWu28I9DZpHy2ib+fo9xyDWKXB4HsRwtA OcXX6RzkrAgsMuxa0AcL/pdqCZnCLwoCaDISm9Ji2CMR6G/Y9cgMj6TGLjT5VOGYfEfG m+PZBzzcVuJOfEQf6pChUgK3aZL3Kya0lcrqo= X-Forwarded-Encrypted: i=1; AL+hErF8fKMl2UcYGQ4LJhD1QGYHNVjgn3d58GK5ZAMfW5pp7P4OimK9Ej28LsEb/aQxs1wOnxUv6h83Rf4uUGs=@vger.kernel.org X-Received: by 2002:a05:620a:45a8:b0:949:a6b9:25e7 with SMTP id af79cd13be357-949bab310fcmr1492154485a.38.1795378181018; Sun, 22 Nov 2026 12:09:41 -0800 (PST) X-Received: by 2002:a05:620a:45a8:b0:949:a6b9:25e7 with SMTP id af79cd13be357-949bab310fcmr1492150785a.38.1795378180574; Sun, 22 Nov 2026 12:09:40 -0800 (PST) Received: from bld-bun-02.bun.broadcom.net ([192.19.176.227]) by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb34ac11sm664845385a.14.2026.11.22.12.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 12:09:40 -0800 (PST) From: Arend van Spriel To: Andre Eikmeyer 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, Yossef Osman , Aditya Garg Subject: Re: [PATCH 5/7] wifi: brcmfmac: add the AWDL data path Date: Sun, 22 Nov 2026 21:09:28 +0100 Message-ID: <20261122200931.2090372-3-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261104151547.70333-6-dev@deq.rocks> References: <20261104151547.70333-6-dev@deq.rocks> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e On Wed, 4 Nov 2026 16:15:45 +0100, Andre Eikmeyer wrote: > The firmware passes AWDL data frames as 802.3 frames. An LLC/SNAP > header with the Apple OUI (aa aa 03 00 17 f2 08 00) is followed by the > AWDL data header 03 04, a 16 bit sequence number, two reserved bytes > and the ethertype. > > Let the AWDL network device send and receive plain Ethernet frames. Its > transmit function adds the 16 bytes of headers and counts the sequence > number, brcmf_netif_rx() removes them from received frames. The headroom > of the network device covers the added header. The addresses of > received frames are moved so that they form an Ethernet header with the > ethertype again, which keeps packet taps consistent. Other frames on > the AWDL interface are dropped. > > Tested-by: Yossef Osman > Tested-by: Aditya Garg > Signed-off-by: Andre Eikmeyer > --- > .../broadcom/brcm80211/brcmfmac/awdl.c | 83 +++++++++++++++++++ > .../broadcom/brcm80211/brcmfmac/awdl.h | 9 ++ > .../broadcom/brcm80211/brcmfmac/core.c | 23 ++++- > 3 files changed, 114 insertions(+), 1 deletion(-) [...] > @@ -252,6 +274,67 @@ int brcmf_awdl_del(struct brcmf_pub *drvr) > +/** > + * brcmf_awdl_encap() - add the AWDL data header to a frame to be sent. > + * > + * @ifp: the AWDL interface. > + * @skb: Ethernet frame, an 802.3 frame on return. > + * > + * Called in the transmit path of the AWDL network device, which serializes > + * it. Return: 0 or a negative error code, the caller frees @skb on error. > + */ > +int brcmf_awdl_encap(struct brcmf_if *ifp, struct sk_buff *skb) > +{ Same as in patch 4, Return: has to start its own line. The kdoc check reports no return value description for brcmf_awdl_encap() and brcmf_awdl_decap(). [...] > @@ -653,6 +659,19 @@ static int brcmf_awdl_netdev_open(struct net_device *ndev) > return 0; > } > > +static netdev_tx_t brcmf_awdl_netdev_start_xmit(struct sk_buff *skb, > + struct net_device *ndev) > +{ > + struct brcmf_if *ifp = netdev_priv(ndev); > + > + if (brcmf_awdl_encap(ifp, skb)) { > + dev_kfree_skb_any(skb); > + ndev->stats.tx_dropped++; > + return NETDEV_TX_OK; > + } > + return brcmf_netdev_start_xmit(skb, ndev); > +} > + > static int brcmf_awdl_netdev_stop(struct net_device *ndev) > { > netif_stop_queue(ndev); In brcmf_netdev_start_xmit() tx_bytes is taken from skb->len on entry, which is after brcmf_awdl_encap() here, so tx_bytes counts the 16 added bytes of every frame while rx_bytes in brcmf_netif_rx() is counted after brcmf_awdl_decap() and leaves them out. Count the length of the Ethernet frame on both sides. [...] > @@ -693,6 +712,8 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool locked) > ndev->netdev_ops = &brcmf_netdev_ops_pri; > > ndev->needed_headroom += drvr->hdrlen; > + if (ifp->awdl) > + ndev->needed_headroom += BRCMF_AWDL_HDR_LEN; > ndev->ethtool_ops = &brcmf_ethtool_ops; > > /* set the mac address & netns */ > The MTU stays at the ether_setup() default of 1500, so a full size frame reaches the firmware as 14 + 16 + 1500 bytes. If the firmware takes less than that, set mtu and max_mtu of the AWDL interface to the largest payload it accepts with the added header. You can add my acknowledgement for this patch in v2 series: Acked-by: Arend van Spriel Regards, Arend