Home | History | Annotate | Download | only in iscsi

Lines Matching defs:pdu

261 	pdu_t *pdu;
287 /* free PDU waiting for ACK */
288 if ((pdu = ccb->ccb_pdu_waiting) != NULL) {
291 if ((pdu->pdu_flags & PDUF_INQUEUE) != 0) {
292 TAILQ_REMOVE(&conn->c_pdus_to_send, pdu, pdu_send_chain);
293 pdu->pdu_flags &= ~PDUF_INQUEUE;
296 free_pdu(pdu);
447 * PDU management functions
452 * Get a PDU for the SCSI operation.
455 * conn The connection this PDU should be associated with
456 * waitok OK to wait for PDU if TRUE
458 * Returns: The PDU or NULL if none is available and waitok is FALSE.
464 pdu_t *pdu;
468 pdu = TAILQ_FIRST(&conn->c_pdu_pool);
470 if (pdu != NULL) {
471 TAILQ_REMOVE(&conn->c_pdu_pool, pdu, pdu_chain);
483 if (pdu == NULL) {
488 memset(pdu, 0, sizeof(pdu_t));
489 pdu->pdu_connection = conn;
490 pdu->pdu_disp = PDUDISP_FREE;
492 DEBC(conn, 15, ("get_pdu: pdu = %p, usecount = %d\n", pdu, conn->c_pducount));
494 return pdu;
499 * Put a PDU back onto the free list.
501 * Parameter: The PDU.
505 free_pdu(pdu_t *pdu)
507 connection_t *conn = pdu->pdu_connection;
510 DEBC(conn, 15, ("free_pdu: pdu = %p, usecount = %d\n", pdu, conn->c_pducount-1));
512 KASSERT((pdu->pdu_flags & PDUF_INQUEUE) == 0);
514 if (PDUDISP_UNUSED == (pdisp = pdu->pdu_disp)) {
515 DEBC(conn, 0, ("freeing UNUSED pdu\n"));
519 pdu->pdu_disp = PDUDISP_UNUSED;
521 /* free temporary data in this PDU */
522 if (pdu->pdu_temp_data)
523 free(pdu->pdu_temp_data, M_TEMP);
527 TAILQ_INSERT_TAIL(&conn->c_pdu_pool, pdu, pdu_chain);
545 pdu_t *pdu;
549 for (i = 0, pdu = conn->c_pdu; i < PDUS_PER_CONNECTION; i++, pdu++) {
550 TAILQ_INSERT_HEAD(&conn->c_pdu_pool, pdu, pdu_chain);
692 get_sernum(session_t *sess, pdu_t *pdu)
699 if ((pdu->pdu_hdr.pduh_Opcode & OP_IMMEDIATE) == 0)