int mpt_intr(void *arg) { mpt_softc_t *mpt = arg; int nrepl = 0; uint32_t reply; if ((mpt_read(mpt, MPT_OFFSET_INTR_STATUS) & MPT_INTR_REPLY_READY) == 0) return (0); reply = mpt_pop_reply_queue(mpt); while (reply != MPT_REPLY_EMPTY) { nrepl++; if (mpt->verbose > 1) { if ((reply & MPT_CONTEXT_REPLY) != 0) { /* Address reply; IOC has something to say */ mpt_print_reply(MPT_REPLY_PTOV(mpt, reply)); } else { /* Context reply; all went well */ mpt_prt(mpt, "context %u reply OK", reply); } } mpt_done(mpt, reply); reply = mpt_pop_reply_queue(mpt); } return (nrepl != 0); }
static int mpt_drain_queue(mpt_softc_t *mpt) { int nrepl = 0; uint32_t reply; reply = mpt_pop_reply_queue(mpt); while (reply != MPT_REPLY_EMPTY) { nrepl++; if (mpt->verbose > 1) { if ((reply & MPT_CONTEXT_REPLY) != 0) { /* Address reply; IOC has something to say */ mpt_print_reply(MPT_REPLY_PTOV(mpt, reply)); } else { /* Context reply; all went well */ mpt_prt(mpt, "context %u reply OK", reply); } } mpt_done(mpt, reply); reply = mpt_pop_reply_queue(mpt); } return (nrepl); }