Support for TIOCSSERIAL in cdc-acm?

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

 



Hello,

for a project I'm working on I need to communicate with a device
(Arduino Uno) at a custom baudrate via a USB serial connection. The
device is accessed via the "cdc-acm" kernel module, which doesn't seem
to allow the setting of serial port parameters:

# lsmod|grep -i acm
cdc_acm                27935  0
# dmesg
...
[71475.837970] usbcore: registered new interface driver cdc_acm
[71475.837972] cdc_acm: USB Abstract Control Model driver for USB modems and
ISDN adapters
(after plugging in the hardware (an Arduino Uno)
[71731.773090] usb 6-2: new full-speed USB device number 5 using uhci_hcd
[71731.958129] usb 6-2: New USB device found, idVendor=2341, idProduct=0001
[71731.958139] usb 6-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=220
[71731.958146] usb 6-2: Product: Arduino Uno
[71731.958151] usb 6-2: Manufacturer: Arduino (www.arduino.cc)
[71731.958157] usb 6-2: SerialNumber: 64932343638351A08180
[71731.963281] cdc_acm 6-2:1.0: ttyACM0: USB ACM device

# setserial /dev/ttyACM0 spd_hi
Cannot set serial info: Invalid argument

# strace setserial /dev/ttyACM0 spd_hi
execve("/bin/setserial", ["setserial", "/dev/ttyACM0", "spd_hi"], [/* 66 vars
*/]) = 0
brk(0)                                  = 0x1ed1000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fd9d311c000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=156038, ...}) = 0
mmap(NULL, 156038, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd9d30f5000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\24B\2262\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1947608, ...}) = 0
mmap(0x3296400000, 3769592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x3296400000
mprotect(0x329658e000, 2097152, PROT_NONE) = 0
mmap(0x329678e000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18e000) = 0x329678e000
mmap(0x3296793000, 21752, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3296793000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fd9d30f4000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fd9d30f2000
arch_prctl(ARCH_SET_FS, 0x7fd9d30f2720) = 0
mprotect(0x329678e000, 16384, PROT_READ) = 0
mprotect(0x329621e000, 4096, PROT_READ) = 0
munmap(0x7fd9d30f5000, 156038)          = 0
open("/dev/ttyACM0", O_RDWR|O_NONBLOCK) = 3
ioctl(3, TIOCGSERIAL, 0x7fff692984e0)   = 0
ioctl(3, TIOCSSERIAL, 0x7fff69298530)   = -1 EINVAL (Invalid argument)
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(0)                                  = 0x1ed1000
brk(0x1ef2000)                          = 0x1ef2000
brk(0)                                  = 0x1ef2000
fstat(4, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fd9d311b000
lseek(4, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(4, "Cannot set serial info: Invalid "..., 41Cannot set serial info:
Invalid argument
) = 41
close(4)                                = 0
munmap(0x7fd9d311b000, 4096)            = 0
exit_group(1)                           = ?

I've tested this on Fedora 15 with kernel 2.6.42.3-2.fc15.x86_64.

There was an old thread on this list about implementing TIOCGSERIAL in
the cdc-acm module
(http://permalink.gmane.org/gmane.linux.usb.general/9236).

Would it be possible to add support for TIOCSSERIAL in cdc-acm as well?

Thanks,
Frank
--
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