This source file includes following definitions.
- ahd_name
- ahd_known_modes
- ahd_build_mode_state
- ahd_extract_mode_state
- ahd_sg_size
- ahd_get_sense_buf
- ahd_get_sense_bufaddr
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 #ifndef _AIC79XX_INLINE_H_
46 #define _AIC79XX_INLINE_H_
47
48
49 static inline char *ahd_name(struct ahd_softc *ahd);
50
51 static inline char *ahd_name(struct ahd_softc *ahd)
52 {
53 return (ahd->name);
54 }
55
56
57 static inline void ahd_known_modes(struct ahd_softc *ahd,
58 ahd_mode src, ahd_mode dst);
59 static inline ahd_mode_state ahd_build_mode_state(struct ahd_softc *ahd,
60 ahd_mode src,
61 ahd_mode dst);
62 static inline void ahd_extract_mode_state(struct ahd_softc *ahd,
63 ahd_mode_state state,
64 ahd_mode *src, ahd_mode *dst);
65
66 void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src,
67 ahd_mode dst);
68 ahd_mode_state ahd_save_modes(struct ahd_softc *ahd);
69 void ahd_restore_modes(struct ahd_softc *ahd,
70 ahd_mode_state state);
71 int ahd_is_paused(struct ahd_softc *ahd);
72 void ahd_pause(struct ahd_softc *ahd);
73 void ahd_unpause(struct ahd_softc *ahd);
74
75 static inline void
76 ahd_known_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
77 {
78 ahd->src_mode = src;
79 ahd->dst_mode = dst;
80 ahd->saved_src_mode = src;
81 ahd->saved_dst_mode = dst;
82 }
83
84 static inline ahd_mode_state
85 ahd_build_mode_state(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
86 {
87 return ((src << SRC_MODE_SHIFT) | (dst << DST_MODE_SHIFT));
88 }
89
90 static inline void
91 ahd_extract_mode_state(struct ahd_softc *ahd, ahd_mode_state state,
92 ahd_mode *src, ahd_mode *dst)
93 {
94 *src = (state & SRC_MODE) >> SRC_MODE_SHIFT;
95 *dst = (state & DST_MODE) >> DST_MODE_SHIFT;
96 }
97
98
99 void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
100 void *sgptr, dma_addr_t addr,
101 bus_size_t len, int last);
102
103
104 static inline size_t ahd_sg_size(struct ahd_softc *ahd);
105
106 void ahd_sync_sglist(struct ahd_softc *ahd,
107 struct scb *scb, int op);
108
109 static inline size_t ahd_sg_size(struct ahd_softc *ahd)
110 {
111 if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
112 return (sizeof(struct ahd_dma64_seg));
113 return (sizeof(struct ahd_dma_seg));
114 }
115
116
117 struct ahd_initiator_tinfo *
118 ahd_fetch_transinfo(struct ahd_softc *ahd,
119 char channel, u_int our_id,
120 u_int remote_id,
121 struct ahd_tmode_tstate **tstate);
122 uint16_t
123 ahd_inw(struct ahd_softc *ahd, u_int port);
124 void ahd_outw(struct ahd_softc *ahd, u_int port,
125 u_int value);
126 uint32_t
127 ahd_inl(struct ahd_softc *ahd, u_int port);
128 void ahd_outl(struct ahd_softc *ahd, u_int port,
129 uint32_t value);
130 uint64_t
131 ahd_inq(struct ahd_softc *ahd, u_int port);
132 void ahd_outq(struct ahd_softc *ahd, u_int port,
133 uint64_t value);
134 u_int ahd_get_scbptr(struct ahd_softc *ahd);
135 void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr);
136 u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset);
137 u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset);
138 struct scb *
139 ahd_lookup_scb(struct ahd_softc *ahd, u_int tag);
140 void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb);
141
142 static inline uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd,
143 struct scb *scb);
144 static inline uint32_t ahd_get_sense_bufaddr(struct ahd_softc *ahd,
145 struct scb *scb);
146
147 #if 0
148
149 #define AHD_COPY_COL_IDX(dst, src) \
150 do { \
151 dst->hscb->scsiid = src->hscb->scsiid; \
152 dst->hscb->lun = src->hscb->lun; \
153 } while (0)
154
155 #endif
156
157 static inline uint8_t *
158 ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb)
159 {
160 return (scb->sense_data);
161 }
162
163 static inline uint32_t
164 ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb)
165 {
166 return (scb->sense_busaddr);
167 }
168
169
170 int ahd_intr(struct ahd_softc *ahd);
171
172 #endif