ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / xtalk / xtalk_private.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_XTALK_XTALK_PRIVATE_H
9 #define _ASM_IA64_SN_XTALK_XTALK_PRIVATE_H
10
11 #include <asm/sn/ioerror.h>        /* for error function and arg types */
12 #include <asm/sn/xtalk/xwidget.h>
13 #include <asm/sn/xtalk/xtalk.h>
14
15 /*
16  * xtalk_private.h -- private definitions for xtalk
17  * crosstalk drivers should NOT include this file.
18  */
19
20 /*
21  * All Crosstalk providers set up PIO using this information.
22  */
23 struct xtalk_piomap_s {
24     vertex_hdl_t            xp_dev;     /* a requestor of this mapping */
25     xwidgetnum_t            xp_target;  /* target (node's widget number) */
26     iopaddr_t               xp_xtalk_addr;      /* which crosstalk addr is mapped */
27     size_t                  xp_mapsz;   /* size of this mapping */
28     caddr_t                 xp_kvaddr;  /* kernel virtual address to use */
29 };
30
31 /*
32  * All Crosstalk providers set up DMA using this information.
33  */
34 struct xtalk_dmamap_s {
35     vertex_hdl_t            xd_dev;     /* a requestor of this mapping */
36     xwidgetnum_t            xd_target;  /* target (node's widget number) */
37 };
38
39 /*
40  * All Crosstalk providers set up interrupts using this information.
41  */
42 struct xtalk_intr_s {
43     vertex_hdl_t            xi_dev;     /* requestor of this intr */
44     xwidgetnum_t            xi_target;  /* master's widget number */
45     xtalk_intr_vector_t     xi_vector;  /* 8-bit interrupt vector */
46     iopaddr_t               xi_addr;    /* xtalk address to generate intr */
47     void                   *xi_sfarg;   /* argument for setfunc */
48     xtalk_intr_setfunc_t    xi_setfunc;         /* device's setfunc routine */
49 };
50
51 /*
52  * Xtalk interrupt handler structure access functions
53  */
54 #define xwidget_hwid_is_sn1_xswitch(_hwid)      \
55                 (((_hwid)->part_num == XXBOW_WIDGET_PART_NUM ||         \
56                   (_hwid)->part_num == PXBOW_WIDGET_PART_NUM) &&        \
57                  ((_hwid)->mfg_num == XXBOW_WIDGET_MFGR_NUM ))
58
59 #define xwidget_hwid_is_xswitch(_hwid)  \
60                         xwidget_hwid_is_sn1_xswitch(_hwid)
61
62 /* common iograph info for all widgets,
63  * stashed in FASTINFO of widget connection points.
64  */
65 struct xwidget_info_s {
66     char                   *w_fingerprint;
67     vertex_hdl_t            w_vertex;   /* back pointer to vertex */
68     xwidgetnum_t            w_id;       /* widget id */
69     struct xwidget_hwid_s   w_hwid;     /* hardware identification (part/rev/mfg) */
70     vertex_hdl_t            w_master;   /* CACHED widget's master */
71     xwidgetnum_t            w_masterid;         /* CACHED widget's master's widgetnum */
72     error_handler_f        *w_efunc;    /* error handling function */
73     error_handler_arg_t     w_einfo;    /* first parameter for efunc */
74     char                   *w_name;     /* canonical hwgraph name */    
75 };
76
77 extern char             widget_info_fingerprint[];
78
79 #endif                          /* _ASM_IA64_SN_XTALK_XTALK_PRIVATE_H */