operations with Ethernet header in case of "802-3" mode

Dan Williams dcbw at redhat.com
Fri Sep 1 17:13:51 UTC 2023


On Fri, 2023-09-01 at 14:07 +0300, Martin Tõnusoo wrote:
> Hi.
> 
> I have a LTE modem with Qualcomm MDM9x25 chipset. It supports both
> the "raw-ip"(qmicli -d /dev/cdc-wdm0 --wda-set-data-format=raw-ip)
> and "802-3"(qmicli -d /dev/cdc-wdm0 --wda-set-data-format=802-3)
> modes.
> 
> 1) Am I correct, that in case of "802-3" mode, the LTE modem pops the
> Ethernet header for egress traffic from host and pushes the Ethernet
> header for ingress traffic?

If the device has CDC-Ether USB descriptors with a valid MAC address,
the qmi_wwan driver will use that MAC address.

If it doesn't have one, then the driver will generate a random address
and tell the firmware to use it.

In 802.3 mode the modem firmware will add a fake ethernet header for
all data packets to the host, and remove a fake header that the driver
adds for packets from host -> modem. The ethernet headers are pointless
and are only there to help hosts that don't have a driver for RAWIP.

> 2) The Ethernet device created by qmi_wwan driver has a MAC address
> with U/L bit set. Where does this address come from? Is this
> generated by the LTE modem firmware and passed to qmi_wwan driver?

If you get a U/L bit set, that means the qmi_wwan driver had to
generate an address because the firmware didn't provide one in the CDC-
Ethernet USB descriptor. Many (most?) modems don't bother, because as
we said before the MAC is pointless. The driver must set the U/L bit
because it is a locally administered address and the driver can't
create one that might conflict with a real vendor's MAC allocation.

Dan



More information about the libqmi-devel mailing list