1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 #ifndef _AIC79XX_INLINE_H_
74 #define _AIC79XX_INLINE_H_
75
76
77 char *ahd_name(struct ahd_softc *ahd);
78
79
80 void ahd_known_modes(struct ahd_softc *, ahd_mode, ahd_mode);
81 ahd_mode_state ahd_build_mode_state(struct ahd_softc *,
82 ahd_mode , ahd_mode );
83 void ahd_extract_mode_state(struct ahd_softc *, ahd_mode_state,
84 ahd_mode *, ahd_mode *);
85 void ahd_set_modes(struct ahd_softc *, ahd_mode, ahd_mode );
86 void ahd_update_modes(struct ahd_softc *);
87 void ahd_assert_modes(struct ahd_softc *, ahd_mode,
88 ahd_mode, const char *, int);
89 ahd_mode_state ahd_save_modes(struct ahd_softc *);
90 void ahd_restore_modes(struct ahd_softc *, ahd_mode_state);
91 int ahd_is_paused(struct ahd_softc *);
92 void ahd_pause(struct ahd_softc *);
93
94 void ahd_unpause(struct ahd_softc *);
95
96
97 void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
98 void *sgptr, bus_addr_t addr,
99 bus_size_t len, int last);
100 void ahd_setup_scb_common(struct ahd_softc *ahd,
101 struct scb *scb);
102 void ahd_setup_data_scb(struct ahd_softc *ahd,
103 struct scb *scb);
104 void ahd_setup_noxfer_scb(struct ahd_softc *ahd,
105 struct scb *scb);
106
107
108 size_t ahd_sg_size(struct ahd_softc *);
109 void *
110 ahd_sg_bus_to_virt(struct ahd_softc *, struct scb *,
111 uint32_t);
112 uint32_t
113 ahd_sg_virt_to_bus(struct ahd_softc *, struct scb *,
114 void *);
115 void ahd_sync_scb(struct ahd_softc *, struct scb *, int);
116 void ahd_sync_sglist(struct ahd_softc *, struct scb *, int);
117 void ahd_sync_sense(struct ahd_softc *, struct scb *, int);
118 uint32_t
119 ahd_targetcmd_offset(struct ahd_softc *, u_int);
120
121
122 void ahd_complete_scb(struct ahd_softc *, struct scb *);
123 void ahd_update_residual(struct ahd_softc *, struct scb *);
124 struct ahd_initiator_tinfo *
125 ahd_fetch_transinfo(struct ahd_softc *, char , u_int,
126 u_int, struct ahd_tmode_tstate **);
127 uint16_t
128 ahd_inw(struct ahd_softc *, u_int);
129 void ahd_outw(struct ahd_softc *, u_int, u_int);
130 uint32_t
131 ahd_inl(struct ahd_softc *, u_int);
132 void ahd_outl(struct ahd_softc *, u_int, uint32_t);
133 uint64_t ahd_inq(struct ahd_softc *, u_int);
134 void ahd_outq(struct ahd_softc *, u_int, uint64_t);
135 u_int ahd_get_scbptr(struct ahd_softc *ahd);
136 void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr);
137 u_int ahd_get_hnscb_qoff(struct ahd_softc *ahd);
138 void ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value);
139 u_int ahd_get_hescb_qoff(struct ahd_softc *ahd);
140 void ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value);
141 u_int ahd_get_snscb_qoff(struct ahd_softc *ahd);
142 void ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value);
143 u_int ahd_get_sescb_qoff(struct ahd_softc *ahd);
144 void ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value);
145 u_int ahd_get_sdscb_qoff(struct ahd_softc *ahd);
146 void ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value);
147 u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset);
148 u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset);
149 uint32_t ahd_inl_scbram(struct ahd_softc *ahd, u_int offset);
150 uint64_t ahd_inq_scbram(struct ahd_softc *ahd, u_int offset);
151 struct scb *ahd_lookup_scb(struct ahd_softc *, u_int);
152 void ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb);
153 void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb);
154 uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb);
155 uint32_t ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb);
156
157
158 void ahd_sync_qoutfifo(struct ahd_softc *ahd, int op);
159 void ahd_sync_tqinfifo(struct ahd_softc *ahd, int op);
160 u_int ahd_check_cmdcmpltqueues(struct ahd_softc *ahd);
161 int ahd_intr(struct ahd_softc *ahd);
162
163 #define AHD_ASSERT_MODES(ahd, source, dest) \
164 ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__);
165
166 #endif