Set si_iosize_max rather than d_maxio.
Register devsw in *attach instead of a SYSINIT.
This commit is contained in:
parent
3ea30afc2d
commit
b2a7a63df7
@ -400,12 +400,18 @@ wdattach(struct isa_device *dvp)
|
|||||||
struct disk *du;
|
struct disk *du;
|
||||||
struct wdparams *wp;
|
struct wdparams *wp;
|
||||||
static char buf[] = "wdcXXX";
|
static char buf[] = "wdcXXX";
|
||||||
|
static int once;
|
||||||
|
|
||||||
dvp->id_intr = wdintr;
|
dvp->id_intr = wdintr;
|
||||||
|
|
||||||
if (dvp->id_unit >= NWDC)
|
if (dvp->id_unit >= NWDC)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
if (!once) {
|
||||||
|
cdevsw_add(&wd_cdevsw);
|
||||||
|
once++;
|
||||||
|
}
|
||||||
|
|
||||||
if (eide_quirks & Q_CMD640B) {
|
if (eide_quirks & Q_CMD640B) {
|
||||||
if (dvp->id_unit == PRIMARY) {
|
if (dvp->id_unit == PRIMARY) {
|
||||||
printf("wdc0: CMD640B workaround enabled\n");
|
printf("wdc0: CMD640B workaround enabled\n");
|
||||||
@ -1187,6 +1193,7 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p)
|
|||||||
if (du == NULL)
|
if (du == NULL)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
|
||||||
|
dev->si_iosize_max = 248 * 512;
|
||||||
/* Finish flushing IRQs left over from wdattach(). */
|
/* Finish flushing IRQs left over from wdattach(). */
|
||||||
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
||||||
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
||||||
@ -2290,16 +2297,4 @@ wdwait(struct disk *du, u_char bits_wanted, int timeout)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wd_drvinit(void *unused)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (wd_cdevsw.d_maxio == 0)
|
|
||||||
wd_cdevsw.d_maxio = 248 * 512;
|
|
||||||
cdevsw_add(&wd_cdevsw);
|
|
||||||
}
|
|
||||||
|
|
||||||
SYSINIT(wddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wd_drvinit,NULL)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* NWDC > 0 */
|
#endif /* NWDC > 0 */
|
||||||
|
@ -481,12 +481,18 @@ wdattach(struct isa_device *dvp)
|
|||||||
struct disk *du;
|
struct disk *du;
|
||||||
struct wdparams *wp;
|
struct wdparams *wp;
|
||||||
static char buf[] = "wdcXXX";
|
static char buf[] = "wdcXXX";
|
||||||
|
static int once;
|
||||||
|
|
||||||
dvp->id_intr = wdintr;
|
dvp->id_intr = wdintr;
|
||||||
|
|
||||||
if (dvp->id_unit >= NWDC)
|
if (dvp->id_unit >= NWDC)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
if (!once) {
|
||||||
|
cdevsw_add(&wd_cdevsw);
|
||||||
|
once++;
|
||||||
|
}
|
||||||
|
|
||||||
if (eide_quirks & Q_CMD640B) {
|
if (eide_quirks & Q_CMD640B) {
|
||||||
if (dvp->id_unit == PRIMARY) {
|
if (dvp->id_unit == PRIMARY) {
|
||||||
printf("wdc0: CMD640B workaround enabled\n");
|
printf("wdc0: CMD640B workaround enabled\n");
|
||||||
@ -1309,6 +1315,7 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p)
|
|||||||
if (du == NULL)
|
if (du == NULL)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
|
||||||
|
dev->si_iosize_max = 248 * 512;
|
||||||
#ifdef PC98
|
#ifdef PC98
|
||||||
outb(0x432,(du->dk_unit)%2);
|
outb(0x432,(du->dk_unit)%2);
|
||||||
#endif
|
#endif
|
||||||
@ -2563,21 +2570,4 @@ wdwait(struct disk *du, u_char bits_wanted, int timeout)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wd_devsw_installed;
|
|
||||||
|
|
||||||
static void wd_drvinit(void *unused)
|
|
||||||
{
|
|
||||||
|
|
||||||
if( ! wd_devsw_installed ) {
|
|
||||||
if (wd_cdevsw.d_maxio == 0)
|
|
||||||
wd_cdevsw.d_maxio = 248 * 512;
|
|
||||||
cdevsw_add(&wd_cdevsw);
|
|
||||||
wd_devsw_installed = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SYSINIT(wddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wd_drvinit,NULL)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* NWDC > 0 */
|
#endif /* NWDC > 0 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user