aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-disk.c14
-rw-r--r--sys/dev/ata/ata-disk.h3
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index 50c0476816c3b..b5d573e0b074b 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -158,14 +158,13 @@ ad_attach(void *notused)
free(adp, M_AD);
continue;
}
- adp->cylinders = adp->ata_parm->cylinders;
adp->heads = adp->ata_parm->heads;
adp->sectors = adp->ata_parm->sectors;
- adp->total_secs = adp->cylinders * adp->heads * adp->sectors;
- if (adp->cylinders == 16383 &&
+ adp->total_secs =
+ adp->ata_parm->cylinders * adp->heads * adp->sectors;
+ if (adp->ata_parm->cylinders == 16383 &&
adp->total_secs < adp->ata_parm->lbasize) {
adp->total_secs = adp->ata_parm->lbasize;
- adp->cylinders = adp->total_secs/(adp->heads*adp->sectors);
}
if (adp->ata_parm->atavalid & ATA_FLAG_54_58 &&
adp->ata_parm->lbasize)
@@ -220,8 +219,9 @@ ad_attach(void *notused)
printf("ad%d: %luMB (%u sectors), "
"%u cyls, %u heads, %u S/T, %u B/S\n",
adp->lun, adp->total_secs / ((1024L * 1024L)/DEV_BSIZE),
- adp->total_secs, adp->cylinders, adp->heads,
- adp->sectors, DEV_BSIZE);
+ adp->total_secs,
+ adp->total_secs / (adp->heads * adp->sectors),
+ adp->heads, adp->sectors, DEV_BSIZE);
printf("ad%d: %d secs/int, %d depth queue, %s\n",
adp->lun, adp->transfersize / DEV_BSIZE, adp->num_tags,
@@ -289,7 +289,7 @@ adopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p)
dl->d_secsize = DEV_BSIZE;
dl->d_nsectors = adp->sectors;
dl->d_ntracks = adp->heads;
- dl->d_ncylinders = adp->cylinders;
+ dl->d_ncylinders = adp->total_secs / (adp->heads * adp->sectors);
dl->d_secpercyl = adp->sectors * adp->heads;
dl->d_secperunit = adp->total_secs;
return 0;
diff --git a/sys/dev/ata/ata-disk.h b/sys/dev/ata/ata-disk.h
index 0e8659fe667d2..359b83a11c7cc 100644
--- a/sys/dev/ata/ata-disk.h
+++ b/sys/dev/ata/ata-disk.h
@@ -133,10 +133,9 @@ struct ad_softc {
struct ata_params *ata_parm; /* ata device params */
int32_t unit; /* ATA_MASTER or ATA_SLAVE */
int32_t lun; /* logical unit number */
- u_int16_t cylinders; /* disk geometry (probed) */
+ u_int32_t total_secs; /* total # of sectors (LBA) */
u_int8_t heads;
u_int8_t sectors;
- u_int32_t total_secs; /* total # of sectors (LBA) */
u_int32_t transfersize; /* size of each transfer */
u_int32_t num_tags; /* number of tags supported */
u_int32_t flags; /* drive flags */