fdc.c (0c7721e8f9f6c719f53f653fd7cf864b6e21cc38) fdc.c (f967c4f96e943f0f23b6e0bc35c023fae350c380)
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)

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

399# define TURNOFF 0
400static timeout_t fd_turnoff;
401static timeout_t fd_motor_on;
402static void fd_turnon(struct fd_data *);
403static void fdc_reset(fdc_p);
404static int fd_in(struct fdc_data *, int *);
405static int out_fdc(struct fdc_data *, int);
406/*
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)

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

399# define TURNOFF 0
400static timeout_t fd_turnoff;
401static timeout_t fd_motor_on;
402static void fd_turnon(struct fd_data *);
403static void fdc_reset(fdc_p);
404static int fd_in(struct fdc_data *, int *);
405static int out_fdc(struct fdc_data *, int);
406/*
407 * The open function is named Fdopen() to avoid confusion with fdopen()
407 * The open function is named fdopen() to avoid confusion with fdopen()
408 * in fd(4). The difference is now only meaningful for debuggers.
409 */
408 * in fd(4). The difference is now only meaningful for debuggers.
409 */
410static d_open_t Fdopen;
410static d_open_t fdopen;
411static d_close_t fdclose;
412static d_strategy_t fdstrategy;
413static void fdstart(struct fdc_data *);
414static timeout_t fd_iotimeout;
415static timeout_t fd_pseudointr;
416static driver_intr_t fdc_intr;
417static int fdcpio(fdc_p, long, caddr_t, u_int);
418static int fdautoselect(dev_t);

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

478static u_int8_t
479fdin_rd(fdc_p fdc)
480{
481 return bus_space_read_1(fdc->portt, fdc->porth, FDIN);
482}
483
484#define CDEV_MAJOR 9
485static struct cdevsw fd_cdevsw = {
411static d_close_t fdclose;
412static d_strategy_t fdstrategy;
413static void fdstart(struct fdc_data *);
414static timeout_t fd_iotimeout;
415static timeout_t fd_pseudointr;
416static driver_intr_t fdc_intr;
417static int fdcpio(fdc_p, long, caddr_t, u_int);
418static int fdautoselect(dev_t);

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

478static u_int8_t
479fdin_rd(fdc_p fdc)
480{
481 return bus_space_read_1(fdc->portt, fdc->porth, FDIN);
482}
483
484#define CDEV_MAJOR 9
485static struct cdevsw fd_cdevsw = {
486 .d_open = Fdopen,
486 .d_open = fdopen,
487 .d_close = fdclose,
488 .d_read = physread,
489 .d_write = physwrite,
490 .d_ioctl = fdioctl,
491 .d_strategy = fdstrategy,
492 .d_name = "fd",
493 .d_maj = CDEV_MAJOR,
494 .d_flags = D_DISK,

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

1555 return (0);
1556}
1557
1558/*
1559 * Block device driver interface functions (interspersed with even more
1560 * auxiliary functions).
1561 */
1562static int
487 .d_close = fdclose,
488 .d_read = physread,
489 .d_write = physwrite,
490 .d_ioctl = fdioctl,
491 .d_strategy = fdstrategy,
492 .d_name = "fd",
493 .d_maj = CDEV_MAJOR,
494 .d_flags = D_DISK,

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

1555 return (0);
1556}
1557
1558/*
1559 * Block device driver interface functions (interspersed with even more
1560 * auxiliary functions).
1561 */
1562static int
1563Fdopen(dev_t dev, int flags, int mode, struct thread *td)
1563fdopen(dev_t dev, int flags, int mode, struct thread *td)
1564{
1565 fdu_t fdu = FDUNIT(minor(dev));
1566 int type = FDTYPE(minor(dev));
1567 fd_p fd;
1568 fdc_p fdc;
1569 int rv, unitattn, dflags;
1570
1571 if ((fd = devclass_get_softc(fd_devclass, fdu)) == 0)

--- 1249 unchanged lines hidden ---
1564{
1565 fdu_t fdu = FDUNIT(minor(dev));
1566 int type = FDTYPE(minor(dev));
1567 fd_p fd;
1568 fdc_p fdc;
1569 int rv, unitattn, dflags;
1570
1571 if ((fd = devclass_get_softc(fd_devclass, fdu)) == 0)

--- 1249 unchanged lines hidden ---