+hpmaptype(hpaddr, type, unit)
+ register struct hpdevice *hpaddr;
+ unsigned type;
+ int unit;
+{
+ int ntracks, hpsn;
+
+ /*
+ * Handle SI model byte stuff when
+ * we think it's an RM03 or RM05.
+ */
+ if (type == 0 || type == 1) {
+ hpsn = hpaddr->hpsn;
+ if ((hpsn & SIMB_LU) != unit)
+ return (type);
+ switch ((hpsn & SIMB_MB) &~ (SIMB_S6|SIRM03|SIRM05)) {
+ case SI9775D:
+ return (8);
+ case SI9730D:
+ return (9);
+ case SI9766:
+ hpaddr->hpcs1 = HP_RECAL|HP_GO;
+ DELAY(100000);
+ return (1);
+
+ case SI9762:
+ return (0);
+ }
+ return (type);
+ }
+ /*
+ * RM03: EMULEX controller. Map to correct
+ * drive type by checking the holding
+ * register for the disk geometry.
+ */
+ if (type == 13) {
+ hpaddr->hpcs1 = HP_NOP;
+ hpaddr->hphr = HPHR_MAXTRAK;
+ ntracks = MASKREG(hpaddr->hphr) + 1;
+ if (ntracks == 16)
+ return (10); /* AMPEX capricorn */
+ hpaddr->hphr = HPHR_MAXSECT;
+ if (ntracks == 48)
+ return (12); /* 48 sector Eagle */
+ if (ntracks == 43)
+ return (11); /* 43 sector Eagle */
+ printf("RM02 with %d tracks?\n", ntracks);
+ return (type);
+ }
+ /*
+ * ML11's all map to the same type.
+ */
+ if (type == 6 || type == 7)
+ return (6);
+ return (type);
+}
+
+int ssect; /* set to 1 if we are on a track with skip sectors */
+