fdc.c (5229d0a11d7c6b633d29a4aeb3f54d5971033b0d) fdc.c (038d1bbd1a1e50d4147b71d54593343ef71dc9d5)
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

--- 1166 unchanged lines hidden (view full) ---

1175 bzero(fd, sizeof *fd);
1176 fd->dev = dev;
1177 fd->fdc = fdc;
1178 fd->fdsu = fdsu;
1179 fd->fdu = device_get_unit(dev);
1180 fd->flags = FD_UA; /* make sure fdautoselect() will be called */
1181
1182 fd->type = FD_DTYPE(flags);
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

--- 1166 unchanged lines hidden (view full) ---

1175 bzero(fd, sizeof *fd);
1176 fd->dev = dev;
1177 fd->fdc = fdc;
1178 fd->fdsu = fdsu;
1179 fd->fdu = device_get_unit(dev);
1180 fd->flags = FD_UA; /* make sure fdautoselect() will be called */
1181
1182 fd->type = FD_DTYPE(flags);
1183#if _MACHINE_ARCH == i386
1183/*
1184 * XXX I think using __i386__ is wrong here since we actually want to probe
1185 * for the machine type, not the CPU type (so non-PC arch's like the PC98 will
1186 * fail the probe). However, for whatever reason, testing for _MACHINE_ARCH
1187 * == i386 breaks the test on FreeBSD/Alpha.
1188 */
1189#ifdef __i386__
1184 if (fd->type == FDT_NONE && (fd->fdu == 0 || fd->fdu == 1)) {
1185 /* Look up what the BIOS thinks we have. */
1186 if (fd->fdu == 0) {
1187 if ((fdc->flags & FDC_ISPCMCIA))
1188 /*
1189 * Somewhat special. No need to force the
1190 * user to set device flags, since the Y-E
1191 * Data PCMCIA floppy is always a 1.44 MB
1192 * device.
1193 */
1194 fd->type = FDT_144M;
1195 else
1196 fd->type = (rtcin(RTC_FDISKETTE) & 0xf0) >> 4;
1197 } else {
1198 fd->type = rtcin(RTC_FDISKETTE) & 0x0f;
1199 }
1200 if (fd->type == FDT_288M_1)
1201 fd->type = FDT_288M;
1202 }
1190 if (fd->type == FDT_NONE && (fd->fdu == 0 || fd->fdu == 1)) {
1191 /* Look up what the BIOS thinks we have. */
1192 if (fd->fdu == 0) {
1193 if ((fdc->flags & FDC_ISPCMCIA))
1194 /*
1195 * Somewhat special. No need to force the
1196 * user to set device flags, since the Y-E
1197 * Data PCMCIA floppy is always a 1.44 MB
1198 * device.
1199 */
1200 fd->type = FDT_144M;
1201 else
1202 fd->type = (rtcin(RTC_FDISKETTE) & 0xf0) >> 4;
1203 } else {
1204 fd->type = rtcin(RTC_FDISKETTE) & 0x0f;
1205 }
1206 if (fd->type == FDT_288M_1)
1207 fd->type = FDT_288M;
1208 }
1203#endif /* _MACHINE_ARCH == i386 */
1209#endif /* __i386__ */
1204 /* is there a unit? */
1205 if (fd->type == FDT_NONE)
1206 return (ENXIO);
1207
1208 /* select it */
1209 set_motor(fdc, fdsu, TURNON);
1210 fdc_reset(fdc); /* XXX reset, then unreset, etc. */
1211 DELAY(1000000); /* 1 sec */

--- 1585 unchanged lines hidden ---
1210 /* is there a unit? */
1211 if (fd->type == FDT_NONE)
1212 return (ENXIO);
1213
1214 /* select it */
1215 set_motor(fdc, fdsu, TURNON);
1216 fdc_reset(fdc); /* XXX reset, then unreset, etc. */
1217 DELAY(1000000); /* 1 sec */

--- 1585 unchanged lines hidden ---