2009-04-09 09:05:33

by Franko Fang

[permalink] [raw]
Subject: The problems for driver module loading

Dear All:

I am sorry, I want to know is there the feature of priority (PRI) for kernel driver loading in Linux, such as in Windows or Mac OS.

I develop an independent ECM driver for our standard ECM ether device. And then I install it on some Linux system, such as OpenSUSE 11.0 or Fedora 10.

But in these systems, they also have a built-in ECM driver cdc_ether.ko. So, while I plug in our device, then the system often attaches cdc_ether.ko driver for our device, but not attaching ours.

Because cdc_ether.ko driver can not support our QMI protocol, so we want the Linux system can always attach our driver to our device, but not cdc_ether.ko driver.

How can I do for this?

Wait for your help, thanks.

Best Regards,

Franko Fang
2009-4-9

******************************************************************************************
This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained here in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email
immediately and delete it!
*****************************************************************************************


2009-04-09 09:49:32

by Alan

[permalink] [raw]
Subject: Re: The problems for driver module loading

> Because cdc_ether.ko driver can not support our QMI protocol, so we want the Linux system can always attach our driver to our device, but not cdc_ether.ko driver.
>
> How can I do for this?

The easiest way is probably to submit some changes to cdc_ether to add
QMI support, or when submitting the QMI driver to also submit a patch to
cdc_ether to make it leave the device alone.

That doesn't help with exising systems however. What do the descriptors
for the hardware look like as cdc_* do actually try to avoid vendor
specific modem intefaces ?

Alan

2009-04-09 14:55:42

by Greg KH

[permalink] [raw]
Subject: Re: The problems for driver module loading

On Thu, Apr 09, 2009 at 04:39:52PM +0800, fangxiaozhi 00110321 wrote:
> Dear All:
>
> I am sorry, I want to know is there the feature of priority (PRI) for
> kernel driver loading in Linux, such as in Windows or Mac OS.

No, Linux does not have that. It is really a "first driver
loaded/linked that wants to grab the driver, wins."

> I develop an independent ECM driver for our standard ECM ether device.
> And then I install it on some Linux system, such as OpenSUSE 11.0 or
> Fedora 10.

Why a separate driver? Why not just modify the existing one?

> But in these systems, they also have a built-in ECM driver
> cdc_ether.ko. So, while I plug in our device, then the system often
> attaches cdc_ether.ko driver for our device, but not attaching ours.
>
> Because cdc_ether.ko driver can not support our QMI protocol, so we
> want the Linux system can always attach our driver to our device, but
> not cdc_ether.ko driver.
>
> How can I do for this?

Add a blacklist entry in the cdc_ether driver.

Or, from userspace, unbind the device from cdc_ether and bind it to your
device. This can easily be done in userspace through sysfs using a
script triggered from udev.

Do you have a pointer to your driver anywhere?

thanks,

greg k-h