// SPDX-License-Identifier: GPL-2.0-or-later /* * (c) 1997-1998 Grant R. Guenther <grant@torque.net> * * This is the low level protocol driver for the EPAT parallel * to IDE adapter from Shuttle Technologies. This adapter is * used in many popular parallel port disk products such as the * SyQuest EZ drives, the Avatar Shark and the Imation SuperDisk.
*/
module_param(epatc8, int, 0);
MODULE_PARM_DESC(epatc8, "support for the Shuttle EP1284 chip, " "used in any recent Imation SuperDisk (LS-120) drive.");
staticvoid epat_write_regr(struct pi_adapter *pi, int cont, int regr, int val)
{ int r = regr + cont_map[cont];
switch (pi->mode) { case 0: case 1: case 2:
w0(0x60+r); w2(1); w0(val); w2(4); break; case 3: case 4: case 5:
w3(0x40+r); w4(val); break;
}
}
staticint epat_read_regr(struct pi_adapter *pi, int cont, int regr)
{ int a, b, r;
r = regr + cont_map[cont];
switch (pi->mode) {
case 0:
w0(r); w2(1); w2(3);
a = r1(); w2(4); b = r1(); return j44(a, b); case 1:
w0(0x40+r); w2(1); w2(4);
a = r1(); b = r2(); w0(0xff); return j53(a, b); case 2:
w0(0x20+r); w2(1); w2(0x25);
a = r0(); w2(4); return a; case 3: case 4: case 5:
w3(r); w2(0x24); a = r4(); w2(4); return a;
}
return -1; /* never gets here */
}
staticvoid epat_read_block(struct pi_adapter *pi, char *buf, int count)
{ int k, ph, a, b;
switch (pi->mode) {
case 0:
w0(7); w2(1); w2(3); w0(0xff);
ph = 0; for (k = 0; k < count; k++) { if (k == count-1)
w0(0xfd);
w2(6 + ph); a = r1(); if (a & 8) {
b = a;
} else {
w2(4+ph); b = r1();
}
buf[k] = j44(a, b);
ph = 1 - ph;
}
w0(0); w2(4); break;
case 1:
w0(0x47); w2(1); w2(5); w0(0xff);
ph = 0; for (k = 0; k < count; k++) { if (k == count - 1)
w0(0xfd);
w2(4 + ph);
a = r1(); b = r2();
buf[k] = j53(a, b);
ph = 1 - ph;
}
w0(0); w2(4); break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.