xbow_info.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id$
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1992-1997,2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
  8.  */
  9. #ifndef _ASM_SN_XTALK_XBOW_INFO_H
  10. #define _ASM_SN_XTALK_XBOW_INFO_H
  11. #include <linux/types.h>
  12. #include <linux/devfs_fs_kernel.h>
  13. #define XBOW_PERF_MODES        0x03
  14. #define XBOW_PERF_COUNTERS     0x02
  15. #define XBOW_MONITOR_NONE      0x00
  16. #define XBOW_MONITOR_SRC_LINK  0x01
  17. #define XBOW_MONITOR_DEST_LINK 0x02
  18. #define XBOW_MONITOR_INP_PKT   0x03
  19. #define XBOW_MONITOR_MULTIPLEX 0x04
  20. #define XBOW_LINK_MULTIPLEX    0x20
  21. #define XBOW_PERF_TIMEOUT 4
  22. #define XBOW_STATS_TIMEOUT HZ
  23. typedef struct xbow_perf_link {
  24.     uint64_t              xlp_cumulative[XBOW_PERF_MODES];
  25.     unsigned char           xlp_link_alive;
  26. } xbow_perf_link_t;
  27. typedef struct xbow_link_status {
  28.     uint64_t              rx_err_count;
  29.     uint64_t              tx_retry_count;
  30. } xbow_link_status_t;
  31. typedef struct xbow_perf {
  32.     uint32_t              xp_current;
  33.     unsigned char           xp_link;
  34.     unsigned char           xp_mode;
  35.     unsigned char           xp_curlink;
  36.     unsigned char           xp_curmode;
  37.     volatile uint32_t    *xp_perf_reg;
  38. } xbow_perf_t;
  39. extern void             xbow_update_perf_counters(devfs_handle_t);
  40. extern xbow_perf_link_t *xbow_get_perf_counters(devfs_handle_t);
  41. extern int              xbow_enable_perf_counter(devfs_handle_t, int, int, int);
  42. #define XBOWIOC_PERF_ENABLE    1
  43. #define XBOWIOC_PERF_DISABLE   2
  44. #define XBOWIOC_PERF_GET   3
  45. #define XBOWIOC_LLP_ERROR_ENABLE  4
  46. #define XBOWIOC_LLP_ERROR_DISABLE 5
  47. #define XBOWIOC_LLP_ERROR_GET   6
  48. struct xbow_perfarg_t {
  49.     int                     link;
  50.     int                     mode;
  51.     int                     counter;
  52. };
  53. #endif /* _ASM_SN_XTALK_XBOW_INFO_H */