kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: bjorn@mork.no (Bjørn Mork)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Load partially USB composite device
Date: Wed, 09 Aug 2017 09:25:13 +0200	[thread overview]
Message-ID: <87bmnpyzhi.fsf@miraculix.mork.no> (raw)
In-Reply-To: <CA+XxOSGkXyY9s3EOLbbbYurO_n99uvF1Qjh-nAC=gvL6p2dxgA@mail.gmail.com> ("loïc tourlonias"'s message of "Wed, 9 Aug 2017 07:25:48 +0200")

lo?c tourlonias <loic.tourlonias@gmail.com> writes:

> Hi everybody,
>
> In my project I have an USB composite device (a LTE modem) which use
> USB to communicate with the processor. This device has several
> interface to communicate but I do not use all of them. In particular,
> it loads cdc_ether device which I don't use and I have an undesired
> ethXX which interferes with a service in my system.

Sounds like your system has other issues, but whatever...

> To schematize, let's say my device is loaded on port 2 of usb1, I have
> the following USB topology:
> - 1-2:1.0: tty
> - 1-2:1.1: tty
> - 1-2:1.2: tty
> - 1-2:1.3: tty
> - 1-2:1.4: tty
> - 1-2:1.5: eth (not desired)
>
> Is there a way to prevent this specific ethXX to mount?
>
> I've already tried to create a udev rules, but I don't manage to stop
> the loading process.
> Here is a summary of my tries:
> 1/ I couldn't use the /sys/bus/usb1/.../1-2/activated file in my udev
> rule because it's an USB composite device and I want to use the tty
> interfaces but not the eth interface
>
> 2/ I have tried to stop the udev loading process, but setting MODALIAS
> environment variable to a NULL-string doesn(t do the trick and
> last-rule udev option has been removed in my udev version (1.8.2).
>
> 3/ I have tried to create a custom environment variable IGNORE_ETH and
> modify my last rule which run modprobe with the modalias variable. In
> the logs I see that modprobe isn't called by udev rules, but the
> cdc_ether device is loaded all the same.
>
> 4/ I have think of creating a stub cdc_ether driver and use the
> /etc/modprobe.d/my_file.conf to preempt the loading for my specific
> usb composite device but this solution is ugly and I'm not sure it
> will work.

The cdc_ether driver treats any ID entry with .driver_info = 0 as a
blacklist entry.  So you can dynamically blacklist devices by writing
the "VID PID" to /sys/bus/usb/drivers/cdc_ether/new_id before the device
is probed.


Bj?rn

  reply	other threads:[~2017-08-09  7:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  5:25 Load partially USB composite device loïc tourlonias
2017-08-09  7:25 ` Bjørn Mork [this message]
2017-08-09  7:53   ` loïc tourlonias
2017-08-09  8:15     ` Bjørn Mork
2017-08-09  8:55       ` loïc tourlonias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmnpyzhi.fsf@miraculix.mork.no \
    --to=bjorn@mork.no \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).