diff options
| author | Alexander Motin <mav@FreeBSD.org> | 2009-12-11 12:44:44 +0000 |
|---|---|---|
| committer | Alexander Motin <mav@FreeBSD.org> | 2009-12-11 12:44:44 +0000 |
| commit | 248e8fd706428af82cde6729c8be4846c0a5851f (patch) | |
| tree | 7cbed4dca8a756b6f3f2c19a77979240cb0d5ac2 /sys/dev | |
| parent | 68d2ef77eb3795733f819822ecd701b847c9b581 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/ata-disk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 03b10650b822..ea427e574ec4 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -126,6 +126,10 @@ ad_attach(device_t dev) adp->disk->d_name = "ad"; adp->disk->d_drv1 = dev; adp->disk->d_maxsize = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; + if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 65536 * DEV_BSIZE); + else /* 28bit ATA command limit */ + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 256 * DEV_BSIZE); adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors; |
