Пример #1
0
scsi_play_audio(
	target_info_t	*tgt,
	unsigned int	start,
	unsigned int	len,
	boolean_t	relative_address,
	io_req_t	ior)
{
	scsi_cmd_play_audio_t	*cmd;

	cmd = (scsi_cmd_play_audio_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PLAY_AUDIO;
	cmd->scsi_cmd_lun_and_relbit = relative_address ? SCSI_RELADR : 0;
	cmd->scsi_cmd_lba1 	   = start >> 24;
	cmd->scsi_cmd_lba2 	   = start >> 16;
	cmd->scsi_cmd_lba3 	   = start >>  8;
	cmd->scsi_cmd_lba4 	   = start >>  0;
	cmd->scsi_cmd_xxx 	   = 0;
	cmd->scsi_cmd_xfer_len_1    = len >> 8;
	cmd->scsi_cmd_xfer_len_2    = len >> 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_PLAY_AUDIO;

        scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

        return tgt->done;
}
Пример #2
0
char
scdisk_mode_select(
	register target_info_t	*tgt,
	register int 		lbn,
	io_req_t		ior,
	char			*mdata,
	int			mlen,
	boolean_t		save)
{
	scsi_cmd_mode_select_t	 *cmd;
	scsi_mode_select_param_t *parm;

	bzero(tgt->cmd_ptr, sizeof(*cmd));
	cmd = (scsi_cmd_mode_select_t*) (tgt->cmd_ptr);

	cmd->scsi_cmd_code = SCSI_CMD_MODE_SELECT;
	cmd->scsi_cmd_xfer_len = mlen;

	if(mdata) {
		cmd->scsi_cmd_lun_and_lba1 = SCSI_CMD_MSL_PF;
		parm = (scsi_mode_select_param_t*) (cmd + 1);
		bcopy(mdata, (char*)parm, mlen);
	}

	if (save)
		cmd->scsi_cmd_lun_and_lba1 |= SCSI_CMD_MSL_SP;

	tgt->cur_cmd = SCSI_CMD_MODE_SELECT;
	scsi_go_and_wait(tgt, sizeof(*cmd) + mlen, 0, ior);

	return tgt->done;
}
Пример #3
0
char
scdisk_verify(
	register target_info_t	*tgt,
	unsigned int		secno,
	unsigned int		nsectrs,
	io_req_t		ior)
{
	scsi_cmd_verify_long_t	*cmd;
	int			len;

	len = ior->io_count;

	cmd = (scsi_cmd_verify_long_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_VERIFY_1;
	cmd->scsi_cmd_lun_and_relbit = len ? SCSI_CMD_VFY_BYTCHK : 0;
	cmd->scsi_cmd_lba1	     = secno >> 24;
	cmd->scsi_cmd_lba2	     = secno >> 16;
	cmd->scsi_cmd_lba3	     = secno >>  8;
	cmd->scsi_cmd_lba4	     = secno;
	cmd->scsi_cmd_xxx	     = 0;
	cmd->scsi_cmd_xfer_len_1     = (nsectrs) >> 8;
	cmd->scsi_cmd_xfer_len_2     = nsectrs;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_VERIFY_1;

	scsi_go_and_wait(tgt, sizeof(*cmd) + len, 0, ior);
	return tgt->done;
}
Пример #4
0
scsi_read_toc(
	target_info_t	*tgt,
	boolean_t	msf_format,
	int		trackno,
	int		allocsize,
	io_req_t	ior)
{
	scsi_cmd_read_toc_t	*cmd;

	cmd = (scsi_cmd_read_toc_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_READ_TOC;
	cmd->scsi_cmd_lun_and_relbit = msf_format ? SCSI_CMD_CD_MSF : 0;
	cmd->scsi_cmd_lba1 	   = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_lba4 	   = 0;
	cmd->scsi_cmd_rtoc_startT  = trackno;
	cmd->scsi_cmd_xfer_len_1    = allocsize >> 8;
	cmd->scsi_cmd_xfer_len_2    = allocsize >> 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_READ_TOC;

        scsi_go_and_wait(tgt, sizeof(*cmd), allocsize, ior);

        return tgt->done;
}
Пример #5
0
scsi_read_header(
	target_info_t	*tgt,
	boolean_t	msf_format,
	unsigned int	lba,
	unsigned int	allocsize,
	io_req_t	ior)
{
	scsi_cmd_read_header_t	*cmd;

	cmd = (scsi_cmd_read_header_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_READ_HEADER;
	cmd->scsi_cmd_lun_and_relbit = msf_format ? SCSI_CMD_CD_MSF : 0;
	cmd->scsi_cmd_lba1 	   = lba >> 24;
	cmd->scsi_cmd_lba2 	   = lba >> 16;
	cmd->scsi_cmd_lba3 	   = lba >>  8;
	cmd->scsi_cmd_lba4 	   = lba >>  0;
	cmd->scsi_cmd_xxx 	   = 0;
	cmd->scsi_cmd_xfer_len_1    = allocsize >> 8;
	cmd->scsi_cmd_xfer_len_2    = allocsize >> 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_READ_HEADER;

        scsi_go_and_wait(tgt, sizeof(*cmd), allocsize, ior);

        return tgt->done;
}
Пример #6
0
scsi_play_audio_track_relative_long(
	target_info_t	*tgt,
	unsigned int	lba,
	int		st,
	unsigned int	len,
	io_req_t	ior)
{
	scsi_cmd_play_audio_tr_l_t	*cmd;

	cmd = (scsi_cmd_play_audio_tr_l_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PLAY_AUDIO_TR_LONG;
	cmd->scsi_cmd_lun_and_relbit = 0;
	cmd->scsi_cmd_lba1 	   = lba >> 24;
	cmd->scsi_cmd_lba2 	   = lba >> 16;
	cmd->scsi_cmd_lba3 	   = lba >>  8;
	cmd->scsi_cmd_lba4 	   = lba >>  0;
	cmd->scsi_cmd_xfer_len_1    = len >> 24;
	cmd->scsi_cmd_xfer_len_2    = len >> 16;
	cmd->scsi_cmd_xfer_len_3    = len >>  8;
	cmd->scsi_cmd_xfer_len_4    = len >>  0;
	cmd->scsi_cmd_patrl_startT  = st;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_PLAY_AUDIO_TR_LONG;

        scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

        return tgt->done;
}
Пример #7
0
scsi_play_audio_msf(
	target_info_t	*tgt,
	int		sm,
	int		ss,
	int		sf,
	int		em,
	int		es,
	int		ef,
	io_req_t	ior)
{
	scsi_cmd_play_audio_msf_t	*cmd;

	cmd = (scsi_cmd_play_audio_msf_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PLAY_AUDIO_MSF;
	cmd->scsi_cmd_lun_and_relbit = 0;
	cmd->scsi_cmd_lba1 = 0;
	cmd->scsi_cmd_pamsf_startM = sm;
	cmd->scsi_cmd_pamsf_startS = ss;
	cmd->scsi_cmd_pamsf_startF = sf;
	cmd->scsi_cmd_pamsf_endM = em;
	cmd->scsi_cmd_pamsf_endS = es;
	cmd->scsi_cmd_pamsf_endF = ef;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_PLAY_AUDIO_MSF;

        scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

        return tgt->done;
}
Пример #8
0
scsi_play_audio_track_index(
	target_info_t	*tgt,
	int		st,
	int		si,
	int		et,
	int		ei,
	io_req_t	ior)
{
	scsi_cmd_play_audio_ti_t	*cmd;

	cmd = (scsi_cmd_play_audio_ti_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PLAY_AUDIO_TI;
	cmd->scsi_cmd_lun_and_relbit = 0;
	cmd->scsi_cmd_lba1 = 0;
	cmd->scsi_cmd_lba2 = 0;
	cmd->scsi_cmd_pati_startT = st;
	cmd->scsi_cmd_pati_startI = si;
	cmd->scsi_cmd_xxx = 0;
	cmd->scsi_cmd_pati_endT = et;
	cmd->scsi_cmd_pati_endI = ei;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_PLAY_AUDIO_TI;

        scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

        return tgt->done;
}
Пример #9
0
char
scsi_format_unit(
	register target_info_t	*tgt,
	unsigned char		mode,
	unsigned char		vuqe,
	register unsigned int	intlv,
	io_req_t		ior)
{
	scsi_cmd_format_t	*cmd;
	char			*parms;

	cmd = (scsi_cmd_format_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_FORMAT_UNIT;
	cmd->scsi_cmd_lun_and_lba1 =
		mode & (SCSI_CMD_FMT_FMTDATA|SCSI_CMD_FMT_CMPLIST|SCSI_CMD_FMT_LIST_TYPE);
	cmd->scsi_cmd_lba2 	   = vuqe;
	cmd->scsi_cmd_lba3 	   = intlv >>  8;
	cmd->scsi_cmd_xfer_len     = intlv;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */

	parms = (char*) cmd + 1;
	if (ior->io_count)
		bcopy(ior->io_data, parms, ior->io_count);
	else
		bzero(parms, 0xff - sizeof(*cmd));

	tgt->cur_cmd = SCSI_CMD_FORMAT_UNIT;

	scsi_go_and_wait(tgt, sizeof(*cmd) + ior->io_count, 0, ior);
	return tgt->done;
}
Пример #10
0
/* move elsewhere ifworks */
scsi2_mode_select(
	target_info_t	*tgt,
	boolean_t	save,
	unsigned char	*page,
	int		pagesize,
	io_req_t	ior)
{
	scsi_cmd_mode_select_t	*cmd;
	scsi2_mode_param_t	*parm;

	bzero(tgt->cmd_ptr, sizeof(*cmd) + sizeof(*parm));
	cmd = (scsi_cmd_mode_select_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_MODE_SELECT;
	cmd->scsi_cmd_lun_and_lba1 = SCSI_CMD_MSL_PF | (save ? SCSI_CMD_MSL_SP : 0);
	cmd->scsi_cmd_xfer_len = pagesize;

	parm = (scsi2_mode_param_t*) (cmd + 1);

	bcopy(page, parm, pagesize);

	tgt->cur_cmd = SCSI_CMD_MODE_SELECT;

	scsi_go_and_wait(tgt, sizeof(*cmd) + pagesize, 0, ior);

	return tgt->done;
}
Пример #11
0
/*
 * SCSI commands fully specific to disks
 */
char
scsi_read_capacity(
	register target_info_t	*tgt,
	int			lbn,
	io_req_t		ior)
{
	scsi_cmd_read_capacity_t	*cmd;

	bzero(tgt->cmd_ptr, sizeof(*cmd));
	cmd = (scsi_cmd_read_capacity_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_READ_CAPACITY;
	/* all zeroes, unless... */
	if (lbn) {
		cmd->scsi_cmd_rcap_flags = SCSI_CMD_RCAP_PMI;
		cmd->scsi_cmd_lba1 = (lbn>>24);
		cmd->scsi_cmd_lba2 = (lbn>>16)&0xff;
		cmd->scsi_cmd_lba3 = (lbn>> 8)&0xff;
		cmd->scsi_cmd_lba4 = (lbn    )&0xff;
	}
	
	tgt->cur_cmd = SCSI_CMD_READ_CAPACITY;

	scsi_go_and_wait(tgt, sizeof(*cmd), sizeof(scsi_rcap_data_t),ior);

	return tgt->done;
}
Пример #12
0
int scsi_pause_resume(
	target_info_t	*tgt,
	boolean_t	stop_it,
	io_req_t	ior)
{
	scsi_cmd_pausres_t	*cmd;

	cmd = (scsi_cmd_pausres_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PAUSE_RESUME;
	cmd->scsi_cmd_lun_and_relbit = 0;
	cmd->scsi_cmd_lba1 	   = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_lba4 	   = 0;
	cmd->scsi_cmd_xxx 	   = 0;
	cmd->scsi_cmd_xfer_len_1    = 0;
	cmd->scsi_cmd_pausres_res  = stop_it ? 0 : SCSI_CMD_PAUSRES_RESUME;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_PAUSE_RESUME;

        scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

        return tgt->done;
}
Пример #13
0
/*
 * SCSI commands specific to sequential access devices
 */
char
sctape_mode_select(
	register target_info_t	*tgt,
	unsigned char		*vuque_data,
	int			vuque_data_len,
	unsigned int		newspeed,
	io_req_t		ior)
{
	scsi_cmd_mode_select_t	*cmd;
	scsi_mode_select_param_t	*parm;
	tape_spec_t			*tape_spec;
	register int			offs;

	bzero(tgt->cmd_ptr, sizeof(*cmd) + 2 * sizeof(*parm));
	cmd = (scsi_cmd_mode_select_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_MODE_SELECT;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_xfer_len = sizeof(scsi_mode_select_param_t) + vuque_data_len;

	parm = (scsi_mode_select_param_t*) (cmd + 1);
	tape_spec = (tape_spec_t *)&parm->device_spec;
	if (newspeed) {
		tape_spec->speed = tgt->dev_info.tape.speed;
		parm->descs[0].density_code = tgt->dev_info.tape.density;
	} else {
		tape_spec->speed = 0;
		parm->descs[0].density_code = 0;
	}
	tape_spec->buffer_mode = 1;
	parm->desc_len = 8;
	if (tgt->dev_info.tape.fixed_size) {
		register int reclen = tgt->block_size;
		parm->descs[0].reclen1 = reclen >> 16;
		parm->descs[0].reclen2 = reclen >>  8;
		parm->descs[0].reclen3 = reclen;
	}

	if (vuque_data_len)
		bcopy((const char *)vuque_data,(char*)(parm+1),vuque_data_len);

	tgt->cur_cmd = SCSI_CMD_MODE_SELECT;

	scsi_go_and_wait(tgt, sizeof(*cmd) + sizeof(*parm) + vuque_data_len, 0, ior);

	return tgt->done;
}
Пример #14
0
/*
 * obnoxious
 */
cdrom_vendor_specific(
	target_info_t	*tgt,
	scsi_command_group_2	*cmd,
	unsigned char	*params,
	int		paramlen,
	int		retlen,
	io_req_t	ior)
{
	bcopy(cmd, tgt->cmd_ptr, sizeof(*cmd));
	if (paramlen)
		bcopy(params, tgt->cmd_ptr + sizeof(*cmd), paramlen);

	tgt->cur_cmd = cmd->scsi_cmd_code;

	scsi_go_and_wait(tgt, sizeof(*cmd) + paramlen, retlen, ior);

	return tgt->done;
}
Пример #15
0
scsi_read_subchannel(
	target_info_t	*tgt,
	boolean_t	msf_format,
	unsigned int	data_format,
	unsigned int	trackno,
	io_req_t	ior)
{
	scsi_cmd_read_subch_t	*cmd;
	int			allocsize;

	switch (data_format) {
	case SCSI_CMD_RS_FMT_SUBQ:
		allocsize = sizeof(cdrom_chan_data_t);
		trackno = 0; break;
	case SCSI_CMD_RS_FMT_CURPOS:
		allocsize = sizeof(cdrom_chan_curpos_t);
		trackno = 0; break;
	case SCSI_CMD_RS_FMT_CATALOG:
		allocsize = sizeof(cdrom_chan_catalog_t);
		trackno = 0; break;
	case SCSI_CMD_RS_FMT_ISRC:
		allocsize = sizeof(cdrom_chan_isrc_t); break;
	}

	cmd = (scsi_cmd_read_subch_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_READ_SUBCH;
	cmd->scsi_cmd_lun_and_relbit = msf_format ? SCSI_CMD_CD_MSF : 0;
	cmd->scsi_cmd_lba1 	   = SCSI_CMD_RS_SUBQ;
	cmd->scsi_cmd_rs_format	   = data_format;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_lba4 	   = 0;
	cmd->scsi_cmd_rs_trackno   = trackno;
	cmd->scsi_cmd_xfer_len_1    = allocsize >> 8;
	cmd->scsi_cmd_xfer_len_2    = allocsize >> 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */
	
	tgt->cur_cmd = SCSI_CMD_READ_SUBCH;

        scsi_go_and_wait(tgt, sizeof(*cmd), allocsize, ior);

        return tgt->done;
}
Пример #16
0
void
scsi_medium_removal(
	register target_info_t	*tgt,
	boolean_t		allow,
	io_req_t		ior)
{
	scsi_cmd_medium_removal_t	*cmd;

	cmd = (scsi_cmd_medium_removal_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_PREVENT_ALLOW_REMOVAL;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_pa_prevent   = allow ? 0 : 1;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_PREVENT_ALLOW_REMOVAL;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);
}
Пример #17
0
char
scsi_read_block_limits(
	register target_info_t	*tgt,
	io_req_t		ior)
{
	scsi_cmd_block_limits_t	*cmd;

	cmd = (scsi_cmd_block_limits_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_READ_BLOCK_LIMITS;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_xfer_len     = 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_READ_BLOCK_LIMITS;

	scsi_go_and_wait(tgt, sizeof(*cmd), sizeof(scsi_blimits_data_t), ior);
	return tgt->done;
}
Пример #18
0
	/* -- HACK Alert */

	scsi_go(tgt, sizeof(*cmd), len, FALSE);
	iowait(ior);
	return tgt->done;
}


#if	0 /* unused commands */
void
scsi_rezero_unit(
	register target_info_t	*tgt,
	io_req_t		ior)
{
	scsi_cmd_rezero_t	*cmd;

	cmd = (scsi_cmd_rezero_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_REZERO_UNIT;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_xfer_len     = 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_REZERO_UNIT;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #19
0
void
scsi_erase(
	register target_info_t	*tgt,
	unsigned char		mode,
	io_req_t		ior)
{
	scsi_cmd_erase_t	*cmd;

	cmd = (scsi_cmd_erase_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_ERASE;
	cmd->scsi_cmd_lun_and_lba1 = mode & SCSI_CMD_ER_LONG;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_xfer_len     = 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_ERASE;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #20
0
void
scsi_seek(
	register target_info_t	*tgt,
	register unsigned int	where,
	io_req_t		ior)
{
	scsi_cmd_seek_t	*cmd;

	cmd = (scsi_cmd_seek_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_SEEK;
	cmd->scsi_cmd_lun_and_lba1 = (where >> 16) & 0x1f;
	cmd->scsi_cmd_lba2 	   = where >>  8;
	cmd->scsi_cmd_lba3 	   = where;
	cmd->scsi_cmd_xfer_len     = 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_SEEK;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #21
0
void
scsi_track_select(
	register target_info_t	*tgt,
	register unsigned char	trackno,
	io_req_t		ior)
{
	scsi_cmd_seek_t	*cmd;

	cmd = (scsi_cmd_seek_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_TRACK_SELECT;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_lba2 	   = 0;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_tp_trackno   = trackno;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_TRACK_SELECT;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #22
0
void
sctape_verify(
	register target_info_t	*tgt,
	register unsigned int	len,
	io_req_t		ior)
{
	scsi_cmd_verify_t	*cmd;

	cmd = (scsi_cmd_verify_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_VERIFY_0;
	cmd->scsi_cmd_lun_and_lba1 = 0;/* XXX */
	cmd->scsi_cmd_lba2 	   = len >> 16;
	cmd->scsi_cmd_lba3 	   = len >>  8;
	cmd->scsi_cmd_xfer_len     = len;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_VERIFY_0;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #23
0
char
scsi_write_filemarks(
	register target_info_t	*tgt,
	register unsigned int	count,
	io_req_t		ior)
{
	scsi_cmd_write_fil_t	*cmd;

	cmd = (scsi_cmd_write_fil_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_WRITE_FILEMARKS;
	cmd->scsi_cmd_lun_and_lba1 = 0;
	cmd->scsi_cmd_lba2 	   = count >> 16;
	cmd->scsi_cmd_lba3 	   = count >>  8;
	cmd->scsi_cmd_xfer_len     = count;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_WRITE_FILEMARKS;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

	return tgt->done;
}
Пример #24
0
void
scsi_release(
	register target_info_t	*tgt,
	unsigned char		id,
	unsigned char		mode,
	io_req_t		ior)
{
	scsi_cmd_release_t	*cmd;

	cmd = (scsi_cmd_release_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_RELEASE;
	cmd->scsi_cmd_lun_and_lba1 = mode & 0x1f;
	cmd->scsi_cmd_reserve_id   = id;
	cmd->scsi_cmd_lba3 	   = 0;
	cmd->scsi_cmd_xfer_len     = 0;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_RELEASE;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #25
0
void
scsi_reserve(
	register target_info_t	*tgt,
	register unsigned int	len,
	unsigned char		id,
	unsigned char		mode,
	io_req_t		ior)
{
	scsi_cmd_reserve_t	*cmd;

	cmd = (scsi_cmd_reserve_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_RESERVE;
	cmd->scsi_cmd_lun_and_lba1 = mode & 0x1f;
	cmd->scsi_cmd_reserve_id   = id;
	cmd->scsi_cmd_extent_llen1 = len >>  8;
	cmd->scsi_cmd_extent_llen2 = len;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_RESERVE;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

}
Пример #26
0
char
scsi_space(
	register target_info_t	*tgt,
	unsigned char		mode,
	register int		count,
	io_req_t		ior)
{
	scsi_cmd_space_t	*cmd;

	cmd = (scsi_cmd_space_t*) (tgt->cmd_ptr);
	cmd->scsi_cmd_code = SCSI_CMD_SPACE;
	cmd->scsi_cmd_lun_and_lba1 = mode & 0x3;
	cmd->scsi_cmd_lba2 	   = count >> 16;
	cmd->scsi_cmd_lba3 	   = count >>  8;
	cmd->scsi_cmd_xfer_len     = count;
	cmd->scsi_cmd_ctrl_byte = 0;	/* not linked */


	tgt->cur_cmd = SCSI_CMD_SPACE;

	scsi_go_and_wait(tgt, sizeof(*cmd), 0, ior);

	return tgt->done;
}