Gmail Календарь Документы Reader Веб ещё »
Недавно посещенные группы | Справка | Вход
Главная страница Google Groups
RTS/CTS handshaking for embedded devices
В данный момент в этой группе слишком много тем, которые должны показываться в первую очередь. Чтобы эта тема показывалась в первую очередь, измените этот параметр для какой-то другой темы.
При обработке Вашего запроса произошла ошибка. Повторите попытку.
пометка
  1 сообщение - Свернуть все  -  Перевести все на Переведено (просмотреть все оригиналы)
Сообщение будет отправлено в группу Usenet. Когда Вы отправляете сообщения в такие группы, Ваш адрес электронной почты публикуется в Интернете.
Ваш ответ не был отправлен.
Сообщение отправлено успешно.
 
Автор:
Кому:
Копия:
В ответ на:
Добавить копию | Добавить заголовок "В ответ на" | Изменить тему
Тема:
Утверждение:
Для подтверждения введите символы, изображенные на картинке ниже, или цифры, которые вы услышите, нажав на значок упрощенного доступа. Слушайте и вводите услышанные числа
 
Oleksiy Kebkal  
Просмотреть профиль   Перевести на Переведено (просмотреть оригинал)
 Дополнительные параметры 2 мар 2007, 21:10
Группы новостей: linux.kernel
Автор: "Oleksiy Kebkal" <keb...@gmail.com>
Дата: Fri, 02 Mar 2007 21:10:07 +0100
Местное время: Пт. 2 мар 2007 21:10
Тема: RTS/CTS handshaking for embedded devices
Hi,

I use arm-linux platform to program some peripheral where pecular
serial flow control is required:

- There is no flow control for the arm-linux device -> control unit
- For the control unix -> arm-linux device
 * RTS must be kept low, the device keeps CTS low as well.
 * when the device wants to send data, it raises CTS. RTS must
   be raised as well. Data can then pass, CTS and RTS are lowered.

Actually it's pretty simillar to the problem, described here:
http://groups.google.de/group/linux.kernel/browse_thread/thread/b5a05...
and I suppose, here:
http://groups.google.de/group/linux.kernel/browse_thread/thread/9479f...

It looked for me obvios that the solution is to switch off the flow
control (CRTSCTS) and to assert/deassert RTS via
ioctl. But I have found, that:
 * even if flow control is switched off, serial_core.c asserts RTS
during opening the serial device.
 * there is no possibility (at least I didn't find it) to preconfigure
serial interface in the user space before opening
  serial device (looks logically), but there is a time gap between
opening the serial device and configuring it, there
  control device "thinks" that arm is ready to get data (RTS is
asserted), but the configuration parameters are
  potentially wrong.

So the first question is, is there any provided by kernel way to solve
the described above task?

If not, maybe it would be more correct just to don't touch RTS, if
flow control is switched off, like here:

Index: drivers/serial/serial_core.c
===================================================================
--- a/drivers/serial/serial_core.c  (mode:100644)
+++ b/drivers/serial/serial_core.c  (mode:100644)
@@ -212,7 +212,7 @@
        * is open and ready to respond.
        */
       if (info->tty->termios->c_cflag & CBAUD)
-               info->mctrl |= TIOCM_RTS | TIOCM_DTR;
+               info->mctrl |= TIOCM_DTR | (info->flags &
ASYNC_CTS_FLOW ? 0 : TIOCM_RTS );
       info->ops->set_mctrl(info->port, info->mctrl);

       info->flags |= ASYNC_INITIALIZED;
@@ -1001,8 +1001,8 @@
       /* Handle transition away from B0 status */
       if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) {
               info->mctrl |= TIOCM_DTR;
-               if (!(cflag & CRTSCTS) ||
-                   !test_bit(TTY_THROTTLED, &tty->flags))
+               if (/*!(cflag & CRTSCTS) ||*/
+                   !test_bit(TTY_THROTTLED, &tty->flags))
                       info->mctrl |= TIOCM_RTS;
               info->ops->set_mctrl(info->port, info->mctrl);
       }
@@ -1301,7 +1301,7 @@
               spin_lock_irqsave(&info->lock, flags);
               if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&
                   (tty->termios->c_cflag & CBAUD)) {
-                       info->mctrl |= TIOCM_DTR | TIOCM_RTS;
+                       info->mctrl |= TIOCM_DTR | (info->flags &
ASYNC_CTS_FLOW ? 0 : TIOCM_RTS );
                       info->ops->set_mctrl(info->port, info->mctrl);
               }
               spin_unlock_irqrestore(&info->lock, flags);

---
Oleksiy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Переслать  
Чтобы отправлять сообщения, сначала необходимо Войти.
Чтобы отправлять сообщения, сначала необходимо присоединиться к группе.
Перед отправкой сообщения обновите свой псевдоним на странице Настройки подписки.
У вас нет разрешения на отправку сообщений.
Конец сообщений
« Назад к обсуждениям « Следующая тема     Предыдущая тема »

Создайте группу - Группы Google - Главная страница Google - Условия предоставления услуг - Политика конфиденциальности
©2010 Google