ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / driver.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_DRIVER_H
9 #define _ASM_IA64_SN_DRIVER_H
10
11 #include <asm/sn/sgi.h>
12 #include <asm/types.h>
13
14 /*
15 ** Interface for device driver handle management.
16 **
17 ** These functions are mostly for use by the loadable driver code, and
18 ** for use by I/O bus infrastructure code.
19 */
20
21 typedef struct device_driver_s *device_driver_t;
22
23 /* == Driver thread priority support == */
24 typedef int ilvl_t;
25
26 struct eframe_s;
27 struct piomap;
28 struct dmamap;
29
30 typedef unsigned long iobush_t;
31
32 /* interrupt function */
33 typedef void           *intr_arg_t;
34 typedef void            intr_func_f(intr_arg_t);
35 typedef intr_func_f    *intr_func_t;
36
37 #define INTR_ARG(n)     ((intr_arg_t)(__psunsigned_t)(n))
38
39 /* system interrupt resource handle -- returned from intr_alloc */
40 typedef struct intr_s *intr_t;
41 #define INTR_HANDLE_NONE ((intr_t)0)
42
43 /*
44  * restore interrupt level value, returned from intr_block_level
45  * for use with intr_unblock_level.
46  */
47 typedef void *rlvl_t;
48
49
50 /* 
51  * A basic, platform-independent description of I/O requirements for
52  * a device. This structure is usually formed by lboot based on information 
53  * in configuration files.  It contains information about PIO, DMA, and
54  * interrupt requirements for a specific instance of a device.
55  *
56  * The pio description is currently unused.
57  *
58  * The dma description describes bandwidth characteristics and bandwidth
59  * allocation requirements. (TBD)
60  *
61  * The Interrupt information describes the priority of interrupt, desired 
62  * destination, policy (TBD), whether this is an error interrupt, etc.  
63  * For now, interrupts are targeted to specific CPUs.
64  */
65
66 typedef struct device_desc_s {
67         /* pio description (currently none) */
68
69         /* dma description */
70         /* TBD: allocated badwidth requirements */
71
72         /* interrupt description */
73         vertex_hdl_t    intr_target;    /* Hardware locator string */
74         int             intr_policy;    /* TBD */
75         ilvl_t          intr_swlevel;   /* software level for blocking intr */
76         char            *intr_name;     /* name of interrupt, if any */
77
78         int             flags;
79 } *device_desc_t;
80
81 /* flag values */
82 #define D_INTR_ISERR    0x1             /* interrupt is for error handling */
83 #define D_IS_ASSOC      0x2             /* descriptor is associated with a dev */
84 #define D_INTR_NOTHREAD 0x4             /* Interrupt handler isn't threaded. */
85
86 #define INTR_SWLEVEL_NOTHREAD_DEFAULT   0       /* Default
87                                                  * Interrupt level in case of
88                                                  * non-threaded interrupt 
89                                                  * handlers
90                                                  */
91 #endif /* _ASM_IA64_SN_DRIVER_H */