Home | History | Annotate | Download | only in ata

Lines Matching defs:chp

81 ata_queue_hwslot_to_xfer(struct ata_channel *chp, int hwslot)
83 struct ata_queue *chq = chp->ch_queue;
86 ata_channel_lock(chp);
99 ata_channel_unlock(chp);
109 ata_queue_get_active_xfer_locked(struct ata_channel *chp)
113 KASSERT(mutex_owned(&chp->ch_lock));
114 xfer = TAILQ_FIRST(&chp->ch_queue->active_xfers);
131 ata_queue_get_active_xfer(struct ata_channel *chp)
135 ata_channel_lock(chp);
136 xfer = ata_queue_get_active_xfer_locked(chp);
137 ata_channel_unlock(chp);
143 ata_queue_drive_active_xfer(struct ata_channel *chp, int drive)
147 ata_channel_lock(chp);
149 TAILQ_FOREACH(xfer, &chp->ch_queue->active_xfers, c_activechain) {
155 ata_channel_unlock(chp);
196 ata_channel_init(struct ata_channel *chp)
198 mutex_init(&chp->ch_lock, MUTEX_DEFAULT, IPL_BIO);
199 cv_init(&chp->ch_thr_idle, "atath");
201 callout_init(&chp->c_timo_callout, 0); /* XXX MPSAFE */
204 if (chp->ch_queue == NULL) {
205 chp->ch_queue = ata_queue_alloc(1);
210 ata_channel_destroy(struct ata_channel *chp)
212 if (chp->ch_queue != NULL) {
213 ata_queue_free(chp->ch_queue);
214 chp->ch_queue = NULL;
217 mutex_enter(&chp->ch_lock);
218 callout_halt(&chp->c_timo_callout, &chp->ch_lock);
219 callout_destroy(&chp->c_timo_callout);
220 mutex_exit(&chp->ch_lock);
222 mutex_destroy(&chp->ch_lock);
223 cv_destroy(&chp->ch_thr_idle);
229 struct ata_channel *chp = v;
230 struct ata_queue *chq = chp->ch_queue;
236 callout_ack(&chp->c_timo_callout);
238 if (chp->ch_flags & ATACH_RECOVERING) {
267 ata_channel_lock(struct ata_channel *chp)
269 mutex_enter(&chp->ch_lock);
273 ata_channel_unlock(struct ata_channel *chp)
275 mutex_exit(&chp->ch_lock);
279 ata_channel_lock_owned(struct ata_channel *chp)
281 KASSERT(mutex_owned(&chp->ch_lock));
286 atachannel_debug(struct ata_channel *chp)
288 struct ata_queue *chq = chp->ch_queue;
291 device_xname(chp->atabus), chp->ch_flags, chp->ch_ndrives);
300 ata_queue_alloc_slot(struct ata_channel *chp, uint8_t *c_slot,
303 struct ata_queue *chq = chp->ch_queue;
306 KASSERT(mutex_owned(&chp->ch_lock));
310 __func__, chp->ch_channel,
331 ata_queue_free_slot(struct ata_channel *chp, uint8_t c_slot)
333 struct ata_queue *chq = chp->ch_queue;
335 KASSERT(mutex_owned(&chp->ch_lock));
344 ata_queue_hold(struct ata_channel *chp)
346 struct ata_queue *chq = chp->ch_queue;
348 KASSERT(mutex_owned(&chp->ch_lock));
355 ata_queue_unhold(struct ata_channel *chp)
357 struct ata_queue *chq = chp->ch_queue;
359 KASSERT(mutex_owned(&chp->ch_lock));
369 ata_queue_active(struct ata_channel *chp)
371 struct ata_queue *chq = chp->ch_queue;
373 if (chp->ch_flags & ATACH_DETACHED)
380 ata_queue_openings(struct ata_channel *chp)
382 return chp->ch_queue->queue_openings;