1*29537Ssam #ifndef lint
2*29537Ssam static char sccsid[] = "@(#)status.c	1.1 (Berkeley/CCI) 07/05/86";
3*29537Ssam #endif
4*29537Ssam 
5*29537Ssam #include	"vdfmt.h"
6*29537Ssam 
7*29537Ssam /*
8*29537Ssam **	These routines are used to display the status of the formatter.
9*29537Ssam */
10*29537Ssam 
11*29537Ssam status()
12*29537Ssam {
13*29537Ssam 	indent();
14*29537Ssam 	switch (cur.state) {
15*29537Ssam 		case cmd :
16*29537Ssam 			print("Waiting for operator response.\n");
17*29537Ssam 			break;
18*29537Ssam 		case fmt :
19*29537Ssam 			dump_state("Formatting");
20*29537Ssam 			break;
21*29537Ssam 		case vfy :
22*29537Ssam 			dump_state("Verifying");
23*29537Ssam 			break;
24*29537Ssam 		case rel :
25*29537Ssam 			dump_state("Relocating");
26*29537Ssam 			break;
27*29537Ssam 		case cor :
28*29537Ssam 			dump_state("Correcting");
29*29537Ssam 			break;
30*29537Ssam 		case inf :
31*29537Ssam 			dump_state("Collecting information");
32*29537Ssam 			break;
33*29537Ssam 		case exec :
34*29537Ssam 			dump_state("Exercising disk");
35*29537Ssam 			break;
36*29537Ssam 		default:
37*29537Ssam 			print("Current state is unknown.\n");
38*29537Ssam 	}
39*29537Ssam 	exdent(1);
40*29537Ssam }
41*29537Ssam 
42*29537Ssam 
43*29537Ssam /*
44*29537Ssam **
45*29537Ssam */
46*29537Ssam 
47*29537Ssam dump_state(string)
48*29537Ssam char	*string;
49*29537Ssam {
50*29537Ssam 	indent();
51*29537Ssam 	print("%s on controller %d, drive %d.\n",
52*29537Ssam 	    string, cur.controller, cur.drive);
53*29537Ssam 	print("Currently accessing cylinder %d, head %d.\n",
54*29537Ssam 	    cur.daddr.cylinder, cur.daddr.track);
55*29537Ssam 	print("Currently ");
56*29537Ssam 	switch (cur.substate) {
57*29537Ssam 		case sub_chk :
58*29537Ssam 			printf("determining drive state.\n");
59*29537Ssam 			break;
60*29537Ssam 		case sub_fmt :
61*29537Ssam 			printf("formatting drive surface.\n");
62*29537Ssam 			break;
63*29537Ssam 		case sub_vfy :
64*29537Ssam 			printf("verifying drive surface.\n");
65*29537Ssam 			break;
66*29537Ssam 		case sub_rel :
67*29537Ssam 			printf("performing relocation operations.\n");
68*29537Ssam 			break;
69*29537Ssam 		case sub_rcvr :
70*29537Ssam 			printf("recovering from hardware error.\n");
71*29537Ssam 			break;
72*29537Ssam 		default :
73*29537Ssam 			printf("I don't know what is happening.\n");
74*29537Ssam 			break;
75*29537Ssam 	}
76*29537Ssam 	exdent(1);
77*29537Ssam }
78*29537Ssam 
79