Lines Matching defs:sp

64 iscsi_r2t(isc_session_t *sp, pduq_t *opq, pduq_t *pq)
91 if(sp->opt.maxXmitDataSegmentLength > 0) // danny's RFC
92 bs = MIN(sp->opt.maxXmitDataSegmentLength, ddtl);
97 edtl, ddtl, bo, dsn, bs, sp->opt.maxXmitDataSegmentLength);
99 wpq = pdu_alloc(sp->isc, M_NOWAIT); // testing ...
103 sdebug(1, "npdu_max=%d npdu_alloc=%d", sp->isc->npdu_max, sp->isc->npdu_alloc);
105 while((wpq = pdu_alloc(sp->isc, M_NOWAIT)) == NULL) {
110 tsleep(sp->isc, 0, "isc_r2t", 5*hz);
130 error = isc_qout(sp, wpq);
198 _scsi_done(isc_session_t *sp, u_int response, u_int status, union ccb *ccb, pduq_t *pq)
253 XPT_DONE(sp, ccb);
260 iscsi_requeue(isc_session_t *sp)
267 sp->flags |= ISC_HOLD;
268 while((pq = i_dqueue_hld(sp)) != NULL) {
271 _scsi_done(sp, 0, 0x28, pq->ccb, NULL);
277 pdu_free(sp->isc, pq);
279 sp->flags &= ~ISC_HOLD;
280 return i? last: sp->sn.cmd;
284 i_pdu_flush(isc_session_t *sp)
290 while((pq = i_dqueue_rsp(sp)) != NULL) {
291 pdu_free(sp->isc, pq);
294 while((pq = i_dqueue_rsv(sp)) != NULL) {
295 pdu_free(sp->isc, pq);
298 while((pq = i_dqueue_snd(sp, -1)) != NULL) {
299 pdu_free(sp->isc, pq);
302 while((pq = i_dqueue_hld(sp)) != NULL) {
303 pdu_free(sp->isc, pq);
306 while((pq = i_dqueue_wsnd(sp)) != NULL) {
307 pdu_free(sp->isc, pq);
318 iscsi_cleanup(isc_session_t *sp)
324 TAILQ_FOREACH_SAFE(pq, &sp->hld, pq_link, pqtmp) {
327 _scsi_done(sp, 1, 0x40, pq->ccb, NULL);
328 TAILQ_REMOVE(&sp->hld, pq, pq_link);
333 pdu_free(sp->isc, pq);
335 while((pq = i_dqueue_snd(sp, BIT(0)|BIT(1)|BIT(2))) != NULL) {
338 _scsi_done(sp, 1, 0x40, pq->ccb, NULL);
343 pdu_free(sp->isc, pq);
346 wakeup(&sp->rsp);
350 iscsi_done(isc_session_t *sp, pduq_t *opq, pduq_t *pq)
357 _scsi_done(sp, cmd->response, cmd->status, opq->ccb, pq);
359 pdu_free(sp->isc, opq);
372 iscsi_async(isc_session_t *sp, pduq_t *pq)
385 isc_stop_receiver(sp); // XXX: temporary solution
389 isc_stop_receiver(sp); // XXX: temporary solution
393 isc_stop_receiver(sp); // XXX: temporary solution
405 iscsi_reject(isc_session_t *sp, pduq_t *opq, pduq_t *pq)
413 XPT_DONE(sp, ccb);
415 pdu_free(sp->isc, opq);
422 dwl(isc_session_t *sp, int lun, u_char *lp)
455 isc_session_t *sp = cam_sim_softc(sim);
463 debug(4, "ccb->sp=%p", ccb_h->spriv_ptr0);
464 sp = ccb_h->spriv_ptr0;
466 if((pq = pdu_alloc(sp->isc, M_NOWAIT)) == NULL) {
467 debug(2, "ccb->sp=%p", ccb_h->spriv_ptr0);
469 sp->isc->npdu_max, sp->isc->npdu_alloc);
470 while((pq = pdu_alloc(sp->isc, M_NOWAIT)) == NULL) {
475 tsleep(sp->isc, 0, "isc_encap", 5*hz);
497 dwl(sp, ccb_h->target_lun, (u_char *)&cmd->lun);
527 if(isc_qout(sp, pq) == 0)
531 pdu_free(sp->isc, pq);
537 scsi_decap(isc_session_t *sp, pduq_t *opq, pduq_t *pq)
551 xdebug("%d] ccb == NULL!", sp->sid);
592 _scsi_done(sp, 0, rcmd->status, opq->ccb, NULL);