Re: Serial driver parity support

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

 



> I wanted to check if you had any feedback or advice about my previous query.  

Kind of slipped off my list


> 1. The serial driver sets TTY_DRIVER_REAL_RAW.  My understanding of  	TTY_DRIVER_REAL_RAW is that, if set, the driver will only send the 	minimum notifications of parity errors required or according to the 	c_iflags.  For example, regarding parity errors:
> 
> 
>    ! (INPCK)         --  char with PE will be pushed as TTY_NORMAL
>    INPCK & !(IGNPAR) --  char with PE will be pushed as TTY_PARITY
>    INPCK & IGNPAR    --  char with PE will be discarded and not pushed
> 
>       Is my understanding correct?

Basically it indicates the hardware behaves as Unix wants in the fast
path case of parity being ignored, break being ignored and no input check
being done. In day gone by it was useful for some block transfer stuff.

Nowdays its basically irrelevant because CPUs are vastly faster relative
to serial data rates (except USB 3G dongles perhaps) and almost all the
communications at high speed is PPP which doesn't have that fast path
anyway.


> 2. When receiving characters, I am pushing a block of characters (<= 16) at 	a time to the TTY data structure.  If a parity error occurs on the 8th 	character, should I push the entire block of data with the TTY_PARITY 	flag?  Or should I first push the first 7 characters with the 	TTY_NORMAL flag and the 8th character separately with the TTY_PARITY 	flag?  

Provide the most accurate error information you can. So if you have byte
accurate error flags then great.

> 3. Is there a priority given to BI, FE, and PE errors?  For example, if more 	than one of these errors occurs for a single character, should all 	errors be flagged?  Or is one error given priority, and (depending on 	the c_iflag settings) the character is pushed with the flag set to 	this type of error?

The kernel only allows you to report one per byte. That's one of those
things that could be improved but nobody has ever been annoyed enough to
fix. I would suggest the order of values is probably as good a priority
as any.

> 4. Should I ever push the parity bit to TTY?  Or should the parity bit 	always be removed first?

If the hardware doesn't remove it then yes you should mask it.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux