diff options
Diffstat (limited to 'drivers/block/acsi.c')
-rw-r--r-- | drivers/block/acsi.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c index 5d2d649f7e8d..196c0ec9cd54 100644 --- a/drivers/block/acsi.c +++ b/drivers/block/acsi.c | |||
@@ -1079,6 +1079,19 @@ static void redo_acsi_request( void ) | |||
1079 | * | 1079 | * |
1080 | ***********************************************************************/ | 1080 | ***********************************************************************/ |
1081 | 1081 | ||
1082 | static int acsi_getgeo(struct block_device *bdev, struct hd_geometry *geo) | ||
1083 | { | ||
1084 | struct acsi_info_struct *aip = bdev->bd_disk->private_data; | ||
1085 | |||
1086 | /* | ||
1087 | * Just fake some geometry here, it's nonsense anyway | ||
1088 | * To make it easy, use Adaptec's usual 64/32 mapping | ||
1089 | */ | ||
1090 | geo->heads = 64; | ||
1091 | geo->sectors = 32; | ||
1092 | geo->cylinders = aip->size >> 11; | ||
1093 | return 0; | ||
1094 | } | ||
1082 | 1095 | ||
1083 | static int acsi_ioctl( struct inode *inode, struct file *file, | 1096 | static int acsi_ioctl( struct inode *inode, struct file *file, |
1084 | unsigned int cmd, unsigned long arg ) | 1097 | unsigned int cmd, unsigned long arg ) |
@@ -1086,18 +1099,6 @@ static int acsi_ioctl( struct inode *inode, struct file *file, | |||
1086 | struct gendisk *disk = inode->i_bdev->bd_disk; | 1099 | struct gendisk *disk = inode->i_bdev->bd_disk; |
1087 | struct acsi_info_struct *aip = disk->private_data; | 1100 | struct acsi_info_struct *aip = disk->private_data; |
1088 | switch (cmd) { | 1101 | switch (cmd) { |
1089 | case HDIO_GETGEO: | ||
1090 | /* HDIO_GETGEO is supported more for getting the partition's | ||
1091 | * start sector... */ | ||
1092 | { struct hd_geometry *geo = (struct hd_geometry *)arg; | ||
1093 | /* just fake some geometry here, it's nonsense anyway; to make it | ||
1094 | * easy, use Adaptec's usual 64/32 mapping */ | ||
1095 | put_user( 64, &geo->heads ); | ||
1096 | put_user( 32, &geo->sectors ); | ||
1097 | put_user( aip->size >> 11, &geo->cylinders ); | ||
1098 | put_user(get_start_sect(inode->i_bdev), &geo->start); | ||
1099 | return 0; | ||
1100 | } | ||
1101 | case SCSI_IOCTL_GET_IDLUN: | 1102 | case SCSI_IOCTL_GET_IDLUN: |
1102 | /* SCSI compatible GET_IDLUN call to get target's ID and LUN number */ | 1103 | /* SCSI compatible GET_IDLUN call to get target's ID and LUN number */ |
1103 | put_user( aip->target | (aip->lun << 8), | 1104 | put_user( aip->target | (aip->lun << 8), |
@@ -1592,6 +1593,7 @@ static struct block_device_operations acsi_fops = { | |||
1592 | .open = acsi_open, | 1593 | .open = acsi_open, |
1593 | .release = acsi_release, | 1594 | .release = acsi_release, |
1594 | .ioctl = acsi_ioctl, | 1595 | .ioctl = acsi_ioctl, |
1596 | .getgeo = acsi_getgeo, | ||
1595 | .media_changed = acsi_media_change, | 1597 | .media_changed = acsi_media_change, |
1596 | .revalidate_disk= acsi_revalidate, | 1598 | .revalidate_disk= acsi_revalidate, |
1597 | }; | 1599 | }; |