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
7 * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 #ifndef _ASM_SN_XTALK_XTALK_PRIVATE_H
10 #define _ASM_SN_XTALK_XTALK_PRIVATE_H
12 #include <asm/sn/ioerror.h> /* for error function and arg types */
13 #include <linux/devfs_fs_kernel.h>
14 #include <asm/sn/xtalk/xwidget.h>
15 #include <asm/sn/xtalk/xtalk.h>
18 * xtalk_private.h -- private definitions for xtalk
19 * crosstalk drivers should NOT include this file.
23 * All Crosstalk providers set up PIO using this information.
25 struct xtalk_piomap_s {
26 devfs_handle_t xp_dev; /* a requestor of this mapping */
27 xwidgetnum_t xp_target; /* target (node's widget number) */
28 iopaddr_t xp_xtalk_addr; /* which crosstalk addr is mapped */
29 size_t xp_mapsz; /* size of this mapping */
30 caddr_t xp_kvaddr; /* kernel virtual address to use */
34 * All Crosstalk providers set up DMA using this information.
36 struct xtalk_dmamap_s {
37 devfs_handle_t xd_dev; /* a requestor of this mapping */
38 xwidgetnum_t xd_target; /* target (node's widget number) */
42 * All Crosstalk providers set up interrupts using this information.
45 devfs_handle_t xi_dev; /* requestor of this intr */
46 xwidgetnum_t xi_target; /* master's widget number */
47 xtalk_intr_vector_t xi_vector; /* 8-bit interrupt vector */
48 iopaddr_t xi_addr; /* xtalk address to generate intr */
49 void *xi_sfarg; /* argument for setfunc */
50 xtalk_intr_setfunc_t xi_setfunc; /* device's setfunc routine */
54 * Xtalk interrupt handler structure access functions
56 #define xtalk_intr_arg(xt) ((xt)->xi_sfarg)
58 #define xwidget_hwid_is_sn0_xswitch(_hwid) \
59 (((_hwid)->part_num == XBOW_WIDGET_PART_NUM ) && \
60 ((_hwid)->mfg_num == XBOW_WIDGET_MFGR_NUM ))
62 #define xwidget_hwid_is_sn1_xswitch(_hwid) \
63 (((_hwid)->part_num == XXBOW_WIDGET_PART_NUM || \
64 (_hwid)->part_num == PXBOW_WIDGET_PART_NUM) && \
65 ((_hwid)->mfg_num == XXBOW_WIDGET_MFGR_NUM ))
67 #define xwidget_hwid_is_xswitch(_hwid) \
68 xwidget_hwid_is_sn1_xswitch(_hwid)
70 /* common iograph info for all widgets,
71 * stashed in FASTINFO of widget connection points.
73 struct xwidget_info_s {
75 devfs_handle_t w_vertex; /* back pointer to vertex */
76 xwidgetnum_t w_id; /* widget id */
77 struct xwidget_hwid_s w_hwid; /* hardware identification (part/rev/mfg) */
78 devfs_handle_t w_master; /* CACHED widget's master */
79 xwidgetnum_t w_masterid; /* CACHED widget's master's widgetnum */
80 error_handler_f *w_efunc; /* error handling function */
81 error_handler_arg_t w_einfo; /* first parameter for efunc */
82 char *w_name; /* canonical hwgraph name */
85 extern char widget_info_fingerprint[];
87 #endif /* _ASM_SN_XTALK_XTALK_PRIVATE_H */