File:  [Research Unix] / researchv10dc / cmd / oworm / oscsi / reset.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

#include	"scsi.h"

s_reset()
{
	struct scsi_i input;
	struct scsi_o output;
	register i, n;

	input.bus_id = -1;
	input.cmd[0] = 0x12;
	input.cmd[1] = 0<<5;
	input.cmd[2] = 0;
	input.cmd[3] = 0;
	input.cmd[4] = 36;
	input.cmd[5] = 0;
	if(scsiio(&input, &output, 36, "reset") < 0)
		return(1);
	sleep(5);
	for(i = 0; i < 60; i++){
		sleep(2);
		n = s_sensei(&input, 0, 0);
		if(scsiio(&input, &output, n, "reset sense") < 0)
			return(1);
		if(output.status[0] == 0){
			print("done\n");
s_sense(0, 0);
			return(0);
		}
		print(".");
	}
	return(0);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.