Line Discipline or Termios lacks ?

Joel Sherrill joel.sherrill at OARcorp.com
Thu Sep 18 15:50:16 UTC 2003


Thomas Doerfler wrote:

> Hi,
> 
> 
>>Ok, I want to do this !! :-) But I don't found how
>>termios_ioctl will call my private driver ioctl
>>function.
>>
>>Termios_icotl have a switch(command) :
>>case KnwonCommand1 :
>>case KnwonCommand2 :
>>case KnwonCommand3 :
>>default : Call line discipline ioctl function
> 
> 
> Well, I would not change the termios code, but intercept the 
> ioctl call in your private driver. 

Nice suggestion.  Would you mind making it a subsection of
the BSP and Device Driver chapter on serial devices?

Also I have searched a bit and not managaed to find a standard
way of doing this function.  If there is a way on *BSD or Linux
to do this, it would be nice to use those names for the IOCTLS
and possibly add them to the standard list.

> Whenever an application performs an ioctl call for a specific 
> device, then the RTEMS io system calls the "ioctl" function in 
> the device driver (e.g. "console_ioctl"). A "nomal" driver 
> supporting "termios" will only hand through that call to 
> termios_ioctl, in that case the drivers "ioctl" function looks 
> like:
> 
> 
> 
> /*
>  * Handle ioctl request.
>  */
> rtems_device_driver console_control(
>   rtems_device_major_number major,
>   rtems_device_minor_number minor,
>   void                    * arg
> )
> { 
>   return rtems_termios_ioctl (arg);
> }
> 
> In your case, you should intercept your own ioctl code in this 
> function, so you would change it to:
> 
> /*
>  * Handle ioctl request.
>  */
> rtems_device_driver console_control(
>   rtems_device_major_number major,
>   rtems_device_minor_number minor,
>   void                    * arg
> )
> { 
>   rtems_status_code rc;
>   rtems_libio_ioctl_args_t *args = arg;
> 
>   switch(args->command) {
>     case_MY_IOCTL_CODE_TO_ENABLE_RTS:
>       rc = console_enable_rts(arg);
>       break;
>     case_MY_IOCTL_CODE_TO_DISABLE_RTS:
>       rc = console_disable_rts(arg);
>       break;
>     default: 
>       rc = rtems_termios_ioctl (arg);
>       break;
>   }
>   return rc;
> }
> 
> 
> Does this help a bit?
> 
> wkr,
> 	Thomas.
> 
> 
> 
>>So How can I do, that's what I don't understand and
>>found a solution to do this and use termios ?
>>
>>
>>>wkr,
>>>	Thomas.
>>
>> 
>> 
>>
>>
>>
>>=====
>>AUBERT Cedric
>>SDEL Controle Commande
>>rue Nungesser & Coli
>>44860 St Aignan de Grand Lieu
>>
>>E-mail : cedric_aubert at yahoo.fr
>>Http : http://www.controle-commande.sdel.fr/
>>
>>__________________________________
>>Do you Yahoo!?
>>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>>http://sitebuilder.yahoo.com
> 
> 
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler           Herbststrasse 8
> D-82178 Puchheim          Germany
> email:    Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd-
> systems.de/pgp_keys.htm
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the users mailing list