Home | History | Annotate | Download | only in ata

Lines Matching defs:chq

69 ata_queue_reset(struct ata_queue *chq)
72 SIMPLEQ_INIT(&chq->queue_xfer);
73 TAILQ_INIT(&chq->active_xfers);
74 chq->queue_freeze = 0;
75 chq->queue_active = 0;
76 chq->active_xfers_used = 0;
77 chq->queue_xfers_avail = __BIT(chq->queue_openings) - 1;
83 struct ata_queue *chq = chp->ch_queue;
88 KASSERTMSG(hwslot < chq->queue_openings, "hwslot %d > openings %d",
89 hwslot, chq->queue_openings);
90 KASSERTMSG((chq->active_xfers_used & __BIT(hwslot)) != 0,
94 TAILQ_FOREACH(xfer, &chq->active_xfers, c_activechain) {
103 hwslot, chq->active_xfers_used);
169 struct ata_queue *chq = kmem_zalloc(sizeof(*chq), KM_SLEEP);
171 chq->queue_openings = openings;
172 ata_queue_reset(chq);
174 cv_init(&chq->queue_drain, "atdrn");
175 cv_init(&chq->queue_idle, "qidl");
177 cv_init(&chq->c_active, "ataact");
178 cv_init(&chq->c_cmd_finish, "atafin");
180 return chq;
184 ata_queue_free(struct ata_queue *chq)
186 cv_destroy(&chq->queue_drain);
187 cv_destroy(&chq->queue_idle);
189 cv_destroy(&chq->c_active);
190 cv_destroy(&chq->c_cmd_finish);
192 kmem_free(chq, sizeof(*chq));
230 struct ata_queue *chq = chp->ch_queue;
248 TAILQ_FOREACH_SAFE(xfer, &chq->active_xfers, c_activechain, nxfer) {
288 struct ata_queue *chq = chp->ch_queue;
293 chq->queue_flags, chq->queue_xfers_avail, chq->active_xfers_used);
295 chq->queue_active, chq->queue_freeze, chq->queue_openings);
303 struct ata_queue *chq = chp->ch_queue;
307 KASSERT(chq->queue_active < chq->queue_openings);
311 chq->queue_xfers_avail, chq->queue_active),
314 mask = __BIT(MIN(chq->queue_openings, drv_openings)) - 1;
316 avail = ffs32(chq->queue_xfers_avail & mask);
324 chq->queue_xfers_avail &= ~__BIT(*c_slot);
326 KASSERT((chq->active_xfers_used & __BIT(*c_slot)) == 0);
333 struct ata_queue *chq = chp->ch_queue;
337 KASSERT((chq->active_xfers_used & __BIT(c_slot)) == 0);
338 KASSERT((chq->queue_xfers_avail & __BIT(c_slot)) == 0);
340 chq->queue_xfers_avail |= __BIT(c_slot);
346 struct ata_queue *chq = chp->ch_queue;
350 chq->queue_hold |= chq->active_xfers_used;
351 chq->active_xfers_used = 0;
357 struct ata_queue *chq = chp->ch_queue;
361 chq->active_xfers_used |= chq->queue_hold;
362 chq->queue_hold = 0;
371 struct ata_queue *chq = chp->ch_queue;
376 return chq->active_xfers_used;