Opened 2 years ago

Last modified 11 months ago

#17979 new bug

usb tethering does not work with the pixel6a (USB NCM network driver)

Reported by: atomozero Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Drivers/Network Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

with the pixel 4 I had no problem surfing the internet through usb tethering. with the new mobile phone when I connect it, the network interface does not appear

Attachments (8)

syslog (372.2 KB ) - added by atomozero 2 years ago.
screenshot2.png (572.7 KB ) - added by atomozero 2 years ago.
screenshot3.png (776.4 KB ) - added by atomozero 2 years ago.
syslog.2 (80.3 KB ) - added by atomozero 2 years ago.
listusb tethering on (27.0 KB ) - added by atomozero 2 years ago.
image_2024-01-26_14-16-08.png (865.6 KB ) - added by atomozero 11 months ago.
Listusb pre post tethering
listusb hrev57520 (31.6 KB ) - added by atomozero 11 months ago.
syslog hrev57520 (423.1 KB ) - added by atomozero 11 months ago.

Change History (22)

by atomozero, 2 years ago

Attachment: syslog added

by atomozero, 2 years ago

Attachment: screenshot2.png added

by atomozero, 2 years ago

Attachment: screenshot3.png added

by atomozero, 2 years ago

Attachment: syslog.2 added

comment:1 by atomozero, 2 years ago

KERN: usb hub 8: KERN: port 3: new device connected
KERN: EcGpeHandler: queuing GPE query handler failed
KERN: Last message repeated 2 times.
KERN: usb hub 8: KERN: port 3: device removed
KERN: usb xhci 1: cancel queued transfers (0) for pipe 0xffffffffaece0b80 (0)
KERN: usb xhci 1: cancel queued transfers (0) for pipe 0xffffffffae9d1f58 (1)
KERN: usb xhci 1: transfer error on slot 9 endpoint 3: Length invalid
KERN: usb error xhci 1: KERN: TRB 0x267a8220 was not found in the endpoint!
KERN: usb xhci 1: cancel queued transfers (0) for pipe 0xffffffffaedc5b58 (1)
KERN: usb xhci 1: transfer error on slot 9 endpoint 2: Length invalid
KERN: usb error xhci 1: KERN: TRB 0x267a8110 was not found in the endpoint!
KERN: usb xhci 1: cancel queued transfers (0) for pipe 0xffffffffaedc5b08 (2)
KERN: usb xhci 1: transfer error on slot 9 endpoint 5: Length invalid
KERN: usb error xhci 1: KERN: TRB 0x267a8440 was not found in the endpoint!
KERN: usb xhci 1: cancel queued transfers (0) for pipe 0xffffffffaece0b80 (0)
KERN: usb xhci 1: KERN: cancel queued transfers (0) for pipe 0xffffffffaece0b80 (0)
KERN: EcGpeHandler: queuing GPE query handler failed
KERN: usb hub 8: port 3: new device connected
KERN: EcGpeHandler: queuing GPE query handler failed

comment:2 by pulkomandy, 2 years ago

Component: - GeneralDrivers/USB/XHCI
Owner: changed from nobody to waddlesplash

Can you attach the output of listusb -v for your phone while it is in tethering mode?

I put it under the xhci (USB3) component for now, if Waddlesplash thinks these errors in the syslog are not a cause of worry, hopefully we can find more from the listusb. I see no info from the usb_rndis driver in the syslog so I assume the device doesn't get far enough for the driver to start doing its work?

by atomozero, 2 years ago

Attachment: listusb tethering on added

comment:3 by atomozero, 2 years ago

if there is anything I can do to help find the bug, I am available for testing :) wifi doesn't work so tethering is my only chance to use Haiku

comment:4 by pulkomandy, 2 years ago

I assume this is your phone:

73	[Device /dev/bus/usb/1/2]
74	    Class .................. 0x00 (Per-interface classes)
75	    Subclass ............... 0x00
76	    Protocol ............... 0x00
77	    Max Endpoint 0 Packet .. 64
78	    USB Version ............ 2.16
79	    Vendor ID .............. 0x18d1 (Google Inc.)
80	    Product ID ............. 0x4ee1 (Nexus/Pixel Device (MTP))
81	    Product Version ........ 0x0510
82	    Manufacturer String .... ""
83	    Product String ......... ""
84	    Serial Number .......... ""
85	    [Configuration 0]
86	        Configuration String . ""
87	        [Interface 0]
88	            [Alternate 0 active]
89	                Class .............. 0x06 (Image)
90	                Subclass ........... 0x01
91	                Protocol ........... 0x01
92	                Interface String ... ""
93	                [Endpoint 0]
94	                    MaxPacketSize .... 512
95	                    Interval ......... 0
96	                    Type ............. Bulk
97	                    Direction ........ Input
98	                [Endpoint 1]
99	                    MaxPacketSize .... 512
100	                    Interval ......... 0
101	                    Type ............. Bulk
102	                    Direction ........ Output
103	                [Endpoint 2]
104	                    MaxPacketSize .... 28
105	                    Interval ......... 6
106	                    Type ............. Interrupt
107	                    Direction ........ Input

In this listusb output, it is in MTP (file transfer) mode, not in network tethering mode. As long as it stays that way, the usb_rndis driver cannot make use of it for USB tethering.

On my phone, switching to USB tethering is done from the Android settings in the connexions menu (annoyingly, not from the popup menu that shows when connecting it to an USB port). But this can change for different Android versions.

So, are you sure you have enabled USB tethering on the phone side? Does it actually remain enabled, or does the phone immediately switch it off? It's possible there's an issue while switching between the different modes and the phone reverts to the default MTP mode.

comment:5 by atomozero, 2 years ago

I confirm that when I enable the USB tethering function from windows or linux the driver is activated without problems. In Haiku when I select the same function, the message I put in the first comment appears in the syslog

comment:6 by pulkomandy, 2 years ago

Ok, so that means the problem is at a lower level than the usb_rndis driver. The phone needs to switch to a different mode which is similar to a very fast unplug and replug of the USB.

Our XHCI (USB3 low level) driver does not manage to handle things so fast and seems a bit confused. I will let Waddlesplash look into that part, as he knows it much better than I do.

comment:7 by waddlesplash, 2 years ago

XHCI handled switching modes just fine on my devices with my Moto G5. So I don't think that's the problem.

These errors are the likely cause:

KERN: usb xhci 1: transfer error on slot 9 endpoint 3: Length invalid
KERN: usb error xhci 1: KERN: TRB 0x267a8220 was not found in the endpoint!

I've seen these before occasionally but I never have managed to get to the bottom of them...

comment:8 by waddlesplash, 11 months ago

Please retest after hrev57519.

by atomozero, 11 months ago

Listusb pre post tethering

comment:9 by atomozero, 11 months ago

This is the only difference that I see activating and deactivating USB tethering. :(

comment:10 by waddlesplash, 11 months ago

Nothing in syslog anymore?

comment:11 by pulkomandy, 11 months ago

Now the phone seems to be properly in tethering mode (the device ID changed to 4eeb instead of 4ee1).

Can you include the output of listusb -v (verbose mode) when it is in that state? (it wasn't in the previous version you shared).

comment:12 by waddlesplash, 11 months ago

Component: Drivers/USB/XHCIDrivers/Network
Owner: changed from waddlesplash to nobody

by atomozero, 11 months ago

Attachment: listusb hrev57520 added

by atomozero, 11 months ago

Attachment: syslog hrev57520 added

comment:13 by pulkomandy, 11 months ago

Ok, so this phone uses USB NCM which we don't have a driver for yet. A new driver will have to be written.

The spec is available here:

https://www.usb.org/document-library/network-control-model-devices-specification-v10-and-errata-and-adopters-agreement

I had a quick look at it, if I understand correctly, the idea is that it is similar to USB ECM (for which we already have a driver), but it allows to send and receive multiple ethernet frames in a single USB packet to reduce CPU usage and increase transfer rates.

comment:14 by pulkomandy, 11 months ago

Summary: usb tethering does not work with the pixel6ausb tethering does not work with the pixel6a (USB NCM network driver)
Note: See TracTickets for help on using tickets.