/dev/cdc-wdm0 device not created with QMI device and qmi_wwan driver

4,160 views
Skip to first unread message

Enrico Sau

unread,
Jul 31, 2014, 11:21:09 AM7/31/14
to andro...@googlegroups.com
I have a QMI capable device which I usually use in a linux desktop with qmi_wwan driver and libqmi.
I want to move the environment to an android platform but I have a problem.
When qmi_wwan driver is bound to my device it correcly creates the network interface wwan0, but it doesn't create the /dev/cdc-wdm0 device as it does in linux desktop.

I found that a device was created under /sys/class/usbmisc/cdc-wdm0, but I cannot open it.

In the dmesg there is no clue for errors:

[   12.245321] qmi_wwan 1-1:1.2: cdc-wdm0: USB WDM device
[   12.245504] qmi_wwan 1-1:1.2 wwan0: register 'qmi_wwan' at usb-0000:00:0b.0-1, WWAN/QMI device, de:d3:47:82:6f:58

Kernel version is 3.10.

Does anyone know what is happening or have any suggestion?
Thank you for your answers.

Enrico

Chih-Wei Huang

unread,
Aug 3, 2014, 11:20:05 PM8/3/14
to Android-x86
/sys and /dev are different filesystem.
Especially, files in /sys are created and handled
by kernel drivers, while files in /dev are device nodes
created and handled by userspace programs.
In android, ueventd is responsible for created nodes
in /dev on receiving the corresponding uevents.

For your problem, I guess the following possibilities:
* You missed some drivers so the device node is not
created. Compare the drivers loaded in android-x86
and a normal linux distro.
* Sometimes ueventd creates the node in different path
than udev of a normal distro. Use the find command to
search it.
* The driver doesn't issue the correct uevent so ueventd
can't create the node.
In this case you can manually create it by mknod.
> --
> You received this message because you are subscribed to the Google Groups
> "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-x86...@googlegroups.com.
> To post to this group, send email to andro...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/d/optout.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Enrico Sau

unread,
Aug 5, 2014, 7:10:06 AM8/5/14
to andro...@googlegroups.com
Thank you for you answer.
I found the problem in devices.c file.
It wasn't looking for devices in  /sys/class/usbmisc , but only in  /sys/class/usb.
I added the path to the source, re-built the system, and I got the device in /dev.

Chih-Wei Huang

unread,
Aug 8, 2014, 11:02:08 AM8/8/14
to Android-x86
2014-08-05 19:10 GMT+08:00 Enrico Sau <enric...@gmail.com>:
> Thank you for you answer.
> I found the problem in devices.c file.
> It wasn't looking for devices in /sys/class/usbmisc , but only in
> /sys/class/usb.
> I added the path to the source, re-built the system, and I got the device in
> /dev.

Please send me the patch.
I'll add it. Thanks!

Enrico Sau

unread,
Aug 26, 2014, 9:09:34 AM8/26/14
to andro...@googlegroups.com
Edit /system/core/init/devices.c file around line 604 and change this line

if (!strncmp(uevent->subsystem, "usb", 3)) {

with this:


if (!strcmp(uevent->subsystem, "usb")||!strcmp(uevent->subsystem, "usbmisc")) {

​Thank you.​



Enrico




--
You received this message because you are subscribed to a topic in the Google Groups "Android-x86" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-x86/1njBsHw0vro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.

Chih-Wei Huang

unread,
Aug 26, 2014, 9:39:29 PM8/26/14
to Android-x86
2014-08-26 21:09 GMT+08:00 Enrico Sau <enric...@gmail.com>:
> Edit /system/core/init/devices.c file around line 604 and change this line
>
> if (!strncmp(uevent->subsystem, "usb", 3)) {
>
> with this:
>
> if (!strcmp(uevent->subsystem, "usb")||!strcmp(uevent->subsystem,
> "usbmisc")) {

Applied. Thank you.

Péter Pusztai

unread,
Dec 23, 2015, 2:04:09 PM12/23/15
to Android-x86


Missing from lollipop branch(and maybe from marshmallow too, I didn't checked it...), please add it (still need it for some qmi devices  testing... atm I'm working on Gobi2k/3k support, I will report back when "it's in clean form". Thanks.

Chih-Wei Huang

unread,
Dec 23, 2015, 8:32:09 PM12/23/15
to Android-x86
This patch can't be applied to lollipop or marshmallow
due to conflict.
Please provide an updated patch
if you still need it.

Péter Pusztai

unread,
Dec 24, 2015, 3:05:02 AM12/24/15
to Android-x86


Applied that way(yeah, I know it's ugly ...) and worked (device created):

} else if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem, "usbmisc")) {

         if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem, "usbmisc")) {

Does not seems to conflict with anything for me, but waiting for input on that...

Chih-Wei Huang

unread,
Dec 24, 2015, 3:17:39 AM12/24/15
to Android-x86
2015-12-24 16:05 GMT+08:00 Péter Pusztai <pusztai....@gmail.com>:
>
>
> Applied that way(yeah, I know it's ugly ...) and worked (device created):
>
> } else if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem,
> "usbmisc")) {
> if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem,
> "usbmisc")) {
>
> Does not seems to conflict with anything for me, but waiting for input on
> that...

I'm not sure what you changed and
I don't want to guess it.
Just provide me a patch, please!
(if you don't know how to create a patch,
search this forum.)

Roman Petrovski

unread,
Jun 12, 2016, 4:10:57 PM6/12/16
to Android-x86


On Thursday, 24 December 2015 08:17:39 UTC, Chih-Wei Huang wrote:
> >
> >
> > Applied that way(yeah, I know it's ugly ...) and worked (device created):
> >
> > } else if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem,
> > "usbmisc")) {
> > if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem,
> > "usbmisc")) {
> >
> > Does not seems to conflict with anything for me, but waiting for input on
> > that...
>
> I'm not sure what you changed and
> I don't want to guess it.
> Just provide me a patch, please!
> (if you don't know how to create a patch,
> search this forum.)
>


Please apply the following to lollipop branch

diff --git a/init/devices.c b/init/devices.c
index 364c5b6..fe03ac5 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -740,7 +740,7 @@ static void handle_generic_device_event(struct uevent *uevent)
return;
mkdir_recursive_for_devpath(devpath);
} else if (!strncmp(uevent->subsystem, "usb", 3)) {
- if (!strcmp(uevent->subsystem, "usb")) {
+ if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem, "usbmisc")) {
if (uevent->device_name) {
if (!assemble_devpath(devpath, "/dev", uevent->device_name))
return;


Chih-Wei Huang

unread,
Jun 13, 2016, 4:02:47 AM6/13/16
to Android-x86
2016-06-11 3:50 GMT+08:00 Roman Petrovski <roman.p...@gmail.com>:
> diff --git a/init/devices.c b/init/devices.c
> index 364c5b6..fe03ac5 100644
> --- a/init/devices.c
> +++ b/init/devices.c
> @@ -740,7 +740,7 @@ static void handle_generic_device_event(struct uevent *uevent)
> return;
> mkdir_recursive_for_devpath(devpath);
> } else if (!strncmp(uevent->subsystem, "usb", 3)) {
> - if (!strcmp(uevent->subsystem, "usb")) {
> + if (!strcmp(uevent->subsystem, "usb") || !strcmp(uevent->subsystem, "usbmisc")) {
> if (uevent->device_name) {
> if (!assemble_devpath(devpath, "/dev", uevent->device_name))
> return;

Applied to marshmallow-x86.
Thank you!
Reply all
Reply to author
Forward
0 new messages