]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/atazz/tabs.h
Add Erik Quanstrom's atazz
[plan9front.git] / sys / src / cmd / atazz / tabs.h
1 Txtab regtx[] = {
2         Ftype,  "type", 0,
3         Fflags, "flags",        0,
4         Fcmd,   "cmd",  0,
5         Ffeat,  "feat", 0,
6         Flba0,  "lba0", 0,
7         Flba8,  "lba8", 0,
8         Flba16, "lba16",        0,
9         Fdev,   "dev",  0,
10         Flba24, "lba24",        0,
11         Flba32, "lba32",        0,
12         Flba40, "lba40",        0,
13         Ffeat8, "feat8",        0,
14         Fsc,    "sc",   0,
15         Fsc8,   "sc8",  0,
16         Ficc,   "icc",  0,
17         Fcontrol,"control",     0,
18
19         /* aliases */
20         Ffeat,  "features",     0,
21         Flba0,  "sector",       0,
22         Flba8,  "cyl0", 0,
23         Flba8,  "byte0",        0,
24         Flba16, "cyl8", 0,
25         Flba24, "dh",   0,
26         Flba24, "byte8",        0,
27         Flba32, "cyl24",        0,
28         Flba40, "cyl32",        0,
29 };
30
31 Txtab smautosave[] = {
32         0,      "disable",      0,
33         0xf1,   "enable",               0,
34 };
35
36 Fetab _b0d2[] = {
37         Fsc,    smautosave,     nelem(smautosave),
38         0,      0,              0,
39 };
40
41 Txtab smlba8[] = {
42         0x4f,   "",             0,
43 };
44 Txtab smlba16[] = {
45         0xc2,   "",             0,
46 };
47
48 Txtab smartfeat[] = {
49 //      0xd0,   "read data",                    0,
50         0xd2,   "attribute autosave",           _b0d2,
51         0xd2,   "aa",                           0,
52         0xd4,   "execute off-line immediate",   0,
53 //      0xd5,   "read log",                     0,
54 //      0xd6,   "write log",                    0,
55         0xd8,   "enable operations",            0,
56         0xd9,   "disable operations",           0,
57         0xda,   "return status",                        0,
58 };
59
60 Fetab _b0[] = {
61         Ffeat,  smartfeat,      nelem(smartfeat),
62         Flba8,  smlba8, 1,
63         Flba16, smlba16,        1,
64         0,      0,      0,
65 };
66
67 Txtab _b0d0feat[] = {
68         0xd0,   "",             0,
69 };
70
71 Fetab _b0d0[] = {
72         Ffeat,  _b0d0feat,      nelem(_b0d0feat),
73         Flba8,  smlba8, 1,
74         Flba16, smlba16,        1,
75         0,      0,      0,
76 };
77
78
79 Txtab _b0d5feat[] = {
80         0xd5,   "",             0,
81 };
82
83 Txtab _b0d5count[] = {
84         0x01,   "",             0,
85 };
86
87 Txtab smpage[] = {
88         0x00,   "page 0",               0,
89         0x01,   "page 1",               0,
90         0x02,   "page 2",               0,
91         0x03,   "page 3",               0,
92         0x04,   "page 4",               0,
93         0x05,   "page 5",               0,
94         0x06,   "page 6",               0,
95         0x07,   "page 7",               0,
96         0x08,   "page 8",               0,
97         0x09,   "page 9",               0,
98         0x11,   "page 17",      0,
99         0xe0,   "sctstat",              0,
100         0xe1,   "sctdata",      0,
101 };
102
103 Fetab _b0d5[] = {
104         Ffeat,  _b0d5feat,      nelem(_b0d5feat),
105 //      Fsc,    _b0d5count,     nelem(_b0d5count),
106         Flba0,  smpage,         nelem(smpage),
107         Flba8,  smlba8, 1,
108         Flba16, smlba16,        1,
109         0,      0,      0,
110 };
111
112 Fetab _2f[] = {
113         Flba0,  smpage,         nelem(smpage),
114         0,      0,              0,
115 };
116
117 Txtab nvfeat[] = {
118         0x00,   "set power mode",                       0,
119         0x01,   "return from power mode",               0,
120         0x10,   "add lbas",                     0,
121         0x11,   "remove lbas",                  0,
122         0x13,   "query pinned set",             0,
123         0x13,   "query misses",                 0,
124         0x14,   "flush",                                0,
125         0x15,   "disable",                      0,
126         0x16,   "disable",                      0,
127 };
128
129 Fetab _b6[] = {
130         Ffeat,  nvfeat,         nelem(nvfeat),
131         0,      0,              0,
132 };
133
134 Txtab umodes[] = {
135         0x40,   "0",    0,
136         0x41,   "1",    0,
137         0x42,   "2",    0,
138         0x43,   "3",    0,
139         0x44,   "4",    0,
140         0x45,   "5",    0,
141         0x46,   "6",    0,
142 };
143
144 Fetab _ef0340[] = {
145         Fsc,    umodes, nelem(umodes),
146         0,      0,      0,
147 };
148
149 Txtab txmode[] = {
150         0x00,   "pio",          0,
151         0x01,   "pio-iordy",    0,
152         0x08,   "piofc",                0,
153         0x20,   "mwdma",        0,
154         0x40,   "udma",         _ef0340,
155 };
156
157 Fetab _ef03[] = {
158         Fsc,    txmode, nelem(txmode),
159         0,      0,      0,
160 };
161
162 Txtab apmmode[] = {
163         0xfe,   "maximum",      0,
164         0x80,   "minimum without standby",      0,
165         0x02,   "intermediate", 0,
166         0x01,   "standby",      0,
167 };
168
169 Fetab _ef05[] = {
170         Fsc,    apmmode,        nelem(apmmode),
171         0,      0,      0,
172 };
173
174 Txtab scisone[] = {
175         1,      "",             0,
176 };
177
178 Fetab _scis1[] = {
179         Fsc,    scisone,        nelem(scisone),
180         0,      0,      0,
181 };
182
183 Txtab feat[] = {
184         0x01,   "enable 8-bit pio",     0,
185         0x02,   "enable write cache",   0,
186         0x03,   "set transfer mode",    _ef03,
187         0x05,   "enable apm",   _ef05,
188         0x06,   "enable power-up in standby",   0,
189         0x07,   "power-up in standby device spin-up",   0,
190         0x10,   "enable sata features",         0,
191         0x0a,   "enable cfa power mode 1",      0,
192         0x31,   "disable media status notification",    0,
193         0x42,   "enable aam",   0,
194         0x43,   "set maximum host interface sector times",      0,
195         0x55,   "disable read look-ahead",      0,
196         0x5d,   "enable release interrupt",     0,
197         0x5e,   "enable service interrupt",     0,
198         0x66,   "disable reverting to power-on defaults",       0,
199         0x81,   "disable 8-bit pio",    0,
200         0x82,   "disable write cache",  0,
201         0x85,   "disable apm",  0,
202         0x86,   "disable power-up in standby",  0,
203         0x8a,   "disable cfa power mode 1",     0,
204         0x10,   "disable sata features",                0,
205         0x95,   "enable media status notification",     0,
206         0xaa,   "enable read look-ahead",       0,
207         0xc1,   "disable free-fall control", 0,
208         0xc2,   "disable aam",  0,
209         0xc3,   "sense data",   0,                              /* incomplete; enable/disable */
210         0xcc,   "enable reverting to power-on defaults",        0,
211         0xdd,   "disable release interrupt",    0,
212         0xde,   "disable service interrupt",    0,
213 };
214
215 Fetab _ef[] = {
216         Ffeat,  feat,   nelem(feat),
217         0,      0,      0,
218 };
219
220 /* 0xffff — sct command executing in background */
221 char *sctetab[] = {
222         "Command complete without error",
223         "Invalid Function Code",
224         "Input LBA out of range"
225         "Request 512-byte data block count overflow.", /* sic */
226         "Invalid Function code in Error Recovery command",
227         "Invalid Selection code in Error Recovery command",
228         "Host read command timer is less than minimum value",
229         "Host write command timer is less than minimum value",
230         "Background SCT command was aborted because of an interrupting host command",
231         "Background SCT command was terminated because of unrecoverable error",
232         "Invalid Function code in SCT Read/Write Long command",
233         "SCT data transfer command was issued without first issuing an SCT command",
234         "Invalid Function code in SCT Feature Control command",
235         "Invalid Feature code in SCT Feature Control command",
236         "Invalid New State value in SCT Feature Control command",
237         "Invalid Option Flags value in SCT Feature Control command",
238         "Invalid SCT Action code",
239         "Invalid Table ID (table not supported)",
240         "Command wa saborted due to device security being locked",
241         "Invalid revision code in SCT data",
242         "Foreground SCT operation was terminated because of unrecoverable error",
243         "Error Recovery Timer expired", /* sic */
244 };
245
246 Txtab fcfewcrt[] = {
247         1,      "enable",               0,
248         2,      "disable",      0,
249 };
250
251 Fetab fcfewcr[] = {
252         Sstate, fcfewcrt,       nelem(fcfewcrt),
253         0,      0,      0,
254 };
255
256 Txtab fcfewct[] = {
257         1,      "set features", 0,
258         2,      "enable",               0,
259         3,      "disable",      0,
260 };
261
262 Fetab fcfewc[] = {
263         Sstate, fcfewct,        nelem(fcfewct),
264         0,      0,      0,
265 };
266
267 Txtab fcfn[] = {
268         1,      "set state",    0,
269         2,      "return state", 0,
270         3,      "return feature option flags",  0,
271 };
272
273 Txtab fcfe[] = {
274         2,      "write cache reordering",       fcfewcr,
275         1,      "write cache",  fcfewc,
276         3,      "temperature logging interval", 0,
277 };
278
279 Txtab fcoptf[] = {
280         1,      "preserve",     0,
281 };
282
283 Txtab fcproto[] = {
284         Pnd,    "",     0,
285 };
286
287 Fetab sctfc[] = {
288         Sfn,    fcfn,   nelem(fcfn),
289         Sfe,    fcfe,   nelem(fcfe),
290         Soptf,  fcoptf, nelem(fcoptf),
291         Pbase,  fcproto,        nelem(fcproto),
292         0,      0,      0,
293 };
294
295 Txtab sctdt[] = {
296         Stabid, "tableid",      0,
297 };
298
299 Txtab tabnam[] = {
300         2,      "hda temperature history",      0,
301 };
302
303 Txtab tablefc[] = {
304         1,      "",     0,
305 };
306
307 Fetab tables[] = {
308         Sfn,    tablefc,        nelem(tablefc),
309         Stabid, tabnam, nelem(tabnam),
310         0,      0,      0,
311 };
312
313 Txtab ersc[] = {
314         1,      "read timer",   0,
315         2,      "write timer",  0,
316 };
317
318 Txtab erfc[] = {
319         1,      "set",  0,
320         2,      "return",       0,
321 };
322
323 Txtab erti[] = {
324         -1,     "=",    0,
325 };
326
327 Fetab scter[] = {
328         Sfn,    erfc,   nelem(erfc),
329         Ssc,    ersc,   nelem(ersc),
330         Stimer, erti,   nelem(erti),
331         Pbase,  fcproto,        nelem(fcproto),
332         0,      0,      0,
333 };
334
335 Fetab patfe[] = {
336         Pbase,  fcproto,        nelem(fcproto),
337         0,      0,      0,
338 };
339
340 Txtab wsfc[] = {
341         1,      "repeat write pattern",         patfe,
342         2,      "repeat write data block",              0,
343         0x101,  "repeat write pattern foreground",      patfe,
344         0x102,  "repeat write data block foreground",   0,
345 };
346
347 Txtab wslba[] = {
348         -1,     "lba",  0,
349 };
350
351 Txtab wscnt[] = {
352         -1,     "count",        0,
353 };
354
355 Txtab wspat[] = {
356         -1,     "pattern",      0,
357 };
358
359 Fetab wsame[] = {
360         Sfn,    wsfc,   nelem(wsfc),
361         Slba,   wslba,  nelem(wslba),
362         Scnt,   wscnt,  nelem(wscnt),
363         Spat,   wspat,  nelem(wspat),
364         0,      0,      0,
365 };
366
367 Txtab action[] = {
368         5,      "read data table",      tables,
369         4,      "feature control",      sctfc,
370         3,      "error recovery time", scter,
371         2,      "write same",   wsame,
372 };
373
374 Fetab scta[] = {
375         Saction,        action, nelem(action),
376         0,      0,      0,
377 };
378
379 Atatab atatab[] = {
380 0x00,   0,      0,      Pnd|P28,                0,      0,      "nop",
381 0x03,   0,      Cmdn,   Pnd|P28,                0,      0,      "cfa request extended error",
382 0x08,   Cmdn,   0,      Preset|P28,             0,      0,      "device reset",
383 0x0b,   0,      Cmdp,   Pnd|P48,                0,      0,      "request sense data ext",
384 0x20,   0,      0,      Pin|Ppio|P28,           0,      iofmt,  "read sector",
385 0x24,   0,      Cmdn,   Pin|Ppio|P48,           0,      iofmt,  "read sector ext",
386 0x25,   0,      Cmdn,   Pin|Pdma|P48,           0,      iofmt,  "read dma ext",
387 0x26,   0,      Cmdn,   Pin|Pdmq|P48,           0,      iofmt,  "read dma queued ext",
388 0x27,   0,      Cmdn,   Pnd|P48,                0,      0,      "read native max address ext",
389 0x29,   0,      Cmdn,   Pin|Ppio|P48,           0,      iofmt,  "read multiple ext",
390 0x2a,   0,      Cmdn,   Pin|Pdma|P48,           0,      iofmt,  "read stream dma ext",
391 0x2b,   0,      Cmdn,   Pin|Ppio|P48,           0,      iofmt,  "read stream ext",
392 0x2f,   Cmd5sc, 0,      Pin|Ppio|P48|P512,      _2f,    glfmt,  "read log ext",
393 0x2f,   Cmd5sc, 0,      Psct|Pin|Ppio|P48|P512, scta,   0,      "sct",
394 0x30,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "write sector",
395 0x34,   0,      Cmdn,   Pout|Ppio|P48,          0,      0,      "write sector ext",
396 0x35,   0,      Cmdn,   Pout|Pdma|P48,          0,      0,      "write dma ext",
397 0x36,   0,      Cmdn,   Pout|Pdmq|P48,          0,      0,      "write dma queued ext",
398 0x37,   0,      Cmdn,   Pnd|P48,                0,      0,      "set max address ext",
399 0x38,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "cfa write sectors without erase",
400 0x39,   0,      Cmdn,   Pout|Ppio|P48,          0,      0,      "write multiple ext",
401 0x3a,   0,      Cmdn,   Pout|Pdma|P48,          0,      0,      "write stream dma ext",
402 0x3b,   0,      Cmdn,   Pout|Ppio|P48,          0,      0,      "write stream ext",
403 0x3d,   0,      Cmdn,   Pout|Pdma|P48,          0,      0,      "write dma fua ext",
404 0x3e,   0,      Cmdn,   Pout|Pdmq|P48,          0,      0,      "write dma queued fua ext",
405 0x3f,   0,      0,      Pout|Ppio|P48,          0,      0,      "write log ext",
406 0x40,   0,      Cmdn,   Pnd|P28,                0,      0,      "read verify sector",
407 0x42,   0,      Cmdn,   Pnd|P48,                0,      0,      "read verify sector ext",
408 0x45,   0,      Cmdn,   Pnd|P48,                0,      0,      "write uncorrectable ext",
409 0x47,   Cmd5sc, 0,      Pin|Pdma|P48|P512,      _2f,    glfmt,  "read log dma ext",
410 0x51,   0,      0,      Pnd|P48,                0,      0,      "configure stream",
411 0x57,   0,      0,      Pout|Pdma|P48,          0,      0,      "write log dma ext",
412 0x5b,   0,      Cmdp,   Pnd|P28,                0,      0,      "trusted non-data",
413 0x5c,   0,      Cmdp,   Pin|Ppio|P28,           0,      iofmt,  "trusted receive",
414 0x5d,   0,      Cmdp,   Pin|Pdma|P28,           0,      iofmt,  "trusted receive dma",
415 0x5e,   0,      Cmdp,   Pout|Ppio|P28,          0,      0,      "trusted send",
416 0x5f,   0,      Cmdp,   Pout|Pdma|P28,          0,      0,      "trusted send dma",
417 0x60,   0,      Cmdn,   Pin|Pdmq|P48,           0,      iofmt,  "read fpdma queued",
418 0x61,   0,      Cmdn,   Pout|Pdmq|P48,          0,      0,      "write fpdma queued",
419 0x87,   0,      Cmdn,   Pin|Ppio|P28,           0,      iofmt,  "cfa translate sector",
420 0x90,   0,      0,      Pdiag|P28,              0,      0,      "execute device diagnostic",
421 0x92,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "download microcode",
422 0x93,   0,      Cmdn,   Pout|Pdma|P28,          0,      0,      "download microcode dma",
423 0xa0,   Cmdn,   0,      Ppkt,                   0,      0,      "packet",
424 0xa1,   Cmdn,   0,      Pin|Ppio|P28|P512,      _scis1, idfmt,  "identify packet device",
425 0xb0,   Cmd5sc, Cmdn,   Pin|Ppio|P28|P512,       _b0d0, sdfmt,  "smart read data",
426 0xb0,   Cmd5sc, Cmdn,   Pin|Ppio|P28|P512,       _b0d5, slfmt,  "smart read log",
427 0xb0,   0,      Cmdn,   Pnd|P28,                 _b0,   smfmt,  "smart",
428 0xb1,   0,      0,      Pnd|P28,                0,      0,      "device configuration overlay",
429 0xb6,   0,      Cmdn,   Pnd|P48,                0,      0,      "nv cache",
430 0xc0,   Cmdf,   Cmdn,   Pnd|P28,                0,      0,      "cfa erase sectors",
431 0xc4,   0,      Cmdn,   Pin|Ppio|P28,           0,      iofmt,  "read multiple",
432 0xc5,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "write multiple",
433 0xc6,   0,      Cmdn,   Pnd|P28,                0,      0,      "set multiple mode",
434 0xc7,   0,      Cmdn,   Pin|Pdmq|P28,           0,      iofmt,  "read dma queued",
435 0xc8,   0,      Cmdn,   Pin|Pdma|P28,           0,      iofmt,  "read dma",
436 0xca,   0,      Cmdn,   Pout|Pdma|P28,          0,      0,      "write dma",
437 0xcc,   0,      Cmdn,   Pout|Pdmq|P28,          0,      0,      "write dma queued",
438 0xcd,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "cfa write multiple without erase",
439 0xce,   0,      Cmdn,   Pout|Ppio|P48,          0,      0,      "write multiple fua ext",
440 0xd1,   0,      Cmdn,   Pnd|P28,                0,      0,      "check media card type",
441 0xda,   0,      Cmdn,   Pnd|P28,                0,      0,      "get media status",
442 0xe0,   0,      0,      Pnd|P28,                0,      0,      "standby immediate",
443 0xe1,   0,      0,      Pnd|P28,                0,      0,      "idle immediate",
444 0xe2,   0,      0,      Pnd|P28,                0,      0,      "standby",
445 0xe3,   0,      0,      Pnd|P28,                0,      0,      "idle",
446 0xe4,   0,      Cmdn,   Pin|Ppio|P28,           0,      iofmt,  "read buffer",
447 0xe5,   0,      0,      Pnd|P28,                0,      0,      "check power mode",
448 0xe6,   0,      0,      Pnd|P28,                0,      0,      "sleep",
449 0xe7,   0,      0,      Pnd|P28,                0,      0,      "flush cache",
450 0xe8,   0,      Cmdn,   Pout|Ppio|P28,          0,      0,      "write buffer",
451 0xe9,   0,      Cmdn,   Pin|Pdma|P28,           0,      iofmt,  "read buffer dma",
452 0xea,   0,      Cmdn,   Pnd|P28,                0,      0,      "flush cache ext",
453 0xeb,   0,      Cmdn,   Pdma|P28,               0,      0,      "write buffer dma",
454 0xec,   0,      0,      Pin|Ppio|P28|P512,      _scis1, idfmt,  "identify device",
455 0xef,   0,      0,      Pnd|P28,                _ef,    0,      "set features",
456 0xf1,   0,      0,      Pout|Ppio|P28,          0,      0,      "security set password",
457 0xf2,   0,      0,      Pout|Ppio|P28,          0,      0,      "security unlock",
458 0xf3,   0,      0,      Pnd|P28,                0,      0,      "security erase prepare",
459 0xf4,   0,      0,      Pout|Ppio|P28,          0,      0,      "security erase unit",
460 0xf5,   0,      0,      Pnd|P28,                0,      0,      "security freeze lock",
461 0xf6,   0,      0,      Pout|Ppio|P28,          0,      0,      "security disable password",
462 0xf8,   0,      0,      Pnd|P28,                0,      0,      "read native max address",
463 0xf9,   0,      0,      Pnd|P28,                0,      0,      "set max address",
464 0xf000, 0,      0,      Pnd|P28,                0,      sigfmt, "signature",
465 0xf100, 0,      0,      Pnd|P28,                0,      0,      "oobreset",
466 };