Toast-Master Posted January 30, 2013 Share Posted January 30, 2013 Я уже пробовал подобный метод, создал файл /etc/udev/rules.d/10-moxa-uport.rules: KERNEL=="ttyUSB*", SYMLINK+="moxa-uport" Далее sudo restart udev и переподключил устройство. В итоге ttyUSB0 определяется, а moxa-uport - нет. Добился того, чтобы появился симлинк, поправив файл следующим образом (возможно некорректным): ATTRS{idVendor}=="110a", ATTRS{idProduct}=="1150", SYMLINK+="moxa-uport" Теперь устройство определяется как moxa-uport, но при запросе параметров setserial -G /dev/moxa-uport выдает следующее /dev/moxa-uport: Permission denied Однако /dev/ttyUSB0 работает нормально. Судя по всему /dev/moxa-uport указывает на другое устройство. Не понятно, почему устройство не определяется по KERNEL=="ttyUSB*", других устройств, удовлетворяющих этому шаблону, в системе нет. Link to comment
Agibalov Posted January 30, 2013 Share Posted January 30, 2013 Посмотреть куда указывает /dev/moxa-uport Вы можете командой ls -l /dev/moxa-uport Что касается определения устройств, то посмотреть атрибуты, присущие конкретному устройству, Вы можете при помощи команды udevadm info -a -n /dev/ttyUSB0 Link to comment
Toast-Master Posted January 31, 2013 Share Posted January 31, 2013 Это все сделал, указывает не на ttyUSB0. С udevadm info -a -n /dev/ttyUSB0 тоже ковырялся, выдает следующее: looking at device '/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:2.0/ttyUSB0/tty/ttyUSB0': KERNEL=="ttyUSB0" SUBSYSTEM=="tty" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:2.0/ttyUSB0': KERNELS=="ttyUSB0" SUBSYSTEMS=="usb-serial" DRIVERS=="mxu1150" ATTRS{port_number}=="0" looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:2.0': KERNELS=="3-1:2.0" SUBSYSTEMS=="usb" DRIVERS=="mxusb" ATTRS{bInterfaceNumber}=="00" ATTRS{bAlternateSetting}==" 0" ATTRS{bNumEndpoints}=="03" ATTRS{bInterfaceClass}=="ff" ATTRS{bInterfaceSubClass}=="00" ATTRS{bInterfaceProtocol}=="00" ATTRS{supports_autosuspend}=="1" looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-1': KERNELS=="3-1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="2" ATTRS{bmAttributes}=="80" ATTRS{bMaxPower}=="100mA" ATTRS{urbnum}=="149" ATTRS{idVendor}=="110a" ATTRS{idProduct}=="1150" ATTRS{bcdDevice}=="0200" ATTRS{bDeviceClass}=="ff" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bNumConfigurations}=="1" ATTRS{bMaxPacketSize0}=="8" ATTRS{speed}=="12" ATTRS{busnum}=="3" ATTRS{devnum}=="3" ATTRS{devpath}=="1" ATTRS{version}==" 2.00" ATTRS{maxchild}=="0" ATTRS{quirks}=="0x0" ATTRS{avoid_reset_quirk}=="0" ATTRS{authorized}=="1" ATTRS{manufacturer}=="Moxa Technologies Co., Ltd." ATTRS{product}=="UPort 1150" looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3': KERNELS=="usb3" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{bmAttributes}=="e0" ATTRS{bMaxPower}==" 0mA" ATTRS{urbnum}=="50" ATTRS{idVendor}=="1d6b" ATTRS{idProduct}=="0001" ATTRS{bcdDevice}=="0302" ATTRS{bDeviceClass}=="09" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bNumConfigurations}=="1" ATTRS{bMaxPacketSize0}=="64" ATTRS{speed}=="12" ATTRS{busnum}=="3" ATTRS{devnum}=="1" ATTRS{devpath}=="0" ATTRS{version}==" 1.10" ATTRS{maxchild}=="2" ATTRS{quirks}=="0x0" ATTRS{avoid_reset_quirk}=="0" ATTRS{authorized}=="1" ATTRS{manufacturer}=="Linux 3.2.0-36-generic uhci_hcd" ATTRS{product}=="UHCI Host Controller" ATTRS{serial}=="0000:00:1a.0" ATTRS{authorized_default}=="1" looking at parent device '/devices/pci0000:00/0000:00:1a.0': KERNELS=="0000:00:1a.0" SUBSYSTEMS=="pci" DRIVERS=="uhci_hcd" ATTRS{vendor}=="0x8086" ATTRS{device}=="0x2937" ATTRS{subsystem_vendor}=="0x1025" ATTRS{subsystem_device}=="0x0212" ATTRS{class}=="0x0c0300" ATTRS{irq}=="20" ATTRS{local_cpus}=="ff" ATTRS{local_cpulist}=="0-7" ATTRS{dma_mask_bits}=="32" ATTRS{consistent_dma_mask_bits}=="32" ATTRS{broken_parity_status}=="0" ATTRS{msi_bus}=="" looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS=="" Кучу вариантов перепробовал, пока не получилось создать корректный симлинк. Link to comment
Agibalov Posted February 7, 2013 Share Posted February 7, 2013 Попробуйте сравнить путь, на который указывает /dev/moxa-uport с путями в выводе udevadm, возможно с критериями совпадает ещё какое-то из подключенных устройств. Link to comment
Zverushka Posted February 8, 2013 Share Posted February 8, 2013 После обновления драйверов minicom перестал работать с моксой 1150 в режиме rs232, при этом в режиме 485 или 422 работает. Putty же, работает во все режимах , может кто знает что не нравится миникому. Debian 3.2.35-2 x86_64 Link to comment
Agibalov Posted February 11, 2013 Share Posted February 11, 2013 Здравствуйте! Попробуйте принудительно отключить контроль потока в minicom. Link to comment
Zverushka Posted February 12, 2013 Share Posted February 12, 2013 Здравствуйте! Попробуйте принудительно отключить контроль потока в minicom. Спасибо, помогло. Link to comment
noonv Posted June 10, 2013 Share Posted June 10, 2013 внёс изменения в driv_linux_uport1p_v1.3.3_build_12091213.tgz для сборки модуля драйвера под последним стабильным ядром - 3.9.4 diff -r mxu11x0_orig/driver/mxu11x0.c mxu11x0/driver/mxu11x0.c 917c917 < #else --- > #elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 919a920,922 > #else > if (port->port.tty) > port->port.tty->port->low_latency = MXU1_DEFAULT_LOW_LATENCY; 1431c1434,1438 < if (!tty || !tty->termios) { --- > #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) > if (!tty || tty->termios) { > #else > if (!tty) { > #endif 1435a1443 > #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 1437a1446,1449 > #else > cflag = tty->termios.c_cflag; > iflag = tty->termios.c_iflag; > #endif 1813c1825 < #else --- > #elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 1815a1828,1830 > #else > usb_serial_debug_data(dev, __FUNCTION__, > urb->actual_length, urb->transfer_buffer); 1906a1922 > #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 1907a1924,1926 > #else > cnt = tty_buffer_request_room(tty->port, length); > #endif 1915a1935 > #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 1916a1937,1939 > #else > tty_insert_flip_string(tty->port, data, cnt); > #endif 1919a1943 > #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 1920a1945,1948 > #else > tty_flip_buffer_push(tty->port); > #endif > 2047c2075 < #else --- > #elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) 2048a2077,2078 > #else > usb_serial_debug_data(&port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer); Link to comment
Linux777 Posted June 19, 2013 Share Posted June 19, 2013 внёс изменения в driv_linux_uport1p_v1.3.3_build_12091213.tgz для сборки модуля драйвера под последним стабильным ядром - 3.9.4 Можно ли Вас попросить опубликовать патч в формате, удобоваримом для большинства современных систем контроля версий и которым было бы очевидно воспользоваться по большинству имеющихся в сети руководств? Я час бился с попытками вбить Ваш патч безуспешно и не удалось, хотя потренировался создавать патчи в этом формате и их успешно накладывать, но Ваш же патч накладывался с ошибками, ручной правкой я добился наложения почти всех строк и видел везде success, но итоговый файл все равно был кашей и не собирался. diff -Naur mxu11x0_orig/driver/mxu11x0.c mxu11x0/driver/mxu11x0.c С опциями -Naur формат патча будет в современном ныне распространенном формате... Link to comment
Komantsev Posted June 20, 2013 Share Posted June 20, 2013 Добрый день! На всякий случай напомню, что на ядро 3.8 есть уже официальный драйвер. Link to comment
noonv Posted June 24, 2013 Share Posted June 24, 2013 Можно ли Вас попросить опубликовать патч в формате, удобоваримом для большинства современных систем контроля версий и которым было бы очевидно воспользоваться по большинству имеющихся в сети руководств? С опциями -Naur формат патча будет в современном ныне распространенном формате... разумеется - моя вина diff -Naur ./mxu11x0_orig//driver/mxu11x0.c ./mxu11x0/driver/mxu11x0.c --- ./mxu11x0_orig//driver/mxu11x0.c 2012-09-12 07:18:52.000000000 +0400 +++ ./mxu11x0/driver/mxu11x0.c 2013-06-10 11:04:43.572601465 +0400 @@ -914,9 +914,12 @@ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) if (port->tty) port->tty->low_latency = MXU1_DEFAULT_LOW_LATENCY; -#else +#elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) if (port->port.tty) port->port.tty->low_latency = MXU1_DEFAULT_LOW_LATENCY; +#else + if (port->port.tty) + port->port.tty->port->low_latency = MXU1_DEFAULT_LOW_LATENCY; #endif @@ -1428,13 +1431,22 @@ dbg("%s - port %d", __FUNCTION__, port->number); - if (!tty || !tty->termios) { +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) + if (!tty || tty->termios) { +#else + if (!tty) { +#endif dbg("%s - no tty or termios", __FUNCTION__); return; } +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) cflag = tty->termios->c_cflag; iflag = tty->termios->c_iflag; +#else + cflag = tty->termios.c_cflag; + iflag = tty->termios.c_iflag; +#endif if (old_termios && cflag == old_termios->c_cflag && iflag == old_termios->c_iflag) { @@ -1810,9 +1822,12 @@ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) usb_serial_debug_data(dev->driver->name, __FUNCTION__, urb->actual_length, urb->transfer_buffer); -#else +#elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) usb_serial_debug_data(debug, dev, __FUNCTION__, urb->actual_length, urb->transfer_buffer); +#else + usb_serial_debug_data(dev, __FUNCTION__, + urb->actual_length, urb->transfer_buffer); #endif if (!mxport->mxp_is_open) @@ -1904,7 +1919,11 @@ break; } +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) cnt = tty_buffer_request_room(tty, length); +#else + cnt = tty_buffer_request_room(tty->port, length); +#endif if(cnt < length){ dbg("%s - [2] dropping data, %d bytes lost\n", __FUNCTION__, length); @@ -1913,11 +1932,20 @@ cnt = length; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) tty_insert_flip_string(tty, data, cnt); +#else + tty_insert_flip_string(tty->port, data, cnt); +#endif length -= cnt; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) tty_flip_buffer_push(tty); +#else + tty_flip_buffer_push(tty->port); +#endif + }while(length > 0); @@ -2044,8 +2072,10 @@ spin_unlock_irqrestore(&mxport->mxp_lock, flags); #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) usb_serial_debug_data(&port->number, __FUNCTION__, count, port->write_urb->transfer_buffer); -#else +#elif(LINUX_VERSION_CODE < KERNEL_VERSION(3,5,3)) usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer); +#else + usb_serial_debug_data(&port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer); #endif usb_fill_bulk_urb(port->write_urb, port->serial->dev, На всякий случай напомню, что на ядро 3.8 есть уже официальный драйвер. только от вас о нём узнал - но он таки не собирается под 3.9.4 Link to comment
antondemidov Posted October 21, 2013 Share Posted October 21, 2013 Добрый день. Обновился до Ubuntu 13.10 и теперь ни один из драйверов не собирается: /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.h:22:98: note: in definition of macro ‘dbg’ #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) ^ /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.c: In function ‘mxu1_get_serial_info’: /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.c:2157:32: error: ‘struct usb_serial’ has no member named ‘minor’ ret_serial.line = port->serial->minor; ^ In file included from /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.c:47:0: /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.c: In function ‘mxu1_drain’: /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.c:2281:40: error: ‘struct usb_serial_port’ has no member named ‘number’ dbg("%s - port %d", __FUNCTION__, port->number); ^ /home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.h:22:98: note: in definition of macro ‘dbg’ #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) ^ make[3]: *** [/home/antondemidov/Загрузки/Moxa/mxu11x0/driver/mxu11x0.o] Ошибка 1 make[2]: *** [_module_/home/antondemidov/Загрузки/Moxa/mxu11x0/driver] Ошибка 2 make[1]: *** [module] Ошибка 2 make: *** [driver_make] Ошибка 2 P.S. 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 i686 i686 GNU/Linux Очень бы хотелось драйвер для 3.11 =( Moxa в твиттере выдала новый драйвер - https://disk.yandex....wdFoUABuQNK3IE= но он тоже не заработал. Обещали написать новый, у меня пока решилось даунгрейдом на ядро 3.9.3 http://kernel.ubuntu...e/v3.9.3-saucy/ P.S. - Прислали новый драйвер в твиттере - у меня заработал. Спасибо больше Мохе - Линк вот - http://yadi.sk/d/p1gftWzlBQ3zm Link to comment
Galaxy Master Posted October 31, 2013 Share Posted October 31, 2013 На дебиане с ядром 3.10.3 с драйвером из предыдущего поста вылезла другая ерунда. Что мол нет в структуре такой-то нет полей таких-то. Первый взгляд на хедеры ядра показал, что в файле mxu11x0.c напутали ifdef-ы и пришлось все #if(LINUX_VERSION_CODE > KERNEL_VERSION(3,10,0)) заменить на #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)) чтоб собрать по быстрому. Кроме того, есть ругань на скрипт mxconf переменная K_SUBLEVEL оказывается пустой. Тоже пришлось править. Link to comment
RTS Posted April 15, 2014 Share Posted April 15, 2014 Здравствуйте! Когда появятся драйвера на UPort 1150 под ядро 3.10 и выше? Без танцев с бубном. Link to comment
Zverushka Posted April 24, 2014 Share Posted April 24, 2014 user@debian:~$ sudo minicom -D /dev/ttyUSB1 minicom: невозможно открыть /dev/ttyUSB1: Ошибка ввода/вывода user@debian:~$ sudo setserial -G /dev/ttyUSB1 /dev/ttyUSB1: Input/output error Вот такая ошибка вылезла, правда только тогда, когда мокса определяется не как ttyUSB0 user@debian:~$ sudo setserial -G /dev/ttyUSB0 /dev/ttyUSB0 uart 16550A port 0x0000 irq 0 baud_base 115200 spd_normal low_latency драйвер v1.3.9, ОС 3.13-1-amd64 #1 SMP Debian 3.13.7-1 (2014-03-25) x86_64 GNU/Linux Link to comment
Komantsev Posted May 5, 2014 Share Posted May 5, 2014 Добрый день, Вот такая ошибка вылезла, правда только тогда, когда мокса определяется не как ttyUSB0 user@debian:~$ sudo setserial -G /dev/ttyUSB0 /dev/ttyUSB0 uart 16550A port 0x0000 irq 0 baud_base 115200 spd_normal low_latency Не совсем понятно, почему Вы обращаетесь к /ttyUSB0, если пишете, что мокса определяется не как ttyUSB0 Уточните, какие сообщения выводятся при подключении UPort 11xx к компьютеру (например, при помощи команды tail –f /var/log/syslog) Link to comment
Zverushka Posted May 13, 2014 Share Posted May 13, 2014 Добрый день, Не совсем понятно, почему Вы обращаетесь к /ttyUSB0, если пишете, что мокса определяется не как ttyUSB0 Уточните, какие сообщения выводятся при подключении UPort 11xx к компьютеру (например, при помощи команды tail –f /var/log/syslog) ttyUSB0 -это первая мокса, ttyUSB1 вторая Link to comment
Komantsev Posted May 13, 2014 Share Posted May 13, 2014 Добрый день, Не могли бы Вы описать полностью конфигурацию системы? Link to comment
Linux777 Posted May 14, 2014 Share Posted May 14, 2014 Вышла Ubuntu 14.04 LTS, будет поддерживаться много лет, как минимум 2 года. НУЖНО как никакое другое обновление Там ядро 3.13 - под него бы... P.S. У меня винда в виртуалке, а на хосте Linux - так вот пока под Linux драйвер не встанет, под виндой устройство опознается но не работает вообще, пишет что не может стартануть его. Link to comment
Duqu Posted May 29, 2014 Share Posted May 29, 2014 поддерживаю. обновление не помешало бы. Link to comment
swarty Posted July 30, 2014 Share Posted July 30, 2014 Обновление драйвера. Писал для 3.14, пробовал собирать на 3.11, так что на 3.13 должно работать. Пока еще плотно не тестировал. diff -Nur mxu11x0/driver/mxu11x0.c mxu11x0-git/driver/mxu11x0.c --- mxu11x0/driver/mxu11x0.c 2013-06-10 13:26:04.000000000 +0400 +++ mxu11x0-git/driver/mxu11x0.c 2014-07-30 13:06:29.998836254 +0400 @@ -900,8 +900,11 @@ MXU1_PIPE_TIMEOUT_ENABLE | (MXU1_TRANSFER_TIMEOUT << 2)); +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); - +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return -ENODEV; @@ -915,12 +918,20 @@ if (port->tty) port->tty->low_latency = MXU1_DEFAULT_LOW_LATENCY; #else + +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + if (port->port.tty) + port->port.tty->low_latency = MXU1_DEFAULT_LOW_LATENCY; + port_number = port->number - port->serial->minor; +#else if (port->port.tty) - port->port.tty->low_latency = MXU1_DEFAULT_LOW_LATENCY; + port->port.low_latency = MXU1_DEFAULT_LOW_LATENCY; + port_number = port->port_number - port->minor; +#endif + #endif - port_number = port->number - port->serial->minor; memset(&(mxport->mxp_icount), 0x00, sizeof(mxport->mxp_icount)); @@ -1059,8 +1070,12 @@ int status = 0; int do_up; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); - +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif + mxdev = usb_get_serial_data(port->serial); mxport = usb_get_serial_port_data(port); if (mxdev == NULL || mxport == NULL) @@ -1080,7 +1095,12 @@ mxport->mxp_write_urb_in_use = 0; - port_number = port->number - port->serial->minor; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + port_number = port->number - port->serial->minor; +#else + port_number = port->port_number - port->minor; +#endif + dbg("%s - sending MXU1_CLOSE_PORT", __FUNCTION__); status = mxu1_command_out_sync(mxdev, MXU1_CLOSE_PORT, @@ -1121,7 +1141,12 @@ { struct mxu1_port *mxport = usb_get_serial_port_data(port); + +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (count == 0) { dbg("%s - write request of 0 bytes", __FUNCTION__); @@ -1157,7 +1182,11 @@ int room = 0; unsigned long flags; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return -ENODEV; @@ -1184,7 +1213,11 @@ int chars = 0; unsigned long flags; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return -ENODEV; @@ -1213,7 +1246,12 @@ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) struct tty_struct *tty; #endif + +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return; @@ -1248,7 +1286,11 @@ #endif int status = 0; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return; @@ -1279,7 +1321,11 @@ struct async_icount cnow = mxport->mxp_icount; dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", - __func__, port->number, +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + __func__, port->number, +#else + __func__, port->port_number, +#endif cnow.rx, cnow.tx); icount->cts = cnow.cts; @@ -1317,27 +1363,43 @@ struct mxu1_port *mxport = usb_get_serial_port_data(port); struct async_icount cnow; struct async_icount cprev; - +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d, cmd = 0x%04X", __FUNCTION__, port->number, cmd); +#else + dbg("%s - port %d, cmd = 0x%04X", __FUNCTION__, port->port_number, cmd); +#endif if (mxport == NULL) return -ENODEV; switch (cmd) { case TIOCGSERIAL: - dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number); +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number); +#else + dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->port_number); +#endif return mxu1_get_serial_info(mxport, (struct serial_struct __user *)arg); case TIOCSSERIAL: - dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->number); +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->number); +#else + dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->port_number); +#endif return mxu1_set_serial_info(mxport, (struct serial_struct __user *)arg); case TIOCMIWAIT: - dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->number); +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->number); +#else + dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->port_number); +#endif cprev = mxport->mxp_icount; mxport->mxp_msr_wait_flags = 1; while (1) { - wait_event_interruptible_timeout(mxport->mxp_msr_wait,(mxport->mxp_msr_wait_flags == 0),MXU1_MSR_WAIT_TIMEOUT); + wait_event_interruptible_timeout(mxport->mxp_msr_wait, + (mxport->mxp_msr_wait_flags == 0),MXU1_MSR_WAIT_TIMEOUT); if (signal_pending(current)) return -ERESTARTSYS; cnow = mxport->mxp_icount; @@ -1355,13 +1417,24 @@ break; case TIOCGICOUNT: - dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, port->number, mxport->mxp_icount.rx, mxport->mxp_icount.tx); +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, + port->number, mxport->mxp_icount.rx, mxport->mxp_icount.tx); +#else + dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, + port->port_number, mxport->mxp_icount.rx, mxport->mxp_icount.tx); +#endif if (copy_to_user((void __user *)arg, &mxport->mxp_icount, sizeof(mxport->mxp_icount))) return -EFAULT; return 0; case MOXA_SET_INTERFACE: +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port%d MOXA_SET_INTERFACE=%d",__FUNCTION__,port->number,(int)arg); +#else + dbg("%s - port%d MOXA_SET_INTERFACE=%d",__FUNCTION__, + port->port_number,(int)arg); +#endif if(mxport->mxp_mxdev->mxd_model_name != MXU1_MODEL_1110){ //UPort 1130, 1150, 1150I switch(arg){ @@ -1423,10 +1496,16 @@ tcflag_t cflag,iflag; int baud; int status = 0; - int port_number = port->number - port->serial->minor; - unsigned int mcr; + int port_number = 0; unsigned int mcr; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + port_number = port->number - port->serial->minor; dbg("%s - port %d", __FUNCTION__, port->number); +#else + port_number = port->port_number - port->minor; + + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif #if(LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) if (!tty || !tty->termios) { @@ -1585,7 +1664,11 @@ unsigned int msr; unsigned int mcr; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return -ENODEV; @@ -1625,7 +1708,11 @@ struct mxu1_port *mxport = usb_get_serial_port_data(port); unsigned int mcr; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif if (mxport == NULL) return -ENODEV; @@ -1862,7 +1949,11 @@ struct device *dev = &urb->dev->dev; #endif +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif /* Check port is valid or not */ if(mxport == NULL) @@ -1900,15 +1991,20 @@ unsigned char *data, int length) { int cnt; - struct tty_struct *tty; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + struct tty_struct *tty; #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) tty = mxport->mxp_port->tty; #else - tty = mxport->mxp_port->port.tty; #endif - do{ +#else + struct tty_port *tty; + tty = &(mxport->mxp_port->port); +#endif + + do{ if (mxport->mxp_read_urb_state == MXU1_READ_URB_STOPPING){ dbg("%s - [1] dropping data, %d bytes lost\n", __FUNCTION__, length); break; @@ -2031,7 +2127,11 @@ #endif unsigned long flags; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif spin_lock_irqsave(&mxport->mxp_lock, flags); @@ -2113,10 +2213,16 @@ int size,status; struct mxu1_device *mxdev = mxport->mxp_mxdev; struct usb_serial_port *port = mxport->mxp_port; - int port_number = port->number - port->serial->minor; - struct mxu1_port_status *data; + int port_number = 0; + struct mxu1_port_status *data; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + port_number = port->number - port->serial->minor; dbg("%s - port %d", __FUNCTION__, port->number); +#else + port_number = port->port_number - port->minor; + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif size = sizeof(struct mxu1_port_status); data = kmalloc(size, GFP_KERNEL); @@ -2154,7 +2260,11 @@ memset(&ret_serial, 0, sizeof(ret_serial)); ret_serial.type = PORT_16550A; - ret_serial.line = port->serial->minor; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) + ret_serial.line = port->serial->minor; +#else + ret_serial.line = port->minor; +#endif ret_serial.port = mxport->mxp_user_get_uart_mode; ret_serial.flags = mxport->mxp_flags; ret_serial.xmit_fifo_size = MXU1_WRITE_BUF_SIZE; @@ -2278,7 +2388,11 @@ wait_queue_t wait; unsigned long flags; +#if(LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) dbg("%s - port %d", __FUNCTION__, port->number); +#else + dbg("%s - port %d", __FUNCTION__, port->port_number); +#endif spin_lock_irqsave(&mxport->mxp_lock, flags); Link to comment
Linux777 Posted August 15, 2014 Share Posted August 15, 2014 Обновление драйвера. Писал для 3.14, пробовал собирать на 3.11, так что на 3.13 должно работать. Пока еще плотно не тестировал. diff -Nur mxu11x0/driver/mxu11x0.c mxu11x0-git/driver/mxu11x0.c Благодарю за попытку, однако... В чем смысл выкладывания патча без указания конкретной версии, на которую надо его накладывать??? patch -p1 < uport1130i_14.04.patch patching file driver/mxu11x0.c patch: **** malformed patch at line 15: @@ -915,12 +918,20 @@ где uport1130i_14.04.patch это содержимое Вашего патча. Накладываю на driv_linux_uport1p_v1.3.5_build_13061013.tgz А на самом деле на что надо? Причем я так же пробовал последнюю версию что можно скачать с оф сайте - это driv_linux_uport1p_v1.3_build_12071316.tgz На 1.3.7 тоже не накладывается! Админы, пожалуйста, организуйте версию для Linux 3.13 - ведь эта версия как минимум два года будет одной и той же, ведь это LTS релиз. Такие релизы поддерживать надо в первую очередь по идее... Link to comment
swarty Posted August 17, 2014 Share Posted August 17, 2014 Да, моя ошибка. Я использовал последний официальный драйвер (1.3.5): Добрый день! На всякий случай напомню, что на ядро 3.8 есть уже официальный драйвер. Что характерно, версии на сайтах отстают от того, что было упомянуто в теме ранее. Теперь по поводу ошибки. Похоже, парсер форума съел часть пустых строк. Если что, в прицепленном файле корректная версия патча. Благодарю за попытку, однако... В чем смысл выкладывания патча без указания конкретной версии, на которую надо его накладывать??? patch -p1 < uport1130i_14.04.patch patching file driver/mxu11x0.c patch: **** malformed patch at line 15: @@ -915,12 +918,20 @@ где uport1130i_14.04.patch это содержимое Вашего патча. Накладываю на driv_linux_uport1p_v1.3.5_build_13061013.tgz А на самом деле на что надо? Причем я так же пробовал последнюю версию что можно скачать с оф сайте - это driv_linux_uport1p_v1.3_build_12071316.tgz ... mxu11x0.txt Link to comment
Linux777 Posted August 18, 2014 Share Posted August 18, 2014 Теперь по поводу ошибки. Похоже, парсер форума съел часть пустых строк. Если что, в прицепленном файле корректная версия патча Наложился патч! И кстати это привело к тому что теперь в виртуальной машине (винда xp) работает uport1130i, а вот в Linux как таковом пока не пашет. Но это уже для меня радость - ну хоть как то работает, срочно надо было... Однако вот какая ошибка: minicom -D /dev/ttyUSB1 minicom: невозможно открыть /dev/ttyUSB1: Ошибка ввода/вывода Linux 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux [ 768.128682] usbcore: registered new interface driver mxu11x0 [ 768.128691] usbserial: USB Serial support registered for MOXA UPort 1110 [ 768.128696] usbserial: USB Serial support registered for MOXA UPort 1130 [ 768.128699] usbserial: USB Serial support registered for MOXA UPort 1150 [ 768.128703] usbserial: USB Serial support registered for MOXA UPort 1150I [ 768.128707] usbserial: USB Serial support registered for MOXA UPort 1130I [ 768.128718] mxu11x0 3-10.1:1.0: MOXA UPort 1130I converter detected [ 768.662769] mxu11x0: probe of 3-10.1:1.0 failed with error -5 [ 768.662782] mxu11x0: 1.3.5:MOXA UPort 11x0 USB to Serial Hub Driver [ 768.752887] usb 3-10.1: USB disconnect, device number 6 [ 768.954052] usb 3-10.1: new full-speed USB device number 10 using xhci_hcd [ 769.002352] usb 3-10.1: New USB device found, idVendor=110a, idProduct=1131 [ 769.002354] usb 3-10.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 769.002355] usb 3-10.1: Product: UPort 1131 [ 769.002356] usb 3-10.1: Manufacturer: Moxa Technologies Co., Ltd. [ 769.003911] mxu11x0 3-10.1:2.0: MOXA UPort 1130I converter detected [ 769.004018] usb 3-10.1: MOXA UPort 1130I converter now attached to ttyUSB1 [ 769.019010] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 769.023156] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 769.026142] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 769.030392] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 769.033678] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 769.037863] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 769.041510] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 769.045647] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 769.049263] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 769.053434] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 798.729114] usb 3-10.1: USB disconnect, device number 10 [ 798.729291] mxu1131 ttyUSB1: MOXA UPort 1130I converter now disconnected from ttyUSB1 [ 798.729304] mxu11x0 3-10.1:2.0: device disconnected [ 799.951099] usb 3-10.1: new full-speed USB device number 11 using xhci_hcd [ 799.991336] usb 3-10.1: New USB device found, idVendor=110a, idProduct=1131 [ 799.991345] usb 3-10.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 799.991350] usb 3-10.1: Product: UPort 1130I [ 799.991354] usb 3-10.1: Manufacturer: Moxa Technologies Co., Ltd. [ 799.993440] mxu11x0 3-10.1:1.0: MOXA UPort 1130I converter detected [ 800.528498] mxu11x0: probe of 3-10.1:1.0 failed with error -5 [ 800.778800] usb 3-10.1: USB disconnect, device number 11 [ 800.975930] usb 3-10.1: new full-speed USB device number 12 using xhci_hcd [ 801.024243] usb 3-10.1: New USB device found, idVendor=110a, idProduct=1131 [ 801.024252] usb 3-10.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 801.024257] usb 3-10.1: Product: UPort 1131 [ 801.024261] usb 3-10.1: Manufacturer: Moxa Technologies Co., Ltd. [ 801.025867] mxu11x0 3-10.1:2.0: MOXA UPort 1130I converter detected [ 801.026076] usb 3-10.1: MOXA UPort 1130I converter now attached to ttyUSB1 [ 801.060450] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 801.064576] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 801.067866] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 801.071996] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 801.075007] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 801.079229] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 801.082532] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 801.086638] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 [ 801.089974] mxu1131 ttyUSB1: mxu1_set_termios - cannot set config on port -1, -32 [ 801.094187] mxu1131 ttyUSB1: mxu1_open - cannot send open command, -32 Link to comment
Zverushka Posted August 25, 2014 Share Posted August 25, 2014 Наложился патч! И кстати это привело к тому что теперь в виртуальной машине (винда xp) работает uport1130i, а вот в Linux как таковом пока не пашет. Но это уже для меня радость - ну хоть как то работает, срочно надо было... Однако вот какая ошибка: minicom -D /dev/ttyUSB1 minicom: невозможно открыть /dev/ttyUSB1: Ошибка ввода/вывода Это было и до патча. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now