Planning to add a PCIe(not in USB protocol) device

Bjørn Mork bjorn at mork.no
Mon Dec 10 13:14:54 UTC 2018


王道之 <lingzangwuhen at gmail.com> writes:

>     By the way, I found the comment  Nozomi, Card-Bus PCI (not USB)  at the
> device "Option GT 3G+ EMEA" in the supported devices list , Is  that mean
> the device use the PCI protocol? If in that way, I can refer to when I
> develop.

Don't know anything about this card. But looking at the driver, it
appears to be a serial device from the time Cardbus was the only way you
could add a semi-internal plugin module to a laptop.  And Cardbus means
PCI interface only.

If you are thinking about support for modern LTE modems with PCIe
interface, then I doubt the nozomi driver is relevant at all.  But do
look at the driver [1] and decide for yourself.

FWIW, I took a brief look at the Windows PCI driver for the Fibocom
L850-GL and it does not look promising at all.  I was hoping that the
PCIe interface was something we could recognize as a USB controller, but
it is not.  Or at least it is not recognizable to me.  Instead the
driver uses the Windows UDE enviroment [2] to emulate a USB MBIM device.
And looking closer at the driver, it appears to emulate absolutely every
aspect of the device, without offloading much at all (if anything) to
the firmware.

Some of the functions found in the driver (using strings - I don't
decompile stuff like this :-):

MbimSendEncapsulateHandler
MbimGetEncapsulateHandler
MbimQueueReadRequest
MbimHandleReadRequest
MbimInitializeRingBuffers
MbimFreeRingBuffers
MbimReadIoCb
MbimWriteIoCb
MbimInterruptRequestHandler
UrbEvtInterruptRequest
UrbEvtBulkOutRequest
UrbCompleteRequest
UrbEvtControlRequestStop
UrbEvtInterruptRequestStop
UrbEvtBulkInRequestStop
UrbEvtBulkOutRequestStop
UrbEvtBulkOutRequestCancel
UrbForwardPendingRequestsToIpc
UsbReadDescriptorsAndPlugIn
UsbDisconnectAll
UsbDisconnect
_UsbEndpointReset
UsbDeviceEvtDefaultEndpointAdd
SetupUsbEndpoint
UsbDeviceEvtEndpointAdd
UsbDeviceEvtEndpointsConfigure
UsbDeviceEvtWdfDeviceQueryUsbCapability
UsbDeviceEvtLinkPowerEntry
UsbDeviceEvtLinkPowerExit
UsbDeviceEvtSetFunctionSuspendAndWake
ReleaseUtaFunction
ReleaseMbimFunction
ReleaseUsbDevice
ReleaseUsbFunction
SetupUsbDeviceFunctions
AllocateUsbDeviceContext
SetupUsbDevice
UdeRetrieveControlQueue
RetrieveUsbFnContextFromInterfaceId
RetrieveUsbFnContextFromEndpoint
CdcBulkInRequestHandler
CdcBulkOutRequestHandler
UsbGetDescriptorHandler
UsbDeviceStandardRequestHandler
UsbGetDeviceVendorDescriptorHandler
UsbInterfaceStandardRequestHandler
UsbInterfaceVendorRequestHandler
UsbEndpointStandardRequestHandler
UsbEndpointVendorRequestHandler
UsbDeviceVendorRequestHandler
CdcControlRequestHandler
CdcInterruptRequestHandler
CdcCompleteRequestFromPassiveWorkItem
CdcInterruptCompletedCb
CdcResponseAvailableCb
CdcControlCompletedCb
AcmSendEncapsulateHandler


Implementing something similar in Linux without using the code from
Intel is going to be a lot of hard work.  And it's not going to be an
easy task if you have to reverse engineer the firmware API too. Which it
seems we have to, given Intels complete silence on the docs topic...

Note that there isn't any "UDE" API in Linux yet.  But that's the
smallest problem here.  Adding one based on code from the USB-over-IP
and/or dummy hcd-driver is easy compared to the remaining tasks.

As for Qualcomm based modems:  Haven't yet seen any docs for the PCIe
interface there either.  So I'll assume it is similar to the Intel one.
But that does of course not mean that the firmware APIs will be anything
close to similar. These PCIe interfaces makes the modem host interfaces
completely proprietary again, and we're back to the state before
Microsoft made MBIM mandatory.

Still curious about what you are planning to support, though.  And what
kind of backing you have from modem chipset vendors. So please keep us
updated with as much info as you are allowed to share.


Bjørn

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/nozomi.c
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/developing-windows-drivers-for-emulated-usb-host-controllers-and-devices


More information about the ModemManager-devel mailing list