wd driver would fail on calling wdgetctlr() for older drives and
controllers. New behaviour is that if the standard method fails, try to recalibrate the drive. Success means the drive exists. patch by hpeyerl@novatel.cuc.ab.ca (who owns several of these historical artifacts)
This commit is contained in:
parent
9c736c1dcf
commit
bf6814fb30
@ -1130,10 +1130,20 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
return(stat);
|
return(stat);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If WDCC_READP fails then we might have an old drive so we try
|
||||||
|
* a seek to 0; if that passes then the drive is there but it's
|
||||||
|
* OLD AND KRUSTY.
|
||||||
|
*/
|
||||||
if (stat & WDCS_ERR) {
|
if (stat & WDCS_ERR) {
|
||||||
|
stat = wdcommand(du, WDCC_RESTORE | WD_STEP);
|
||||||
|
if(stat & WDCS_ERR) {
|
||||||
splx(x);
|
splx(x);
|
||||||
return(inb(wdc+wd_error));
|
return(inb(wdc+wd_error));
|
||||||
}
|
}
|
||||||
|
stat = 0x7f; /* MFM/RLL marker for later. */
|
||||||
|
}
|
||||||
|
|
||||||
/* obtain parameters */
|
/* obtain parameters */
|
||||||
wp = &du->dk_params;
|
wp = &du->dk_params;
|
||||||
@ -1146,6 +1156,7 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
p = (u_short *) (wp->wdp_model + i);
|
p = (u_short *) (wp->wdp_model + i);
|
||||||
*p = ntohs(*p);
|
*p = ntohs(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
||||||
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
||||||
@ -1161,10 +1172,18 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
du->dk_dd.d_partitions[1].p_offset = 0;
|
du->dk_dd.d_partitions[1].p_offset = 0;
|
||||||
|
|
||||||
/* dubious ... */
|
/* dubious ... */
|
||||||
bcopy("ESDI/IDE", du->dk_dd.d_typename, 9);
|
if(stat == 0x7f) {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ST506", sizeof du->dk_dd.d_typename);
|
||||||
|
for(i=0; i<sizeof(wp->wdp_model); i++)
|
||||||
|
wp->wdp_model[i] = ' ';
|
||||||
|
strncpy(wp->wdp_model, "KrUsTy DiSk", sizeof wp->wdp_model);
|
||||||
|
du->dk_dd.d_type = DTYPE_ST506;
|
||||||
|
} else {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ESDI/IDE", sizeof du->dk_dd.d_typename);
|
||||||
|
du->dk_dd.d_type = DTYPE_ESDI;
|
||||||
|
}
|
||||||
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
||||||
/* better ... */
|
/* better ... */
|
||||||
du->dk_dd.d_type = DTYPE_ESDI;
|
|
||||||
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
||||||
|
|
||||||
/* XXX sometimes possibly needed */
|
/* XXX sometimes possibly needed */
|
||||||
|
@ -1130,10 +1130,20 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
return(stat);
|
return(stat);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If WDCC_READP fails then we might have an old drive so we try
|
||||||
|
* a seek to 0; if that passes then the drive is there but it's
|
||||||
|
* OLD AND KRUSTY.
|
||||||
|
*/
|
||||||
if (stat & WDCS_ERR) {
|
if (stat & WDCS_ERR) {
|
||||||
|
stat = wdcommand(du, WDCC_RESTORE | WD_STEP);
|
||||||
|
if(stat & WDCS_ERR) {
|
||||||
splx(x);
|
splx(x);
|
||||||
return(inb(wdc+wd_error));
|
return(inb(wdc+wd_error));
|
||||||
}
|
}
|
||||||
|
stat = 0x7f; /* MFM/RLL marker for later. */
|
||||||
|
}
|
||||||
|
|
||||||
/* obtain parameters */
|
/* obtain parameters */
|
||||||
wp = &du->dk_params;
|
wp = &du->dk_params;
|
||||||
@ -1146,6 +1156,7 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
p = (u_short *) (wp->wdp_model + i);
|
p = (u_short *) (wp->wdp_model + i);
|
||||||
*p = ntohs(*p);
|
*p = ntohs(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
||||||
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
||||||
@ -1161,10 +1172,18 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
du->dk_dd.d_partitions[1].p_offset = 0;
|
du->dk_dd.d_partitions[1].p_offset = 0;
|
||||||
|
|
||||||
/* dubious ... */
|
/* dubious ... */
|
||||||
bcopy("ESDI/IDE", du->dk_dd.d_typename, 9);
|
if(stat == 0x7f) {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ST506", sizeof du->dk_dd.d_typename);
|
||||||
|
for(i=0; i<sizeof(wp->wdp_model); i++)
|
||||||
|
wp->wdp_model[i] = ' ';
|
||||||
|
strncpy(wp->wdp_model, "KrUsTy DiSk", sizeof wp->wdp_model);
|
||||||
|
du->dk_dd.d_type = DTYPE_ST506;
|
||||||
|
} else {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ESDI/IDE", sizeof du->dk_dd.d_typename);
|
||||||
|
du->dk_dd.d_type = DTYPE_ESDI;
|
||||||
|
}
|
||||||
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
||||||
/* better ... */
|
/* better ... */
|
||||||
du->dk_dd.d_type = DTYPE_ESDI;
|
|
||||||
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
||||||
|
|
||||||
/* XXX sometimes possibly needed */
|
/* XXX sometimes possibly needed */
|
||||||
|
@ -1130,10 +1130,20 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
return(stat);
|
return(stat);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If WDCC_READP fails then we might have an old drive so we try
|
||||||
|
* a seek to 0; if that passes then the drive is there but it's
|
||||||
|
* OLD AND KRUSTY.
|
||||||
|
*/
|
||||||
if (stat & WDCS_ERR) {
|
if (stat & WDCS_ERR) {
|
||||||
|
stat = wdcommand(du, WDCC_RESTORE | WD_STEP);
|
||||||
|
if(stat & WDCS_ERR) {
|
||||||
splx(x);
|
splx(x);
|
||||||
return(inb(wdc+wd_error));
|
return(inb(wdc+wd_error));
|
||||||
}
|
}
|
||||||
|
stat = 0x7f; /* MFM/RLL marker for later. */
|
||||||
|
}
|
||||||
|
|
||||||
/* obtain parameters */
|
/* obtain parameters */
|
||||||
wp = &du->dk_params;
|
wp = &du->dk_params;
|
||||||
@ -1146,6 +1156,7 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
p = (u_short *) (wp->wdp_model + i);
|
p = (u_short *) (wp->wdp_model + i);
|
||||||
*p = ntohs(*p);
|
*p = ntohs(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
printf("gc %x cyl %d trk %d sec %d type %d sz %d model %s\n", wp->wdp_config,
|
||||||
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
wp->wdp_fixedcyl+wp->wdp_removcyl, wp->wdp_heads, wp->wdp_sectors,
|
||||||
@ -1161,10 +1172,18 @@ wdgetctlr(int u, struct disk *du)
|
|||||||
du->dk_dd.d_partitions[1].p_offset = 0;
|
du->dk_dd.d_partitions[1].p_offset = 0;
|
||||||
|
|
||||||
/* dubious ... */
|
/* dubious ... */
|
||||||
bcopy("ESDI/IDE", du->dk_dd.d_typename, 9);
|
if(stat == 0x7f) {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ST506", sizeof du->dk_dd.d_typename);
|
||||||
|
for(i=0; i<sizeof(wp->wdp_model); i++)
|
||||||
|
wp->wdp_model[i] = ' ';
|
||||||
|
strncpy(wp->wdp_model, "KrUsTy DiSk", sizeof wp->wdp_model);
|
||||||
|
du->dk_dd.d_type = DTYPE_ST506;
|
||||||
|
} else {
|
||||||
|
strncpy(du->dk_dd.d_typename, "ESDI/IDE", sizeof du->dk_dd.d_typename);
|
||||||
|
du->dk_dd.d_type = DTYPE_ESDI;
|
||||||
|
}
|
||||||
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
bcopy(wp->wdp_model+20, du->dk_dd.d_packname, 14-1);
|
||||||
/* better ... */
|
/* better ... */
|
||||||
du->dk_dd.d_type = DTYPE_ESDI;
|
|
||||||
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
du->dk_dd.d_subtype |= DSTYPE_GEOMETRY;
|
||||||
|
|
||||||
/* XXX sometimes possibly needed */
|
/* XXX sometimes possibly needed */
|
||||||
|
Loading…
Reference in New Issue
Block a user