This commit was generated by cvs2svn to compensate for changes in r164,
[gnokii.git] / Docs / developers / other / sniffs / irda / tools / fcs / fcs.h
1 /*********************************************************************
2  *                
3  * Filename:      fcs.h
4  * Version:       
5  * Description:   fcs routines for irda
6  * Status:        Experimental.
7  * Author:        Dag Brattli <dagb@cs.uit.no>
8  * Created at:    Mon Aug  4 20:40:53 1997
9  * Modified at:   Sat Jul 17 08:43:59 1999
10  * Modified by:   Thomas Schneider <nok-trace-men@dev-thomynet.de>
11  * Sources:       crc.h by Dag Brattli <dagb@cs.uit.no> in
12  *                linux-irda-project
13  * 
14  ********************************************************************/
15
16 #ifndef FCS_H
17 #define FCS_H
18
19 #include <linux/types.h>
20
21 #define INIT_FCS  0xffff   /* Initial FCS value    */
22 #define GOOD_FCS  0xf0b8   /* Good final FCS value */
23
24 #define IR_FCS(fcs, byte)((fcs >> 8)^irda_fcs16_table[ (fcs^byte) & 0xff])
25
26 unsigned short fcs_calc( __u16 oldfcs, __u8 *buf, int len);
27
28 extern __u16 irda_fcs16_table[];
29
30 #endif