ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / vector.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
7  */
8 #ifndef _ASM_IA64_SN_VECTOR_H
9 #define _ASM_IA64_SN_VECTOR_H
10
11 #define NET_VEC_NULL            ((net_vec_t)  0)
12 #define NET_VEC_BAD             ((net_vec_t) -1)
13
14 #define VEC_POLLS_W             128     /* Polls before write times out */
15 #define VEC_POLLS_R             128     /* Polls before read times out */
16 #define VEC_POLLS_X             128     /* Polls before exch times out */
17
18 #define VEC_RETRIES_W           8       /* Retries before write fails */
19 #define VEC_RETRIES_R           8       /* Retries before read fails */
20 #define VEC_RETRIES_X           4       /* Retries before exch fails */
21
22 #define NET_ERROR_NONE          0       /* No error             */
23 #define NET_ERROR_HARDWARE      (-1)    /* Hardware error       */
24 #define NET_ERROR_OVERRUN       (-2)    /* Extra response(s)    */
25 #define NET_ERROR_REPLY         (-3)    /* Reply parms mismatch */
26 #define NET_ERROR_ADDRESS       (-4)    /* Addr error response  */
27 #define NET_ERROR_COMMAND       (-5)    /* Cmd error response   */
28 #define NET_ERROR_PROT          (-6)    /* Prot error response  */
29 #define NET_ERROR_TIMEOUT       (-7)    /* Too many retries     */
30 #define NET_ERROR_VECTOR        (-8)    /* Invalid vector/path  */
31 #define NET_ERROR_ROUTERLOCK    (-9)    /* Timeout locking rtr  */
32 #define NET_ERROR_INVAL         (-10)   /* Invalid vector request */
33
34 #ifndef __ASSEMBLY__
35 #include <linux/types.h>
36 #include <asm/sn/types.h>
37
38 typedef uint64_t              net_reg_t;
39 typedef uint64_t              net_vec_t;
40
41 int             vector_write(net_vec_t dest,
42                               int write_id, int address,
43                               uint64_t value);
44
45 int             vector_read(net_vec_t dest,
46                              int write_id, int address,
47                              uint64_t *value);
48
49 int             vector_write_node(net_vec_t dest, nasid_t nasid,
50                               int write_id, int address,
51                               uint64_t value);
52
53 int             vector_read_node(net_vec_t dest, nasid_t nasid,
54                              int write_id, int address,
55                              uint64_t *value);
56
57 int             vector_length(net_vec_t vec);
58 net_vec_t       vector_get(net_vec_t vec, int n);
59 net_vec_t       vector_prefix(net_vec_t vec, int n);
60 net_vec_t       vector_modify(net_vec_t entry, int n, int route);
61 net_vec_t       vector_reverse(net_vec_t vec);
62 net_vec_t       vector_concat(net_vec_t vec1, net_vec_t vec2);
63
64 char            *net_errmsg(int);
65
66 #ifndef _STANDALONE
67 int hub_vector_write(cnodeid_t cnode, net_vec_t vector, int writeid,
68         int addr, net_reg_t value);
69 int hub_vector_read(cnodeid_t cnode, net_vec_t vector, int writeid,
70         int addr, net_reg_t *value);
71 #endif
72
73 #endif /* __ASSEMBLY__ */
74
75 #endif /* _ASM_IA64_SN_VECTOR_H */