| 1 | /* r3964 linediscipline for linux |
|---|
| 2 | * |
|---|
| 3 | * ----------------------------------------------------------- |
|---|
| 4 | * Copyright by |
|---|
| 5 | * Philips Automation Projects |
|---|
| 6 | * Kassel (Germany) |
|---|
| 7 | * http://www.pap-philips.de |
|---|
| 8 | * ----------------------------------------------------------- |
|---|
| 9 | * This software may be used and distributed according to the terms of |
|---|
| 10 | * the GNU General Public License, incorporated herein by reference. |
|---|
| 11 | * |
|---|
| 12 | * Author: |
|---|
| 13 | * L. Haag |
|---|
| 14 | * |
|---|
| 15 | * $Log: n_r3964.h,v $ |
|---|
| 16 | * Revision 1.2 2004/01/01 18:23:41 mmazur |
|---|
| 17 | * - Total Infor^H^H^H^H^HKernel Block Removal part 1 |
|---|
| 18 | * - after finishing this I will make a script to test each and every header |
|---|
| 19 | * for getting parsed correctly by a C compiler |
|---|
| 20 | * |
|---|
| 21 | * Revision 1.1.1.1 2003/12/15 18:46:58 mmazur |
|---|
| 22 | * Initial from debian |
|---|
| 23 | * |
|---|
| 24 | * Revision 1.3 2001/03/18 13:02:24 dwmw2 |
|---|
| 25 | * Fix timer usage, use spinlocks properly. |
|---|
| 26 | * |
|---|
| 27 | * Revision 1.2 2001/03/18 12:53:15 dwmw2 |
|---|
| 28 | * Merge changes in 2.4.2 |
|---|
| 29 | * |
|---|
| 30 | * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2 |
|---|
| 31 | * This'll screw the version control |
|---|
| 32 | * |
|---|
| 33 | * Revision 1.6 1998/09/30 00:40:38 dwmw2 |
|---|
| 34 | * Updated to use kernel's N_R3964 if available |
|---|
| 35 | * |
|---|
| 36 | * Revision 1.4 1998/04/02 20:29:44 lhaag |
|---|
| 37 | * select, blocking, ... |
|---|
| 38 | * |
|---|
| 39 | * Revision 1.3 1998/02/12 18:58:43 root |
|---|
| 40 | * fixed some memory leaks |
|---|
| 41 | * calculation of checksum characters |
|---|
| 42 | * |
|---|
| 43 | * Revision 1.2 1998/02/07 13:03:17 root |
|---|
| 44 | * ioctl read_telegram |
|---|
| 45 | * |
|---|
| 46 | * Revision 1.1 1998/02/06 19:19:43 root |
|---|
| 47 | * Initial revision |
|---|
| 48 | * |
|---|
| 49 | * |
|---|
| 50 | */ |
|---|
| 51 | |
|---|
| 52 | #ifndef __LINUX_N_R3964_H__ |
|---|
| 53 | #define __LINUX_N_R3964_H__ |
|---|
| 54 | |
|---|
| 55 | /* line disciplines for r3964 protocol */ |
|---|
| 56 | #include <asm/termios.h> |
|---|
| 57 | |
|---|
| 58 | /* |
|---|
| 59 | * Ioctl-commands |
|---|
| 60 | */ |
|---|
| 61 | |
|---|
| 62 | #define R3964_ENABLE_SIGNALS 0x5301 |
|---|
| 63 | #define R3964_SETPRIORITY 0x5302 |
|---|
| 64 | #define R3964_USE_BCC 0x5303 |
|---|
| 65 | #define R3964_READ_TELEGRAM 0x5304 |
|---|
| 66 | |
|---|
| 67 | /* Options for R3964_SETPRIORITY */ |
|---|
| 68 | #define R3964_MASTER 0 |
|---|
| 69 | #define R3964_SLAVE 1 |
|---|
| 70 | |
|---|
| 71 | /* Options for R3964_ENABLE_SIGNALS */ |
|---|
| 72 | #define R3964_SIG_ACK 0x0001 |
|---|
| 73 | #define R3964_SIG_DATA 0x0002 |
|---|
| 74 | #define R3964_SIG_ALL 0x000f |
|---|
| 75 | #define R3964_SIG_NONE 0x0000 |
|---|
| 76 | #define R3964_USE_SIGIO 0x1000 |
|---|
| 77 | |
|---|
| 78 | /* |
|---|
| 79 | * r3964 operation states: |
|---|
| 80 | */ |
|---|
| 81 | |
|---|
| 82 | /* types for msg_id: */ |
|---|
| 83 | enum {R3964_MSG_ACK=1, R3964_MSG_DATA }; |
|---|
| 84 | |
|---|
| 85 | #define R3964_MAX_MSG_COUNT 32 |
|---|
| 86 | |
|---|
| 87 | /* error codes for client messages */ |
|---|
| 88 | #define R3964_OK 0 /* no error. */ |
|---|
| 89 | #define R3964_TX_FAIL -1 /* transmission error, block NOT sent */ |
|---|
| 90 | #define R3964_OVERFLOW -2 /* msg queue overflow */ |
|---|
| 91 | |
|---|
| 92 | /* the client gets this struct when calling read(fd,...): */ |
|---|
| 93 | struct r3964_client_message { |
|---|
| 94 | int msg_id; |
|---|
| 95 | int arg; |
|---|
| 96 | int error_code; |
|---|
| 97 | }; |
|---|
| 98 | |
|---|
| 99 | #define R3964_MTU 256 |
|---|
| 100 | |
|---|
| 101 | #endif |
|---|