Home | History | Annotate | Download | only in jazz

Lines Matching defs:fdc

248  * the drive).  If `fdc' is not NULL, the drive was found but was not
254 fdprint(void *aux, const char *fdc)
258 if (fdc == NULL)
264 fdcattach(struct fdc_softc *fdc)
269 callout_init(&fdc->sc_timo_ch, 0);
270 callout_init(&fdc->sc_intr_ch, 0);
272 fdc->sc_state = DEVIDLE;
273 TAILQ_INIT(&fdc->sc_drives);
284 (void)config_found(fdc->sc_dev, (void *)&fa, fdprint,
292 struct fdc_softc *fdc = device_private(parent);
295 bus_space_tag_t iot = fdc->sc_iot;
296 bus_space_handle_t ioh = fdc->sc_ioh;
312 n = fdcresult(fdc);
318 aprint_debug(" %x", fdc->sc_status[i]);
322 if (n != 2 || (fdc->sc_status[0] & 0xf8) != 0x20)
336 struct fdc_softc *fdc = device_private(parent);
359 fdc->sc_fd[drive] = fd;
392 fd_nvtotype(char *fdc, int nvraminfo, int drive)
414 fdc, drive, type);
486 struct fdc_softc *fdc =
488 if (fdc->sc_state == DEVIDLE) {
490 fdcstart(fdc);
506 struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
507 int active = TAILQ_FIRST(&fdc->sc_drives) != 0;
511 TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
515 fdcstart(fdc);
521 struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
532 TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
534 TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
543 fdc->sc_state = DEVIDLE;
561 fd_set_motor(struct fdc_softc *fdc, int reset)
567 if ((fd = TAILQ_FIRST(&fdc->sc_drives)) != NULL)
574 if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
576 bus_space_write_1(fdc->sc_iot, fdc->sc_ioh, FDOUT, status);
583 fdc = device_private(device_parent(fd->sc_dev));
588 fd_set_motor(fdc, 0);
596 struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
601 if ((TAILQ_FIRST(&fdc->sc_drives) == fd) &&
602 (fdc->sc_state == MOTORWAIT))
603 (void)fdcintr(fdc);
608 fdcresult(struct fdc_softc *fdc)
610 bus_space_tag_t iot = fdc->sc_iot;
611 bus_space_handle_t ioh = fdc->sc_ioh;
621 if (n >= sizeof(fdc->sc_status)) {
625 fdc->sc_status[n++] =
685 fdcstart(struct fdc_softc *fdc)
691 if (fdc->sc_state != DEVIDLE) {
696 (void)fdcintr(fdc);
700 fdcpstatus(int n, struct fdc_softc *fdc)
709 snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
710 printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
713 snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
715 snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
717 snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
720 fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
733 struct fdc_softc *fdc = device_private(device_parent(dev));
736 out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
737 (void)fdcresult(fdc);
742 fdcpstatus(n, fdc);
748 struct fdc_softc *fdc = arg;
749 struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
754 log(LOG_ERR, "%s: state %d\n", __func__, fdc->sc_state);
759 fdc->sc_state++;
761 fdc->sc_state = DEVIDLE;
763 (void)fdcintr(fdc);
781 struct fdc_softc *fdc = arg;
782 #define st0 fdc->sc_status[0]
783 #define cyl fdc->sc_status[1]
786 bus_space_tag_t iot = fdc->sc_iot;
787 bus_space_handle_t ioh = fdc->sc_ioh;
793 fd = TAILQ_FIRST(&fdc->sc_drives);
795 fdc->sc_state = DEVIDLE;
803 TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
808 switch (fdc->sc_state) {
810 fdc->sc_errors = 0;
816 fdc->sc_state = MOTORWAIT;
821 struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
827 fd_set_motor(fdc, 0);
828 fdc->sc_state = MOTORWAIT;
835 fd_set_motor(fdc, 0);
852 fdc->sc_state = SEEKWAIT;
857 callout_reset(&fdc->sc_timo_ch, 4 * hz, fdctimeout, fdc);
866 nblks = uimin(nblks, fdc->sc_maxiosize / FDC_BSIZE);
886 FDCDMA_START(fdc, (uint8_t *)bp->b_data + fd->sc_skip,
906 fdc->sc_state = IOCOMPLETE;
911 callout_reset(&fdc->sc_timo_ch, 2 * hz, fdctimeout, fdc);
915 callout_stop(&fdc->sc_timo_ch);
916 fdc->sc_state = SEEKCOMPLETE;
918 callout_reset(&fdc->sc_intr_ch, hz / 50, fdcpseudointr, fdc);
926 if (fdcresult(fdc) != 2 || (st0 & 0xf8) != 0x20 ||
931 fdcretry(fdc);
938 FDCDMA_ABORT(fdc);
943 fdcretry(fdc);
947 callout_stop(&fdc->sc_timo_ch);
952 i = fdcresult(fdc);
954 FDCDMA_ABORT(fdc);
961 fdcretry(fdc);
964 FDCDMA_DONE(fdc);
965 if (fdc->sc_errors) {
969 fdc->sc_errors = 0;
983 fd_set_motor(fdc, 1);
985 fd_set_motor(fdc, 0);
986 fdc->sc_state = RESETCOMPLETE;
987 callout_reset(&fdc->sc_timo_ch, hz / 2, fdctimeout, fdc);
991 callout_stop(&fdc->sc_timo_ch);
995 (void)fdcresult(fdc);
1002 fdc->sc_state = RECALWAIT;
1003 callout_reset(&fdc->sc_timo_ch, 5 * hz, fdctimeout, fdc);
1007 callout_stop(&fdc->sc_timo_ch);
1008 fdc->sc_state = RECALCOMPLETE;
1010 callout_reset(&fdc->sc_intr_ch, hz / 30, fdcpseudointr, fdc);
1015 if (fdcresult(fdc) != 2 || (st0 & 0xf8) != 0x20 || cyl != 0) {
1019 fdcretry(fdc);
1042 fdcretry(struct fdc_softc *fdc)
1047 fd = TAILQ_FIRST(&fdc->sc_drives);
1050 switch (fdc->sc_errors) {
1053 fdc->sc_state = DOSEEK;
1060 fdc->sc_state = DORECAL;
1065 fdc->sc_state = DORESET;
1072 fdcpstatus(7, fdc);
1076 fdc->sc_errors++;