/drivers/staging/sbe-2t3e3/ctrl.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 131 lines · 97 code · 22 blank · 12 comment · 0 complexity · 63a3e4c6d1ffdc1f9a9ee522b395d64a MD5 · raw file

  1. /*
  2. * SBE 2T3E3 synchronous serial card driver for Linux
  3. *
  4. * Copyright (C) 2009-2010 Krzysztof Halasa <khc@pm.waw.pl>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of version 2 of the GNU General Public License
  8. * as published by the Free Software Foundation.
  9. *
  10. * This code is based on a driver written by SBE Inc.
  11. */
  12. #ifndef CTRL_H
  13. #define CTRL_H
  14. #define SBE_2T3E3_OFF 0
  15. #define SBE_2T3E3_ON 1
  16. #define SBE_2T3E3_LED_NONE 0
  17. #define SBE_2T3E3_LED_GREEN 1
  18. #define SBE_2T3E3_LED_YELLOW 2
  19. #define SBE_2T3E3_CABLE_LENGTH_LESS_THAN_255_FEET 0
  20. #define SBE_2T3E3_CABLE_LENGTH_GREATER_THAN_255_FEET 1
  21. #define SBE_2T3E3_CRC_16 0
  22. #define SBE_2T3E3_CRC_32 1
  23. #define SBE_2T3E3_PANEL_FRONT 0
  24. #define SBE_2T3E3_PANEL_REAR 1
  25. #define SBE_2T3E3_FRAME_MODE_HDLC 0
  26. #define SBE_2T3E3_FRAME_MODE_TRANSPARENT 1
  27. #define SBE_2T3E3_FRAME_MODE_RAW 2
  28. #define SBE_2T3E3_FRAME_TYPE_E3_G751 0
  29. #define SBE_2T3E3_FRAME_TYPE_E3_G832 1
  30. #define SBE_2T3E3_FRAME_TYPE_T3_CBIT 2
  31. #define SBE_2T3E3_FRAME_TYPE_T3_M13 3
  32. #define SBE_2T3E3_FRACTIONAL_MODE_NONE 0
  33. #define SBE_2T3E3_FRACTIONAL_MODE_0 1
  34. #define SBE_2T3E3_FRACTIONAL_MODE_1 2
  35. #define SBE_2T3E3_FRACTIONAL_MODE_2 3
  36. #define SBE_2T3E3_SCRAMBLER_OFF 0
  37. #define SBE_2T3E3_SCRAMBLER_LARSCOM 1
  38. #define SBE_2T3E3_SCRAMBLER_ADC_KENTROX_DIGITAL 2
  39. #define SBE_2T3E3_TIMING_LOCAL 0
  40. #define SBE_2T3E3_TIMING_LOOP 1
  41. #define SBE_2T3E3_LOOPBACK_NONE 0
  42. #define SBE_2T3E3_LOOPBACK_ETHERNET 1
  43. #define SBE_2T3E3_LOOPBACK_FRAMER 2
  44. #define SBE_2T3E3_LOOPBACK_LIU_DIGITAL 3
  45. #define SBE_2T3E3_LOOPBACK_LIU_ANALOG 4
  46. #define SBE_2T3E3_LOOPBACK_LIU_REMOTE 5
  47. #define SBE_2T3E3_PAD_COUNT_1 1
  48. #define SBE_2T3E3_PAD_COUNT_2 2
  49. #define SBE_2T3E3_PAD_COUNT_3 3
  50. #define SBE_2T3E3_PAD_COUNT_4 4
  51. #define SBE_2T3E3_CHIP_21143 0
  52. #define SBE_2T3E3_CHIP_CPLD 1
  53. #define SBE_2T3E3_CHIP_FRAMER 2
  54. #define SBE_2T3E3_CHIP_LIU 3
  55. #define SBE_2T3E3_LOG_LEVEL_NONE 0
  56. #define SBE_2T3E3_LOG_LEVEL_ERROR 1
  57. #define SBE_2T3E3_LOG_LEVEL_WARNING 2
  58. #define SBE_2T3E3_LOG_LEVEL_INFO 3
  59. /* commands */
  60. #define SBE_2T3E3_PORT_GET 0
  61. #define SBE_2T3E3_PORT_SET 1
  62. #define SBE_2T3E3_PORT_GET_STATS 2
  63. #define SBE_2T3E3_PORT_DEL_STATS 3
  64. #define SBE_2T3E3_PORT_READ_REGS 4
  65. #define SBE_2T3E3_LOG_LEVEL 5
  66. #define SBE_2T3E3_PORT_WRITE_REGS 6
  67. #define NG_SBE_2T3E3_NODE_TYPE "sbe2T3E3"
  68. #define NG_SBE_2T3E3_COOKIE 0x03800891
  69. typedef struct t3e3_param {
  70. u_int8_t frame_mode; /* FRAME_MODE_* */
  71. u_int8_t crc; /* CRC_* */
  72. u_int8_t receiver_on; /* ON/OFF */
  73. u_int8_t transmitter_on; /* ON/OFF */
  74. u_int8_t frame_type; /* FRAME_TYPE_* */
  75. u_int8_t panel; /* PANEL_* */
  76. u_int8_t line_build_out; /* ON/OFF */
  77. u_int8_t receive_equalization; /* ON/OFF */
  78. u_int8_t transmit_all_ones; /* ON/OFF */
  79. u_int8_t loopback; /* LOOPBACK_* */
  80. u_int8_t clock_source; /* TIMING_* */
  81. u_int8_t scrambler; /* SCRAMBLER_* */
  82. u_int8_t pad_count; /* PAD_COUNT_* */
  83. u_int8_t log_level; /* LOG_LEVEL_* - unused */
  84. u_int8_t fractional_mode; /* FRACTIONAL_MODE_* */
  85. u_int8_t bandwidth_start; /* 0-255 */
  86. u_int8_t bandwidth_stop; /* 0-255 */
  87. } t3e3_param_t;
  88. typedef struct t3e3_stats {
  89. u_int64_t in_bytes;
  90. u32 in_packets, in_dropped;
  91. u32 in_errors, in_error_desc, in_error_coll, in_error_drib,
  92. in_error_crc, in_error_mii;
  93. u_int64_t out_bytes;
  94. u32 out_packets, out_dropped;
  95. u32 out_errors, out_error_jab, out_error_lost_carr,
  96. out_error_no_carr, out_error_link_fail, out_error_underflow,
  97. out_error_dereferred;
  98. u_int8_t LOC, LOF, OOF, LOS, AIS, FERF, IDLE, AIC, FEAC;
  99. u_int16_t FEBE_code;
  100. u32 LCV, FRAMING_BIT, PARITY_ERROR, FEBE_count, CP_BIT;
  101. } t3e3_stats_t;
  102. typedef struct t3e3_resp {
  103. union {
  104. t3e3_param_t param;
  105. t3e3_stats_t stats;
  106. u32 data;
  107. } u;
  108. } t3e3_resp_t;
  109. #endif /* CTRL_H */