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