File: /usr/src/linux/include/asm-ia64/sn/xtalk/xbow_info.h

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 Silicon Graphics, Inc.
8      * Copyright (C) 2000 by Colin Ngam
9      */
10     #ifndef _ASM_SN_XTALK_XBOW_INFO_H
11     #define _ASM_SN_XTALK_XBOW_INFO_H
12     
13     #define XBOW_PERF_MODES	       0x03
14     #define XBOW_PERF_COUNTERS     0x02
15     
16     #define XBOW_MONITOR_NONE      0x00
17     #define XBOW_MONITOR_SRC_LINK  0x01
18     #define XBOW_MONITOR_DEST_LINK 0x02
19     #define XBOW_MONITOR_INP_PKT   0x03
20     #define XBOW_MONITOR_MULTIPLEX 0x04
21     
22     #define XBOW_LINK_MULTIPLEX    0x20
23     
24     #define XBOW_PERF_TIMEOUT	4
25     #define XBOW_STATS_TIMEOUT	HZ
26     
27     typedef struct xbow_perf_link {
28         uint64_t              xlp_cumulative[XBOW_PERF_MODES];
29         unsigned char           xlp_link_alive;
30     } xbow_perf_link_t;
31     
32     
33     typedef struct xbow_link_status {
34         uint64_t              rx_err_count;
35         uint64_t              tx_retry_count;
36     } xbow_link_status_t;
37     
38     
39     
40     typedef struct xbow_perf {
41         uint32_t              xp_current;
42         unsigned char           xp_link;
43         unsigned char           xp_mode;
44         unsigned char           xp_curlink;
45         unsigned char           xp_curmode;
46         volatile uint32_t    *xp_perf_reg;
47     } xbow_perf_t;
48     
49     extern void             xbow_update_perf_counters(devfs_handle_t);
50     extern xbow_perf_link_t *xbow_get_perf_counters(devfs_handle_t);
51     extern int              xbow_enable_perf_counter(devfs_handle_t, int, int, int);
52     
53     #define XBOWIOC_PERF_ENABLE	  	1
54     #define XBOWIOC_PERF_DISABLE	 	2
55     #define XBOWIOC_PERF_GET	 	3
56     #define XBOWIOC_LLP_ERROR_ENABLE 	4
57     #define XBOWIOC_LLP_ERROR_DISABLE	5
58     #define XBOWIOC_LLP_ERROR_GET	 	6
59     
60     
61     struct xbow_perfarg_t {
62         int                     link;
63         int                     mode;
64         int                     counter;
65     };
66     
67     #endif				/* _ASM_SN_XTALK_XBOW_INFO_H */
68