* Re: Environment woes
2010-08-09 22:37 Environment woes Josua Dietze
@ 2010-08-10 4:37 ` Kay Sievers
2010-08-10 6:28 ` Josua Dietze
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Kay Sievers @ 2010-08-10 4:37 UTC (permalink / raw)
To: linux-hotplug
On Tue, Aug 10, 2010 at 00:37, Josua Dietze <digidietze@draisberghof.de> wrote:
> Up to now I have used a rule to add a symlink to the "right" port; the check
> is done by a script via "PROGRAM". If the port is not right, the result of
> the script is empty, thus no symlink:
>
> ACTION="add", KERNEL="ttyUSB*", PROGRAM="<script> %p", SYMLINK="%c"
Who needs these custom links? Why don't you just use the stuff in
/dev/serial/ which should already work?
Kay
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Environment woes
2010-08-09 22:37 Environment woes Josua Dietze
2010-08-10 4:37 ` Kay Sievers
@ 2010-08-10 6:28 ` Josua Dietze
2010-08-10 19:30 ` Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Josua Dietze @ 2010-08-10 6:28 UTC (permalink / raw)
To: linux-hotplug
Am 10.08.2010 06:37, schrieb Kay Sievers:
> On Tue, Aug 10, 2010 at 00:37, Josua Dietze<digidietze@draisberghof.de> wrote:
>> Up to now I have used a rule to add a symlink to the "right" port; the check
>> is done by a script via "PROGRAM". If the port is not right, the result of
>> the script is empty, thus no symlink:
>>
>> ACTION="add", KERNEL="ttyUSB*", PROGRAM="<script> %p", SYMLINK="%c"
>
> Who needs these custom links? Why don't you just use the stuff in
> /dev/serial/ which should already work?
There is a symlink to *every* port in the /dev/serial folders. Again,
only *one* of them is usable for connecting through
wvdial/umtsmon/networkmanager. The latter often auto-selects a wrong
port, BTW.
I add *one* symlink called "gsmmodem[x]" to make life easier for users.
Examples:
Huawei E160 ttyUSB0,1,2 gsmmodem -> ttyUSB0
ZTE MF110 ttyUSB0,1,2 gsmmodem -> ttyUSB2
These interfaces all have a class of 0xff. Some are even accepting AT
commands, but are only intended for diagnostic purposes, misleading
users and probers.
Thanks,
Josua Dietze
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Environment woes
2010-08-09 22:37 Environment woes Josua Dietze
2010-08-10 4:37 ` Kay Sievers
2010-08-10 6:28 ` Josua Dietze
@ 2010-08-10 19:30 ` Greg KH
2010-08-10 20:02 ` Josua Dietze
2010-08-10 20:14 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2010-08-10 19:30 UTC (permalink / raw)
To: linux-hotplug
On Tue, Aug 10, 2010 at 12:37:23AM +0200, Josua Dietze wrote:
> Hi everyone,
>
> I am in need of a friendly hint regarding a delicate matter ...
>
> I maintain a Linux tool to put USB devices from one mode (or state)
> to the other.
What program, usb-modeswitch?
> Usually there is more than one interface exposed after the mode
> switch, but only one is suitable for a wireless connection; binding
> the GSM driver ("option") or the generic serial driver will add
> multiple ports though (ttyUSB).
Let the modem-manager program handle knowing which tty device to use,
that type of logic can usually only be detected after talking to the
device.
And what happens with your tool when in the near future, we want to talk
to those other device nodes because modem-manager knows what thoes ports
do and how to get the data out of them?
In short, you shouldn't have to do any of this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Environment woes
2010-08-09 22:37 Environment woes Josua Dietze
` (2 preceding siblings ...)
2010-08-10 19:30 ` Greg KH
@ 2010-08-10 20:02 ` Josua Dietze
2010-08-10 20:14 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Josua Dietze @ 2010-08-10 20:02 UTC (permalink / raw)
To: linux-hotplug
Am 10.08.2010 21:30, schrieb Greg KH:
> On Tue, Aug 10, 2010 at 12:37:23AM +0200, Josua Dietze wrote:
>> I maintain a Linux tool to put USB devices from one mode (or state)
>> to the other.
>
> What program, usb-modeswitch?
That's the one, yes.
>> Usually there is more than one interface exposed after the mode
>> switch, but only one is suitable for a wireless connection; binding
>> the GSM driver ("option") or the generic serial driver will add
>> multiple ports though (ttyUSB).
>
> Let the modem-manager program handle knowing which tty device to use,
> that type of logic can usually only be detected after talking to the
> device.
Unfortunately, I keep receiving reports that modem-manager picks the
wrong port after probing, and there is no way of setting the port
manually in NetworkManager. This happens mostly with devices where the
interrupt port has a number > 0. I have yet to meet a GSM modem device
where the "interrupt rule" does *not* apply.
I usually recommend using wvdial (autoprobing problems too) and edit
the port directly in the config file. And just entering "gsmmodem"
spares users the testing of all ports, some of which may seem to work
at first but then build up a very unreliable connection.
> And what happens with your tool when in the near future, we want to talk
> to those other device nodes because modem-manager knows what thoes ports
> do and how to get the data out of them?
The usb_modeswitch helper in the post-switch rule only picks ttyUSB
ports and looks only for their transfer type. It doesn't do anything
to the ports if they are bulk.
Note that this is unrelated to the preceding switching process and
doesn't change anything at all except that one symlink.
And yes, it can be scrapped anytime without further consequences when
there are other solutions. It is a temporary workaround to make user's
life a little easier.
> In short, you shouldn't have to do any of this.
I couldn't agree more! :-)
Regards,
Josua Dietze
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Environment woes
2010-08-09 22:37 Environment woes Josua Dietze
` (3 preceding siblings ...)
2010-08-10 20:02 ` Josua Dietze
@ 2010-08-10 20:14 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2010-08-10 20:14 UTC (permalink / raw)
To: linux-hotplug
On Tue, Aug 10, 2010 at 10:02:10PM +0200, Josua Dietze wrote:
> Am 10.08.2010 21:30, schrieb Greg KH:
> >Let the modem-manager program handle knowing which tty device to use,
> >that type of logic can usually only be detected after talking to the
> >device.
>
>
> Unfortunately, I keep receiving reports that modem-manager picks the
> wrong port after probing, and there is no way of setting the port
> manually in NetworkManager. This happens mostly with devices where
> the interrupt port has a number > 0. I have yet to meet a GSM modem
> device where the "interrupt rule" does *not* apply.
Then point people at the modem-manager developers :)
> I usually recommend using wvdial (autoprobing problems too) and edit
> the port directly in the config file. And just entering "gsmmodem"
> spares users the testing of all ports, some of which may seem to
> work at first but then build up a very unreliable connection.
It sounds like this is information that the modem-manager developers
would like to know about, so that they can pick the correct ports. Or
is it networkmanager that does that these days, I can't remember, sorry.
Either way, I don't see this a function of the modeswitch program at
all.
good luck,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread