aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sonet.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/sonet.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/sonet.h')
-rw-r--r--include/linux/sonet.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
new file mode 100644
index 000000000000..753680296e17
--- /dev/null
+++ b/include/linux/sonet.h
@@ -0,0 +1,75 @@
1/* sonet.h - SONET/SHD physical layer control */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef LINUX_SONET_H
7#define LINUX_SONET_H
8
9#define __SONET_ITEMS \
10 __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
11 __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
12 __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
13 __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
14 __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
15 __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
16 __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
17 __HANDLE_ITEM(tx_cells); /* cells sent */ \
18 __HANDLE_ITEM(rx_cells); /* cells received */
19
20struct sonet_stats {
21#define __HANDLE_ITEM(i) int i
22 __SONET_ITEMS
23#undef __HANDLE_ITEM
24} __attribute__ ((packed));
25
26
27#define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
28 /* get statistics */
29#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
30 /* ... and zero counters */
31#define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
32 /* set error insertion */
33#define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
34 /* clear error insertion */
35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
36 /* query error insertion */
37#define SONET_SETFRAMING _IO('a',ATMIOC_PHYTYP+5)
38 /* set framing mode (SONET/SDH) */
39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
40 /* get framing mode */
41#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
42 unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
43
44#define SONET_INS_SBIP 1 /* section BIP */
45#define SONET_INS_LBIP 2 /* line BIP */
46#define SONET_INS_PBIP 4 /* path BIP */
47#define SONET_INS_FRAME 8 /* out of frame */
48#define SONET_INS_LOS 16 /* set line to zero */
49#define SONET_INS_LAIS 32 /* line alarm indication signal */
50#define SONET_INS_PAIS 64 /* path alarm indication signal */
51#define SONET_INS_HCS 128 /* insert HCS error */
52
53#define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
54#define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
55
56#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
57
58
59#ifdef __KERNEL__
60
61#include <asm/atomic.h>
62
63struct k_sonet_stats {
64#define __HANDLE_ITEM(i) atomic_t i
65 __SONET_ITEMS
66#undef __HANDLE_ITEM
67};
68
69extern void sonet_copy_stats(struct k_sonet_stats *from,struct sonet_stats *to);
70extern void sonet_subtract_stats(struct k_sonet_stats *from,
71 struct sonet_stats *to);
72
73#endif
74
75#endif