If current_heads or current_sectors in the disk cap page are zero, dont try to use the current_ geometry.

This avoids a panic with BIOS'n that sets these to zero.
This commit is contained in:
Søren Schmidt 2006-09-14 19:12:29 +00:00
parent 3c5b80d6c2
commit abd7633203
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162311

View file

@ -105,7 +105,8 @@ ad_attach(device_t dev)
}
device_set_ivars(dev, adp);
if (atadev->param.atavalid & ATA_FLAG_54_58) {
if ((atadev->param.atavalid & ATA_FLAG_54_58) &&
atadev->param.current_heads && atadev->param.current_sectors) {
adp->heads = atadev->param.current_heads;
adp->sectors = atadev->param.current_sectors;
adp->total_secs = (u_int32_t)atadev->param.current_size_1 |