static void tws_drain_response_queue(struct tws_softc *sc) { u_int16_t req_id; u_int64_t mfa; while ( tws_get_response(sc, &req_id, &mfa) ); }
static void tws_intr_resp(struct tws_softc *sc) { u_int16_t req_id; u_int64_t mfa; while ( tws_get_response(sc, &req_id, &mfa) ) { sc->stats.reqs_out++; if ( req_id == TWS_INVALID_REQID ) { TWS_TRACE_DEBUG(sc, "invalid req_id", mfa, req_id); sc->stats.reqs_errored++; tws_err_complete(sc, mfa); continue; } sc->reqs[req_id].cb(&sc->reqs[req_id]); } }
u_int16_t tws_poll4_response(struct tws_softc *sc, u_int64_t *mfa) { u_int16_t req_id; time_t endt; endt = TWS_LOCAL_TIME + TWS_POLL_TIMEOUT; do { if(tws_get_response(sc, &req_id, mfa)) { if ( req_id == TWS_INVALID_REQID ) { TWS_TRACE_DEBUG(sc, "invalid req_id", 0, req_id); return(TWS_INVALID_REQID); } return(req_id); } } while (TWS_LOCAL_TIME <= endt); TWS_TRACE_DEBUG(sc, "poll timeout", 0, 0); return(TWS_INVALID_REQID); }