Re: [PATCH] cdc-wdm: add a dummy implementation of ioctls TCGETS and TCSETS

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

 



Oliver Neukum <oliver@xxxxxxxxxx> writes:
> Am Freitag 27 Februar 2009 10:55:47 schrieb Bjørn Mork:
>> This patch adds a dummy implementation of the TCGETS and TCSETS ioctls
>> to cdc-wdm.  This is necessary for userspace applications like "chat".
>
> How common is that?

I have no statistics but have briefly tested some applications found in
Debian stable by stracing them (haven't yet looked at the source to
verify these results):

bjorn@nemi:~$ dpkg -l ppp wvdial gsm-utils
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                        Version                     Description
+++-===========================-===========================-=======================================
ii  gsm-utils                   1.10-13                     GSM mobile phone access applications
ii  ppp                         2.4.4rel-10.1               Point-to-Point Protocol (PPP) - daemon
ii  wvdial                      1.60.1+nmu2                 PPP dialer with built-in intelligence


The results were:

chat (from the Debian package ppp) requires TCGETS and TCSETS

wvdial additionally requires TCFLSH.  It also calls TIOCGSERIAL and
TIOCMGET but does not seem to require them.

gsmctl and gsmsmsd (from the Debian package gsm-utils) require the
additional ioctls TIOCMBIC, TIOCMBIS and TCSBRK.  But these utilities
also assume that ATZ will always succeed, which prevents me from testing
them any further.  I conclude that these apps must be fixed in any case
and that there therefore is no need to implement workarounds in the
driver. 

I've not tried to get GUI applications like kppp etc to work, as they
probably are tuned too much towards ppp-connections to be useful with
cdc-wdm devices.


>> Note: I have not understood why cdc-wdm isn't a fullblown TTY driver,
>> like cdc-acm is.  Could anyone care to explain?
>
> The device is no tty. The operations specific to ttys make no sense.
> Your patch essentially proves that implementing no-ops.

OK. Thanks for explaining.

>> The correct fix for the described problem may be changing cdc-wdm to use
>> the TTY layer, but I guess that means renaming the devices and possibly
>> other very userspace visible changes?  Let me know if this is desired,
>> and I'll try to provide a patch.
>
> No, the correct fix is to fix "chat". The question is how practicable that
> is.

Agreed.  I certainly had (and have) my doubts about adding workarounds
like this to a driver.  However, in this case there is a number of old
applications which have never seen a non-tty modem-lookalike, but which
still are potentionally usable with the cdc-wdm driver.

But it's so easy to just post a patch like this and let someone else
decide whether it's wise or not.  You just gotta love the open source
development model :-)



Bjørn
--
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