Re: ldattach: struct termios

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

 



On Fri, 28 Mar 2008 02:32:41, Karel Zak wrote:
 Yes and no... ;-) Few notes about speed:

 1/ you needn't to translate the speed (number) to Bxxx constant. This
    translation is supported by cfsetspeed()  -- unfortunately there
    isn't any man page about it. You have to read glibc source code...

OIC. Nice feature. Pity it's so badly advertised.

 2/ the range of supported speeds is checked by cfset{i,o}speed(), so
    you cannot use it for arbitrary bit rates.

They'd have to check for non-standard rates and set the speed field of
c_cflag to BOTHER. But the fact that a "fgrep -r BOTHER ." in the glibc
source tree comes up blank leaves little hope for that.

 3/ fortunately, it seems that tcsetattr() (that translate from glibc
    to kernel termios) doesn't check the speed setting. So you can
    bypass cfset{i,o}speed() and set it manually.

 ... so, see the patch bellow.

Wonderful. Thanks a lot for your work. Please make it so. IOW:

Acked-by: Tilman Schmidt <tilman@xxxxxxx>

 Cool. See (non-standard speed):

# lsmod | grep gigaset

# /ldattach  -s 999999 M101 /dev/ttyS0

# lsmod | grep gigaset
ser_gigaset            17993  2
gigaset                57809  1 ser_gigaset
crc_ccitt              10432  1 gigaset
isdn                  132513  1 gigaset

# dmesg
...
gigaset: Driver for Gigaset 307x
ser_gigaset: Tilman Schmidt
ser_gigaset: Serial Driver for Gigaset 307x using Siemens M101
ser_gigaset ser_gigaset.0: Could not initialize the device.

Purrfect. :-)

 sys-utils/ldattach.c |  146 ++++++++++++-------------------------------------
 1 files changed, 36 insertions(+), 110 deletions(-)

Mmmh, nice. It's always good to see a patch delete more lines
than it adds. :-)

Thanks muchly,
Tilman

--
Tilman Schmidt                    E-Mail: tilman@xxxxxxx
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux