- /***********************************************\
- * Assume we have a board at this stage *
- * setup dma channel from jumpers and save int *
- * level *
- \***********************************************/
-#ifdef __386BSD__
- printf("aha%d: reading board settings, ",unit);
-#define PRNT(x) printf(x)
-#else __386BSD__
- printf("aha%d:",unit);
+ /*
+ * Assume we have a board at this stage, do an adapter inquire
+ * to find out what type of controller it is
+ */
+ aha_cmd(unit, 0, sizeof(inquire), 1 ,&inquire, AHA_INQUIRE);
+#ifdef AHADEBUG
+ printf("aha%d: inquire %x, %x, %x, %x\n",
+ unit,
+ inquire.boardid, inquire.spec_opts,
+ inquire.revision_1, inquire.revision_2);
+#endif /* AHADEBUG */
+ /*
+ * XXX The Buslogic 545S gets the AHA_INQUIRE command wrong,
+ * they only return one byte which causes us to print an error,
+ * so if the boardid comes back as 0x20, tell the user why they
+ * get the "cmd/data port empty" message
+ */
+ if (inquire.boardid == 0x20) {
+ /* looks like a Buslogic 545 */
+ printf ("aha%d: above cmd/data port empty do to Buslogic 545\n",
+ unit);
+ }
+ /*
+ * If we are a 1542C or 1542CF disable the extended bios so that the
+ * mailbox interface is unlocked.
+ * No need to check the extended bios flags as some of the
+ * extensions that cause us problems are not flagged in that byte.
+ */
+ if ((inquire.boardid == 0x43) || (inquire.boardid == 0x44) ||
+ (inquire.boardid == 0x45)) {
+ aha_cmd(unit, 0, sizeof(extbios), 0, &extbios, AHA_EXT_BIOS);
+#ifdef AHADEBUG
+ printf("aha%d: extended bios flags %x\n", unit, extbios.flags);
+#endif /* AHADEBUG */
+ printf("aha%d: 1542C/CF detected, unlocking mailbox\n");
+ aha_cmd(unit, 2, 0, 0, 0, AHA_MBX_ENABLE,
+ 0, extbios.mailboxlock);
+ }
+
+ /*
+ * setup dma channel from jumpers and save int
+ * level
+ */
+ printf("aha%d: reading board settings, ", unit);