Re: Clarification regarding USB Data Card (3G Dongle) enumeration in Linux udev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-05-06 at 14:27 +0530, Suresh Kumar N. wrote:
> On Mon, May 5, 2014 at 8:38 PM, Dan Williams <dcbw@xxxxxxxxxx> wrote:
> > On Mon, 2014-05-05 at 11:07 +0530, Suresh Kumar N. wrote:
> >> Hi,
> >>
> >> I am new to udev and device enumeration.
> >>
> >> I am interested to know how USB Data Card would get enumerated.
> >>
> >> Based on my understanding Data Card can get enumerated below 2 possible ways -
> >>   1. As a modem
> >>   2. As a Network Interface Card (NIC)
> >
> > Or both at the same time.
> >
> >> Is there a Standard defining the way a Data Card should be enumerated?
> >
> > There is no single standard.  There is a few "standards" and multiple
> > proprietary mechanisms, and sometimes these are combined in the same
> > device.
> >
> > The device simply enumerates as a normal USB device, providing to the
> > host computer one or more USB interfaces.
> >
> > Each USB interface can be any one of:
> >
> > 1) serial interface (AT, QCDM, WMC, WDM, CDC-ACM, etc)
> > 2) pseudo-ethernet NIC (proprietary, CDC-ETHER, CDC-NCM, etc)
> 
> In such case (pseudo-ethernet NIC) do we assume that the firmware on
> the USB Dongle is responsible to establish IP address?
> In other words how does IP address allocation occur in this case?

The firmware is always involved, because the IP address comes from the
cellular network, and the firmware is what receives it.  The firmware
must then provide that address to the host, so that the host can
communicate with the network.  This happens in a few ways:

1) firmware implements a DHCP server, IPv6 Router, etc; host uses DHCP
client or IPv6 Router Discovery to obtain IP address and DNS details

2) firmware provides static IP address and DNS details over AT commands

3) firmware provides static IP address and DNS details via proprietary
protocols (QMI, MBIM, etc)

4) firmware implements PPP over serial port and provides IP address and
DNS details via IPCP/IPV6CP

Most modems still support #4 over at least one AT-capable serial port.
Many modems implement multiple methods (eg, Qualcomm firmware often does
#1, #3, and #4).

Note that in all cases, connection setup (with the APN and other
details) must occur via control channels (with AT, QMI, MBIM, etc)
before you can use any of these methods to obtain an IP address from the
firmware.

There is actually another class of "plug and play" 3G dongle that
provides a NAT-ed IP network (192.168.0.x or 10.x) to the host over what
looks like a USB ethernet NIC.  These appear exactly like a normal USB
ethernet dongle or a home router to the host, and to configure the
device, you use a web browser on the host like you would with a home
router.  None of the 3G stuff is exposed to the host.  One example is
Huawei HiLink devices like the E3256, though not all HiLink-branded
devices operate this way.

Dan

> > 3) proprietary control protocols (CnS, QMI, etc)
> > 4) standard non-serial control protocols (MBIM)
> >
> > A modem can provide any of these in combination.  Which port speaks what
> > protocol is detected by one or more of the following methods:
> >
> > a) USB VID/PID and interface number hardcoded in the drivers or in
> > userland udev rules
> > b) USB interface type (eg, serial port or NIC port, done in userland)
> > c) probing with known request/response to determine different
> > communication protocols used if the port type is indeterminate
> 
> Thanks for the information.
> 
> >
> > Dan
> >
> >> Please correct if my understanding is not correct or incomplete.
> >>
> >> Thanks in advance for your clarifications.
> >>
> >> Warm Regards,
> >> Suresh
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> >> the body of a message to majordomo@xxxxxxxxxxxxxxx
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux