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_IA64_SN_VECTOR_H
10 #define _ASM_IA64_SN_VECTOR_H
11 
12 #include <linux/config.h>
13 
14 #define NET_VEC_NULL            ((net_vec_t)  0)
15 #define NET_VEC_BAD             ((net_vec_t) -1)
16 
17 #define VEC_POLLS_W		128	/* Polls before write times out */
18 #define VEC_POLLS_R		128	/* Polls before read times out */
19 #define VEC_POLLS_X		128	/* Polls before exch times out */
20 
21 #define VEC_RETRIES_W		8	/* Retries before write fails */
22 #define VEC_RETRIES_R           8	/* Retries before read fails */
23 #define VEC_RETRIES_X		4	/* Retries before exch fails */
24 
25 #define NET_ERROR_NONE		0	/* No error		*/
26 #define NET_ERROR_HARDWARE	(-1)	/* Hardware error	*/
27 #define NET_ERROR_OVERRUN	(-2)	/* Extra response(s)	*/
28 #define NET_ERROR_REPLY		(-3)	/* Reply parms mismatch */
29 #define NET_ERROR_ADDRESS	(-4)	/* Addr error response	*/
30 #define NET_ERROR_COMMAND	(-5)	/* Cmd error response	*/
31 #define NET_ERROR_PROT		(-6)	/* Prot error response	*/
32 #define NET_ERROR_TIMEOUT	(-7)	/* Too many retries	*/
33 #define NET_ERROR_VECTOR	(-8)	/* Invalid vector/path	*/
34 #define NET_ERROR_ROUTERLOCK	(-9)	/* Timeout locking rtr	*/
35 #define NET_ERROR_INVAL		(-10)	/* Invalid vector request */
36 
37 #ifndef __ASSEMBLY__
38 #include <linux/types.h>
39 #include <asm/sn/types.h>
40 
41 typedef uint64_t              net_reg_t;
42 typedef uint64_t              net_vec_t;
43 
44 int             vector_write(net_vec_t dest,
45                               int write_id, int address,
46                               uint64_t value);
47 
48 int             vector_read(net_vec_t dest,
49                              int write_id, int address,
50                              uint64_t *value);
51 
52 int             vector_write_node(net_vec_t dest, nasid_t nasid,
53                               int write_id, int address,
54                               uint64_t value);
55 
56 int             vector_read_node(net_vec_t dest, nasid_t nasid,
57                              int write_id, int address,
58                              uint64_t *value);
59 
60 int             vector_length(net_vec_t vec);
61 net_vec_t       vector_get(net_vec_t vec, int n);
62 net_vec_t       vector_prefix(net_vec_t vec, int n);
63 net_vec_t       vector_modify(net_vec_t entry, int n, int route);
64 net_vec_t       vector_reverse(net_vec_t vec);
65 net_vec_t       vector_concat(net_vec_t vec1, net_vec_t vec2);
66 
67 char		*net_errmsg(int);
68 
69 #ifndef _STANDALONE
70 int hub_vector_write(cnodeid_t cnode, net_vec_t vector, int writeid,
71 	int addr, net_reg_t value);
72 int hub_vector_read(cnodeid_t cnode, net_vec_t vector, int writeid,
73 	int addr, net_reg_t *value);
74 #endif
75 
76 #endif /* __ASSEMBLY__ */
77 
78 #endif /* _ASM_IA64_SN_VECTOR_H */
79