freebsd5/sys/cam/scsi/scsi_sa.c
/*
 * The reserve and release unit commands differ only by their opcodes.
 */
The reserve and release unit commands differ only by their opcodes.
The reserve and release unit commands differ only by their opcodes .
void
scsi_reserve_release_unit(struct ccb_scsiio *csio, u_int32_t retries,
			  void (*cbfcnp)(struct cam_periph *, union ccb *),
			  u_int8_t tag_action, int third_party,
			  int third_party_id, u_int8_t sense_len,
			  u_int32_t timeout, int reserve)
{
	struct scsi_reserve_release_unit *scsi_cmd;
	scsi_cmd = (struct scsi_reserve_release_unit *)&csio->cdb_io.cdb_bytes;
	bzero(scsi_cmd, sizeof(*scsi_cmd));
	if (reserve)
		scsi_cmd->opcode = RESERVE_UNIT;
	else
		scsi_cmd->opcode = RELEASE_UNIT;
	if (third_party) {
		scsi_cmd->lun_thirdparty |= SRRU_3RD_PARTY;
		scsi_cmd->lun_thirdparty |=
			((third_party_id << SRRU_3RD_SHAMT) & SRRU_3RD_MASK);
	}
	cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action, NULL,
	    0, sense_len, sizeof(*scsi_cmd), timeout);
}
void scsi_reserve_release_unit ( struct ccb_scsiio * csio , u_int32_t retries , void ( * cbfcnp ) ( struct cam_periph * , union ccb * ) , u_int8_t tag_action , int third_party , int third_party_id , u_int8_t sense_len , u_int32_t timeout , int reserve ) { struct scsi_reserve_release_unit * scsi_cmd ; scsi_cmd = ( struct scsi_reserve_release_unit * ) & csio -> cdb_io . cdb_bytes ; bzero ( scsi_cmd , sizeof ( * scsi_cmd ) ) ; if ( reserve ) scsi_cmd -> opcode = RESERVE_UNIT ; else scsi_cmd -> opcode = RELEASE_UNIT ; if ( third_party ) { scsi_cmd -> lun_thirdparty |= SRRU_3RD_PARTY ; scsi_cmd -> lun_thirdparty |= ( ( third_party_id << SRRU_3RD_SHAMT ) & SRRU_3RD_MASK ) ; } cam_fill_csio ( csio , retries , cbfcnp , CAM_DIR_NONE , tag_action , NULL , 0 , sense_len , sizeof ( * scsi_cmd ) , timeout ) ; }
The reserve and release unit commands differ only by their opcodes.
The reserve and release unit commands differ only by their opcodes .