// SPDX-License-Identifier: GPL-2.0-or-later /* * (c) 1997-1998 Grant R. Guenther <grant@torque.net> * * This is a low-level driver for the KBIC-951A and KBIC-971A * parallel to IDE adapter chips from KingByte Information Systems. * * The chips are almost identical, however, the wakeup code * required for the 971A interferes with the correct operation of * the 951A, so this driver registers itself twice, once for * each chip.
*/
/* * count must be congruent to 0 MOD 4, but all known applications *have this property.
*/ staticvoid kbic_read_block(struct pi_adapter *pi, char *buf, int count)
{ int k, a, b;
switch (pi->mode) { case 0:
w0(0x98); w2(4); w2(6); w2(4); for (k = 0; k < count / 2; k++) {
w2(1); w0(8);
a = r1();
w0(0x28);
b = r1();
buf[2 * k] = j44(a, b);
w2(5);
b = r1();
w0(8);
a = r1();
buf[2 * k + 1] = j44(a, b);
w2(4);
} break; case 1:
w0(0xb8); w2(4); w2(6); w2(4); for (k = 0; k < count / 4; k++) {
w0(0xb8);
w2(4); w2(5);
w0(8);
buf[4 * k] = j53(r12w());
w0(0xb8);
buf[4 * k + 1] = j53(r12w());
w2(4); w2(5);
buf[4 * k + 3] = j53(r12w());
w0(8);
buf[4 * k + 2] = j53(r12w());
}
w2(4); break; case 2:
w0(0x88); w2(4); w2(6); w2(4); for (k = 0; k < count / 2; k++) {
w2(0xa0); w2(0xa1);
buf[2 * k] = r0();
w2(0xa5);
buf[2 * k + 1] = r0();
}
w2(4); break; case 3:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count; k++)
buf[k] = r4();
w2(4); w2(0); w2(4); break; case 4:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count / 2; k++)
((u16 *)buf)[k] = r4w();
w2(4); w2(0); w2(4); break; case 5:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count / 4; k++)
((u32 *)buf)[k] = r4l();
w2(4); w2(0); w2(4); break;
}
}
staticvoid kbic_write_block(struct pi_adapter *pi, char *buf, int count)
{ int k;
switch (pi->mode) { case 0: case 1: case 2:
w0(0x90); w2(4); w2(6); w2(4); for (k = 0; k < count / 2; k++) {
w0(buf[2 * k + 1]);
w2(0); w2(4);
w0(buf[2 * k]);
w2(5); w2(4);
} break; case 3:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count / 2; k++) {
w4(buf[2 * k + 1]);
w4(buf[2 * k]);
}
w2(4); w2(0); w2(4); break; case 4:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count / 2; k++)
w4w(swab16(((u16 *)buf)[k]));
w2(4); w2(0); w2(4); break; case 5:
w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k = 0; k < count / 4; k++)
w4l(swab16(((u16 *)buf)[2 * k]) |
swab16(((u16 *)buf)[2 * k + 1]) << 16);
w2(4); w2(0); w2(4); break;
}
}
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Grant R. Guenther ");
MODULE_DESCRIPTION("KingByte Information Systems KBIC-951A and KBIC-971A " "parallel port IDE adapter protocol driver");
module_init(kbic_init)
module_exit(kbic_exit)
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.