sonet.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /* sonet.h - SONET/SHD physical layer control */
  3. /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
  4. #ifndef _UAPILINUX_SONET_H
  5. #define _UAPILINUX_SONET_H
  6. #define __SONET_ITEMS \
  7. __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
  8. __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
  9. __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
  10. __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
  11. __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
  12. __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
  13. __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
  14. __HANDLE_ITEM(tx_cells); /* cells sent */ \
  15. __HANDLE_ITEM(rx_cells); /* cells received */
  16. struct sonet_stats {
  17. #define __HANDLE_ITEM(i) int i
  18. __SONET_ITEMS
  19. #undef __HANDLE_ITEM
  20. } __attribute__ ((packed));
  21. #define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
  22. /* get statistics */
  23. #define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
  24. /* ... and zero counters */
  25. #define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
  26. /* set error insertion */
  27. #define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
  28. /* clear error insertion */
  29. #define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
  30. /* query error insertion */
  31. #define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
  32. /* set framing mode (SONET/SDH) */
  33. #define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
  34. /* get framing mode */
  35. #define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
  36. unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
  37. #define SONET_INS_SBIP 1 /* section BIP */
  38. #define SONET_INS_LBIP 2 /* line BIP */
  39. #define SONET_INS_PBIP 4 /* path BIP */
  40. #define SONET_INS_FRAME 8 /* out of frame */
  41. #define SONET_INS_LOS 16 /* set line to zero */
  42. #define SONET_INS_LAIS 32 /* line alarm indication signal */
  43. #define SONET_INS_PAIS 64 /* path alarm indication signal */
  44. #define SONET_INS_HCS 128 /* insert HCS error */
  45. #define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
  46. #define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
  47. #define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
  48. #endif /* _UAPILINUX_SONET_H */