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

2018-12-10 Thread Ben Chan
I wonder why MBIM-enumerated-over-PCIe (L860) is preferred over
MBIM-over-USB3 (L850). Perhaps the theoretical achievable data rate
over PCIe?

Despite the MBIM enumeration, having a vendor specific host interface
does feel going backward as Bjørn said.  IMHO, the industry should
really move towards standard interface protocols like MBIM instead of
legacy protocols like AT, or worse, proprietary protocols.  On
Chromium OS, we don't even install the fibocom plugin but simply rely
on the generic plugin with MBIM to support L850 :)

- Ben

On Mon, Dec 10, 2018 at 6:25 PM 王道之  wrote:
>
> Hey Aleksander
>  The device is basic on the Intel 7560 chip, or L860 in fibocom that 
> difference the L850 with PCIe in MBIM protocol.
>  I am not sure there need a PCIe lib or yet, as now I can use lspci found 
> the device, and there is a net port with the drive offered by Intel. And the 
> drive would be open source later time.
>  You add the device L850 of Fibocom in the ModemManager early time, and 
> now the Fibocom want to add the L860 by itself, and I work for Fibocom. So I 
> am going to add a PCIe L860 in the ModemManager.
> As I planned, I am going to add the L860 in the plugin, then init the 
> device ports(this may need a lib?), then init the modem with AT commd.
>  About the L860 there is a net port, divided in several ports by VLAN id. 
> Here is some description:
>  The host driver maps each channel exposed by the modem to an interface 
> for application to exercise communication over such channels. For network 
> devices, each IP session  (0  to 7) is mapped to INM network interfaces (INM0 
> to INM7). Thus "/PCIE/IOSM/IPS/0" will be mapped to INM0, "/PCIE/IOSM/IPS/1" 
> will be mapped to "/PCIE/IOSM/IPS/1" and so on. Similarly, 
> "/PCIE/IOSM/CTRL/0" is mapped to RPC device, "/PCIE/IOSM/TRACE/0" to trace, 
> "/PCIE/IOSM/CTRL/0" and "/PCIE/IOSM/CTRL/2" to IAT devices and so  on. These  
> are  internals to PCIe communication and are transparent  to user-space 
> application.
>
> The IOSM host driver exposes the interfaces as a VLAN devices (except  for  
> flashing  device). Following table lists the interfaces  exposed  by  the 
> host driver. Please  note  that,  not every interface is supported by the 
> modem. The host driver allows opening of  an  interface only if it is 
> supported on the modem side.
>
>
> Cheers!
>
> Quincy Chen
>
>
> Aleksander Morgado  于2018年12月10日周一 下午4:54写道:
>>
>> Hey,
>>
>> > I am going to add a PCIe not in USB protocol modem device in the 
>> > Modemmanager. In order to better integrate into the current architecture 
>> > of Modemmanager, any development advice?
>> > As I planned, I am going to add the new PCIe device in the plugins 
>> > folder,but I am not sure where to add the PCIe lib just like the libqmi or 
>> > the libmbim.
>> > 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.
>> >
>>
>> Is this PCIe library a new one that you're writing?
>> What device is this?
>>
>> Cheers!
>>
>> --
>> Aleksander
>> https://aleksander.es
>
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


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

2018-12-10 Thread 王道之
Hey Aleksander
 The device is basic on the Intel 7560 chip, or L860 in fibocom that
difference the L850 with PCIe in MBIM protocol.
 I am not sure there need a PCIe lib or yet, as now I can use lspci
found the device, and there is a net port with the drive offered by Intel.
And the drive would be open source later time.
 You add the device L850 of Fibocom in the ModemManager early time, and
now the Fibocom want to add the L860 by itself, and I work for Fibocom. So
I am going to add a PCIe L860 in the ModemManager.
As I planned, I am going to add the L860 in the plugin, then init the
device ports(this may need a lib?), then init the modem with AT commd.
 About the L860 there is a net port, divided in several ports by VLAN
id. Here is some description:
 *The host driver maps each channel exposed by the modem to an
interface for application to exercise communication over such channels. For
network devices, each IP session  (0  to 7) is mapped to INM network
interfaces (INM0 to INM7). Thus "/PCIE/IOSM/IPS/0" will be mapped to INM0,
"/PCIE/IOSM/IPS/1" will be mapped to "/PCIE/IOSM/IPS/1" and so on.
Similarly, "/PCIE/IOSM/CTRL/0" is mapped to RPC device,
"/PCIE/IOSM/TRACE/0" to trace, "/PCIE/IOSM/CTRL/0" and "/PCIE/IOSM/CTRL/2"
to IAT devices and so  on. These  are  internals to PCIe communication and
are transparent  to user-space application.*

*The IOSM host driver exposes the interfaces as a VLAN devices (except
for  flashing  device). Following table lists the interfaces  exposed  by
the host driver. Please  note  that,  not every interface is supported by
the modem. The host driver allows opening of  an  interface only if it is
supported on the modem side.*


Cheers!

Quincy Chen

Aleksander Morgado  于2018年12月10日周一 下午4:54写道:

> Hey,
>
> > I am going to add a PCIe not in USB protocol modem device in the
> Modemmanager. In order to better integrate into the current architecture of
> Modemmanager, any development advice?
> > As I planned, I am going to add the new PCIe device in the plugins
> folder,but I am not sure where to add the PCIe lib just like the libqmi or
> the libmbim.
> > 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.
> >
>
> Is this PCIe library a new one that you're writing?
> What device is this?
>
> Cheers!
>
> --
> Aleksander
> https://aleksander.es
>
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Reconnection loop on latest git master

2018-12-10 Thread Aleksander Morgado
Hey,

On Mon, Dec 10, 2018 at 12:28 PM Nick B  wrote:

> Ah brilliant, that means we’re close; I will look into doing that.  Should
> it be okay to edit /lib/netifd/proto/modemmanager.sh on a running system?
> I plan to hack at it until it works reasonably well.
>
>
Yes, that would be a way to do it.

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


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

2018-12-10 Thread Bjørn Mork
王道之  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
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Reconnection loop on latest git master

2018-12-10 Thread Nick B
Ah brilliant, that means we’re close; I will look into doing that.  Should it 
be okay to edit /lib/netifd/proto/modemmanager.sh on a running system?  I plan 
to hack at it until it works reasonably well.


Best,
Nicholas
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


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

2018-12-10 Thread Aleksander Morgado
Hey,

> I am going to add a PCIe not in USB protocol modem device in the 
> Modemmanager. In order to better integrate into the current architecture of 
> Modemmanager, any development advice?
> As I planned, I am going to add the new PCIe device in the plugins 
> folder,but I am not sure where to add the PCIe lib just like the libqmi or 
> the libmbim.
> 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.
>

Is this PCIe library a new one that you're writing?
What device is this?

Cheers!

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


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

2018-12-10 Thread 王道之
Hey all
I am going to add a PCIe not in USB protocol modem device in the
Modemmanager. In order to better integrate into the current architecture of
Modemmanager, any development advice?
As I planned, I am going to add the new PCIe device in
the plugins folder,but I am not sure where to add the PCIe lib just like
the libqmi or the libmbim.
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.

Regargs!
Quincy Chen
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel